// rotate the camera by the given quaternion public void rotate(OMV.Quaternion rot) { rot.Normalize(); m_heading = rot * m_heading; if (OnCameraUpdate != null) OnCameraUpdate(this); }
// rotate the camera by the given quaternion public void rotate(OMV.Quaternion rot) { rot.Normalize(); m_heading = rot * m_heading; }
// Rotate a vector by a quaternian public static OMV.Vector3 RotateVector(OMV.Quaternion q, OMV.Vector3 v) { OMV.Vector3 v2, v3; q.Normalize(); OMV.Vector3 qv = new OMV.Vector3(q.X, q.Y, q.Z); v2 = OMV.Vector3.Cross(qv, v); v3 = OMV.Vector3.Cross(qv, v2); v2 *= (2.0f * q.W); v3 *= 2.0f; return v + v2 + v3; }