Skip to main content

vrvec4

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
numberw
w element
vrvec2wx
wx elements
vrvec3wxy
wxy elements
vrvec4wxyz
wxyz elements
vrvec3wxz
wxz elements
vrvec4wxzy
wxzy elements
vrvec2wy
wy elements
vrvec3wyx
wyx elements
vrvec4wyxz
wyxz elements
vrvec3wyz
wyz elements
vrvec4wyzx
wyzx elements
vrvec2wz
wz elements
vrvec3wzx
wzx elements
vrvec4wzxy
wzxy elements
vrvec3wzy
wzy elements
vrvec4wzyx
wzyx elements
numberx
x element
vrvec2xw
xw elements
vrvec3xwy
xwy elements
vrvec4xwyz
xwyz elements
vrvec3xwz
xwz elements
vrvec4xwzy
xwzy elements
vrvec2xy
xy elements
vrvec3xyw
xyw elements
vrvec4xywz
xywz elements
vrvec3xyz
xyz elements
vrvec4xyzw
xyzw elements
vrvec2xz
xz elements
vrvec3xzw
xzw elements
vrvec4xzwy
xzwy elements
vrvec3xzy
xzy elements
vrvec4xzyw
xzyw elements
numbery
y element
vrvec2yw
yw elements
vrvec3ywx
ywx elements
vrvec4ywxz
ywxz elements
vrvec3ywz
ywz elements
vrvec4ywzx
ywzx elements
vrvec2yx
yx elements
vrvec3yxw
yxw elements
vrvec4yxwz
yxwz elements
vrvec3yxz
yxz elements
vrvec4yxzw
yxzw elements
vrvec2yz
yz elements
vrvec3yzw
yzw elements
vrvec4yzwx
yzwx elements
vrvec3yzx
yzx elements
vrvec4yzxw
yzxw elements
numberz
z element
vrvec2zw
zw elements
vrvec3zwx
zwx elements
vrvec4zwxy
zwxy elements
vrvec3zwy
zwy elements
vrvec4zwyx
zwyx elements
vrvec2zx
zx elements
vrvec3zxw
zxw elements
vrvec4zxwy
zxwy elements
vrvec3zxy
zxy elements
vrvec4zxyw
zxyw elements
vrvec2zy
zy elements
vrvec3zyw
zyw elements
vrvec4zywx
zywx elements
vrvec3zyx
zyx elements
vrvec4zyxw
zyxw 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

w

number w;

w element

wx

vrvec2 wx;

wx elements

wxy

vrvec3 wxy;

wxy elements

wxyz

vrvec4 wxyz;

wxyz elements

wxz

vrvec3 wxz;

wxz elements

wxzy

vrvec4 wxzy;

wxzy elements

wy

vrvec2 wy;

wy elements

wyx

vrvec3 wyx;

wyx elements

wyxz

vrvec4 wyxz;

wyxz elements

wyz

vrvec3 wyz;

wyz elements

wyzx

vrvec4 wyzx;

wyzx elements

wz

vrvec2 wz;

wz elements

wzx

vrvec3 wzx;

wzx elements

wzxy

vrvec4 wzxy;

wzxy elements

wzy

vrvec3 wzy;

wzy elements

wzyx

vrvec4 wzyx;

wzyx elements

x

number x;

x element

xw

vrvec2 xw;

xw elements

xwy

vrvec3 xwy;

xwy elements

xwyz

vrvec4 xwyz;

xwyz elements

xwz

vrvec3 xwz;

xwz elements

xwzy

vrvec4 xwzy;

xwzy elements

xy

vrvec2 xy;

xy elements

xyw

vrvec3 xyw;

xyw elements

xywz

vrvec4 xywz;

xywz elements

xyz

vrvec3 xyz;

xyz elements

xyzw

vrvec4 xyzw;

xyzw elements

xz

vrvec2 xz;

xz elements

xzw

vrvec3 xzw;

xzw elements

xzwy

vrvec4 xzwy;

xzwy elements

xzy

vrvec3 xzy;

xzy elements

xzyw

vrvec4 xzyw;

xzyw elements

y

number y;

y element

yw

vrvec2 yw;

yw elements

ywx

vrvec3 ywx;

ywx elements

ywxz

vrvec4 ywxz;

ywxz elements

ywz

vrvec3 ywz;

ywz elements

ywzx

vrvec4 ywzx;

ywzx elements

yx

vrvec2 yx;

yx elements

yxw

vrvec3 yxw;

yxw elements

yxwz

vrvec4 yxwz;

yxwz elements

yxz

vrvec3 yxz;

yxz elements

yxzw

vrvec4 yxzw;

yxzw elements

yz

vrvec2 yz;

yz elements

yzw

vrvec3 yzw;

yzw elements

yzwx

vrvec4 yzwx;

yzwx elements

yzx

vrvec3 yzx;

yzx elements

yzxw

vrvec4 yzxw;

yzxw elements

z

number z;

z element

zw

vrvec2 zw;

zw elements

zwx

vrvec3 zwx;

zwx elements

zwxy

vrvec4 zwxy;

zwxy elements

zwy

vrvec3 zwy;

zwy elements

zwyx

vrvec4 zwyx;

zwyx elements

zx

vrvec2 zx;

zx elements

zxw

vrvec3 zxw;

zxw elements

zxwy

vrvec4 zxwy;

zxwy elements

zxy

vrvec3 zxy;

zxy elements

zxyw

vrvec4 zxyw;

zxyw elements

zy

vrvec2 zy;

zy elements

zyw

vrvec3 zyw;

zyw elements

zywx

vrvec4 zywx;

zywx elements

zyx

vrvec3 zyx;

zyx elements

zyxw

vrvec4 zyxw;

zyxw elements