This repository was archived by the owner on Dec 13, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 123
VRageMath.Vector2
Malware edited this page Dec 21, 2018
·
52 revisions
← Index
Namespace: VRageMath
Assembly: VRage.Math.dll
Defines a vector with two components.
_float X_ |
Gets or sets the x-component of the vector. |
_float Y_ |
Gets or sets the y-component of the vector. |
static _Vector2 Zero_ |
|
static _Vector2 One_ |
|
static _Vector2 UnitX_ |
|
static _Vector2 UnitY_ |
|
static _Vector2 PositiveInfinity_ |
_float Item_ |
_string ToString()_ |
Retrieves a string representation of the current object. |
_bool Equals(Vector2 other)_ |
Determines whether the specified Object is equal to the Vector2. |
_bool Equals(Object obj)_ |
Returns a value that indicates whether the current instance is equal to a specified object. |
_int GetHashCode()_ |
Gets the hash code of the vector object. |
_bool IsValid()_ |
|
_void AssertIsValid()_ |
|
_float Length()_ |
Calculates the length of the vector. |
_float LengthSquared()_ |
Calculates the length of the vector squared. |
static _float Distance(Vector2 value1, Vector2 value2)_ |
Calculates the distance between two vectors. |
static _void Distance(ref Vector2 value1, ref Vector2 value2, ref float result)_ |
Calculates the distance between two vectors. |
static _float DistanceSquared(Vector2 value1, Vector2 value2)_ |
Calculates the distance between two vectors squared. |
static _void DistanceSquared(ref Vector2 value1, ref Vector2 value2, ref float result)_ |
Calculates the distance between two vectors squared. |
static _float Dot(Vector2 value1, Vector2 value2)_ |
Calculates the dot product of two vectors. If the two vectors are unit vectors, the dot product returns a floating point value between -1 and 1 that can be used to determine some properties of the angle between two vectors. For example, it can show whether the vectors are orthogonal, parallel, or have an acute or obtuse angle between them. |
static _void Dot(ref Vector2 value1, ref Vector2 value2, ref float result)_ |
Calculates the dot product of two vectors and writes the result to a user-specified variable. If the two vectors are unit vectors, the dot product returns a floating point value between -1 and 1 that can be used to determine some properties of the angle between two vectors. For example, it can show whether the vectors are orthogonal, parallel, or have an acute or obtuse angle between them. |
_void Normalize()_ |
Turns the current vector into a unit vector. The result is a vector one unit in length pointing in the same direction as the original vector. |
static _Vector2 Normalize(Vector2 value)_ |
Creates a unit vector from the specified vector. The result is a vector one unit in length pointing in the same direction as the original vector. |
static _void Normalize(ref Vector2 value, ref Vector2 result)_ |
Creates a unit vector from the specified vector, writing the result to a user-specified variable. The result is a vector one unit in length pointing in the same direction as the original vector. |
static _Vector2 Reflect(Vector2 vector, Vector2 normal)_ |
Determines the reflect vector of the given vector and normal. |
static _void Reflect(ref Vector2 vector, ref Vector2 normal, ref Vector2 result)_ |
Determines the reflect vector of the given vector and normal. |
static _Vector2 Min(Vector2 value1, Vector2 value2)_ |
Returns a vector that contains the lowest value from each matching pair of components. |
static _void Min(ref Vector2 value1, ref Vector2 value2, ref Vector2 result)_ |
Returns a vector that contains the lowest value from each matching pair of components. |
static _Vector2 Max(Vector2 value1, Vector2 value2)_ |
Returns a vector that contains the highest value from each matching pair of components. |
static _void Max(ref Vector2 value1, ref Vector2 value2, ref Vector2 result)_ |
Returns a vector that contains the highest value from each matching pair of components. |
static _Vector2 Clamp(Vector2 value1, Vector2 min, Vector2 max)_ |
Restricts a value to be within a specified range. |
static _void Clamp(ref Vector2 value1, ref Vector2 min, ref Vector2 max, ref Vector2 result)_ |
Restricts a value to be within a specified range. |
static _Vector2 ClampToSphere(Vector2 vector, float radius)_ |
|
static _void ClampToSphere(ref Vector2 vector, float radius)_ |
|
static _Vector2 Lerp(Vector2 value1, Vector2 value2, float amount)_ |
Performs a linear interpolation between two vectors. |
static _void Lerp(ref Vector2 value1, ref Vector2 value2, float amount, ref Vector2 result)_ |
Performs a linear interpolation between two vectors. |
static _Vector2 Barycentric(Vector2 value1, Vector2 value2, Vector2 value3, float amount1, float amount2)_ |
Returns a Vector2 containing the 2D Cartesian coordinates of a point specified in barycentric (areal) coordinates relative to a 2D triangle. |
static _void Barycentric(ref Vector2 value1, ref Vector2 value2, ref Vector2 value3, float amount1, float amount2, ref Vector2 result)_ |
Returns a Vector2 containing the 2D Cartesian coordinates of a point specified in barycentric (areal) coordinates relative to a 2D triangle. |
static _Vector2 SmoothStep(Vector2 value1, Vector2 value2, float amount)_ |
Interpolates between two values using a cubic equation. |
static _void SmoothStep(ref Vector2 value1, ref Vector2 value2, float amount, ref Vector2 result)_ |
Interpolates between two values using a cubic equation. |
static _Vector2 CatmullRom(Vector2 value1, Vector2 value2, Vector2 value3, Vector2 value4, float amount)_ |
Performs a Catmull-Rom interpolation using the specified positions. |
static _void CatmullRom(ref Vector2 value1, ref Vector2 value2, ref Vector2 value3, ref Vector2 value4, float amount, ref Vector2 result)_ |
Performs a Catmull-Rom interpolation using the specified positions. |
static _Vector2 Hermite(Vector2 value1, Vector2 tangent1, Vector2 value2, Vector2 tangent2, float amount)_ |
Performs a Hermite spline interpolation. |
static _void Hermite(ref Vector2 value1, ref Vector2 tangent1, ref Vector2 value2, ref Vector2 tangent2, float amount, ref Vector2 result)_ |
Performs a Hermite spline interpolation. |
static _Vector2 Transform(Vector2 position, Matrix matrix)_ |
Transforms the vector (x, y, 0, 1) by the specified matrix. |
static _void Transform(ref Vector2 position, ref Matrix matrix, ref Vector2 result)_ |
Transforms a Vector2 by the given Matrix. |
static _Vector2 TransformNormal(Vector2 normal, Matrix matrix)_ |
Transforms a 2D vector normal by a matrix. |
static _void TransformNormal(ref Vector2 normal, ref Matrix matrix, ref Vector2 result)_ |
Transforms a vector normal by a matrix. |
static _Vector2 Transform(Vector2 value, Quaternion rotation)_ |
Transforms a single Vector2, or the vector normal (x, y, 0, 0), by a specified Quaternion rotation. |
static _void Transform(ref Vector2 value, ref Quaternion rotation, ref Vector2 result)_ |
Transforms a Vector2, or the vector normal (x, y, 0, 0), by a specified Quaternion rotation. |
static _void Transform(Vector2[] sourceArray, ref Matrix matrix, Vector2[] destinationArray)_ |
Transforms an array of Vector2s by a specified Matrix. |
static _void Transform(Vector2[] sourceArray, int sourceIndex, ref Matrix matrix, Vector2[] destinationArray, int destinationIndex, int length)_ |
Transforms a specified range in an array of Vector2s by a specified Matrix and places the results in a specified range in a destination array. |
static _void TransformNormal(Vector2[] sourceArray, ref Matrix matrix, Vector2[] destinationArray)_ |
Transforms an array of Vector2 vector normals by a specified Matrix. |
static _void TransformNormal(Vector2[] sourceArray, int sourceIndex, ref Matrix matrix, Vector2[] destinationArray, int destinationIndex, int length)_ |
Transforms a specified range in an array of Vector2 vector normals by a specified Matrix and places the results in a specified range in a destination array. |
static _void Transform(Vector2[] sourceArray, ref Quaternion rotation, Vector2[] destinationArray)_ |
Transforms an array of Vector2s by a specified Quaternion. |
static _void Transform(Vector2[] sourceArray, int sourceIndex, ref Quaternion rotation, Vector2[] destinationArray, int destinationIndex, int length)_ |
Transforms a specified range in an array of Vector2s by a specified Quaternion and places the results in a specified range in a destination array. |
static _Vector2 Negate(Vector2 value)_ |
Returns a vector pointing in the opposite direction. |
static _void Negate(ref Vector2 value, ref Vector2 result)_ |
Returns a vector pointing in the opposite direction. |
static _Vector2 Add(Vector2 value1, Vector2 value2)_ |
Adds two vectors. |
static _void Add(ref Vector2 value1, ref Vector2 value2, ref Vector2 result)_ |
Adds two vectors. |
static _Vector2 Subtract(Vector2 value1, Vector2 value2)_ |
Subtracts a vector from a vector. |
static _void Subtract(ref Vector2 value1, ref Vector2 value2, ref Vector2 result)_ |
Subtracts a vector from a vector. |
static _Vector2 Multiply(Vector2 value1, Vector2 value2)_ |
Multiplies the components of two vectors by each other. |
static _void Multiply(ref Vector2 value1, ref Vector2 value2, ref Vector2 result)_ |
Multiplies the components of two vectors by each other. |
static _Vector2 Multiply(Vector2 value1, float scaleFactor)_ |
Multiplies a vector by a scalar value. |
static _void Multiply(ref Vector2 value1, float scaleFactor, ref Vector2 result)_ |
Multiplies a vector by a scalar value. |
static _Vector2 Divide(Vector2 value1, Vector2 value2)_ |
Divides the components of a vector by the components of another vector. |
static _void Divide(ref Vector2 value1, ref Vector2 value2, ref Vector2 result)_ |
Divides the components of a vector by the components of another vector. |
static _Vector2 Divide(Vector2 value1, float divider)_ |
Divides a vector by a scalar value. |
static _void Divide(ref Vector2 value1, float divider, ref Vector2 result)_ |
Divides a vector by a scalar value. |
_bool Between(ref Vector2 start, ref Vector2 end)_ |
|
static _Vector2 Floor(Vector2 position)_ |
|
_void Rotate(double angle)_ |
|
static _bool IsZero(ref Vector2 value)_ |
|
static _bool IsZero(ref Vector2 value, float epsilon)_ |
|
static _bool IsZero(Vector2 value, float epsilon)_ |
|
static _Vector2 SignNonZero(Vector2 value)_ |
Do you have questions, comments, suggestions for improvements? Is there something I can do better? Did I make a mistake? Please add an issue here, and prefix your issue title with Wiki. Thank you, your help will be very appreciated!