SVector

Index

Functions Index

Function

SVector Add (SVector other) SVector Add (float other)

SVector Scale (SVector other) SVector Scale (float other)

SVector Divide (SVector other) SVector Divide (float other)

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)

static SVector operator+ (SVector a, SVector b) static SVector operator+ (SVector a, float b)

static SVector operator- (SVector a, SVector b) static SVector operator- (SVector a, float b)

static SVector operator* (SVector a, SVector b) static SVector operator* (SVector a, float b)

static SVector operator/ (SVector a, SVector b) static SVector operator/ (SVector a, float b)

Properties Index

Property

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

Parameter
Type
Description

Scale

SVector Scale (SVector other) SVector Scale (float other)

Multiplies this Vector

Parameter
Type
Description

Divide

SVector Divide (SVector other) SVector Divide (float other)

Divides this Vector

Parameter
Type
Description

Distance

float Distance (SVector other)

Returns the distance between this vector and other in meters

Parameter
Type
Description

SquareDistance

float SquareDistance (SVector other)

Returns the square of the distance between this vector and other in meters, considerably faster than distance()

Parameter
Type
Description

InRange

bool InRange (SVector other, float range)

Returns if other is within range meters of this vector, inclusive

Parameter
Type
Description

Cross

SVector Cross (SVector other)

Returns the cross product of this vector and other

Parameter
Type
Description

Lerp

SVector Lerp (SVector other, float t)

Linear interpolates between this and other based on factor t (0-1)

Parameter
Type
Description

Slerp

SVector Slerp (SVector other, float t)

Spherically linear interpolates between this and other based on factor t (0-1)

Parameter
Type
Description

MoveTowards

SVector MoveTowards (SVector other, float maxDistance)

Moves this vector closer to other by a maximum of maxDistance units

Parameter
Type
Description

Dot

float Dot (SVector other)

Returns the dot product between this and other (note - normalise your vectors first!

Parameter
Type
Description

Equals

bool Equals (SVector other)

Function Description

Parameter
Type
Description

ToString

string ToString ()

Function Description

New

static SVector New (float x, float y, float z)

Initialises vector from three floats

Parameter
Type
Description

operator+

static SVector operator+ (SVector a, SVector b) static SVector operator+ (SVector a, float b)

Function Description

Parameter
Type
Description

operator-

static SVector operator- (SVector a, SVector b) static SVector operator- (SVector a, float b)

Function Description

Parameter
Type
Description

operator*

static SVector operator* (SVector a, SVector b) static SVector operator* (SVector a, float b)

Function Description

Parameter
Type
Description

operator/

static SVector operator/ (SVector a, SVector b) static SVector operator/ (SVector a, float b)

Function Description

Parameter
Type
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)

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?