vrvec3
Module: Maths
A vector.
#include <lua_api.h>
Public Functions
Type | Name |
---|---|
Any | copy() (vrCopy) Returns a copy of a Vector, Matrix, Ray, Sphere, AABBox, Quaternion or Plane |
vrvec3 | cross(Any vec2) (vrCross) Returns the cross product of two vectors. Both vectors must be the same type |
number | dot(Any vec2) (vrDot) Returns the dot product of two vectors. Both vectors must be the same type |
number | getLength() (vrLength) Returns the length of a vector. |
number | getLengthSq() (vrLengthSquared) Returns the squared length of a vector. |
Any | normalise() (vrNormalise) Returns normalised vector/matrix. |
Any | operator*() |
Any | operator+() |
Any | operator-() |
Any | operator/() |
Any | operator=() |
Public Attributes
Type | Name |
---|---|
number | pitch Rotation around X axis (if this is a vector of Euler angles). |
number | roll Rotation around Z axis (if this is a vector of Euler angles). |
number | x x element |
vrvec2 | xy xy elements |
vrvec3 | xyz xyz elements |
vrvec2 | xz xz elements |
vrvec3 | xzy xzy elements |
number | y y element |
number | yaw Rotation around Y axis (if this is a vector of Euler angles). |
vrvec2 | yx yx elements |
vrvec3 | yxz yxz elements |
vrvec2 | yz yz elements |
vrvec3 | yzx yzx elements |
number | z z element |
vrvec2 | zx zx elements |
vrvec3 | zxy zxy elements |
vrvec2 | zy zy elements |
vrvec3 | zyx zyx elements |
Public Functions Documentation
copy
Any copy()
(vrCopy) Returns a copy of a Vector, Matrix, Ray, Sphere, AABBox, Quaternion or Plane
cross
vrvec3 cross(
Any vec2
)
(vrCross) Returns the cross product of two vectors. Both vectors must be the same type
Parameters:
- vec2 Vector 2 {x, y} or {x, y, z}.
dot
number dot(
Any vec2
)
(vrDot) Returns the dot product of two vectors. Both vectors must be the same type
Parameters:
- vec2 Vector 2 {x, y} or {x, y, z}.
getLength
number getLength()
(vrLength) Returns the length of a vector.
getLengthSq
number getLengthSq()
(vrLengthSquared) Returns the squared length of a vector.
normalise
Any normalise()
(vrNormalise) Returns normalised vector/matrix.
Return: Normalised vector or matrix depending on the type passed in
operator*
Any operator*()
operator+
Any operator+()
operator-
Any operator-()
operator/
Any operator/()
operator=
Any operator=()
Public Attributes Documentation
pitch
number pitch;
Rotation around X axis (if this is a vector of Euler angles).
roll
number roll;
Rotation around Z axis (if this is a vector of Euler angles).
x
number x;
x element
xy
vrvec2 xy;
xy elements
xyz
vrvec3 xyz;
xyz elements
xz
vrvec2 xz;
xz elements
xzy
vrvec3 xzy;
xzy elements
y
number y;
y element
yaw
number yaw;
Rotation around Y axis (if this is a vector of Euler angles).
yx
vrvec2 yx;
yx elements
yxz
vrvec3 yxz;
yxz elements
yz
vrvec2 yz;
yz elements
yzx
vrvec3 yzx;
yzx elements
z
number z;
z element
zx
vrvec2 zx;
zx elements
zxy
vrvec3 zxy;
zxy elements
zy
vrvec2 zy;
zy elements
zyx
vrvec3 zyx;
zyx elements