Example #1
0
/* ************************************************************************* */
Vector Rot3::quaternion() const {
  gtsam::Quaternion q = toQuaternion();
  Vector v(4);
  v(0) = q.w();
  v(1) = q.x();
  v(2) = q.y();
  v(3) = q.z();
  return v;
}
 /**
 * @brief convert
 * @param src
 * @return
 */
 void convertRepresentationTo(OrientationType repType)
 {
   if(repType == Euler) { toEulers(); }
   else if(repType == OrientationMatrix) { toOrientationMatrix(); }
   else if(repType == Quaternion) { toQuaternion(); }
   else if(repType == AxisAngle) { toAxisAngle(); }
   else if(repType == Rodrigues) { toRodrigues(); }
   else if(repType == Homochoric) { toHomochoric(); }
   else if(repType == Cubochoric) { toCubochoric(); }
 }
Example #3
0
	/// Apply the euler rotation to the vector rhs.
	inline Vector3 operator*(const Vector3 &rhs) const {
		return toQuaternion() * rhs;
	}
Example #4
0
	/// Casting operator. This allows any ogre function that wants a Quaternion to accept a Euler instead.
	inline operator Quaternion() const {
		return toQuaternion();
	}
Example #5
0
	/// Get a vector pointing up.
	inline Vector3 up() const {
		return toQuaternion() * Vector3::UNIT_Y;
	}
Example #6
0
	/// Get a vector pointing to the right.
	inline Vector3 right() const {
		return toQuaternion() * Vector3::UNIT_X;
	}
Example #7
0
	/// Get a vector pointing forwards.
	inline Vector3 forward() const {
		return toQuaternion() * Vector3::NEGATIVE_UNIT_Z;
	}
Example #8
0
 inline void lookAt(const Vector3f& dest, const Vector3f& up = {0, 1, 0}) {
   transform.rotation = toQuaternion(m_lookAt(transform.position, dest, up));
 }