vrvec2

A vector.

Public Attributes


number length

DEPRECATED since version 2.0.0. Please use vrvec2:getLength() instead.


number x

x element


xy elements


number y

y element


yx elements

Public Member Functions


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

Parameters
vec2

Vector 2 {x, y} or {x, y, z}.


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}.


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.

Returns

Normalised vector or matrix depending on the type passed in


Any operator*()

Any operator+()

Any operator-()

Any operator/()

Any operator=()

No Results.

Getting StartedArchitectureBest PracticesHow ToAdvanced TopicsChangelogvrtreevrtree_cppvtCoreCoreForeign Function InterfaceMetanodesMigrationsObserversPropertiesSettingsTreeUtilitiesAPI DefinitionsVR ExchangePluginsLua API