示例#1
0
 /// Rotate about the local up axis
 public void yaw(float angleDeg)
 {
     Matrix3 rotate = new Matrix3 ();
     rotate.setRotateAxis (this.Up, angleDeg);
     m_rotation.Right *= rotate;
     m_rotation.Forward *= rotate;
 }
示例#2
0
 // Rotate about "axis" through origin
 public void rotateWorld(Vector3 axis, float angleDeg)
 {
     Matrix3 rotate = new Matrix3 ();
     rotate.setRotateAxis (axis, angleDeg);
     m_rotation *= rotate;
     m_position *= rotate;
 }
示例#3
0
 /// Rotate about the local right axis
 public void pitch(float angleDeg)
 {
     Matrix3 rotate = new Matrix3 ();
     rotate.setRotateAxis (this.Right, angleDeg);
     m_rotation.Up *= rotate;
     m_rotation.Forward *= rotate;
 }
示例#4
0
 /// Rotate about "axis" through "p"
 public void rotateAboutPoint(Vector3 p, Vector3 axis, float angleDeg)
 {
     Matrix3 rotate = new Matrix3 ();
     rotate.setRotateAxis (axis, angleDeg);
     m_rotation *= rotate;
     m_position *= rotate;
     m_position += -p * rotate + p;
 }
示例#5
0
 // rotate about "axis" through "p"
 public static Matrix4 createRotationAboutPoint(Vector3 p, Vector3 axis, float angleDeg)
 {
     Matrix3 rotate = new Matrix3 ();
     rotate.setRotateAxis (axis, angleDeg);
     Vector3 translation = -p * rotate + p;
     return (new Matrix4 (rotate, translation));
 }