CopperLicht API Documentation
Class CL3D.Quaternion
Quaternion class for representing rotations
Class Overview
CL3D.Quaternion(x, y, z, w)
Quaternion class for representing rotations
- Parameters:
- x
- y
- z
- w
Field Attributes | Field Name and Description |
---|---|
W component of the Quaternion
|
|
X component of the Quaternion
|
|
Y component of the Quaternion
|
|
Z component of the Quaternion
|
Method Attributes | Method Name and Description |
---|---|
addToThis(b)
Addition operator, adds another quaternion to this one
|
|
clone()
Creates a clone of this Quaternion
|
|
copyTo(tgt)
Copies the content of this Quaternion to a target Quaternion
|
|
dotProduct(q2)
calculates to dot product with another quaternion
|
|
Creates a matrix from this quaternion
|
|
multiplyWith(s)
Multiplication operator, multiplies with a float (scalar).
|
|
setFromEuler(dest, y, z)
Sets the quaternion from euler coordinates
|
|
slerp(q1, q2, time)
set this quaternion to the result of the interpolation between two quaternions.
|
|
toEuler(dest)
Fills a 3D vector with euler coodinates representing this quaternion
|
Field Detail
{Number}
W
W component of the Quaternion
{Number}
X
X component of the Quaternion
{Number}
Y
Y component of the Quaternion
{Number}
Z
Z component of the Quaternion
Method Detail
addToThis(b)
Addition operator, adds another quaternion to this one
- Parameters:
- b
clone()
Creates a clone of this Quaternion
copyTo(tgt)
Copies the content of this Quaternion to a target Quaternion
- Parameters:
- tgt
dotProduct(q2)
calculates to dot product with another quaternion
- Parameters:
- q2
getMatrix()
Creates a matrix from this quaternion
multiplyWith(s)
Multiplication operator, multiplies with a float (scalar).
- Parameters:
- s
normalize()
setFromEuler(dest, y, z)
Sets the quaternion from euler coordinates
- Parameters:
- {CL3D.Vect3d} dest
- 3d vector to be filled with the euler coordinates
- y
- z
slerp(q1, q2, time)
set this quaternion to the result of the interpolation between two quaternions. Time is a float between 0 and 1
- Parameters:
- q1
- q2
- time
toEuler(dest)
Fills a 3D vector with euler coodinates representing this quaternion
- Parameters:
- {CL3D.Vect3d} dest
- 3d vector to be filled with the euler coordinates