goog.vec.Quaternion
Namespace.AnyType
.Float32
.Float64
.Number
.add
Adds the two quaternions.
quat0
{goog.vec.Quaternion.AnyType
}
quat1
{goog.vec.Quaternion.AnyType
}
resultQuat
{goog.vec.Quaternion.AnyType
}
.cloneFloat32
Creates a clone of the given Float32 quaternion.
q
{goog.vec.Quaternion.Float32
}
goog.vec.Quaternion.Float32
}
.cloneFloat64
Creates a clone of the given Float64 quaternion.
q
{goog.vec.Quaternion.Float64
}
goog.vec.Quaternion.Float64
}
.concat(quat0, quat1, resultQuat)
Concatenates the two quaternions storing the result into resultQuat.
quat0
{goog.vec.Quaternion.AnyType
}
quat1
{goog.vec.Quaternion.AnyType
}
resultQuat
{goog.vec.Quaternion.AnyType
}
goog.vec.Quaternion.AnyType
}
.conjugate(quat, resultQuat)
Computes the conjugate of the quaternion in quat storing the result into resultQuat.
quat
{goog.vec.Quaternion.AnyType
}
resultQuat
{goog.vec.Quaternion.AnyType
}
goog.vec.Quaternion.AnyType
}
.createFloat32
Creates a Float32 quaternion, initialized to zero.
goog.vec.Quaternion.Float32
}
.createFloat32FromArray
Creates a new Float32 quaternion initialized with the values from the supplied array.
vec
{goog.vec.AnyType
}
goog.vec.Quaternion.Float32
}
.createFloat32FromValues
Creates a new Float32 quaternion initialized with the supplied values.
v0
{number
}
v1
{number
}
v2
{number
}
v3
{number
}
goog.vec.Quaternion.Float32
}
.createFloat64
Creates a Float64 quaternion, initialized to zero.
goog.vec.Quaternion.Float64
}
.createFloat64FromArray
Creates a new Float64 quaternion initialized with the values from the supplied array.
vec
{goog.vec.AnyType
}
goog.vec.Quaternion.Float64
}
.createFloat64FromValues
Creates a new Float64 quaternion initialized with the supplied values.
v0
{number
}
v1
{number
}
v2
{number
}
v3
{number
}
goog.vec.Quaternion.Float64
}
.createNumber
Creates a Number quaternion, initialized to zero.
goog.vec.Quaternion.Number
}
.dot
Computes the dot (scalar) product of two quaternions.
q0
{goog.vec.Quaternion.AnyType
}
q1
{goog.vec.Quaternion.AnyType
}
number
}
.fromAngleAxis(angle, axis, quat)
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.
angle
{number
}
axis
{goog.vec.Quaternion.AnyType
}
quat
{goog.vec.Quaternion.AnyType
}
goog.vec.Quaternion.AnyType
}
.fromRotationMatrix4(matrix, quat)
Generates the quaternion from the given rotation matrix.
matrix
{goog.vec.Quaternion.AnyType
}
quat
{goog.vec.Quaternion.AnyType
}
goog.vec.Quaternion.AnyType
}
.magnitude
Returns the magnitude of the given quaternion.
quat0
{goog.vec.Quaternion.AnyType
}
number
}
.magnitudeSquared
Returns the square magnitude of the given quaternion.
quat0
{goog.vec.Quaternion.AnyType
}
number
}
.negate
Negates a quaternion, storing the result into resultQuat.
quat0
{goog.vec.Quaternion.AnyType
}
resultQuat
{goog.vec.Quaternion.AnyType
}
.nlerp
Compute the simple linear interpolation of the two quaternions q0 and q1 according to the coefficient t. The resulting quaternion is stored in resultVec.
q0
{goog.vec.Quaternion.AnyType
}
q1
{goog.vec.Quaternion.AnyType
}
t
{number
}
resultQuat
{goog.vec.Quaternion.AnyType
}
.normalize
Normalizes the given quaternion storing the result into resultVec.
quat0
{goog.vec.Quaternion.AnyType
}
resultQuat
{goog.vec.Quaternion.AnyType
}
.scale
Multiplies each component of quat0 with scalar storing the product into resultVec.
quat0
{goog.vec.Quaternion.AnyType
}
scalar
{number
}
resultQuat
{goog.vec.Quaternion.AnyType
}
.setFromArray
Initializes the quaternion with the given array of values.
q
{goog.vec.Quaternion.AnyType
}
values
{goog.vec.AnyType
}
goog.vec.Quaternion.AnyType
}
.setFromValues
Initializes the quaternion with the given values.
q
{goog.vec.Quaternion.AnyType
}
v0
{number
}
v1
{number
}
v2
{number
}
v3
{number
}
goog.vec.Vec4.AnyType
}
.slerp(q0, q1, t, resultQuat)
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.
q0
{goog.vec.Quaternion.AnyType
}
q1
{goog.vec.Quaternion.AnyType
}
t
{number
}
resultQuat
{goog.vec.Quaternion.AnyType
}
goog.vec.Quaternion.AnyType
}
.toAngleAxis(quat, axis)
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].
quat
{goog.vec.Quaternion.AnyType
}
axis
{goog.vec.Quaternion.AnyType
}
number
}
.toRotationMatrix4(quat, matrix)
Generates the rotation matrix from the given quaternion.
quat
{goog.vec.Quaternion.AnyType
}
matrix
{goog.vec.AnyType
}
goog.vec.AnyType
}