Quat 类型
继承于 ValueType
表示 2D 向量和坐标
索引
属性(properties)
方法
constructor构造函数,可查看 cc.quatclone克隆一个四元数并返回set用另一个四元数的值设置到当前对象上。equals当前的四元数是否与指定的四元数相等。toEuler转换四元数到欧拉角fromEuler转换欧拉角到四元数lerp计算四元数的插值结果lerp计算四元数乘积的结果rotateAround围绕世界空间轴按给定弧度旋转四元数toString转换为方便阅读的字符串。
Details
属性(properties)
x
| meta | description |
|---|---|
| 类型 | Number |
| 定义于 | cocos2d/core/value-types/quat.js:69 |
y
| meta | description |
|---|---|
| 类型 | Number |
| 定义于 | cocos2d/core/value-types/quat.js:72 |
z
| meta | description |
|---|---|
| 类型 | Number |
| 定义于 | cocos2d/core/value-types/quat.js:75 |
w
| meta | description |
|---|---|
| 类型 | Number |
| 定义于 | cocos2d/core/value-types/quat.js:78 |
方法
constructor
构造函数,可查看 cc.quat
| meta | description |
|---|---|
| 定义于 | cocos2d/core/value-types/quat.js:42 |
参数列表
clone
克隆一个四元数并返回
| meta | description |
|---|---|
| 返回 | Quat |
| 定义于 | cocos2d/core/value-types/quat.js:85 |
set
用另一个四元数的值设置到当前对象上。
| meta | description |
|---|---|
| 返回 | Quat |
| 定义于 | cocos2d/core/value-types/quat.js:95 |
参数列表
newValueQuat !#en new value to set. !#zh 要设置的新值
equals
当前的四元数是否与指定的四元数相等。
| meta | description |
|---|---|
| 返回 | Boolean |
| 定义于 | cocos2d/core/value-types/quat.js:111 |
参数列表
otherQuat
toEuler
转换四元数到欧拉角
| meta | description |
|---|---|
| 返回 | Vec3 |
| 定义于 | cocos2d/core/value-types/quat.js:122 |
参数列表
outVec3
fromEuler
转换欧拉角到四元数
| meta | description |
|---|---|
| 返回 | Quat |
| 定义于 | cocos2d/core/value-types/quat.js:134 |
参数列表
eulerVec3
lerp
计算四元数的插值结果
| meta | description |
|---|---|
| 返回 | Quat |
| 定义于 | cocos2d/core/value-types/quat.js:146 |
参数列表
lerp
计算四元数乘积的结果
| meta | description |
|---|---|
| 返回 | Quat |
| 定义于 | cocos2d/core/value-types/quat.js:161 |
参数列表
rotateAround
围绕世界空间轴按给定弧度旋转四元数
| meta | description |
|---|---|
| 返回 | Quat |
| 定义于 | cocos2d/core/value-types/quat.js:180 |
参数列表
rotQuat Quaternion to rotateaxisVec3 The axis around which to rotate in world spaceradNumber Angle (in radians) to rotateoutQuat Quaternion to store result
toString
转换为方便阅读的字符串。
| meta | description |
|---|---|
| 返回 | string |
| 定义于 | cocos2d/core/value-types/value-type.js:97 |