Package com.flansmod.common.guns.raytracing

Examples of com.flansmod.common.guns.raytracing.PlayerSnapshot


                  }
                  int snapshotToTry = player instanceof EntityPlayerMP ? ((EntityPlayerMP)player).ping / 50 : 0;
                  if(snapshotToTry >= otherData.snapshots.length)
                    snapshotToTry = otherData.snapshots.length - 1;
                 
                  PlayerSnapshot snapshot = otherData.snapshots[snapshotToTry];
                  if(snapshot == null)
                    snapshot = otherData.snapshots[0];
                 
                  //DEBUG
                  //snapshot = new PlayerSnapshot(player);
                 
                  //Check one last time for a null snapshot. If this is the case, fall back to normal hit detection
                  if(snapshot == null)
                    shouldDoNormalHitDetect = true;
                  else
                  {
                    //Raytrace
                    ArrayList<BulletHit> playerHits = snapshot.raytrace(data.lastMeleePositions[k] == null ? nextPosInWorldCoords : data.lastMeleePositions[k], dPos);
                    hits.addAll(playerHits);
                  }
                }
               
                //If we couldn't get a snapshot, use normal entity hitbox calculations
View Full Code Here


            continue;
          int snapshotToTry = pingOfShooter / 50;
          if(snapshotToTry >= data.snapshots.length)
            snapshotToTry = data.snapshots.length - 1;
         
          PlayerSnapshot snapshot = data.snapshots[snapshotToTry];
          if(snapshot == null)
            snapshot = data.snapshots[0];
         
          //DEBUG
          //snapshot = new PlayerSnapshot(player);
         
          //Check one last time for a null snapshot. If this is the case, fall back to normal hit detection
          if(snapshot == null)
            shouldDoNormalHitDetect = true;
          else
          {
            //Raytrace
            ArrayList<BulletHit> playerHits = snapshot.raytrace(origin, motion);
            hits.addAll(playerHits);
          }
        }
       
        //If we couldn't get a snapshot, use normal entity hitbox calculations
View Full Code Here

    }
   
    //Move all snapshots along one place
        System.arraycopy(snapshots, 0, snapshots, 1, snapshots.length - 2 + 1);
    //Take new snapshot
    snapshots[0] = new PlayerSnapshot(player);
  }
View Full Code Here

TOP

Related Classes of com.flansmod.common.guns.raytracing.PlayerSnapshot

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.