Vector3Box - stingray.Vector3Box object reference - Stingray Lua API Reference
A "box" that stores a Vector3 object across multiple frames.
Normally, vectors are temporary objects that can only be safely used within a single frame. When you need a vector value
to persist across multiple frames, you can call Vector3Box.store() to store the vector in a Vector3Box, and
Vector3Box.unbox() to retrieve the stored values.
For more information, see Object Lifetimes and Userdata Binding.
You can set and retrieve component values by using the [] operator. Use the indices 1 or "x" for the X component, 2 or "y" for the Y
component, and 3 or "z" for the Z component. For example:
yComponentValue = vectorBox[2]
zComponentValue = vectorBox["z"]
|
x : number
The X axis component value last stored in the box.
|
|
y : number
The Y axis component value last stored in the box.
|
|
z : number
The Z axis component value last stored in the box.
|
|
Stores the specified vector values in the box.
|
Parameters Returns | This function does not return any values. |
|
Stores the specified vector values in the box.
|
Parameters self : | stingray.Vector3Box |
Specifies the object instance that this function will act on.
|
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.
|
Returns | This function does not return any values. |
|
unbox ( self ) : stingray.Vector3
Retrieves the vector last stored in the specified box.
|