Quat Class

Extends ValueType

Module: cc

Representation of 2D vectors and points.

Index

Properties
  • x Number
  • y Number
  • z Number
  • w Number
Methods
  • constructor Constructor
  • 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
  • lerp 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 TODO

Details

Properties

x
meta description
Type Number
Defined in cocos2d/core/value-types/quat.js:69
y
meta description
Type Number
Defined in cocos2d/core/value-types/quat.js:72
z
meta description
Type Number
Defined in cocos2d/core/value-types/quat.js:75
w
meta description
Type Number
Defined in cocos2d/core/value-types/quat.js:78

Methods

constructor

Constructor see cc.quat

meta description
Defined in cocos2d/core/value-types/quat.js:42
Parameters
clone

clone a Quat object and return the new object

meta description
Returns Quat
Defined in cocos2d/core/value-types/quat.js:85
set

Set values with another quaternion

meta description
Returns Quat
Defined in cocos2d/core/value-types/quat.js:95
Parameters
  • newValue Quat !#en new value to set. !#zh 要设置的新值
equals

Check whether current quaternion equals another

meta description
Returns Boolean
Defined in cocos2d/core/value-types/quat.js:111
Parameters
toEuler

Convert quaternion to euler

meta description
Returns Vec3
Defined in cocos2d/core/value-types/quat.js:122
Parameters
fromEuler

Convert euler to quaternion

meta description
Returns Quat
Defined in cocos2d/core/value-types/quat.js:134
Parameters
lerp

Calculate the interpolation result between this quaternion and another one with given ratio

meta description
Returns Quat
Defined in cocos2d/core/value-types/quat.js:146
Parameters
lerp

Calculate the multiply result between this quaternion and another one

meta description
Returns Quat
Defined in cocos2d/core/value-types/quat.js:161
Parameters
rotateAround

Rotates a quaternion by the given angle (in radians) about a world space axis.

meta description
Returns Quat
Defined in cocos2d/core/value-types/quat.js:180
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

TODO

meta description
Returns string
Defined in cocos2d/core/value-types/value-type.js:97

results matching ""

    No results matching ""