VectorExtensions Class |
Namespace: Gamelogic.Extensions
[VersionAttribute(1, 0, 0)] public static class VectorExtensions
The VectorExtensions type exposes the following members.
| Name | Description | |
|---|---|---|
| Dot(Vector2, Vector2) |
Equivalent to Vector2.Dot(v1, v2).
| |
| Dot(Vector3, Vector3) |
Equivalent to Vector3.Dot(v1, v2).
| |
| Dot(Vector4, Vector4) |
Equivalent to Vector4.Dot(v1, v2).
| |
| HadamardDiv(Vector2, Vector2) |
Divides one vector component by component by another.
| |
| HadamardDiv(Vector3, Vector3) |
Divides one vector component by component by another.
| |
| HadamardDiv(Vector4, Vector4) |
Divides one vector component by component by another.
| |
| HadamardMod(Vector2, Vector2) |
Multiplies component by component.
| |
| HadamardMod(Vector3, Vector3) |
Multiplies component by component.
| |
| HadamardMod(Vector4, Vector4) |
Multiplies component by component.
| |
| HadamardMul(Vector2, Vector2) |
Multiplies one vector componentwise by another.
| |
| HadamardMul(Vector3, Vector3) |
Multiplies one vector component by component by another.
| |
| HadamardMul(Vector4, Vector4) |
Multiplies one vector component by component by another.
| |
| Perp |
Returns the vector rotated 90 degrees counter-clockwise.
| |
| PerpDot |
Equivalent to Vector2.Dot(v1.Perp(), v2).
| |
| PerpXY |
Turns the vector 90 degrees anticlockwise as viewed from the front (keeping the z coordinate intact).
Equivalent to v.To2DXY().Perp().To3DXY(v.z); | |
| PerpXZ |
Turns the vector 90 degrees anticlockwise as viewed from the top (keeping the y coordinate intact).
Equivalent to v.To2DXZ().Perp().To3DXZ(v.y); | |
| Proj(Vector2, Vector2) |
Returns the projection of this vector onto the given base.
| |
| Proj(Vector3, Vector3) |
Returns the projection of this vector onto the given base.
| |
| Proj(Vector4, Vector4) |
Returns the projection of this vector onto the given base.
| |
| ReflectAboutX |
Reflects the vector about x-axis.
| |
| ReflectAboutY |
Reflects the vector about y-axis.
| |
| Rej(Vector2, Vector2) |
Returns the rejection of this vector onto the given base.
| |
| Rej(Vector3, Vector3) |
Returns the rejection of this vector onto the given base.
| |
| Rej(Vector4, Vector4) |
Returns the rejection of this vector onto the given base.
The sum of a vector's projection and rejection on a base is
equal to the original vector.
| |
| Rotate |
Rotates a vector by a given angle.
| |
| Rotate180 |
Rotates a vector by a 180 degrees.
| |
| Rotate270 |
Rotates a vector by a 270 degrees.
| |
| Rotate90 |
Rotates a vector by a 90 degrees.
| |
| RotateAround |
Rotates a vector by a given angle around a given point.
| |
| To2DXY |
Converts a 3D vector to a 2D vector taking the x and y coordinates.
| |
| To2DXZ |
Converts a 3D vector to a 2D vector taking the x and z coordinates.
| |
| To2DYZ |
Converts a 3D vector to a 2D vector taking the y and z coordinates.
| |
| To3DXY(Vector2) |
Converts a 2D vector to a 3D vector using the vector
for the x and y coordinates, and 0 for the z coordinate.
| |
| To3DXY(Vector2, Single) |
Converts a 2D vector to a 3D vector using the vector
for the x and y coordinates, and the given value for the z coordinate.
| |
| To3DXZ(Vector2) |
Converts a 2D vector to a 3D vector using the vector
for the x and z coordinates, and 0 for the y coordinate.
| |
| To3DXZ(Vector2, Single) |
Converts a 2D vector to a 3D vector using the vector
for the x and z coordinates, and the given value for the y coordinate.
| |
| To3DYZ(Vector2) |
Converts a 2D vector to a 3D vector using the vector
for the y and z coordinates, and 0 for the x coordinate.
| |
| To3DYZ(Vector2, Single) |
Converts a 2D vector to a 3D vector using the vector
for the y and z coordinates, and the given value for the x coordinate.
| |
| WithIncX(Vector2, Single) |
Returns a copy of the vector with the x-coordinate incremented
with the given value.
| |
| WithIncX(Vector3, Single) |
Returns a copy of the vector with the x-coordinate incremented
with the given value.
| |
| WithIncY(Vector2, Single) |
Returns a copy of the vector with the y-coordinate incremented
with the given value.
| |
| WithIncY(Vector3, Single) |
Returns a copy of the vector with the y-coordinate incremented
with the given value.
| |
| WithIncZ |
Returns a copy of the vector with the z-coordinate incremented
with the given value.
| |
| WithX(Vector2, Single) |
Returns a copy of this vector with the given x-coordinate.
| |
| WithX(Vector3, Single) |
Returns a copy of this vector with the given x-coordinate.
| |
| WithY(Vector2, Single) |
Returns a copy of this vector with the given y-coordinate.
| |
| WithY(Vector3, Single) |
Returns a copy of this vector with the given y-coordinate.
| |
| WithZ |
Returns a copy of this vector with the given z-coordinate.
| |
| XZY |
Creates a new vector by permuting the given vector's coordinates in the order XZY.
| |
| YX |
Swaps the x and y coordinates of the vector.
| |
| YXZ |
Creates a new vector by permuting the given vector's coordinates in the order YXZ.
| |
| YZX |
Creates a new vector by permuting the given vector's coordinates in the order YZX.
| |
| ZXY |
Creates a new vector by permuting the given vector's coordinates in the order ZXY.
| |
| ZYX |
Creates a new vector by permuting the given vector's coordinates in the order ZYX.
|