Vector3 class

Vector3 class

A vector with three components.

The Vector3 type exposes the following members:

Constructors

ConstructorDescription
initInitializes a new instance of the Vector3 struct.
initInitializes a new instance of the Vector3 struct.
initInitializes a new instance of the Vector3 struct.
initInitializes a new instance of the Vector3 struct.
initConstructs a new instance of Vector3

Properties

PropertyDescription
length2Gets the square of the length.
lengthGets the length of this vector.
zeroGets unit vector (0, 0, 0)
oneGets unit vector (1, 1, 1)
unit_xGets unit vector (1, 0, 0)
unit_yGets unit vector (0, 1, 0)
unit_zGets unit vector (0, 0, 1)
ORIGINGets the origin position.
UNIT_SCALEGets the unit scale vector.
X_AXISGets the X axis.
Y_AXISGets the Y axis.
Z_AXISGets the Z axis.

Indexer

NameDescription
[index]

Methods

MethodDescription
angle_betweenCalculate the inner angle between two direction
Two direction can be non-normalized vectors
angle_betweenCalculate the inner angle between two direction
Two direction can be non-normalized vectors
dotGets the dot product of two vectors
normalizeNormalizes this instance.
sinCalculates sine on each component
cosCalculates cosine on each component
crossCross product of two vectors
setSets the x/y/z component in one call.
compare_toCompare current vector to another instance.

See Also