Exemple #1
0
 public Physics(rlbot.flat.Physics physics)
 {
     Location        = physics.Location.Value.ToVector3();
     Velocity        = physics.Velocity.Value.ToVector3();
     AngularVelocity = physics.AngularVelocity.Value.ToVector3();
     Rotation        = new Orientation(physics.Rotation);
 }
Exemple #2
0
 public static Ball ParseFromGamePacket(rlbot.flat.GameTickPacket packet)
 {
     rlbot.flat.BallInfo info    = packet.Ball.GetValueOrDefault();
     rlbot.flat.Physics  physics = info.Physics.Value;
     return(new Ball()
     {
         Location = Conversion.ToVector3(physics.Location.GetValueOrDefault()),
         Rotation = Conversion.ToRotation(physics.Rotation.GetValueOrDefault()),
         Velocity = Conversion.ToVector3(physics.Velocity.GetValueOrDefault()),
         AngularVelocity = Conversion.ToVector3(physics.AngularVelocity.GetValueOrDefault()),
     });
 }