Quat
Class
Extends ValueType
Module: cc
Parent Module: cc
Representation of 2D vectors and points.
Index
Properties
x
Number
y
Number
z
Number
w
Number
Methods
constructor
Constructor
mul
Calculate the multiply result between this quaternion and another one
clone
Obtaining copy specified quaternion
copy
Copy quaternion target
set
Provided Quaternion Value
identity
The target of an assignment as a unit quaternion
rotationTo
Set quaternion rotation is the shortest path between two vectors, the default two vectors are normalized
getAxisAngle
Get the rotary shaft and the arc of rotation quaternion
multiply
Quaternion multiplication
multiplyScalar
Quaternion scalar multiplication
scaleAndAdd
Quaternion multiplication and addition: A + B * scale
rotateX
About the X axis specified quaternion
rotateY
Rotation about the Y axis designated quaternion
rotateZ
Around the Z axis specified quaternion
rotateAround
Space around the world at a given axis of rotation quaternion
rotateAroundLocal
Local space around the specified axis rotation quaternion
calculateW
The component w xyz components calculated, normalized by default
dot
Quaternion dot product (scalar product)
lerp
Element by element linear interpolation: A + t * (B - A)
slerp
Spherical quaternion interpolation
sqlerp
Quaternion with two spherical interpolation control points
invert
Quaternion inverse
conjugate
Conjugating a quaternion, and the unit quaternion equivalent to inversion, but more efficient
len
Seek length quaternion
lengthSqr
Seeking quaternion square of the length
normalize
Normalized quaternions
fromAxes
Calculated according to the local orientation quaternion coordinate axis, the default three vectors are normalized and mutually perpendicular
fromViewUp
The forward direction and the direction of the viewport computing quaternion
fromAxisAngle
The quaternion calculated and the arc of rotation of the rotary shaft
- `` Set a quaternion from the given euler angle 0, 0, z.
fromMat3
Calculating the three-dimensional quaternion matrix information, default zoom information input matrix does not contain
fromEuler
The quaternion calculated Euler angle information, rotation order YZX
toAxisX
This returns the result of the quaternion coordinate system X-axis vector
toAxisY
This returns the result of the quaternion coordinate system Y axis vector
toAxisZ
This returns the result of the quaternion coordinate system the Z-axis vector
toEuler
The quaternion calculated Euler angles, return angle x, y in the [-180, 180] interval, z default the range [-90, 90] interval, the rotation order YZX
strictEquals
Analyzing quaternion equivalent
equals
Negative floating point error quaternion approximately equivalent Analyzing
toArray
Quaternion rotation array
fromArray
Array to a quaternion
clone
clone a Quat object and return the new object
set
Set values with another quaternion
equals
Check whether current quaternion equals another
toEuler
Convert quaternion to euler
fromEuler
Convert euler to quaternion
lerp
Calculate the interpolation result between this quaternion and another one with given ratio
multiply
Calculate the multiply result between this quaternion and another one
rotateAround
Rotates a quaternion by the given angle (in radians) about a world space axis.
toString
Convert to a readable string.
Details
Properties
x
y
z
w
Methods
constructor
Constructor
see cc.quat
Parameters
mul
Calculate the multiply result between this quaternion and another one
Parameters
clone
Obtaining copy specified quaternion
copy
Copy quaternion target
set
Provided Quaternion Value
identity
The target of an assignment as a unit quaternion
rotationTo
Set quaternion rotation is the shortest path between two vectors, the default two vectors are normalized
getAxisAngle
Get the rotary shaft and the arc of rotation quaternion
Parameters
multiply
Quaternion multiplication
multiplyScalar
Quaternion scalar multiplication
scaleAndAdd
Quaternion multiplication and addition: A + B * scale
rotateX
About the X axis specified quaternion
Parameters
rotateY
Rotation about the Y axis designated quaternion
Parameters
rotateZ
Around the Z axis specified quaternion
Parameters
rotateAround
Space around the world at a given axis of rotation quaternion
Parameters
axis
Unknown 旋转轴,默认已归一化
rad
Unknown 旋转弧度
rotateAroundLocal
Local space around the specified axis rotation quaternion
Parameters
axis
Unknown 旋转轴
rad
Unknown 旋转弧度
calculateW
The component w xyz components calculated, normalized by default
dot
Quaternion dot product (scalar product)
lerp
Element by element linear interpolation: A + t * (B - A)
slerp
Spherical quaternion interpolation
sqlerp
Quaternion with two spherical interpolation control points
invert
Quaternion inverse
conjugate
Conjugating a quaternion, and the unit quaternion equivalent to inversion, but more efficient
len
Seek length quaternion
lengthSqr
Seeking quaternion square of the length
normalize
Normalized quaternions
fromAxes
Calculated according to the local orientation quaternion coordinate axis, the default three vectors are normalized and mutually perpendicular
fromViewUp
The forward direction and the direction of the viewport computing quaternion
Parameters
view
Unknown 视口面向的前方向,必须归一化
up
Unknown 视口的上方向,必须归一化,默认为 (0, 1, 0)
fromAxisAngle
The quaternion calculated and the arc of rotation of the rotary shaft
Set a quaternion from the given euler angle 0, 0, z.
Parameters
out
Quat Quaternion to store result.
z
number Angle to rotate around Z axis in degrees.
fromMat3
Calculating the three-dimensional quaternion matrix information, default zoom information input matrix does not contain
fromEuler
The quaternion calculated Euler angle information, rotation order YZX
toAxisX
This returns the result of the quaternion coordinate system X-axis vector
toAxisY
This returns the result of the quaternion coordinate system Y axis vector
toAxisZ
This returns the result of the quaternion coordinate system the Z-axis vector
toEuler
The quaternion calculated Euler angles, return angle x, y in the [-180, 180] interval, z default the range [-90, 90] interval, the rotation order YZX
Parameters
outerZ
Unknown z 取值范围区间改为 [-180, -90] U [90, 180]
strictEquals
Analyzing quaternion equivalent
equals
Negative floating point error quaternion approximately equivalent Analyzing
toArray
Quaternion rotation array
Parameters
fromArray
Array to a quaternion
Parameters
clone
clone a Quat object and return the new object
set
Set values with another quaternion
Parameters
newValue
Quat !#en new value to set. !#zh 要设置的新值
equals
Check whether current quaternion equals another
Parameters
toEuler
Convert quaternion to euler
Parameters
fromEuler
Convert euler to quaternion
Parameters
lerp
Calculate the interpolation result between this quaternion and another one with given ratio
Parameters
multiply
Calculate the multiply result between this quaternion and another one
Parameters
rotateAround
Rotates a quaternion by the given angle (in radians) about a world space axis.
Parameters
rot
Quat Quaternion to rotate
axis
Vec3 The axis around which to rotate in world space
rad
Number Angle (in radians) to rotate
out
Quat Quaternion to store result
toString
Convert to a readable string.