(Created page with "The SVector struct contains a simple 3D vector of X, Y and Z floats ==Fields== {{ScriptFunction|float|X|{ get; set; }|X axis (red axis)}} {{ScriptFunction|float|Y|{ get; set;...") |
|||
Line 18: | Line 18: | ||
{{ScriptFunction|SVector|Divide|(SVector other);|Divides another vector to this, and returns the result}} | {{ScriptFunction|SVector|Divide|(SVector other);|Divides another vector to this, and returns the result}} | ||
{{ScriptFunction|SVector|Divide|(float other);|Divides a float to each axis of this, and returns the result}} | {{ScriptFunction|SVector|Divide|(float other);|Divides a float to each axis of this, and returns the result}} | ||
− | |||
{{ScriptFunction|float|Magnitude|{ get ; }|Returns the magnitude of this vector}} | {{ScriptFunction|float|Magnitude|{ get ; }|Returns the magnitude of this vector}} | ||
{{ScriptFunction|SVector|Normalised|{ get ; }|Returns the normalised version of this vector}} | {{ScriptFunction|SVector|Normalised|{ get ; }|Returns the normalised version of this vector}} | ||
Line 29: | Line 28: | ||
{{ScriptFunction|SVector|MoveTowards|(SVector other, float maxDistance);|Moves this vector closer to other by a maximum of maxDistance units}} | {{ScriptFunction|SVector|MoveTowards|(SVector other, float maxDistance);|Moves this vector closer to other by a maximum of maxDistance units}} | ||
{{ScriptFunction|float|Dot|(SVector other);|Returns the dot product between this and other (note - normalise your vectors first!)}} | {{ScriptFunction|float|Dot|(SVector other);|Returns the dot product between this and other (note - normalise your vectors first!)}} | ||
− | |||
− | |||
− | |||
==Static Members== | ==Static Members== |
The SVector struct contains a simple 3D vector of X, Y and Z floats
X axis (red axis)
Y axis (green axis)
Z axis (blue axis)
Initialises vector from three floats
Note: Add/Scale/Divide are also implemented as operators (e.g. A + B, A += B)
Adds another vector to this, and returns the result
Adds a float to each axis of this, and returns the result
Multiplies another vector to this, and returns the result
Multiplies a float to each axis of this, and returns the result
Divides another vector to this, and returns the result
Divides a float to each axis of this, and returns the result
Returns the magnitude of this vector
Returns the normalised version of this vector
Returns the distance between this vector and other in meters
Returns the square of the distance between this vector and other in meters, considerably faster than distance()
Returns if other is within range meters of this vector, inclusive
Returns the cross product of this vector and other
Linear interpolates between this and other based on factor t (0..1)
Spherically linear interpolates between this and other based on factor t (0..1)
Moves this vector closer to other by a maximum of maxDistance units
Returns the dot product between this and other (note - normalise your vectors first!)
Equivalent of new SVector(0,1,0)
Equivalent of new SVector(0,-1,0)
Equivalent of new SVector(-1,0,0)
Equivalent of new SVector(1,0,0)
Equivalent of new SVector(0,0,1)
Equivalent of new SVector(0,0,-1)
Equivalent of new SVector(0,0,0)
Equivalent of new SVector(1,1,1)
Contains the largest possible negative vector
Contains the largest possible vector
|