SFRotation
The SFRotation object corresponds to an X3D SFRotation field.
It has four numeric properties: x, y, z (the axis of rotation) and angle. These may also be addressed by indices [0] through [3].
Properties
Type | Property | Description | Standard |
---|---|---|---|
number | x | The first value of the axis vector. [read/write].
| X3D2.0 |
number | y | The second value of the axis vector. [read/write].
| X3D2.0 |
number | z | The third value of the axis vector. [read/write].
| X3D2.0 |
number | angle | The angle of the rotation (in radians). [read/write].
| X3D2.0 |
Functions
Return type | Function | Description | Standard |
---|---|---|---|
SFRotation(number x, number y, number z, number angle) | Creates a new SFRotation object. x, y, and z are the axis of the rotation. angle is the angle of the rotation (in radians). Missing values default to 0.0, except y, which defaults to 1.0. | ||
SFVec3f | getAxis() | Returns the axis of rotation.
| X3D2.0 |
SFRotation | inverse() | Returns the inverse of this object's rotation.
| X3D2.0 |
SFRotation | multiply(SFRotation rot) | Returns the object multiplied by the passed value.
| X3D2.0 |
SFVec3f | multVec(SFVec3f vec) |
| |
void | setAxis(SFVec3f vec) | Sets the axis of rotation to the value passed in vec.
| X3D2.0 |
SFRotation | slerp(SFRotation dest, number t) |
Returns the value of the spherical linear interpolation between this object's rotation and dest at value
| X3D2.0 |
String | toString() | Returns a String containing the value of x, y, z, and angle using the X3D Classic VRML encoding.
| X3D2.0 |