vec.Quaternion

Classes


Public Protected Private

Global Functions

goog.vec.Quaternion.add(quat0quat1resultQuat)
Adds the two quaternions.
Arguments:
quat0 : goog.vec.Quaternion.AnyType
The first addend.
quat1 : goog.vec.Quaternion.AnyType
The second addend.
resultQuat : goog.vec.Quaternion.AnyType
The quaternion to receive the result. May be quat0 or quat1.
code »
goog.vec.Quaternion.cloneFloat32(q) goog.vec.Quaternion.Float32
Creates a clone of the given Float32 quaternion.
Arguments:
q : goog.vec.Quaternion.Float32
The source quaternion.
Returns: goog.vec.Quaternion.Float32  The new quaternion.
code »
goog.vec.Quaternion.cloneFloat64(q) goog.vec.Quaternion.Float64
Creates a clone of the given Float64 quaternion.
Arguments:
q : goog.vec.Quaternion.Float64
The source quaternion.
Returns: goog.vec.Quaternion.Float64  The new quaternion.
code »
goog.vec.Quaternion.concat(quat0quat1resultQuat) !goog.vec.Quaternion.AnyType
Concatenates the two quaternions storing the result into resultQuat.
Arguments:
quat0 : goog.vec.Quaternion.AnyType
The first quaternion.
quat1 : goog.vec.Quaternion.AnyType
The second quaternion.
resultQuat : goog.vec.Quaternion.AnyType
The quaternion to receive the result.
Returns: !goog.vec.Quaternion.AnyType  Return q so that operations can be chained together.
code »
goog.vec.Quaternion.conjugate(quatresultQuat) !goog.vec.Quaternion.AnyType
Computes the conjugate of the quaternion in quat storing the result into resultQuat.
Arguments:
quat : goog.vec.Quaternion.AnyType
The source quaternion.
resultQuat : goog.vec.Quaternion.AnyType
The quaternion to receive the result.
Returns: !goog.vec.Quaternion.AnyType  Return q so that operations can be chained together.
code »
goog.vec.Quaternion.createFloat32() !goog.vec.Quaternion.Float32
Creates a Float32 quaternion, initialized to zero.
Returns: !goog.vec.Quaternion.Float32  The new quaternion.
code »
goog.vec.Quaternion.createFloat32FromArray(vec) !goog.vec.Quaternion.Float32
Creates a new Float32 quaternion initialized with the values from the supplied array.
Arguments:
vec : goog.vec.AnyType
The source 4 element array.
Returns: !goog.vec.Quaternion.Float32  The new quaternion.
code »
goog.vec.Quaternion.createFloat32FromValues(v0v1v2v3) !goog.vec.Quaternion.Float32
Creates a new Float32 quaternion initialized with the supplied values.
Arguments:
v0 : number
The value for element at index 0.
v1 : number
The value for element at index 1.
v2 : number
The value for element at index 2.
v3 : number
The value for element at index 3.
Returns: !goog.vec.Quaternion.Float32  The new quaternion.
code »
goog.vec.Quaternion.createFloat64() goog.vec.Quaternion.Float64
Creates a Float64 quaternion, initialized to zero.
Returns: goog.vec.Quaternion.Float64  The new quaternion.
code »
goog.vec.Quaternion.createFloat64FromArray(vec) !goog.vec.Quaternion.Float64
Creates a new Float64 quaternion initialized with the values from the supplied array.
Arguments:
vec : goog.vec.AnyType
The source 4 element array.
Returns: !goog.vec.Quaternion.Float64  The new quaternion.
code »
goog.vec.Quaternion.createFloat64FromValues(v0v1v2v3) !goog.vec.Quaternion.Float64
Creates a new Float64 quaternion initialized with the supplied values.
Arguments:
v0 : number
The value for element at index 0.
v1 : number
The value for element at index 1.
v2 : number
The value for element at index 2.
v3 : number
The value for element at index 3.
Returns: !goog.vec.Quaternion.Float64  The new quaternion.
code »
goog.vec.Quaternion.createNumber() goog.vec.Quaternion.Number
Creates a Number quaternion, initialized to zero.
Returns: goog.vec.Quaternion.Number  The new quaternion.
code »
goog.vec.Quaternion.dot(q0q1) number
Computes the dot (scalar) product of two quaternions.
Arguments:
q0 : goog.vec.Quaternion.AnyType
The first quaternion.
q1 : goog.vec.Quaternion.AnyType
The second quaternion.
Returns: number  The scalar product.
code »
goog.vec.Quaternion.fromAngleAxis(angleaxisquat) goog.vec.Quaternion.AnyType
Generates a unit quaternion from the given angle-axis rotation pair. The rotation axis is not required to be a unit vector, but should have non-zero length. The angle should be specified in radians.
Arguments:
angle : number
The angle (in radians) to rotate about the axis.
axis : goog.vec.Quaternion.AnyType
Unit vector specifying the axis of rotation.
quat : goog.vec.Quaternion.AnyType
Unit quaternion to store the result.
Returns: goog.vec.Quaternion.AnyType  Return q so that operations can be chained together.
code »
goog.vec.Quaternion.fromRotationMatrix4(matrixquat) !goog.vec.Quaternion.AnyType
Generates the quaternion from the given rotation matrix.
Arguments:
matrix : goog.vec.Quaternion.AnyType
The source matrix.
quat : goog.vec.Quaternion.AnyType
The resulting quaternion.
Returns: !goog.vec.Quaternion.AnyType  Return q so that operations can be chained together.
code »
goog.vec.Quaternion.magnitude(quat0) number
Returns the magnitude of the given quaternion.
Arguments:
quat0 : goog.vec.Quaternion.AnyType
The quaternion.
Returns: number  The magnitude of the quaternion.
code »
goog.vec.Quaternion.magnitudeSquared(quat0) number
Returns the square magnitude of the given quaternion.
Arguments:
quat0 : goog.vec.Quaternion.AnyType
The quaternion.
Returns: number  The magnitude of the quaternion.
code »
goog.vec.Quaternion.negate(quat0resultQuat)
Negates a quaternion, storing the result into resultQuat.
Arguments:
quat0 : goog.vec.Quaternion.AnyType
The quaternion to negate.
resultQuat : goog.vec.Quaternion.AnyType
The quaternion to receive the result. May be quat0.
code »
goog.vec.Quaternion.nlerp(q0q1tresultQuat)
Compute the simple linear interpolation of the two quaternions q0 and q1 according to the coefficient t. The resulting quaternion is stored in resultVec.
Arguments:
q0 : goog.vec.Quaternion.AnyType
The first quaternion.
q1 : goog.vec.Quaternion.AnyType
The second quaternion.
t : number
The interpolation factor.
resultQuat : goog.vec.Quaternion.AnyType
The quaternion to receive the results (may be q0 or q1).
code »
goog.vec.Quaternion.normalize(quat0resultQuat)
Normalizes the given quaternion storing the result into resultVec.
Arguments:
quat0 : goog.vec.Quaternion.AnyType
The quaternion to normalize.
resultQuat : goog.vec.Quaternion.AnyType
The quaternion to receive the result. May be quat0.
code »
goog.vec.Quaternion.scale(quat0scalarresultQuat)
Multiplies each component of quat0 with scalar storing the product into resultVec.
Arguments:
quat0 : goog.vec.Quaternion.AnyType
The source quaternion.
scalar : number
The value to multiply with each component of quat0.
resultQuat : goog.vec.Quaternion.AnyType
The quaternion to receive the result. May be quat0.
code »
goog.vec.Quaternion.setFromArray(qvalues) !goog.vec.Quaternion.AnyType
Initializes the quaternion with the given array of values.
Arguments:
q : goog.vec.Quaternion.AnyType
The quaternion to receive the values.
values : goog.vec.AnyType
The array of values.
Returns: !goog.vec.Quaternion.AnyType  return q so that operations can be chained together.
code »
goog.vec.Quaternion.setFromValues(qv0v1v2v3) !goog.vec.Vec4.AnyType
Initializes the quaternion with the given values.
Arguments:
q : goog.vec.Quaternion.AnyType
The quaternion to receive the values.
v0 : number
The value for element at index 0.
v1 : number
The value for element at index 1.
v2 : number
The value for element at index 2.
v3 : number
The value for element at index 3.
Returns: !goog.vec.Vec4.AnyType  return q so that operations can be chained together.
code »
goog.vec.Quaternion.slerp(q0q1tresultQuat) goog.vec.Quaternion.AnyType
Computes the spherical linear interpolated value from the given quaternions q0 and q1 according to the coefficient t. The resulting quaternion is stored in resultQuat.
Arguments:
q0 : goog.vec.Quaternion.AnyType
The first quaternion.
q1 : goog.vec.Quaternion.AnyType
The second quaternion.
t : number
The interpolating coefficient.
resultQuat : goog.vec.Quaternion.AnyType
The quaternion to receive the result.
Returns: goog.vec.Quaternion.AnyType  Return q so that operations can be chained together.
code »
goog.vec.Quaternion.toAngleAxis(quataxis) number
Generates an angle-axis rotation pair from a unit quaternion. The quaternion is assumed to be of unit length. The calculated values are returned via the passed 'axis' object and the 'angle' number returned by the function itself. The returned rotation axis is a non-zero length unit vector, and the returned angle is in radians in the range of [-PI, +PI].
Arguments:
quat : goog.vec.Quaternion.AnyType
Unit quaternion to convert.
axis : goog.vec.Quaternion.AnyType
Vector to store the returned rotation axis.
Returns: number  angle Angle (in radians) to rotate about 'axis'. The range of the returned angle is [-PI, +PI].
code »
goog.vec.Quaternion.toRotationMatrix4(quatmatrix) !goog.vec.AnyType
Generates the rotation matrix from the given quaternion.
Arguments:
quat : goog.vec.Quaternion.AnyType
The source quaternion.
matrix : goog.vec.AnyType
The resulting matrix.
Returns: !goog.vec.AnyType  Return resulting matrix so that operations can be chained together.
code »

Global Properties

goog.vec.Quaternion.AnyType :
No description.
Code »
goog.vec.Quaternion.Float32 :
No description.
Code »
goog.vec.Quaternion.Float64 :
No description.
Code »
goog.vec.Quaternion.Number :
No description.
Code »

Package vec

Package Reference