Skip to content

DataTypes: Quaternion.hpp

Alanzote edited this page Dec 25, 2018 · 1 revision

Quaternions are used for object rotation in LEGO Universe. A Quaternion is composed of 4 float values: x, y, z and w. A nice explanation of Quaternion can be found in Wikipedia.

Contructors

  • No Parameters
    • Creates an empty quaternion.
  • float x, float y, float z, float w
    • Creates a Quaternino with values.

Methods

  • isNull
    • Return Type: bool
    • Comment: Wheather this Quaternion is null.
  • rotateX
    • Return Type: void
    • Input Type: float radians
    • Comment: Wrapper that calls static rotateX.
  • rotateY
    • Return Type: void
    • Input Type: float radians
    • Comment: Wrapper that calls static rotateY.
  • rotateZ
    • Return Type: void
    • Input Type: float radians
    • Comment: Wrapper that calls static rotateZ.
  • normalize
    • Return Type: void
    • Comment: Normalizes the Quaternion.
  • yaw
    • Return Type: float
    • Comment: Returns the yaw of this Quaternion.

Static Methods

  • rotateX
    • Return Type: void
    • Input Types: Quaternion, float radians
    • Comment: Rotates a Quaternion on X axis.
  • rotateY
    • Return Type: void
    • Input Types: Quaternion, float radians
    • Comment: Rotates a Quaternion on Y axis.
  • rotateZ
    • Return Type: void
    • Input Types: Quaternion, float radians
    • Comment: Rotates a Quaternion on Z axis.
  • makeString
    • Return Type: std::string
    • Comment: Transforms a Quaternion into a string.
  • slerp
    • Return Type: float
    • Input Types: Quaternion q1, Quaternion q2, float progress, float accuracy threshold
    • Comment: Slerps the Quaternion.
  • invert
    • Return Type: Quaternion
    • Input Type: Quaternion
    • Comment: Inverts the Specified Quaternion.
  • dotProduct
    • Return Type: float
    • Input Types: Quaternion q1, Quaternion q2
    • Comment: Calculates the dot product between two quaternions.
  • length
    • Return Type: float
    • Input Type: Quaternion
    • Comment: Returns the Length of the Quaternion.
  • fromAxisAngle
    • Return Type: Quaternion
    • Input Types: Vector3 axis, float angle
    • Comment: Creates a new Quaternion with axis and angle.
  • fromRotationMatrix
    • Return Type: Quaternion
    • Input Types: float*
    • Comment: Creates a new Quaternion with rotation matrix.
  • toQuaternion
    • Return Type: Quaternion
    • Input Type: Vector3
    • Comment: Transforms a Vector3 into a Quaternion.
  • toEuler
    • Return Type: Vector3
    • Input Type: Quaternion&
    • Comment: Transforms a Quaternion into an Euler Vector3.
  • betweenPoints
    • Return Type: Quaternion
    • Input Types: Vector3 origin, Vector3 destination
    • Comment: Returns a rotation value between two Vector3 points.

Operators

Quaternion supports the following operators: * (Quaternion, float and Vector3), +, =, *=.

Clone this wiki locally