Click or drag to resize

VectorExtensions Class

Contains useful extension methods for vectors.
Inheritance Hierarchy
SystemObject
  Gamelogic.ExtensionsVectorExtensions

Namespace:  Gamelogic.Extensions
Assembly:  Assembly-CSharp (in Assembly-CSharp.dll) Version: 0.0.0.0
Syntax
C#
[VersionAttribute(1, 0, 0)]
public static class VectorExtensions

The VectorExtensions type exposes the following members.

Methods
  NameDescription
Public methodStatic memberDot(Vector2, Vector2)
Equivalent to Vector2.Dot(v1, v2).
Public methodStatic memberDot(Vector3, Vector3)
Equivalent to Vector3.Dot(v1, v2).
Public methodStatic memberDot(Vector4, Vector4)
Equivalent to Vector4.Dot(v1, v2).
Public methodStatic memberHadamardDiv(Vector2, Vector2)
Divides one vector component by component by another.
Public methodStatic memberHadamardDiv(Vector3, Vector3)
Divides one vector component by component by another.
Public methodStatic memberHadamardDiv(Vector4, Vector4)
Divides one vector component by component by another.
Public methodStatic memberHadamardMod(Vector2, Vector2)
Multiplies component by component.
Public methodStatic memberHadamardMod(Vector3, Vector3)
Multiplies component by component.
Public methodStatic memberHadamardMod(Vector4, Vector4)
Multiplies component by component.
Public methodStatic memberHadamardMul(Vector2, Vector2)
Multiplies one vector componentwise by another.
Public methodStatic memberHadamardMul(Vector3, Vector3)
Multiplies one vector component by component by another.
Public methodStatic memberHadamardMul(Vector4, Vector4)
Multiplies one vector component by component by another.
Public methodStatic memberPerp
Returns the vector rotated 90 degrees counter-clockwise.
Public methodStatic memberPerpDot
Equivalent to Vector2.Dot(v1.Perp(), v2).
Public methodStatic memberPerpXY
Turns the vector 90 degrees anticlockwise as viewed from the front (keeping the z coordinate intact). Equivalent to
v.To2DXY().Perp().To3DXY(v.z);
Public methodStatic memberPerpXZ
Turns the vector 90 degrees anticlockwise as viewed from the top (keeping the y coordinate intact). Equivalent to
v.To2DXZ().Perp().To3DXZ(v.y);
Public methodStatic memberProj(Vector2, Vector2)
Returns the projection of this vector onto the given base.
Public methodStatic memberProj(Vector3, Vector3)
Returns the projection of this vector onto the given base.
Public methodStatic memberProj(Vector4, Vector4)
Returns the projection of this vector onto the given base.
Public methodStatic memberReflectAboutX
Reflects the vector about x-axis.
Public methodStatic memberReflectAboutY
Reflects the vector about y-axis.
Public methodStatic memberRej(Vector2, Vector2)
Returns the rejection of this vector onto the given base.
Public methodStatic memberRej(Vector3, Vector3)
Returns the rejection of this vector onto the given base.
Public methodStatic memberRej(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.
Public methodStatic memberRotate
Rotates a vector by a given angle.
Public methodStatic memberRotate180
Rotates a vector by a 180 degrees.
Public methodStatic memberRotate270
Rotates a vector by a 270 degrees.
Public methodStatic memberRotate90
Rotates a vector by a 90 degrees.
Public methodStatic memberRotateAround
Rotates a vector by a given angle around a given point.
Public methodStatic memberTo2DXY
Converts a 3D vector to a 2D vector taking the x and y coordinates.
Public methodStatic memberTo2DXZ
Converts a 3D vector to a 2D vector taking the x and z coordinates.
Public methodStatic memberTo2DYZ
Converts a 3D vector to a 2D vector taking the y and z coordinates.
Public methodStatic memberTo3DXY(Vector2)
Converts a 2D vector to a 3D vector using the vector for the x and y coordinates, and 0 for the z coordinate.
Public methodStatic memberTo3DXY(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.
Public methodStatic memberTo3DXZ(Vector2)
Converts a 2D vector to a 3D vector using the vector for the x and z coordinates, and 0 for the y coordinate.
Public methodStatic memberTo3DXZ(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.
Public methodStatic memberTo3DYZ(Vector2)
Converts a 2D vector to a 3D vector using the vector for the y and z coordinates, and 0 for the x coordinate.
Public methodStatic memberTo3DYZ(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.
Public methodStatic memberWithIncX(Vector2, Single)
Returns a copy of the vector with the x-coordinate incremented with the given value.
Public methodStatic memberWithIncX(Vector3, Single)
Returns a copy of the vector with the x-coordinate incremented with the given value.
Public methodStatic memberWithIncY(Vector2, Single)
Returns a copy of the vector with the y-coordinate incremented with the given value.
Public methodStatic memberWithIncY(Vector3, Single)
Returns a copy of the vector with the y-coordinate incremented with the given value.
Public methodStatic memberWithIncZ
Returns a copy of the vector with the z-coordinate incremented with the given value.
Public methodStatic memberWithX(Vector2, Single)
Returns a copy of this vector with the given x-coordinate.
Public methodStatic memberWithX(Vector3, Single)
Returns a copy of this vector with the given x-coordinate.
Public methodStatic memberWithY(Vector2, Single)
Returns a copy of this vector with the given y-coordinate.
Public methodStatic memberWithY(Vector3, Single)
Returns a copy of this vector with the given y-coordinate.
Public methodStatic memberWithZ
Returns a copy of this vector with the given z-coordinate.
Public methodStatic memberXZY
Creates a new vector by permuting the given vector's coordinates in the order XZY.
Public methodStatic memberYX
Swaps the x and y coordinates of the vector.
Public methodStatic memberYXZ
Creates a new vector by permuting the given vector's coordinates in the order YXZ.
Public methodStatic memberYZX
Creates a new vector by permuting the given vector's coordinates in the order YZX.
Public methodStatic memberZXY
Creates a new vector by permuting the given vector's coordinates in the order ZXY.
Public methodStatic memberZYX
Creates a new vector by permuting the given vector's coordinates in the order ZYX.
Top
See Also