/**
  *  @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));
 }
 /**
  *  @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));
 }
Beispiel #3
0
 public static FPQuaternion LookRotation(FPVector forward, FPVector upwards)
 {
     return(CreateFromMatrix(FPMatrix.LookAt(forward, upwards)));
 }