Dungeon Architect
17.0.0
|
Represents a 3D vector using three single-precision floating-point numbers. More...
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... | |
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.
SharpNav.Geometry.Vector3.Vector3 | ( | float | value | ) |
Constructs a new instance.
value | The value that will initialize this instance. |
Definition at line 68 of file Vector3.cs.
SharpNav.Geometry.Vector3.Vector3 | ( | float | x, |
float | y, | ||
float | z | ||
) |
SharpNav.Geometry.Vector3.Vector3 | ( | Vector3 | v | ) |
Constructs a new Vector3 from the given Vector3.
v | The Vector3 to copy components from. |
Definition at line 92 of file Vector3.cs.
|
static |
Adds two vectors.
a | Left operand. |
b | Right operand. |
result | Result of operation. |
Definition at line 490 of file Vector3.cs.
void SharpNav.Geometry.Vector3.Add | ( | ref Vector3 | right | ) |
Add the Vector passed as parameter to this instance.
right | Right operand. This parameter is only read from. |
Definition at line 172 of file Vector3.cs.
Adds two vectors.
a | Left operand. |
b | Right operand. |
Definition at line 478 of file Vector3.cs.
void SharpNav.Geometry.Vector3.Add | ( | Vector3 | right | ) |
Add the Vector passed as parameter to this instance.
right | Right operand. This parameter is only read from. |
Definition at line 162 of file Vector3.cs.
|
static |
Interpolate 3 Vectors using Barycentric coordinates
a | First input Vector. |
b | Second input Vector. |
c | Third input Vector. |
u | First Barycentric Coordinate. |
v | Second Barycentric Coordinate. |
result | Output 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.
|
static |
Interpolate 3 Vectors using Barycentric coordinates
a | First input Vector |
b | Second input Vector |
c | Third input Vector |
u | First Barycentric Coordinate |
v | Second Barycentric Coordinate |
Definition at line 881 of file Vector3.cs.
|
static |
Calculates the angle (in radians) between two vectors.
first | The first vector. |
second | The second vector. |
result | Angle (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.
Calculates the angle (in radians) between two vectors.
first | The first vector. |
second | The second vector. |
Note that the returned angle is never bigger than the constant Pi.
Definition at line 919 of file Vector3.cs.
|
static |
Clamp a vector to the given minimum and maximum vectors
vec | Input vector |
min | Minimum vector |
max | Maximum vector |
result | The clamped vector |
Definition at line 740 of file Vector3.cs.
Clamp a vector to the given minimum and maximum vectors
vec | Input vector |
min | Minimum vector |
max | Maximum vector |
Definition at line 725 of file Vector3.cs.
|
static |
Calculate the component-wise maximum of two vectors
a | First operand |
b | Second operand |
result | The component-wise maximum |
Definition at line 677 of file Vector3.cs.
Calculate the component-wise maximum of two vectors
a | First operand |
b | Second operand |
Definition at line 663 of file Vector3.cs.
|
static |
Calculate the component-wise minimum of two vectors
a | First operand |
b | Second operand |
result | The component-wise minimum |
Definition at line 646 of file Vector3.cs.
Calculate the component-wise minimum of two vectors
a | First operand |
b | Second operand |
Definition at line 632 of file Vector3.cs.
|
static |
Caclulate the cross (vector) product of two vectors
left | First operand |
right | Second operand |
result | The cross product of the two inputs |
Definition at line 828 of file Vector3.cs.
Caclulate the cross (vector) product of two vectors
left | First operand |
right | Second operand |
Definition at line 814 of file Vector3.cs.
void SharpNav.Geometry.Vector3.Div | ( | float | f | ) |
Divide this instance by a scalar.
f | Scalar operand. |
Definition at line 224 of file Vector3.cs.
Divide a vector by a scalar
a | Vector operand |
f | Scalar operand |
result | Result of the division |
Definition at line 458 of file Vector3.cs.
Divide a vector by a scalar
a | Vector operand |
f | Scalar operand |
Definition at line 442 of file Vector3.cs.
|
static |
Divides a vector by a scalar.
vector | Left operand. |
scale | Right operand. |
result | Result of the operation. |
Definition at line 594 of file Vector3.cs.
|
static |
Divide a vector by the components of a vector (scale).
vector | Left operand. |
scale | Right operand. |
result | Result of the operation. |
Definition at line 617 of file Vector3.cs.
Divides a vector by a scalar.
vector | Left operand. |
scale | Right operand. |
Definition at line 582 of file Vector3.cs.
Divides a vector by the components of a vector (scale).
vector | Left operand. |
scale | Right operand. |
Definition at line 605 of file Vector3.cs.
|
static |
Calculate the dot (scalar) product of two vectors
left | First operand |
right | Second operand |
result | The dot product of the two inputs |
Definition at line 799 of file Vector3.cs.
Calculate the dot (scalar) product of two vectors
left | First operand |
right | Second operand |
Definition at line 788 of file Vector3.cs.
override bool SharpNav.Geometry.Vector3.Equals | ( | object | obj | ) |
Indicates whether this instance and a specified object are equal.
obj | The object to compare to. |
Definition at line 1133 of file Vector3.cs.
bool SharpNav.Geometry.Vector3.Equals | ( | Vector3 | other | ) |
Indicates whether the current vector is equal to another vector.
other | A vector to compare with this vector. |
Definition at line 1152 of file Vector3.cs.
override int SharpNav.Geometry.Vector3.GetHashCode | ( | ) |
Returns the hashcode for this instance.
Definition at line 1119 of file Vector3.cs.
float SharpNav.Geometry.Vector3.Length | ( | ) |
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.
Definition at line 257 of file Vector3.cs.
|
static |
Returns a new Vector that is the linear blend of the 2 given Vectors
a | First input vector |
b | Second input vector |
blend | The blend factor. a when blend=0, b when blend=1. |
result | a when blend=0, b when blend=1, and a linear combination otherwise |
Definition at line 861 of file Vector3.cs.
Returns a new Vector that is the linear blend of the 2 given Vectors
a | First input vector |
b | Second input vector |
blend | The blend factor. a when blend=0, b when blend=1. |
Definition at line 846 of file Vector3.cs.
Returns the Vector3 with the minimum magnitude
left | Left operand |
right | Right operand |
Definition at line 709 of file Vector3.cs.
Returns the Vector3 with the minimum magnitude
left | Left operand |
right | Right operand |
Definition at line 694 of file Vector3.cs.
void SharpNav.Geometry.Vector3.Mult | ( | float | f | ) |
Multiply this instance by a scalar.
f | Scalar operand. |
Definition at line 210 of file Vector3.cs.
Multiply a vector and a scalar
a | Vector operand |
f | Scalar operand |
result | Result of the multiplication |
Definition at line 424 of file Vector3.cs.
Multiply a vector and a scalar
a | Vector operand |
f | Scalar operand |
Definition at line 409 of file Vector3.cs.
|
static |
Multiplies a vector by a scalar.
vector | Left operand. |
scale | Right operand. |
result | Result of the operation. |
Definition at line 544 of file Vector3.cs.
|
static |
Multiplies a vector by the components of a vector (scale).
vector | Left operand. |
scale | Right operand. |
result | Result of the operation. |
Definition at line 567 of file Vector3.cs.
Multiplies a vector by a scalar.
vector | Left operand. |
scale | Right operand. |
Definition at line 532 of file Vector3.cs.
Multiplies a vector by the components a vector (scale).
vector | Left operand. |
scale | Right operand. |
Definition at line 555 of file Vector3.cs.
void SharpNav.Geometry.Vector3.Normalize | ( | ) |
Scales the Vector3 to unit length.
Definition at line 279 of file Vector3.cs.
Scale a vector to unit length
vec | The input vector |
result | The normalized vector |
Definition at line 770 of file Vector3.cs.
Scale a vector to unit length
vec | The input vector |
Definition at line 756 of file Vector3.cs.
Vector3 SharpNav.Geometry.Vector3.Normalized | ( | ) |
Returns a copy of the Vector3 scaled to unit length.
Definition at line 267 of file Vector3.cs.
Compares two instances for inequality.
left | The first instance. |
right | The second instance. |
Definition at line 1090 of file Vector3.cs.
Multiplies an instance by a scalar.
scale | The scalar. |
vec | The instance. |
Definition at line 1036 of file Vector3.cs.
Multiplies an instance by a scalar.
vec | The instance. |
scale | The scalar. |
Definition at line 1022 of file Vector3.cs.
Component-wise multiplication between the specified instance by a scale vector.
scale | Left operand. |
vec | Right operand. |
Definition at line 1050 of file Vector3.cs.
Adds two instances.
left | The first instance. |
right | The second instance. |
Definition at line 981 of file Vector3.cs.
Subtracts two instances.
left | The first instance. |
right | The second instance. |
Definition at line 995 of file Vector3.cs.
Negates an instance.
vec | The instance. |
Definition at line 1008 of file Vector3.cs.
Divides an instance by a scalar.
vec | The instance. |
scale | The scalar. |
Definition at line 1064 of file Vector3.cs.
Compares two instances for equality.
left | The first instance. |
right | The second instance. |
Definition at line 1079 of file Vector3.cs.
void SharpNav.Geometry.Vector3.Scale | ( | float | sx, |
float | sy, | ||
float | sz | ||
) |
Scales the current Vector3 by the given amounts.
sx | The scale of the X component. |
sy | The scale of the Y component. |
sz | The scale of the Z component. |
Definition at line 298 of file Vector3.cs.
void SharpNav.Geometry.Vector3.Scale | ( | ref Vector3 | scale | ) |
Scales this instance by the given parameter.
scale | The scaling of the individual components. |
Definition at line 318 of file Vector3.cs.
void SharpNav.Geometry.Vector3.Scale | ( | Vector3 | scale | ) |
Scales this instance by the given parameter.
scale | The scaling of the individual components. |
Definition at line 308 of file Vector3.cs.
void SharpNav.Geometry.Vector3.Set | ( | float | x, |
float | y, | ||
float | z | ||
) |
|
static |
Subtract one Vector from another
a | First operand |
b | Second operand |
result | Result of subtraction |
Definition at line 391 of file Vector3.cs.
void SharpNav.Geometry.Vector3.Sub | ( | ref Vector3 | right | ) |
Subtract the Vector passed as parameter from this instance.
right | Right operand. This parameter is only read from. |
Definition at line 196 of file Vector3.cs.
Defines the size of the Vector3 struct in bytes.
Subtract one Vector from another
a | First operand |
b | Second operand |
Definition at line 376 of file Vector3.cs.
void SharpNav.Geometry.Vector3.Sub | ( | Vector3 | right | ) |
Subtract the Vector passed as parameter from this instance.
right | Right operand. This parameter is only read from. |
Definition at line 186 of file Vector3.cs.
|
static |
Subtract one Vector from another
a | First operand |
b | Second operand |
result | Result of subtraction |
Definition at line 517 of file Vector3.cs.
Subtract one Vector from another
a | First operand |
b | Second operand |
Definition at line 505 of file Vector3.cs.
override string SharpNav.Geometry.Vector3.ToString | ( | ) |
Returns a System.String that represents the current Vector3.
Definition at line 1106 of file Vector3.cs.
Defines an instance with all components set to 1.
Definition at line 356 of file Vector3.cs.
Defines a unit-length Vector3 that points towards the X-axis.
Definition at line 336 of file Vector3.cs.
Defines a unit-length Vector3 that points towards the Y-axis.
Definition at line 341 of file Vector3.cs.
/// Defines a unit-length Vector3 that points towards the Z-axis.
Definition at line 346 of file Vector3.cs.
float SharpNav.Geometry.Vector3.X |
The X component of the Vector3.
Definition at line 48 of file Vector3.cs.
float SharpNav.Geometry.Vector3.Y |
The Y component of the Vector3.
Definition at line 53 of file Vector3.cs.
float SharpNav.Geometry.Vector3.Z |
The Z component of the Vector3.
Definition at line 58 of file Vector3.cs.
Defines a zero-length Vector3.
Definition at line 351 of file Vector3.cs.
|
getset |
Gets or sets the value at the index of the Vector.
Definition at line 119 of file Vector3.cs.
|
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.
|
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.
|
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.
|
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.
|
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.