Skip to main content

vrvec3

Module: Maths

A vector.

#include <lua_api.h>

Public Functions​

TypeName
Anycopy()
(vrCopy) Returns a copy of a Vector, Matrix, Ray, Sphere, AABBox, Quaternion or Plane
vrvec3cross(Any vec2)
(vrCross) Returns the cross product of two vectors. Both vectors must be the same type
numberdot(Any vec2)
(vrDot) Returns the dot product of two vectors. Both vectors must be the same type
numbergetLength()
(vrLength) Returns the length of a vector.
numbergetLengthSq()
(vrLengthSquared) Returns the squared length of a vector.
Anynormalise()
(vrNormalise) Returns normalised vector/matrix.
Anyoperator*()
Anyoperator+()
Anyoperator-()
Anyoperator/()
Anyoperator=()

Public Attributes​

TypeName
numberpitch
Rotation around X axis (if this is a vector of Euler angles).
numberroll
Rotation around Z axis (if this is a vector of Euler angles).
numberx
x element
vrvec2xy
xy elements
vrvec3xyz
xyz elements
vrvec2xz
xz elements
vrvec3xzy
xzy elements
numbery
y element
numberyaw
Rotation around Y axis (if this is a vector of Euler angles).
vrvec2yx
yx elements
vrvec3yxz
yxz elements
vrvec2yz
yz elements
vrvec3yzx
yzx elements
numberz
z element
vrvec2zx
zx elements
vrvec3zxy
zxy elements
vrvec2zy
zy elements
vrvec3zyx
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