SVector
Index
Functions Index
float Distance (SVector other)
float SquareDistance (SVector other)
bool InRange (SVector other, float range)
SVector Cross (SVector other)
SVector Lerp (SVector other, float t)
SVector Slerp (SVector other, float t)
SVector MoveTowards (SVector other, float maxDistance)
float Dot (SVector other)
bool Equals (SVector other)
string ToString ()
Static Functions
static SVector New (float x, float y, float z)
Properties Index
float X get set
float Y get set
float Z get set
float Magnitude get
SVector Normalised get
Static Properties
static SVector Up get
static SVector Down get
static SVector Left get
static SVector Right get
static SVector Forward get
static SVector Back get
static SVector Zero get
static SVector One get
static SVector MaxValue get
static SVector MinValue get
Functions
Add
SVector Add (SVector other) SVector Add (float other)
Adds this Vector
Scale
SVector Scale (SVector other) SVector Scale (float other)
Multiplies this Vector
Divide
SVector Divide (SVector other) SVector Divide (float other)
Divides this Vector
Distance
float Distance (SVector other)
Returns the distance between this vector and other in meters
SquareDistance
float SquareDistance (SVector other)
Returns the square of the distance between this vector and other in meters, considerably faster than distance()
InRange
bool InRange (SVector other, float range)
Returns if other is within range meters of this vector, inclusive
Cross
SVector Cross (SVector other)
Returns the cross product of this vector and other
Lerp
SVector Lerp (SVector other, float t)
Linear interpolates between this and other based on factor t (0-1)
Slerp
SVector Slerp (SVector other, float t)
Spherically linear interpolates between this and other based on factor t (0-1)
MoveTowards
SVector MoveTowards (SVector other, float maxDistance)
Moves this vector closer to other by a maximum of maxDistance units
Dot
float Dot (SVector other)
Returns the dot product between this and other (note - normalise your vectors first!
Equals
bool Equals (SVector other)
Function Description
ToString
string ToString ()
Function Description
New
static SVector New (float x, float y, float z)
Initialises vector from three floats
operator+
static SVector operator+ (SVector a, SVector b) static SVector operator+ (SVector a, float b)
Function Description
operator-
static SVector operator- (SVector a, SVector b) static SVector operator- (SVector a, float b)
Function Description
operator*
static SVector operator* (SVector a, SVector b) static SVector operator* (SVector a, float b)
Function Description
operator/
static SVector operator/ (SVector a, SVector b) static SVector operator/ (SVector a, float b)
Function Description
Properties
X
float X get set
X axis (red axis)
Y
float Y get set
Y axis (green axis)
Z
float Z get set
Z axis (blue axis)
Magnitude
float Magnitude get
Returns the magnitude of this vector
Normalised
SVector Normalised get
Returns the normalised version of this vector
Up
static SVector Up get
Equivalent of new SVector(0,1,0)
Down
static SVector Down get
Equivalent of new SVector(0,-1,0)
Left
static SVector Left get
Equivalent of new SVector(-1,0,0)
Right
static SVector Right get
Equivalent of new SVector(1,0,0)
Forward
static SVector Forward get
Equivalent of new SVector(0,0,1)
Back
static SVector Back get
Equivalent of new SVector(0,0,-1)
Zero
static SVector Zero get
Equivalent of new SVector(0,0,0)
One
static SVector One get
Equivalent of new SVector(1,1,1)
MaxValue
static SVector MaxValue get
Contains the largest possible vector [3.402823E+38, 3.402823E+38, 3.402823E+38]
MinValue
static SVector MinValue get
Contains the largest possible negative vector
Last updated
Was this helpful?

