vec3
Constructors
| Name | Prototype |
|---|---|
new | function(): vec3 |
new | function(x: float, y: float, z: float): vec3 |
Metamethods
| Name | Prototype |
|---|---|
__eq | function(rhs: vec3): bool |
__lt | function(rhs: vec3): bool |
__le | function(rhs: vec3): bool |
__add | function(rhs: float|vec3): vec3 --[[scalar & vector]] |
__sub | function(rhs: float|vec3): vec3 --[[scalar & vector]] |
__mul | function(rhs: float|vec3): vec3 --[[scalar & vector]] |
__div | function(rhs: float|vec3): vec3 --[[scalar & vector]] |
__idiv | function(rhs: float|vec3): vec3 --[[scalar & vector]] |
Members
| Name | Type |
|---|---|
x | float |
y | float |
z | float |
Methods
dot
Returns the dot product of two vectors
cross
Returns the cross product of two vectors
to_radians
Converts a rotation vector from degrees to radians
to_degrees
Converts a rotation vector from radians to degrees
distance_to
Returns the distance between two vectors
magnitude
Returns the magnitude of a vector
min_component
Returns the smallest component of a vector
max_component
Returns the largest component of a vector
normalize
Converts a vector to a unit vector
is_null
Returns true if all components of a vector are zero