QuaternionBox - stingray.QuaternionBox object reference - Stingray Lua API Reference
A "box" that stores a Quaternion object across multiple frames.
Normally, quaternions are temporary objects that can only be safely used within a single frame. When you need a quaternion value
to persist across multiple frames, you can call QuaternionBox.store() to store the quaternion in a QuaternionBox, and
QuaternionBox.unbox() to retrieve the stored values.
For more information, see Object Lifetimes and Userdata Binding.
|
Stores the specified quaternion values in the box.
|
Parameters self : | stingray.QuaternionBox | Specifies the object instance that this function will act on. You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation. |
quat : | stingray.Quaternion | The quaternion to store in the box. |
Returns | This function does not return any values. |
|
store ( self, x, y, z, w )
Stores the specified quaternion values in the box.
|
Parameters self : | stingray.QuaternionBox | Specifies the object instance that this function will act on. You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation. |
x : | number | The X component value to store in the box. |
y : | number | The Y component value to store in the box. |
z : | number | The Z component value to store in the box. |
w : | number | The W component value to store in the box. |
Returns | This function does not return any values. |
|
unbox ( self ) : stingray.Quaternion
Retrieves the quaternion last stored in the specified box.
|
Parameters self : | stingray.QuaternionBox | Specifies the object instance that this function will act on. You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation. |
Returns