3rd Eye Scene C#
3rd Eye Scene C# documentation
|
A basic vector3 implementation. More...
Public Member Functions | |
Vector3 (float scalar) | |
Construct a new vector with all components set to scalar . | |
Vector3 (float x, float y, float z) | |
Construct a vector with the given component values. | |
void | Negate () |
Negate each component of this vector. | |
float | Normalise (float epsilon=Epsilon) |
Normalise this vector. | |
float | Dot (Vector3 other) |
Calculate the dot product of this vector and another. | |
Vector3 | Cross (Vector3 other) |
Calculate the cross product of this vector and another. | |
override bool | Equals (object obj) |
Compare two vectors for precise numeric equality. | |
override int | GetHashCode () |
Generates a simple hash code for this vector. | |
Static Public Member Functions | |
static Vector3 | Scalar (float scalar) |
Creates a vector with all components set to scalar . | |
static bool | operator== (Vector3 a, Vector3 b) |
Compare two quaternions for precise numeric equality. | |
static bool | operator!= (Vector3 a, Vector3 b) |
Compare two quaternions for inequality using precise numeric equality. | |
static Vector3 | operator+ (Vector3 a, Vector3 b) |
Sum two vectors and return the result. | |
static Vector3 | operator- (Vector3 a, Vector3 b) |
Subtract one vectors from another and return the result. | |
static Vector3 | operator* (Vector3 v, float s) |
Scale a vector by a scalar value. | |
static Vector3 | operator* (float s, Vector3 v) |
Scale a vector by a scalar value. | |
static Vector3 | operator/ (Vector3 v, float s) |
Divide a vector by a scalar value. | |
Public Attributes | |
const float | Epsilon = 1e-6f |
Default epsilon value used in various calculations. | |
Static Public Attributes | |
static Vector3 | Zero = new Vector3 { X = 0, Y = 0, Z = 0 } |
A zero vector (0, 0, 0). | |
static Vector3 | One = new Vector3 { X = 1, Y = 1, Z = 1 } |
A vector with all components one (1, 1, 1). | |
static Vector3 | AxisX = new Vector3 { X = 1, Y = 0, Z = 0 } |
A vector representing the X axis: (1, 0, 0). | |
static Vector3 | AxisY = new Vector3 { X = 0, Y = 1, Z = 0 } |
A vector representing the Y axis: (0, 1, 0). | |
static Vector3 | AxisZ = new Vector3 { X = 0, Y = 0, Z = 1 } |
A vector representing the Z axis: (0, 0, 1). | |
Properties | |
float | X [get, set] |
The vector X component. | |
float | Y [get, set] |
The vector Y component. | |
float | Z [get, set] |
The vector Z component. | |
float | MagnitudeSquared [get] |
Return the squared magnitude of this vector: X * X + Y * Y + Z * Z | |
float | Magnitude [get] |
Calculate the magnitude of this vector. | |
float | this[int index] [get, set] |
Indexing accessor. | |
bool | IsZero [get] |
Test if this vector is exactly zero in all components. | |
Vector3 | Negated [get] |
Return the negation of this vector. | |
Vector3 | Normalised [get] |
Calculate and return a normalised copy of this vector. |
A basic vector3 implementation.
Tes::Maths::Vector3::Vector3 | ( | float | scalar | ) | [inline] |
Construct a new vector with all components set to scalar .
scalar | The value to assign to each component. |
Tes::Maths::Vector3::Vector3 | ( | float | x, |
float | y, | ||
float | z | ||
) | [inline] |
Construct a vector with the given component values.
x | The X coordinate. |
y | The Y coordinate. |
z | The Z coordinate. |
Calculate the cross product of this vector and another.
other | The other vector. |
this
and other .float Tes::Maths::Vector3::Dot | ( | Vector3 | other | ) | [inline] |
Calculate the dot product of this vector and another.
other | The other vector. |
this
and other .override bool Tes::Maths::Vector3::Equals | ( | object | obj | ) | [inline] |
Compare two vectors for precise numeric equality.
obj | The vector to compare to. |
InvalidCastException | When obj is not a Vector3. |
override int Tes::Maths::Vector3::GetHashCode | ( | ) | [inline] |
Generates a simple hash code for this vector.
void Tes::Maths::Vector3::Negate | ( | ) | [inline] |
Negate each component of this vector.
The vector is not normalised when the magnitude is less than or equal to Epsilon.
float Tes::Maths::Vector3::Normalise | ( | float | epsilon = Epsilon | ) | [inline] |
Normalise this vector.
The vector is left as is if its magnitude is less than or equal to epsilon .
epsilon | Prevents normalisation of small vectors with magnitudes less than or equal to this value. |
Compare two quaternions for inequality using precise numeric equality.
a | A quaternion to compare. |
b | A quaternion to compare. |
Scale a vector by a scalar value.
v | The vector value. |
s | The scalar value. |
Scale a vector by a scalar value.
s | The scalar value. |
v | The vector value. |
Sum two vectors and return the result.
a | An operand. |
b | An operand. |
Subtract one vectors from another and return the result.
a | An operand. |
b | An operand. |
Divide a vector by a scalar value.
v | The vector value. |
s | The scalar value. |
Compare two quaternions for precise numeric equality.
a | A quaternion to compare. |
b | A quaternion to compare. |
static Vector3 Tes::Maths::Vector3::Scalar | ( | float | scalar | ) | [inline, static] |
Creates a vector with all components set to scalar .
scalar | The value for all components. |
float Tes::Maths::Vector3::MagnitudeSquared [get] |
Return the squared magnitude of this vector: X * X + Y * Y + Z * Z
Vector3 Tes::Maths::Vector3::Negated [get] |
Return the negation of this vector.
The sign of each component is flipped.
float Tes::Maths::Vector3::this[int index] [get, set] |
Indexing accessor.
Indexes X, Y, Z, W across the range [0, 2].
index | The component index [0, 2]. |
IndexOutOfRangeException | Thrown when index is out of range. |