コード例 #1
0
 /**
  *  @brief Rotates game object to point forward vector to a target position.
  *
  *  @param target Target position.
  **/
 public void LookAt(FPVector target)
 {
     this.rotation = FPQuaternion.CreateFromMatrix(FPMatrix.CreateFromLookAt(position, target));
 }
コード例 #2
0
 /**
  *  @brief Moves game object based on provided translation vector and a relative {@link FPTransform}.
  *
  *  The game object will move based on FPTransform's forward vector.
  **/
 public void Translate(FPVector translation, FPTransform relativeTo)
 {
     this.position += FPVector.Transform(translation, FPMatrix.CreateFromQuaternion(relativeTo.rotation));
 }
コード例 #3
0
 public static FPQuaternion LookRotation(FPVector forward, FPVector upwards)
 {
     return(CreateFromMatrix(FPMatrix.LookAt(forward, upwards)));
 }