Public Member Functions | |
Vector3 (float x, float y, float z) | |
Creates a new 3 dimensional Vector. | |
float | Dot (Vector3 vector) |
Performs a Dot Product operation on 2 vectors, which produces the angle between them. | |
Vector3 | Cross (Vector3 vector) |
Performs a Cross Product operation on 2 vectors, which returns a vector that is perpendicular to the intersection of the 2 vectors. Useful for finding face normals. | |
Vector3 | Perpendicular () |
Finds a vector perpendicular to this one. | |
Vector3 | ToNormalized () |
Finds the midpoint between the supplied Vector and this vector. Compares the supplied vector and updates it's x/y/z components of they are higher in value.
Compares the supplied vector and updates it's x/y/z components of they are lower in value. | |
float | Normalize () |
Normalizes the vector. | |
Vector3 | Reflect (Vector3 normal) |
Calculates a reflection vector to the plane with the given normal. | |
override string | ToString () |
Overrides the Object.ToString() method to provide a text representation of a Vector3. | |
string | ToIntegerString () |
Overrides the Object.ToString() method to provide a text representation of a Vector3. | |
string | ToString (bool shortenDecmialPlaces) |
Overrides the Object.ToString() method to provide a text representation of a Vector3. | |
override int | GetHashCode () |
Provides a unique hash code based on the member variables of this class. This should be done because the equality operators (==, !=) have been overriden by this class.
The standard implementation is a simple XOR operation between all local member variables. | |
override bool | Equals (object obj) |
Compares this Vector to another object. This should be done because the equality operators (==, !=) have been overriden by this class. | |
Static Public Member Functions | |
static bool | operator== (Vector3 left, Vector3 right) |
User to compare two Vector3 instances for equality. | |
static bool | operator!= (Vector3 left, Vector3 right) |
User to compare two Vector3 instances for inequality. | |
static Vector3 | Multiply (Vector3 left, Vector3 right) |
Used when a Vector3 is multiplied by another vector. | |
static Vector3 | operator * (Vector3 left, Vector3 right) |
Used when a Vector3 is multiplied by another vector. | |
static Vector3 | Divide (Vector3 left, float scalar) |
Used to divide a vector by a scalar value. | |
static Vector3 | operator/ (Vector3 left, Vector3 right) |
Used when a Vector3 is divided by another vector. | |
static Vector3 | Divide (Vector3 left, Vector3 right) |
Used when a Vector3 is divided by another vector. | |
static Vector3 | operator/ (Vector3 left, float scalar) |
Used to divide a vector by a scalar value. | |
static Vector3 | Add (Vector3 left, Vector3 right) |
Used when a Vector3 is added to another Vector3. | |
static Vector3 | operator+ (Vector3 left, Vector3 right) |
Used when a Vector3 is added to another Vector3. | |
static Vector3 | Multiply (Vector3 left, float scalar) |
Used when a Vector3 is multiplied by a scalar value. | |
static Vector3 | operator * (Vector3 left, float scalar) |
Used when a Vector3 is multiplied by a scalar value. | |
static Vector3 | Multiply (float scalar, Vector3 right) |
Used when a scalar value is multiplied by a Vector3. | |
static Vector3 | operator * (float scalar, Vector3 right) |
Used when a scalar value is multiplied by a Vector3. | |
static Vector3 | Subtract (Vector3 left, Vector3 right) |
Used to subtract a Vector3 from another Vector3. | |
static Vector3 | operator- (Vector3 left, Vector3 right) |
Used to subtract a Vector3 from another Vector3. | |
static Vector3 | Negate (Vector3 left) |
Used to negate the elements of a vector. | |
static Vector3 | operator- (Vector3 left) |
Used to negate the elements of a vector. | |
static bool | operator> (Vector3 left, Vector3 right) |
Returns true if the vector's scalar components are all smaller that the ones of the vector it is compared against. | |
static bool | operator< (Vector3 left, Vector3 right) |
Returns true if the vector's scalar components are all greater that the ones of the vector it is compared against. | |
Public Attributes | |
float | x |
X component. | |
float | y |
Y component. | |
float | z |
Z component. | |
Properties | |
float | Length |
Gets the length (magnitude) of this Vector3. The Sqrt operation is expensive, so only use this if you need the exact length of the Vector. If vector lengths are only going to be compared, use LengthSquared instead. | |
float | LengthSquared |
Returns the length (magnitude) of the vector squared. | |
static Vector3 | Zero |
Gets a Vector3 with all components set to 0. | |
static Vector3 | UnitScale |
Gets a Vector3 with all components set to 1. | |
static Vector3 | UnitX |
Gets a Vector3 with the X set to 1, and the others set to 0. | |
static Vector3 | UnitY |
Gets a Vector3 with the Y set to 1, and the others set to 0. | |
static Vector3 | UnitZ |
Gets a Vector3 with the Z set to 1, and the others set to 0. | |
static Vector3 | NegativeUnitX |
Gets a Vector3 with the X set to -1, and the others set to 0. | |
static Vector3 | NegativeUnitY |
Gets a Vector3 with the Y set to -1, and the others set to 0. | |
static Vector3 | NegativeUnitZ |
Gets a Vector3 with the Z set to -1, and the others set to 0. |
A direction in 3D space represented as distances along the 3 orthoganal axes (x, y, z). Note that positions, directions and scaling factors can be represented by a vector, depending on how you interpret the values.
|
Used when a Vector3 is added to another Vector3.
|
|
Performs a Cross Product operation on 2 vectors, which returns a vector that is perpendicular to the intersection of the 2 vectors. Useful for finding face normals.
|
|
Used when a Vector3 is divided by another vector.
|
|
Used to divide a vector by a scalar value.
|
|
Performs a Dot Product operation on 2 vectors, which produces the angle between them.
|
|
Compares this Vector to another object. This should be done because the equality operators (==, !=) have been overriden by this class.
|
|
Provides a unique hash code based on the member variables of this class. This should be done because the equality operators (==, !=) have been overriden by this class. The standard implementation is a simple XOR operation between all local member variables.
|
|
Used when a scalar value is multiplied by a Vector3.
|
|
Used when a Vector3 is multiplied by a scalar value.
|
|
Used when a Vector3 is multiplied by another vector.
|
|
Used to negate the elements of a vector.
|
|
Normalizes the vector. This method normalises the vector such that it's length / magnitude is 1. The result is called a unit vector. This function will not crash for zero-sized vectors, but there will be no changes made to their components.
|
|
Used when a scalar value is multiplied by a Vector3.
|
|
Used when a Vector3 is multiplied by a scalar value.
|
|
Used when a Vector3 is multiplied by another vector.
|
|
User to compare two Vector3 instances for inequality.
|
|
Used when a Vector3 is added to another Vector3.
|
|
Used to negate the elements of a vector.
|
|
Used to subtract a Vector3 from another Vector3.
|
|
Used to divide a vector by a scalar value.
|
|
Used when a Vector3 is divided by another vector.
|
|
Returns true if the vector's scalar components are all greater that the ones of the vector it is compared against.
|
|
User to compare two Vector3 instances for equality.
|
|
Returns true if the vector's scalar components are all smaller that the ones of the vector it is compared against.
|
|
Finds a vector perpendicular to this one.
|
|
Calculates a reflection vector to the plane with the given normal. Assumes this vector is pointing AWAY from the plane, invert if not.
|
|
Used to subtract a Vector3 from another Vector3.
|
|
Overrides the Object.ToString() method to provide a text representation of a Vector3.
|
|
Finds the midpoint between the supplied Vector and this vector. Compares the supplied vector and updates it's x/y/z components of they are higher in value. Compares the supplied vector and updates it's x/y/z components of they are lower in value.
|
|
Overrides the Object.ToString() method to provide a text representation of a Vector3.
|
|
Overrides the Object.ToString() method to provide a text representation of a Vector3.
|