Dungeon Architect  17.0.0
SharpNav.Geometry.Vector3 Struct Reference

Represents a 3D vector using three single-precision floating-point numbers. More...

Inheritance diagram for SharpNav.Geometry.Vector3:

Public Member Functions

 Vector3 (float value)
 Constructs a new instance. More...
 
 Vector3 (float x, float y, float z)
 Constructs a new Vector3. More...
 
 Vector3 (Vector3 v)
 Constructs a new Vector3 from the given Vector3. More...
 
void Set (float x, float y, float z)
 Sets the Vector3 values. More...
 
void Add (Vector3 right)
 Add the Vector passed as parameter to this instance. More...
 
void Add (ref Vector3 right)
 Add the Vector passed as parameter to this instance. More...
 
void Sub (Vector3 right)
 Subtract the Vector passed as parameter from this instance. More...
 
void Sub (ref Vector3 right)
 Subtract the Vector passed as parameter from this instance. More...
 
void Mult (float f)
 Multiply this instance by a scalar. More...
 
void Div (float f)
 Divide this instance by a scalar. More...
 
float Length ()
 Gets the length (magnitude) of the vector. More...
 
float LengthSquared ()
 Gets the square of the vector length (magnitude). More...
 
Vector3 Normalized ()
 Returns a copy of the Vector3 scaled to unit length. More...
 
void Normalize ()
 Scales the Vector3 to unit length. More...
 
void Scale (float sx, float sy, float sz)
 Scales the current Vector3 by the given amounts. More...
 
void Scale (Vector3 scale)
 Scales this instance by the given parameter. More...
 
void Scale (ref Vector3 scale)
 Scales this instance by the given parameter. More...
 
override string ToString ()
 Returns a System.String that represents the current Vector3. More...
 
override int GetHashCode ()
 Returns the hashcode for this instance. More...
 
override bool Equals (object obj)
 Indicates whether this instance and a specified object are equal. More...
 
bool Equals (Vector3 other)
 Indicates whether the current vector is equal to another vector. More...
 

Static Public Member Functions

static Vector3 Sub (Vector3 a, Vector3 b)
 Defines the size of the Vector3 struct in bytes. More...
 
static void Sub (ref Vector3 a, ref Vector3 b, out Vector3 result)
 Subtract one Vector from another More...
 
static Vector3 Mult (Vector3 a, float f)
 Multiply a vector and a scalar More...
 
static void Mult (ref Vector3 a, float f, out Vector3 result)
 Multiply a vector and a scalar More...
 
static Vector3 Div (Vector3 a, float f)
 Divide a vector by a scalar More...
 
static void Div (ref Vector3 a, float f, out Vector3 result)
 Divide a vector by a scalar More...
 
static Vector3 Add (Vector3 a, Vector3 b)
 Adds two vectors. More...
 
static void Add (ref Vector3 a, ref Vector3 b, out Vector3 result)
 Adds two vectors. More...
 
static Vector3 Subtract (Vector3 a, Vector3 b)
 Subtract one Vector from another More...
 
static void Subtract (ref Vector3 a, ref Vector3 b, out Vector3 result)
 Subtract one Vector from another More...
 
static Vector3 Multiply (Vector3 vector, float scale)
 Multiplies a vector by a scalar. More...
 
static void Multiply (ref Vector3 vector, float scale, out Vector3 result)
 Multiplies a vector by a scalar. More...
 
static Vector3 Multiply (Vector3 vector, Vector3 scale)
 Multiplies a vector by the components a vector (scale). More...
 
static void Multiply (ref Vector3 vector, ref Vector3 scale, out Vector3 result)
 Multiplies a vector by the components of a vector (scale). More...
 
static Vector3 Divide (Vector3 vector, float scale)
 Divides a vector by a scalar. More...
 
static void Divide (ref Vector3 vector, float scale, out Vector3 result)
 Divides a vector by a scalar. More...
 
static Vector3 Divide (Vector3 vector, Vector3 scale)
 Divides a vector by the components of a vector (scale). More...
 
static void Divide (ref Vector3 vector, ref Vector3 scale, out Vector3 result)
 Divide a vector by the components of a vector (scale). More...
 
static Vector3 ComponentMin (Vector3 a, Vector3 b)
 Calculate the component-wise minimum of two vectors More...
 
static void ComponentMin (ref Vector3 a, ref Vector3 b, out Vector3 result)
 Calculate the component-wise minimum of two vectors More...
 
static Vector3 ComponentMax (Vector3 a, Vector3 b)
 Calculate the component-wise maximum of two vectors More...
 
static void ComponentMax (ref Vector3 a, ref Vector3 b, out Vector3 result)
 Calculate the component-wise maximum of two vectors More...
 
static Vector3 Min (Vector3 left, Vector3 right)
 Returns the Vector3 with the minimum magnitude More...
 
static Vector3 Max (Vector3 left, Vector3 right)
 Returns the Vector3 with the minimum magnitude More...
 
static Vector3 Clamp (Vector3 vec, Vector3 min, Vector3 max)
 Clamp a vector to the given minimum and maximum vectors More...
 
static void Clamp (ref Vector3 vec, ref Vector3 min, ref Vector3 max, out Vector3 result)
 Clamp a vector to the given minimum and maximum vectors More...
 
static Vector3 Normalize (Vector3 vec)
 Scale a vector to unit length More...
 
static void Normalize (ref Vector3 vec, out Vector3 result)
 Scale a vector to unit length More...
 
static float Dot (Vector3 left, Vector3 right)
 Calculate the dot (scalar) product of two vectors More...
 
static void Dot (ref Vector3 left, ref Vector3 right, out float result)
 Calculate the dot (scalar) product of two vectors More...
 
static Vector3 Cross (Vector3 left, Vector3 right)
 Caclulate the cross (vector) product of two vectors More...
 
static void Cross (ref Vector3 left, ref Vector3 right, out Vector3 result)
 Caclulate the cross (vector) product of two vectors More...
 
static Vector3 Lerp (Vector3 a, Vector3 b, float blend)
 Returns a new Vector that is the linear blend of the 2 given Vectors More...
 
static void Lerp (ref Vector3 a, ref Vector3 b, float blend, out Vector3 result)
 Returns a new Vector that is the linear blend of the 2 given Vectors More...
 
static Vector3 BaryCentric (Vector3 a, Vector3 b, Vector3 c, float u, float v)
 Interpolate 3 Vectors using Barycentric coordinates More...
 
static void BaryCentric (ref Vector3 a, ref Vector3 b, ref Vector3 c, float u, float v, out Vector3 result)
 Interpolate 3 Vectors using Barycentric coordinates More...
 
static float CalculateAngle (Vector3 first, Vector3 second)
 Calculates the angle (in radians) between two vectors. More...
 
static void CalculateAngle (ref Vector3 first, ref Vector3 second, out float result)
 Calculates the angle (in radians) between two vectors. More...
 
static Vector3 operator+ (Vector3 left, Vector3 right)
 Adds two instances. More...
 
static Vector3 operator- (Vector3 left, Vector3 right)
 Subtracts two instances. More...
 
static Vector3 operator- (Vector3 vec)
 Negates an instance. More...
 
static Vector3 operator* (Vector3 vec, float scale)
 Multiplies an instance by a scalar. More...
 
static Vector3 operator* (float scale, Vector3 vec)
 Multiplies an instance by a scalar. More...
 
static Vector3 operator* (Vector3 vec, Vector3 scale)
 Component-wise multiplication between the specified instance by a scale vector. More...
 
static Vector3 operator/ (Vector3 vec, float scale)
 Divides an instance by a scalar. More...
 
static bool operator== (Vector3 left, Vector3 right)
 Compares two instances for equality. More...
 
static bool operator!= (Vector3 left, Vector3 right)
 Compares two instances for inequality. More...
 

Public Attributes

float X
 The X component of the Vector3. More...
 
float Y
 The Y component of the Vector3. More...
 
float Z
 The Z component of the Vector3. More...
 

Static Public Attributes

static readonly Vector3 UnitX = new Vector3(1, 0, 0)
 Defines a unit-length Vector3 that points towards the X-axis. More...
 
static readonly Vector3 UnitY = new Vector3(0, 1, 0)
 Defines a unit-length Vector3 that points towards the Y-axis. More...
 
static readonly Vector3 UnitZ = new Vector3(0, 0, 1)
 /// Defines a unit-length Vector3 that points towards the Z-axis. More...
 
static readonly Vector3 Zero = new Vector3(0, 0, 0)
 Defines a zero-length Vector3. More...
 
static readonly Vector3 One = new Vector3(1, 1, 1)
 Defines an instance with all components set to 1. More...
 

Properties

float this[int index] [get, set]
 Gets or sets the value at the index of the Vector. More...
 
Vector3 Xzy [get, set]
 Gets or sets an OpenTK.Vector3 with the X, Z, and Y components of this instance. More...
 
Vector3 Yxz [get, set]
 Gets or sets an OpenTK.Vector3 with the Y, X, and Z components of this instance. More...
 
Vector3 Yzx [get, set]
 Gets or sets an OpenTK.Vector3 with the Y, Z, and X components of this instance. More...
 
Vector3 Zxy [get, set]
 Gets or sets an OpenTK.Vector3 with the Z, X, and Y components of this instance. More...
 
Vector3 Zyx [get, set]
 Gets or sets an OpenTK.Vector3 with the Z, Y, and X components of this instance. More...
 

Detailed Description

Represents a 3D vector using three single-precision floating-point numbers.

The Vector3 structure is suitable for interoperation with unmanaged code requiring three consecutive floats.

Definition at line 41 of file Vector3.cs.

Constructor & Destructor Documentation

◆ Vector3() [1/3]

SharpNav.Geometry.Vector3.Vector3 ( float  value)

Constructs a new instance.

Parameters
valueThe value that will initialize this instance.

Definition at line 68 of file Vector3.cs.

◆ Vector3() [2/3]

SharpNav.Geometry.Vector3.Vector3 ( float  x,
float  y,
float  z 
)

Constructs a new Vector3.

Parameters
xThe x component of the Vector3.
yThe y component of the Vector3.
zThe z component of the Vector3.

Definition at line 81 of file Vector3.cs.

◆ Vector3() [3/3]

SharpNav.Geometry.Vector3.Vector3 ( Vector3  v)

Constructs a new Vector3 from the given Vector3.

Parameters
vThe Vector3 to copy components from.

Definition at line 92 of file Vector3.cs.

Member Function Documentation

◆ Add() [1/4]

static void SharpNav.Geometry.Vector3.Add ( ref Vector3  a,
ref Vector3  b,
out Vector3  result 
)
static

Adds two vectors.

Parameters
aLeft operand.
bRight operand.
resultResult of operation.

Definition at line 490 of file Vector3.cs.

◆ Add() [2/4]

void SharpNav.Geometry.Vector3.Add ( ref Vector3  right)

Add the Vector passed as parameter to this instance.

Parameters
rightRight operand. This parameter is only read from.

Definition at line 172 of file Vector3.cs.

◆ Add() [3/4]

static Vector3 SharpNav.Geometry.Vector3.Add ( Vector3  a,
Vector3  b 
)
static

Adds two vectors.

Parameters
aLeft operand.
bRight operand.
Returns
Result of operation.

Definition at line 478 of file Vector3.cs.

◆ Add() [4/4]

void SharpNav.Geometry.Vector3.Add ( Vector3  right)

Add the Vector passed as parameter to this instance.

Parameters
rightRight operand. This parameter is only read from.

Definition at line 162 of file Vector3.cs.

◆ BaryCentric() [1/2]

static void SharpNav.Geometry.Vector3.BaryCentric ( ref Vector3  a,
ref Vector3  b,
ref Vector3  c,
float  u,
float  v,
out Vector3  result 
)
static

Interpolate 3 Vectors using Barycentric coordinates

Parameters
aFirst input Vector.
bSecond input Vector.
cThird input Vector.
uFirst Barycentric Coordinate.
vSecond Barycentric Coordinate.
resultOutput Vector. a when u=v=0, b when u=1,v=0, c when u=0,v=1, and a linear combination of a,b,c otherwise

Definition at line 893 of file Vector3.cs.

◆ BaryCentric() [2/2]

static Vector3 SharpNav.Geometry.Vector3.BaryCentric ( Vector3  a,
Vector3  b,
Vector3  c,
float  u,
float  v 
)
static

Interpolate 3 Vectors using Barycentric coordinates

Parameters
aFirst input Vector
bSecond input Vector
cThird input Vector
uFirst Barycentric Coordinate
vSecond Barycentric Coordinate
Returns
a when u=v=0, b when u=1,v=0, c when u=0,v=1, and a linear combination of a,b,c otherwise

Definition at line 881 of file Vector3.cs.

◆ CalculateAngle() [1/2]

static void SharpNav.Geometry.Vector3.CalculateAngle ( ref Vector3  first,
ref Vector3  second,
out float  result 
)
static

Calculates the angle (in radians) between two vectors.

Parameters
firstThe first vector.
secondThe second vector.
resultAngle (in radians) between the vectors.

Note that the returned angle is never bigger than the constant Pi.

Definition at line 929 of file Vector3.cs.

◆ CalculateAngle() [2/2]

static float SharpNav.Geometry.Vector3.CalculateAngle ( Vector3  first,
Vector3  second 
)
static

Calculates the angle (in radians) between two vectors.

Parameters
firstThe first vector.
secondThe second vector.
Returns
Angle (in radians) between the vectors.

Note that the returned angle is never bigger than the constant Pi.

Definition at line 919 of file Vector3.cs.

◆ Clamp() [1/2]

static void SharpNav.Geometry.Vector3.Clamp ( ref Vector3  vec,
ref Vector3  min,
ref Vector3  max,
out Vector3  result 
)
static

Clamp a vector to the given minimum and maximum vectors

Parameters
vecInput vector
minMinimum vector
maxMaximum vector
resultThe clamped vector

Definition at line 740 of file Vector3.cs.

◆ Clamp() [2/2]

static Vector3 SharpNav.Geometry.Vector3.Clamp ( Vector3  vec,
Vector3  min,
Vector3  max 
)
static

Clamp a vector to the given minimum and maximum vectors

Parameters
vecInput vector
minMinimum vector
maxMaximum vector
Returns
The clamped vector

Definition at line 725 of file Vector3.cs.

◆ ComponentMax() [1/2]

static void SharpNav.Geometry.Vector3.ComponentMax ( ref Vector3  a,
ref Vector3  b,
out Vector3  result 
)
static

Calculate the component-wise maximum of two vectors

Parameters
aFirst operand
bSecond operand
resultThe component-wise maximum

Definition at line 677 of file Vector3.cs.

◆ ComponentMax() [2/2]

static Vector3 SharpNav.Geometry.Vector3.ComponentMax ( Vector3  a,
Vector3  b 
)
static

Calculate the component-wise maximum of two vectors

Parameters
aFirst operand
bSecond operand
Returns
The component-wise maximum

Definition at line 663 of file Vector3.cs.

◆ ComponentMin() [1/2]

static void SharpNav.Geometry.Vector3.ComponentMin ( ref Vector3  a,
ref Vector3  b,
out Vector3  result 
)
static

Calculate the component-wise minimum of two vectors

Parameters
aFirst operand
bSecond operand
resultThe component-wise minimum

Definition at line 646 of file Vector3.cs.

◆ ComponentMin() [2/2]

static Vector3 SharpNav.Geometry.Vector3.ComponentMin ( Vector3  a,
Vector3  b 
)
static

Calculate the component-wise minimum of two vectors

Parameters
aFirst operand
bSecond operand
Returns
The component-wise minimum

Definition at line 632 of file Vector3.cs.

◆ Cross() [1/2]

static void SharpNav.Geometry.Vector3.Cross ( ref Vector3  left,
ref Vector3  right,
out Vector3  result 
)
static

Caclulate the cross (vector) product of two vectors

Parameters
leftFirst operand
rightSecond operand
Returns
The cross product of the two inputs
Parameters
resultThe cross product of the two inputs

Definition at line 828 of file Vector3.cs.

◆ Cross() [2/2]

static Vector3 SharpNav.Geometry.Vector3.Cross ( Vector3  left,
Vector3  right 
)
static

Caclulate the cross (vector) product of two vectors

Parameters
leftFirst operand
rightSecond operand
Returns
The cross product of the two inputs

Definition at line 814 of file Vector3.cs.

◆ Div() [1/3]

void SharpNav.Geometry.Vector3.Div ( float  f)

Divide this instance by a scalar.

Parameters
fScalar operand.

Definition at line 224 of file Vector3.cs.

◆ Div() [2/3]

static void SharpNav.Geometry.Vector3.Div ( ref Vector3  a,
float  f,
out Vector3  result 
)
static

Divide a vector by a scalar

Parameters
aVector operand
fScalar operand
resultResult of the division

Definition at line 458 of file Vector3.cs.

◆ Div() [3/3]

static Vector3 SharpNav.Geometry.Vector3.Div ( Vector3  a,
float  f 
)
static

Divide a vector by a scalar

Parameters
aVector operand
fScalar operand
Returns
Result of the division

Definition at line 442 of file Vector3.cs.

◆ Divide() [1/4]

static void SharpNav.Geometry.Vector3.Divide ( ref Vector3  vector,
float  scale,
out Vector3  result 
)
static

Divides a vector by a scalar.

Parameters
vectorLeft operand.
scaleRight operand.
resultResult of the operation.

Definition at line 594 of file Vector3.cs.

◆ Divide() [2/4]

static void SharpNav.Geometry.Vector3.Divide ( ref Vector3  vector,
ref Vector3  scale,
out Vector3  result 
)
static

Divide a vector by the components of a vector (scale).

Parameters
vectorLeft operand.
scaleRight operand.
resultResult of the operation.

Definition at line 617 of file Vector3.cs.

◆ Divide() [3/4]

static Vector3 SharpNav.Geometry.Vector3.Divide ( Vector3  vector,
float  scale 
)
static

Divides a vector by a scalar.

Parameters
vectorLeft operand.
scaleRight operand.
Returns
Result of the operation.

Definition at line 582 of file Vector3.cs.

◆ Divide() [4/4]

static Vector3 SharpNav.Geometry.Vector3.Divide ( Vector3  vector,
Vector3  scale 
)
static

Divides a vector by the components of a vector (scale).

Parameters
vectorLeft operand.
scaleRight operand.
Returns
Result of the operation.

Definition at line 605 of file Vector3.cs.

◆ Dot() [1/2]

static void SharpNav.Geometry.Vector3.Dot ( ref Vector3  left,
ref Vector3  right,
out float  result 
)
static

Calculate the dot (scalar) product of two vectors

Parameters
leftFirst operand
rightSecond operand
resultThe dot product of the two inputs

Definition at line 799 of file Vector3.cs.

◆ Dot() [2/2]

static float SharpNav.Geometry.Vector3.Dot ( Vector3  left,
Vector3  right 
)
static

Calculate the dot (scalar) product of two vectors

Parameters
leftFirst operand
rightSecond operand
Returns
The dot product of the two inputs

Definition at line 788 of file Vector3.cs.

◆ Equals() [1/2]

override bool SharpNav.Geometry.Vector3.Equals ( object  obj)

Indicates whether this instance and a specified object are equal.

Parameters
objThe object to compare to.
Returns
True if the instances are equal; false otherwise.

Definition at line 1133 of file Vector3.cs.

◆ Equals() [2/2]

bool SharpNav.Geometry.Vector3.Equals ( Vector3  other)

Indicates whether the current vector is equal to another vector.

Parameters
otherA vector to compare with this vector.
Returns
true if the current vector is equal to the vector parameter; otherwise, false.

Definition at line 1152 of file Vector3.cs.

◆ GetHashCode()

override int SharpNav.Geometry.Vector3.GetHashCode ( )

Returns the hashcode for this instance.

Returns
A System.Int32 containing the unique hashcode for this instance.

Definition at line 1119 of file Vector3.cs.

◆ Length()

float SharpNav.Geometry.Vector3.Length ( )

Gets the length (magnitude) of the vector.

LengthSquared

Definition at line 240 of file Vector3.cs.

◆ LengthSquared()

float SharpNav.Geometry.Vector3.LengthSquared ( )

Gets the square of the vector length (magnitude).

This property avoids the costly square root operation required by the Length property. This makes it more suitable for comparisons.

Length

Definition at line 257 of file Vector3.cs.

◆ Lerp() [1/2]

static void SharpNav.Geometry.Vector3.Lerp ( ref Vector3  a,
ref Vector3  b,
float  blend,
out Vector3  result 
)
static

Returns a new Vector that is the linear blend of the 2 given Vectors

Parameters
aFirst input vector
bSecond input vector
blendThe blend factor. a when blend=0, b when blend=1.
resulta when blend=0, b when blend=1, and a linear combination otherwise

Definition at line 861 of file Vector3.cs.

◆ Lerp() [2/2]

static Vector3 SharpNav.Geometry.Vector3.Lerp ( Vector3  a,
Vector3  b,
float  blend 
)
static

Returns a new Vector that is the linear blend of the 2 given Vectors

Parameters
aFirst input vector
bSecond input vector
blendThe blend factor. a when blend=0, b when blend=1.
Returns
a when blend=0, b when blend=1, and a linear combination otherwise

Definition at line 846 of file Vector3.cs.

◆ Max()

static Vector3 SharpNav.Geometry.Vector3.Max ( Vector3  left,
Vector3  right 
)
static

Returns the Vector3 with the minimum magnitude

Parameters
leftLeft operand
rightRight operand
Returns
The minimum Vector3

Definition at line 709 of file Vector3.cs.

◆ Min()

static Vector3 SharpNav.Geometry.Vector3.Min ( Vector3  left,
Vector3  right 
)
static

Returns the Vector3 with the minimum magnitude

Parameters
leftLeft operand
rightRight operand
Returns
The minimum Vector3

Definition at line 694 of file Vector3.cs.

◆ Mult() [1/3]

void SharpNav.Geometry.Vector3.Mult ( float  f)

Multiply this instance by a scalar.

Parameters
fScalar operand.

Definition at line 210 of file Vector3.cs.

◆ Mult() [2/3]

static void SharpNav.Geometry.Vector3.Mult ( ref Vector3  a,
float  f,
out Vector3  result 
)
static

Multiply a vector and a scalar

Parameters
aVector operand
fScalar operand
resultResult of the multiplication

Definition at line 424 of file Vector3.cs.

◆ Mult() [3/3]

static Vector3 SharpNav.Geometry.Vector3.Mult ( Vector3  a,
float  f 
)
static

Multiply a vector and a scalar

Parameters
aVector operand
fScalar operand
Returns
Result of the multiplication

Definition at line 409 of file Vector3.cs.

◆ Multiply() [1/4]

static void SharpNav.Geometry.Vector3.Multiply ( ref Vector3  vector,
float  scale,
out Vector3  result 
)
static

Multiplies a vector by a scalar.

Parameters
vectorLeft operand.
scaleRight operand.
resultResult of the operation.

Definition at line 544 of file Vector3.cs.

◆ Multiply() [2/4]

static void SharpNav.Geometry.Vector3.Multiply ( ref Vector3  vector,
ref Vector3  scale,
out Vector3  result 
)
static

Multiplies a vector by the components of a vector (scale).

Parameters
vectorLeft operand.
scaleRight operand.
resultResult of the operation.

Definition at line 567 of file Vector3.cs.

◆ Multiply() [3/4]

static Vector3 SharpNav.Geometry.Vector3.Multiply ( Vector3  vector,
float  scale 
)
static

Multiplies a vector by a scalar.

Parameters
vectorLeft operand.
scaleRight operand.
Returns
Result of the operation.

Definition at line 532 of file Vector3.cs.

◆ Multiply() [4/4]

static Vector3 SharpNav.Geometry.Vector3.Multiply ( Vector3  vector,
Vector3  scale 
)
static

Multiplies a vector by the components a vector (scale).

Parameters
vectorLeft operand.
scaleRight operand.
Returns
Result of the operation.

Definition at line 555 of file Vector3.cs.

◆ Normalize() [1/3]

void SharpNav.Geometry.Vector3.Normalize ( )

Scales the Vector3 to unit length.

Definition at line 279 of file Vector3.cs.

◆ Normalize() [2/3]

static void SharpNav.Geometry.Vector3.Normalize ( ref Vector3  vec,
out Vector3  result 
)
static

Scale a vector to unit length

Parameters
vecThe input vector
resultThe normalized vector

Definition at line 770 of file Vector3.cs.

◆ Normalize() [3/3]

static Vector3 SharpNav.Geometry.Vector3.Normalize ( Vector3  vec)
static

Scale a vector to unit length

Parameters
vecThe input vector
Returns
The normalized vector

Definition at line 756 of file Vector3.cs.

◆ Normalized()

Vector3 SharpNav.Geometry.Vector3.Normalized ( )

Returns a copy of the Vector3 scaled to unit length.

Definition at line 267 of file Vector3.cs.

◆ operator!=()

static bool SharpNav.Geometry.Vector3.operator!= ( Vector3  left,
Vector3  right 
)
static

Compares two instances for inequality.

Parameters
leftThe first instance.
rightThe second instance.
Returns
True, if left does not equa lright; false otherwise.

Definition at line 1090 of file Vector3.cs.

◆ operator*() [1/3]

static Vector3 SharpNav.Geometry.Vector3.operator* ( float  scale,
Vector3  vec 
)
static

Multiplies an instance by a scalar.

Parameters
scaleThe scalar.
vecThe instance.
Returns
The result of the calculation.

Definition at line 1036 of file Vector3.cs.

◆ operator*() [2/3]

static Vector3 SharpNav.Geometry.Vector3.operator* ( Vector3  vec,
float  scale 
)
static

Multiplies an instance by a scalar.

Parameters
vecThe instance.
scaleThe scalar.
Returns
The result of the calculation.

Definition at line 1022 of file Vector3.cs.

◆ operator*() [3/3]

static Vector3 SharpNav.Geometry.Vector3.operator* ( Vector3  vec,
Vector3  scale 
)
static

Component-wise multiplication between the specified instance by a scale vector.

Parameters
scaleLeft operand.
vecRight operand.
Returns
Result of multiplication.

Definition at line 1050 of file Vector3.cs.

◆ operator+()

static Vector3 SharpNav.Geometry.Vector3.operator+ ( Vector3  left,
Vector3  right 
)
static

Adds two instances.

Parameters
leftThe first instance.
rightThe second instance.
Returns
The result of the calculation.

Definition at line 981 of file Vector3.cs.

◆ operator-() [1/2]

static Vector3 SharpNav.Geometry.Vector3.operator- ( Vector3  left,
Vector3  right 
)
static

Subtracts two instances.

Parameters
leftThe first instance.
rightThe second instance.
Returns
The result of the calculation.

Definition at line 995 of file Vector3.cs.

◆ operator-() [2/2]

static Vector3 SharpNav.Geometry.Vector3.operator- ( Vector3  vec)
static

Negates an instance.

Parameters
vecThe instance.
Returns
The result of the calculation.

Definition at line 1008 of file Vector3.cs.

◆ operator/()

static Vector3 SharpNav.Geometry.Vector3.operator/ ( Vector3  vec,
float  scale 
)
static

Divides an instance by a scalar.

Parameters
vecThe instance.
scaleThe scalar.
Returns
The result of the calculation.

Definition at line 1064 of file Vector3.cs.

◆ operator==()

static bool SharpNav.Geometry.Vector3.operator== ( Vector3  left,
Vector3  right 
)
static

Compares two instances for equality.

Parameters
leftThe first instance.
rightThe second instance.
Returns
True, if left equals right; false otherwise.

Definition at line 1079 of file Vector3.cs.

◆ Scale() [1/3]

void SharpNav.Geometry.Vector3.Scale ( float  sx,
float  sy,
float  sz 
)

Scales the current Vector3 by the given amounts.

Parameters
sxThe scale of the X component.
syThe scale of the Y component.
szThe scale of the Z component.

Definition at line 298 of file Vector3.cs.

◆ Scale() [2/3]

void SharpNav.Geometry.Vector3.Scale ( ref Vector3  scale)

Scales this instance by the given parameter.

Parameters
scaleThe scaling of the individual components.

Definition at line 318 of file Vector3.cs.

◆ Scale() [3/3]

void SharpNav.Geometry.Vector3.Scale ( Vector3  scale)

Scales this instance by the given parameter.

Parameters
scaleThe scaling of the individual components.

Definition at line 308 of file Vector3.cs.

◆ Set()

void SharpNav.Geometry.Vector3.Set ( float  x,
float  y,
float  z 
)

Sets the Vector3 values.

Parameters
xThe x component of the Vector3.
yThe y component of the Vector3.
zThe z component of the Vector3.

Definition at line 109 of file Vector3.cs.

◆ Sub() [1/4]

static void SharpNav.Geometry.Vector3.Sub ( ref Vector3  a,
ref Vector3  b,
out Vector3  result 
)
static

Subtract one Vector from another

Parameters
aFirst operand
bSecond operand
resultResult of subtraction

Definition at line 391 of file Vector3.cs.

◆ Sub() [2/4]

void SharpNav.Geometry.Vector3.Sub ( ref Vector3  right)

Subtract the Vector passed as parameter from this instance.

Parameters
rightRight operand. This parameter is only read from.

Definition at line 196 of file Vector3.cs.

◆ Sub() [3/4]

static Vector3 SharpNav.Geometry.Vector3.Sub ( Vector3  a,
Vector3  b 
)
static

Defines the size of the Vector3 struct in bytes.

Subtract one Vector from another

Parameters
aFirst operand
bSecond operand
Returns
Result of subtraction

Definition at line 376 of file Vector3.cs.

◆ Sub() [4/4]

void SharpNav.Geometry.Vector3.Sub ( Vector3  right)

Subtract the Vector passed as parameter from this instance.

Parameters
rightRight operand. This parameter is only read from.

Definition at line 186 of file Vector3.cs.

◆ Subtract() [1/2]

static void SharpNav.Geometry.Vector3.Subtract ( ref Vector3  a,
ref Vector3  b,
out Vector3  result 
)
static

Subtract one Vector from another

Parameters
aFirst operand
bSecond operand
resultResult of subtraction

Definition at line 517 of file Vector3.cs.

◆ Subtract() [2/2]

static Vector3 SharpNav.Geometry.Vector3.Subtract ( Vector3  a,
Vector3  b 
)
static

Subtract one Vector from another

Parameters
aFirst operand
bSecond operand
Returns
Result of subtraction

Definition at line 505 of file Vector3.cs.

◆ ToString()

override string SharpNav.Geometry.Vector3.ToString ( )

Returns a System.String that represents the current Vector3.

Returns

Definition at line 1106 of file Vector3.cs.

Member Data Documentation

◆ One

readonly Vector3 SharpNav.Geometry.Vector3.One = new Vector3(1, 1, 1)
static

Defines an instance with all components set to 1.

Definition at line 356 of file Vector3.cs.

◆ UnitX

readonly Vector3 SharpNav.Geometry.Vector3.UnitX = new Vector3(1, 0, 0)
static

Defines a unit-length Vector3 that points towards the X-axis.

Definition at line 336 of file Vector3.cs.

◆ UnitY

readonly Vector3 SharpNav.Geometry.Vector3.UnitY = new Vector3(0, 1, 0)
static

Defines a unit-length Vector3 that points towards the Y-axis.

Definition at line 341 of file Vector3.cs.

◆ UnitZ

readonly Vector3 SharpNav.Geometry.Vector3.UnitZ = new Vector3(0, 0, 1)
static

/// Defines a unit-length Vector3 that points towards the Z-axis.

Definition at line 346 of file Vector3.cs.

◆ X

float SharpNav.Geometry.Vector3.X

The X component of the Vector3.

Definition at line 48 of file Vector3.cs.

◆ Y

float SharpNav.Geometry.Vector3.Y

The Y component of the Vector3.

Definition at line 53 of file Vector3.cs.

◆ Z

float SharpNav.Geometry.Vector3.Z

The Z component of the Vector3.

Definition at line 58 of file Vector3.cs.

◆ Zero

readonly Vector3 SharpNav.Geometry.Vector3.Zero = new Vector3(0, 0, 0)
static

Defines a zero-length Vector3.

Definition at line 351 of file Vector3.cs.

Property Documentation

◆ this[int index]

float SharpNav.Geometry.Vector3.this[int index]
getset

Gets or sets the value at the index of the Vector.

Definition at line 119 of file Vector3.cs.

◆ Xzy

Vector3 SharpNav.Geometry.Vector3.Xzy
getset

Gets or sets an OpenTK.Vector3 with the X, Z, and Y components of this instance.

Definition at line 947 of file Vector3.cs.

◆ Yxz

Vector3 SharpNav.Geometry.Vector3.Yxz
getset

Gets or sets an OpenTK.Vector3 with the Y, X, and Z components of this instance.

Definition at line 952 of file Vector3.cs.

◆ Yzx

Vector3 SharpNav.Geometry.Vector3.Yzx
getset

Gets or sets an OpenTK.Vector3 with the Y, Z, and X components of this instance.

Definition at line 957 of file Vector3.cs.

◆ Zxy

Vector3 SharpNav.Geometry.Vector3.Zxy
getset

Gets or sets an OpenTK.Vector3 with the Z, X, and Y components of this instance.

Definition at line 962 of file Vector3.cs.

◆ Zyx

Vector3 SharpNav.Geometry.Vector3.Zyx
getset

Gets or sets an OpenTK.Vector3 with the Z, Y, and X components of this instance.

Definition at line 967 of file Vector3.cs.


The documentation for this struct was generated from the following file: