Space Engineers
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Properties | List of all members
VRageMath.Vector2 Struct Reference

Defines a vector with two components. More...

Inheritance diagram for VRageMath.Vector2:

Public Member Functions

 Vector2 (float x, float y)
 Initializes a new instance of Vector2. More...
 
 Vector2 (float value)
 Creates a new instance of Vector2. More...
 
override string ToString ()
 Retrieves a string representation of the current object. More...
 
bool Equals (Vector2 other)
 Determines whether the specified Object is equal to the Vector2. More...
 
override bool Equals (object obj)
 Returns a value that indicates whether the current instance is equal to a specified object. More...
 
override int GetHashCode ()
 Gets the hash code of the vector object. More...
 
bool IsValid ()
 
void AssertIsValid ()
 
float Length ()
 Calculates the length of the vector. More...
 
float LengthSquared ()
 Calculates the length of the vector squared. More...
 
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. More...
 
bool Between (ref Vector2 start, ref Vector2 end)
 
void Rotate (double angle)
 

Static Public Member Functions

static Vector2 ()
 
static operator Vector2I (Vector2 vector)
 
static Vector2 operator- (Vector2 value)
 Returns a vector pointing in the opposite direction. More...
 
static bool operator== (Vector2 value1, Vector2 value2)
 Tests vectors for equality. More...
 
static bool operator!= (Vector2 value1, Vector2 value2)
 Tests vectors for inequality. More...
 
static Vector2 operator+ (Vector2 value1, Vector2 value2)
 Adds two vectors. More...
 
static Vector2 operator+ (Vector2 value1, float value2)
 Adds float to each component of a vector. More...
 
static Vector2 operator- (Vector2 value1, Vector2 value2)
 Subtracts a vector from a vector. More...
 
static Vector2 operator- (Vector2 value1, float value2)
 Subtracts a vector from a vector. More...
 
static Vector2 operator* (Vector2 value1, Vector2 value2)
 Multiplies the components of two vectors by each other. More...
 
static Vector2 operator* (Vector2 value, float scaleFactor)
 Multiplies a vector by a scalar value. More...
 
static Vector2 operator* (float scaleFactor, Vector2 value)
 Multiplies a vector by a scalar value. More...
 
static Vector2 operator/ (Vector2 value1, Vector2 value2)
 Divides the components of a vector by the components of another vector. More...
 
static Vector2 operator/ (Vector2 value1, float divider)
 Divides a vector by a scalar value. More...
 
static Vector2 operator/ (float value1, Vector2 value2)
 Divides a scalar value by a vector. More...
 
static float Distance (Vector2 value1, Vector2 value2)
 Calculates the distance between two vectors. More...
 
static void Distance (ref Vector2 value1, ref Vector2 value2, out float result)
 Calculates the distance between two vectors. More...
 
static float DistanceSquared (Vector2 value1, Vector2 value2)
 Calculates the distance between two vectors squared. More...
 
static void DistanceSquared (ref Vector2 value1, ref Vector2 value2, out float result)
 Calculates the distance between two vectors squared. More...
 
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. More...
 
static void Dot (ref Vector2 value1, ref Vector2 value2, out 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. More...
 
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. More...
 
static void Normalize (ref Vector2 value, out 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. More...
 
static Vector2 Reflect (Vector2 vector, Vector2 normal)
 Determines the reflect vector of the given vector and normal. More...
 
static void Reflect (ref Vector2 vector, ref Vector2 normal, out Vector2 result)
 Determines the reflect vector of the given vector and normal. More...
 
static Vector2 Min (Vector2 value1, Vector2 value2)
 Returns a vector that contains the lowest value from each matching pair of components. More...
 
static void Min (ref Vector2 value1, ref Vector2 value2, out Vector2 result)
 Returns a vector that contains the lowest value from each matching pair of components. More...
 
static Vector2 Max (Vector2 value1, Vector2 value2)
 Returns a vector that contains the highest value from each matching pair of components. More...
 
static void Max (ref Vector2 value1, ref Vector2 value2, out Vector2 result)
 Returns a vector that contains the highest value from each matching pair of components. More...
 
static Vector2 Clamp (Vector2 value1, Vector2 min, Vector2 max)
 Restricts a value to be within a specified range. More...
 
static void Clamp (ref Vector2 value1, ref Vector2 min, ref Vector2 max, out Vector2 result)
 Restricts a value to be within a specified range. More...
 
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. More...
 
static void Lerp (ref Vector2 value1, ref Vector2 value2, float amount, out Vector2 result)
 Performs a linear interpolation between two vectors. More...
 
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. More...
 
static void Barycentric (ref Vector2 value1, ref Vector2 value2, ref Vector2 value3, float amount1, float amount2, out Vector2 result)
 Returns a Vector2 containing the 2D Cartesian coordinates of a point specified in barycentric (areal) coordinates relative to a 2D triangle. More...
 
static Vector2 SmoothStep (Vector2 value1, Vector2 value2, float amount)
 Interpolates between two values using a cubic equation. More...
 
static void SmoothStep (ref Vector2 value1, ref Vector2 value2, float amount, out Vector2 result)
 Interpolates between two values using a cubic equation. More...
 
static Vector2 CatmullRom (Vector2 value1, Vector2 value2, Vector2 value3, Vector2 value4, float amount)
 Performs a Catmull-Rom interpolation using the specified positions. More...
 
static void CatmullRom (ref Vector2 value1, ref Vector2 value2, ref Vector2 value3, ref Vector2 value4, float amount, out Vector2 result)
 Performs a Catmull-Rom interpolation using the specified positions. More...
 
static Vector2 Hermite (Vector2 value1, Vector2 tangent1, Vector2 value2, Vector2 tangent2, float amount)
 Performs a Hermite spline interpolation. More...
 
static void Hermite (ref Vector2 value1, ref Vector2 tangent1, ref Vector2 value2, ref Vector2 tangent2, float amount, out Vector2 result)
 Performs a Hermite spline interpolation. More...
 
static Vector2 Transform (Vector2 position, Matrix matrix)
 Transforms the vector (x, y, 0, 1) by the specified matrix. More...
 
static void Transform (ref Vector2 position, ref Matrix matrix, out Vector2 result)
 Transforms a Vector2 by the given Matrix. More...
 
static Vector2 TransformNormal (Vector2 normal, Matrix matrix)
 Transforms a 2D vector normal by a matrix. More...
 
static void TransformNormal (ref Vector2 normal, ref Matrix matrix, out Vector2 result)
 Transforms a vector normal by a matrix. More...
 
static Vector2 Transform (Vector2 value, Quaternion rotation)
 Transforms a single Vector2, or the vector normal (x, y, 0, 0), by a specified Quaternion rotation. More...
 
static void Transform (ref Vector2 value, ref Quaternion rotation, out Vector2 result)
 Transforms a Vector2, or the vector normal (x, y, 0, 0), by a specified Quaternion rotation. More...
 
static void Transform (Vector2[] sourceArray, ref Matrix matrix, Vector2[] destinationArray)
 Transforms an array of Vector2s by a specified Matrix. More...
 
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. More...
 
static void TransformNormal (Vector2[] sourceArray, ref Matrix matrix, Vector2[] destinationArray)
 Transforms an array of Vector2 vector normals by a specified Matrix. More...
 
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. More...
 
static void Transform (Vector2[] sourceArray, ref Quaternion rotation, Vector2[] destinationArray)
 Transforms an array of Vector2s by a specified Quaternion. More...
 
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. More...
 
static Vector2 Negate (Vector2 value)
 Returns a vector pointing in the opposite direction. More...
 
static void Negate (ref Vector2 value, out Vector2 result)
 Returns a vector pointing in the opposite direction. More...
 
static Vector2 Add (Vector2 value1, Vector2 value2)
 Adds two vectors. More...
 
static void Add (ref Vector2 value1, ref Vector2 value2, out Vector2 result)
 Adds two vectors. More...
 
static Vector2 Subtract (Vector2 value1, Vector2 value2)
 Subtracts a vector from a vector. More...
 
static void Subtract (ref Vector2 value1, ref Vector2 value2, out Vector2 result)
 Subtracts a vector from a vector. More...
 
static Vector2 Multiply (Vector2 value1, Vector2 value2)
 Multiplies the components of two vectors by each other. More...
 
static void Multiply (ref Vector2 value1, ref Vector2 value2, out Vector2 result)
 Multiplies the components of two vectors by each other. More...
 
static Vector2 Multiply (Vector2 value1, float scaleFactor)
 Multiplies a vector by a scalar value. More...
 
static void Multiply (ref Vector2 value1, float scaleFactor, out Vector2 result)
 Multiplies a vector by a scalar value. More...
 
static Vector2 Divide (Vector2 value1, Vector2 value2)
 Divides the components of a vector by the components of another vector. More...
 
static void Divide (ref Vector2 value1, ref Vector2 value2, out Vector2 result)
 Divides the components of a vector by the components of another vector. More...
 
static Vector2 Divide (Vector2 value1, float divider)
 Divides a vector by a scalar value. More...
 
static void Divide (ref Vector2 value1, float divider, out Vector2 result)
 Divides a vector by a scalar value. More...
 
static Vector2 Floor (Vector2 position)
 
static bool IsZero (ref Vector2 value)
 
static bool IsZero (ref Vector2 value, float epsilon)
 
static bool IsZero (Vector2 value, float epsilon)
 

Public Attributes

float X
 Gets or sets the x-component of the vector. More...
 
float Y
 Gets or sets the y-component of the vector. More...
 

Static Public Attributes

static Vector2 Zero = new Vector2()
 
static Vector2 One = new Vector2(1f, 1f)
 
static Vector2 UnitX = new Vector2(1f, 0f)
 
static Vector2 UnitY = new Vector2(0f, 1f)
 
static Vector2 PositiveInfinity = One * float.PositiveInfinity
 

Properties

float this[int index] [get, set]
 

Detailed Description

Defines a vector with two components.

Definition at line 11 of file Vector2.cs.

Constructor & Destructor Documentation

static VRageMath.Vector2.Vector2 ( )
inlinestatic

Definition at line 30 of file Vector2.cs.

VRageMath.Vector2.Vector2 ( float  x,
float  y 
)
inline

Initializes a new instance of Vector2.

Parameters
xInitial value for the x-component of the vector.
yInitial value for the y-component of the vector.

Definition at line 38 of file Vector2.cs.

VRageMath.Vector2.Vector2 ( float  value)
inline

Creates a new instance of Vector2.

Parameters
valueValue to initialize both components to.

Definition at line 48 of file Vector2.cs.

Member Function Documentation

static Vector2 VRageMath.Vector2.Add ( Vector2  value1,
Vector2  value2 
)
inlinestatic

Adds two vectors.

Parameters
value1Source vector.
value2Source vector.

Definition at line 895 of file Vector2.cs.

static void VRageMath.Vector2.Add ( ref Vector2  value1,
ref Vector2  value2,
out Vector2  result 
)
inlinestatic

Adds two vectors.

Parameters
value1Source vector.
value2Source vector.
result[OutAttribute] Sum of the source vectors.

Definition at line 907 of file Vector2.cs.

void VRageMath.Vector2.AssertIsValid ( )
inline

Definition at line 282 of file Vector2.cs.

static Vector2 VRageMath.Vector2.Barycentric ( Vector2  value1,
Vector2  value2,
Vector2  value3,
float  amount1,
float  amount2 
)
inlinestatic

Returns a Vector2 containing the 2D Cartesian coordinates of a point specified in barycentric (areal) coordinates relative to a 2D triangle.

Parameters
value1A Vector2 containing the 2D Cartesian coordinates of vertex 1 of the triangle.
value2A Vector2 containing the 2D Cartesian coordinates of vertex 2 of the triangle.
value3A Vector2 containing the 2D Cartesian coordinates of vertex 3 of the triangle.
amount1Barycentric coordinate b2, which expresses the weighting factor toward vertex 2 (specified in value2).
amount2Barycentric coordinate b3, which expresses the weighting factor toward vertex 3 (specified in value3).

Definition at line 551 of file Vector2.cs.

static void VRageMath.Vector2.Barycentric ( ref Vector2  value1,
ref Vector2  value2,
ref Vector2  value3,
float  amount1,
float  amount2,
out Vector2  result 
)
inlinestatic

Returns a Vector2 containing the 2D Cartesian coordinates of a point specified in barycentric (areal) coordinates relative to a 2D triangle.

Parameters
value1A Vector2 containing the 2D Cartesian coordinates of vertex 1 of the triangle.
value2A Vector2 containing the 2D Cartesian coordinates of vertex 2 of the triangle.
value3A Vector2 containing the 2D Cartesian coordinates of vertex 3 of the triangle.
amount1Barycentric coordinate b2, which expresses the weighting factor toward vertex 2 (specified in value2).
amount2Barycentric coordinate b3, which expresses the weighting factor toward vertex 3 (specified in value3).
result[OutAttribute] The 2D Cartesian coordinates of the specified point are placed in this Vector2 on exit.

Definition at line 563 of file Vector2.cs.

bool VRageMath.Vector2.Between ( ref Vector2  start,
ref Vector2  end 
)
inline

Definition at line 1025 of file Vector2.cs.

static Vector2 VRageMath.Vector2.CatmullRom ( Vector2  value1,
Vector2  value2,
Vector2  value3,
Vector2  value4,
float  amount 
)
inlinestatic

Performs a Catmull-Rom interpolation using the specified positions.

Parameters
value1The first position in the interpolation.
value2The second position in the interpolation.
value3The third position in the interpolation.
value4The fourth position in the interpolation.
amountWeighting factor.

Definition at line 599 of file Vector2.cs.

static void VRageMath.Vector2.CatmullRom ( ref Vector2  value1,
ref Vector2  value2,
ref Vector2  value3,
ref Vector2  value4,
float  amount,
out Vector2  result 
)
inlinestatic

Performs a Catmull-Rom interpolation using the specified positions.

Parameters
value1The first position in the interpolation.
value2The second position in the interpolation.
value3The third position in the interpolation.
value4The fourth position in the interpolation.
amountWeighting factor.
result[OutAttribute] A vector that is the result of the Catmull-Rom interpolation.

Definition at line 613 of file Vector2.cs.

static Vector2 VRageMath.Vector2.Clamp ( Vector2  value1,
Vector2  min,
Vector2  max 
)
inlinestatic

Restricts a value to be within a specified range.

Parameters
value1The value to clamp.
minThe minimum value.
maxThe maximum value.

Definition at line 472 of file Vector2.cs.

static void VRageMath.Vector2.Clamp ( ref Vector2  value1,
ref Vector2  min,
ref Vector2  max,
out Vector2  result 
)
inlinestatic

Restricts a value to be within a specified range.

Parameters
value1The value to clamp.
minThe minimum value.
maxThe maximum value.
result[OutAttribute] The clamped value.

Definition at line 490 of file Vector2.cs.

static Vector2 VRageMath.Vector2.ClampToSphere ( Vector2  vector,
float  radius 
)
inlinestatic

Definition at line 503 of file Vector2.cs.

static void VRageMath.Vector2.ClampToSphere ( ref Vector2  vector,
float  radius 
)
inlinestatic

Definition at line 515 of file Vector2.cs.

static float VRageMath.Vector2.Distance ( Vector2  value1,
Vector2  value2 
)
inlinestatic

Calculates the distance between two vectors.

Parameters
value1Source vector.
value2Source vector.

Definition at line 307 of file Vector2.cs.

static void VRageMath.Vector2.Distance ( ref Vector2  value1,
ref Vector2  value2,
out float  result 
)
inlinestatic

Calculates the distance between two vectors.

Parameters
value1Source vector.
value2Source vector.
result[OutAttribute] The distance between the vectors.

Definition at line 318 of file Vector2.cs.

static float VRageMath.Vector2.DistanceSquared ( Vector2  value1,
Vector2  value2 
)
inlinestatic

Calculates the distance between two vectors squared.

Parameters
value1Source vector.
value2Source vector.

Definition at line 330 of file Vector2.cs.

static void VRageMath.Vector2.DistanceSquared ( ref Vector2  value1,
ref Vector2  value2,
out float  result 
)
inlinestatic

Calculates the distance between two vectors squared.

Parameters
value1Source vector.
value2Source vector.
result[OutAttribute] The distance between the vectors squared.

Definition at line 341 of file Vector2.cs.

static Vector2 VRageMath.Vector2.Divide ( Vector2  value1,
Vector2  value2 
)
inlinestatic

Divides the components of a vector by the components of another vector.

Parameters
value1Source vector.
value2Divisor vector.

Definition at line 983 of file Vector2.cs.

static void VRageMath.Vector2.Divide ( ref Vector2  value1,
ref Vector2  value2,
out Vector2  result 
)
inlinestatic

Divides the components of a vector by the components of another vector.

Parameters
value1Source vector.
value2The divisor.
result[OutAttribute] The result of the division.

Definition at line 995 of file Vector2.cs.

static Vector2 VRageMath.Vector2.Divide ( Vector2  value1,
float  divider 
)
inlinestatic

Divides a vector by a scalar value.

Parameters
value1Source vector.
dividerThe divisor.

Definition at line 1005 of file Vector2.cs.

static void VRageMath.Vector2.Divide ( ref Vector2  value1,
float  divider,
out Vector2  result 
)
inlinestatic

Divides a vector by a scalar value.

Parameters
value1Source vector.
dividerThe divisor.
result[OutAttribute] The result of the division.

Definition at line 1018 of file Vector2.cs.

static float VRageMath.Vector2.Dot ( Vector2  value1,
Vector2  value2 
)
inlinestatic

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.

Parameters
value1Source vector.
value2Source vector.

Definition at line 352 of file Vector2.cs.

static void VRageMath.Vector2.Dot ( ref Vector2  value1,
ref Vector2  value2,
out float  result 
)
inlinestatic

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.

Parameters
value1Source vector.
value2Source vector.
result[OutAttribute] The dot product of the two vectors.

Definition at line 361 of file Vector2.cs.

bool VRageMath.Vector2.Equals ( Vector2  other)
inline

Determines whether the specified Object is equal to the Vector2.

Parameters
otherThe Object to compare with the current Vector2.

Definition at line 247 of file Vector2.cs.

override bool VRageMath.Vector2.Equals ( object  obj)
inline

Returns a value that indicates whether the current instance is equal to a specified object.

Parameters
objObject to make the comparison with.

Definition at line 259 of file Vector2.cs.

static Vector2 VRageMath.Vector2.Floor ( Vector2  position)
inlinestatic

Definition at line 1030 of file Vector2.cs.

override int VRageMath.Vector2.GetHashCode ( )
inline

Gets the hash code of the vector object.

Definition at line 270 of file Vector2.cs.

static Vector2 VRageMath.Vector2.Hermite ( Vector2  value1,
Vector2  tangent1,
Vector2  value2,
Vector2  tangent2,
float  amount 
)
inlinestatic

Performs a Hermite spline interpolation.

Parameters
value1Source position vector.
tangent1Source tangent vector.
value2Source position vector.
tangent2Source tangent vector.
amountWeighting factor.

Definition at line 625 of file Vector2.cs.

static void VRageMath.Vector2.Hermite ( ref Vector2  value1,
ref Vector2  tangent1,
ref Vector2  value2,
ref Vector2  tangent2,
float  amount,
out Vector2  result 
)
inlinestatic

Performs a Hermite spline interpolation.

Parameters
value1Source position vector.
tangent1Source tangent vector.
value2Source position vector.
tangent2Source tangent vector.
amountWeighting factor.
result[OutAttribute] The result of the Hermite spline interpolation.

Definition at line 643 of file Vector2.cs.

bool VRageMath.Vector2.IsValid ( )
inline

Definition at line 275 of file Vector2.cs.

static bool VRageMath.Vector2.IsZero ( ref Vector2  value)
inlinestatic

Definition at line 1042 of file Vector2.cs.

static bool VRageMath.Vector2.IsZero ( ref Vector2  value,
float  epsilon 
)
inlinestatic

Definition at line 1048 of file Vector2.cs.

static bool VRageMath.Vector2.IsZero ( Vector2  value,
float  epsilon 
)
inlinestatic

Definition at line 1053 of file Vector2.cs.

float VRageMath.Vector2.Length ( )
inline

Calculates the length of the vector.

Definition at line 290 of file Vector2.cs.

float VRageMath.Vector2.LengthSquared ( )
inline

Calculates the length of the vector squared.

Definition at line 298 of file Vector2.cs.

static Vector2 VRageMath.Vector2.Lerp ( Vector2  value1,
Vector2  value2,
float  amount 
)
inlinestatic

Performs a linear interpolation between two vectors.

Parameters
value1Source vector.
value2Source vector.
amountValue between 0 and 1 indicating the weight of value2.

Definition at line 529 of file Vector2.cs.

static void VRageMath.Vector2.Lerp ( ref Vector2  value1,
ref Vector2  value2,
float  amount,
out Vector2  result 
)
inlinestatic

Performs a linear interpolation between two vectors.

Parameters
value1Source vector.
value2Source vector.
amountValue between 0 and 1 indicating the weight of value2.
result[OutAttribute] The result of the interpolation.

Definition at line 541 of file Vector2.cs.

static Vector2 VRageMath.Vector2.Max ( Vector2  value1,
Vector2  value2 
)
inlinestatic

Returns a vector that contains the highest value from each matching pair of components.

Parameters
value1Source vector.
value2Source vector.

Definition at line 450 of file Vector2.cs.

static void VRageMath.Vector2.Max ( ref Vector2  value1,
ref Vector2  value2,
out Vector2  result 
)
inlinestatic

Returns a vector that contains the highest value from each matching pair of components.

Parameters
value1Source vector.
value2Source vector.
result[OutAttribute] The maximized vector.

Definition at line 462 of file Vector2.cs.

static Vector2 VRageMath.Vector2.Min ( Vector2  value1,
Vector2  value2 
)
inlinestatic

Returns a vector that contains the lowest value from each matching pair of components.

Parameters
value1Source vector.
value2Source vector.

Definition at line 428 of file Vector2.cs.

static void VRageMath.Vector2.Min ( ref Vector2  value1,
ref Vector2  value2,
out Vector2  result 
)
inlinestatic

Returns a vector that contains the lowest value from each matching pair of components.

Parameters
value1Source vector.
value2Source vector.
result[OutAttribute] The minimized vector.

Definition at line 440 of file Vector2.cs.

static Vector2 VRageMath.Vector2.Multiply ( Vector2  value1,
Vector2  value2 
)
inlinestatic

Multiplies the components of two vectors by each other.

Parameters
value1Source vector.
value2Source vector.

Definition at line 939 of file Vector2.cs.

static void VRageMath.Vector2.Multiply ( ref Vector2  value1,
ref Vector2  value2,
out Vector2  result 
)
inlinestatic

Multiplies the components of two vectors by each other.

Parameters
value1Source vector.
value2Source vector.
result[OutAttribute] The result of the multiplication.

Definition at line 951 of file Vector2.cs.

static Vector2 VRageMath.Vector2.Multiply ( Vector2  value1,
float  scaleFactor 
)
inlinestatic

Multiplies a vector by a scalar value.

Parameters
value1Source vector.
scaleFactorScalar value.

Definition at line 961 of file Vector2.cs.

static void VRageMath.Vector2.Multiply ( ref Vector2  value1,
float  scaleFactor,
out Vector2  result 
)
inlinestatic

Multiplies a vector by a scalar value.

Parameters
value1Source vector.
scaleFactorScalar value.
result[OutAttribute] The result of the multiplication.

Definition at line 973 of file Vector2.cs.

static Vector2 VRageMath.Vector2.Negate ( Vector2  value)
inlinestatic

Returns a vector pointing in the opposite direction.

Parameters
valueSource vector.

Definition at line 873 of file Vector2.cs.

static void VRageMath.Vector2.Negate ( ref Vector2  value,
out Vector2  result 
)
inlinestatic

Returns a vector pointing in the opposite direction.

Parameters
valueSource vector.
result[OutAttribute] Vector pointing in the opposite direction.

Definition at line 885 of file Vector2.cs.

void VRageMath.Vector2.Normalize ( )
inline

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.

Definition at line 369 of file Vector2.cs.

static Vector2 VRageMath.Vector2.Normalize ( Vector2  value)
inlinestatic

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.

Parameters
valueSource Vector2.

Definition at line 380 of file Vector2.cs.

static void VRageMath.Vector2.Normalize ( ref Vector2  value,
out Vector2  result 
)
inlinestatic

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.

Parameters
valueSource vector.
result[OutAttribute] Normalized vector.

Definition at line 393 of file Vector2.cs.

static VRageMath.Vector2.operator Vector2I ( Vector2  vector)
inlineexplicitstatic

Definition at line 69 of file Vector2.cs.

static bool VRageMath.Vector2.operator!= ( Vector2  value1,
Vector2  value2 
)
inlinestatic

Tests vectors for inequality.

Parameters
value1Vector to compare.
value2Vector to compare.

Definition at line 102 of file Vector2.cs.

static Vector2 VRageMath.Vector2.operator* ( Vector2  value1,
Vector2  value2 
)
inlinestatic

Multiplies the components of two vectors by each other.

Parameters
value1Source vector.
value2Source vector.

Definition at line 162 of file Vector2.cs.

static Vector2 VRageMath.Vector2.operator* ( Vector2  value,
float  scaleFactor 
)
inlinestatic

Multiplies a vector by a scalar value.

Parameters
valueSource vector.
scaleFactorScalar value.

Definition at line 174 of file Vector2.cs.

static Vector2 VRageMath.Vector2.operator* ( float  scaleFactor,
Vector2  value 
)
inlinestatic

Multiplies a vector by a scalar value.

Parameters
scaleFactorScalar value.
valueSource vector.

Definition at line 186 of file Vector2.cs.

static Vector2 VRageMath.Vector2.operator+ ( Vector2  value1,
Vector2  value2 
)
inlinestatic

Adds two vectors.

Parameters
value1Source vector.
value2Source vector.

Definition at line 114 of file Vector2.cs.

static Vector2 VRageMath.Vector2.operator+ ( Vector2  value1,
float  value2 
)
inlinestatic

Adds float to each component of a vector.

Parameters
value1Source vector.
value2Source float.

Definition at line 126 of file Vector2.cs.

static Vector2 VRageMath.Vector2.operator- ( Vector2  value)
inlinestatic

Returns a vector pointing in the opposite direction.

Parameters
valueSource vector.

Definition at line 78 of file Vector2.cs.

static Vector2 VRageMath.Vector2.operator- ( Vector2  value1,
Vector2  value2 
)
inlinestatic

Subtracts a vector from a vector.

Parameters
value1Source vector.
value2source vector.

Definition at line 138 of file Vector2.cs.

static Vector2 VRageMath.Vector2.operator- ( Vector2  value1,
float  value2 
)
inlinestatic

Subtracts a vector from a vector.

Parameters
value1Source vector.
value2source vector.

Definition at line 150 of file Vector2.cs.

static Vector2 VRageMath.Vector2.operator/ ( Vector2  value1,
Vector2  value2 
)
inlinestatic

Divides the components of a vector by the components of another vector.

Parameters
value1Source vector.
value2Divisor vector.

Definition at line 198 of file Vector2.cs.

static Vector2 VRageMath.Vector2.operator/ ( Vector2  value1,
float  divider 
)
inlinestatic

Divides a vector by a scalar value.

Parameters
value1Source vector.
dividerThe divisor.

Definition at line 210 of file Vector2.cs.

static Vector2 VRageMath.Vector2.operator/ ( float  value1,
Vector2  value2 
)
inlinestatic

Divides a scalar value by a vector.

Definition at line 222 of file Vector2.cs.

static bool VRageMath.Vector2.operator== ( Vector2  value1,
Vector2  value2 
)
inlinestatic

Tests vectors for equality.

Parameters
value1Source vector.
value2Source vector.

Definition at line 90 of file Vector2.cs.

static Vector2 VRageMath.Vector2.Reflect ( Vector2  vector,
Vector2  normal 
)
inlinestatic

Determines the reflect vector of the given vector and normal.

Parameters
vectorSource vector.
normalNormal of vector.

Definition at line 404 of file Vector2.cs.

static void VRageMath.Vector2.Reflect ( ref Vector2  vector,
ref Vector2  normal,
out Vector2  result 
)
inlinestatic

Determines the reflect vector of the given vector and normal.

Parameters
vectorSource vector.
normalNormal of vector.
result[OutAttribute] The created reflect vector.

Definition at line 417 of file Vector2.cs.

void VRageMath.Vector2.Rotate ( double  angle)
inline

Definition at line 1035 of file Vector2.cs.

static Vector2 VRageMath.Vector2.SmoothStep ( Vector2  value1,
Vector2  value2,
float  amount 
)
inlinestatic

Interpolates between two values using a cubic equation.

Parameters
value1Source value.
value2Source value.
amountWeighting value.

Definition at line 573 of file Vector2.cs.

static void VRageMath.Vector2.SmoothStep ( ref Vector2  value1,
ref Vector2  value2,
float  amount,
out Vector2  result 
)
inlinestatic

Interpolates between two values using a cubic equation.

Parameters
value1Source value.
value2Source value.
amountWeighting value.
result[OutAttribute] The interpolated value.

Definition at line 587 of file Vector2.cs.

static Vector2 VRageMath.Vector2.Subtract ( Vector2  value1,
Vector2  value2 
)
inlinestatic

Subtracts a vector from a vector.

Parameters
value1Source vector.
value2Source vector.

Definition at line 917 of file Vector2.cs.

static void VRageMath.Vector2.Subtract ( ref Vector2  value1,
ref Vector2  value2,
out Vector2  result 
)
inlinestatic

Subtracts a vector from a vector.

Parameters
value1Source vector.
value2Source vector.
result[OutAttribute] The result of the subtraction.

Definition at line 929 of file Vector2.cs.

override string VRageMath.Vector2.ToString ( )
inline

Retrieves a string representation of the current object.

Definition at line 233 of file Vector2.cs.

static Vector2 VRageMath.Vector2.Transform ( Vector2  position,
Matrix  matrix 
)
inlinestatic

Transforms the vector (x, y, 0, 1) by the specified matrix.

Parameters
positionThe source vector.
matrixThe transformation matrix.

Definition at line 659 of file Vector2.cs.

static void VRageMath.Vector2.Transform ( ref Vector2  position,
ref Matrix  matrix,
out Vector2  result 
)
inlinestatic

Transforms a Vector2 by the given Matrix.

Parameters
positionThe source Vector2.
matrixThe transformation Matrix.
result[OutAttribute] The Vector2 resulting from the transformation.

Definition at line 673 of file Vector2.cs.

static Vector2 VRageMath.Vector2.Transform ( Vector2  value,
Quaternion  rotation 
)
inlinestatic

Transforms a single Vector2, or the vector normal (x, y, 0, 0), by a specified Quaternion rotation.

Parameters
valueThe vector to rotate.
rotationThe Quaternion rotation to apply.

Definition at line 711 of file Vector2.cs.

static void VRageMath.Vector2.Transform ( ref Vector2  value,
ref Quaternion  rotation,
out Vector2  result 
)
inlinestatic

Transforms a Vector2, or the vector normal (x, y, 0, 0), by a specified Quaternion rotation.

Parameters
valueThe vector to rotate.
rotationThe Quaternion rotation to apply.
result[OutAttribute] An existing Vector2 filled in with the result of the rotation.

Definition at line 733 of file Vector2.cs.

static void VRageMath.Vector2.Transform ( Vector2[]  sourceArray,
ref Matrix  matrix,
Vector2[]  destinationArray 
)
inlinestatic

Transforms an array of Vector2s by a specified Matrix.

Parameters
sourceArrayThe array of Vector2s to transform.
matrixThe transform Matrix to apply.
destinationArrayAn existing array into which the transformed Vector2s are written.

Definition at line 753 of file Vector2.cs.

static void VRageMath.Vector2.Transform ( Vector2[]  sourceArray,
int  sourceIndex,
ref Matrix  matrix,
Vector2[]  destinationArray,
int  destinationIndex,
int  length 
)
inlinestatic

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.

Parameters
sourceArrayThe source array.
sourceIndexThe index of the first Vector2 to transform in the source array.
matrixThe Matrix to transform by.
destinationArrayThe destination array into which the resulting Vector2s will be written.
destinationIndexThe index of the position in the destination array where the first result Vector2 should be written.
lengthThe number of Vector2s to be transformed.

Definition at line 768 of file Vector2.cs.

static void VRageMath.Vector2.Transform ( Vector2[]  sourceArray,
ref Quaternion  rotation,
Vector2[]  destinationArray 
)
inlinestatic

Transforms an array of Vector2s by a specified Quaternion.

Parameters
sourceArrayThe array of Vector2s to transform.
rotationThe transform Matrix to use.
destinationArrayAn existing array into which the transformed Vector2s are written.

Definition at line 817 of file Vector2.cs.

static void VRageMath.Vector2.Transform ( Vector2[]  sourceArray,
int  sourceIndex,
ref Quaternion  rotation,
Vector2[]  destinationArray,
int  destinationIndex,
int  length 
)
inlinestatic

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.

Parameters
sourceArrayThe source array.
sourceIndexThe index of the first Vector2 to transform in the source array.
rotationThe Quaternion rotation to apply.
destinationArrayThe destination array into which the resulting Vector2s are written.
destinationIndexThe index of the position in the destination array where the first result Vector2 should be written.
lengthThe number of Vector2s to be transformed.

Definition at line 844 of file Vector2.cs.

static Vector2 VRageMath.Vector2.TransformNormal ( Vector2  normal,
Matrix  matrix 
)
inlinestatic

Transforms a 2D vector normal by a matrix.

Parameters
normalThe source vector.
matrixThe transformation matrix.

Definition at line 685 of file Vector2.cs.

static void VRageMath.Vector2.TransformNormal ( ref Vector2  normal,
ref Matrix  matrix,
out Vector2  result 
)
inlinestatic

Transforms a vector normal by a matrix.

Parameters
normalThe source vector.
matrixThe transformation matrix.
result[OutAttribute] The Vector2 resulting from the transformation.

Definition at line 699 of file Vector2.cs.

static void VRageMath.Vector2.TransformNormal ( Vector2[]  sourceArray,
ref Matrix  matrix,
Vector2[]  destinationArray 
)
inlinestatic

Transforms an array of Vector2 vector normals by a specified Matrix.

Parameters
sourceArrayThe array of vector normals to transform.
matrixThe transform Matrix to apply.
destinationArrayAn existing array into which the transformed vector normals are written.

Definition at line 785 of file Vector2.cs.

static void VRageMath.Vector2.TransformNormal ( Vector2[]  sourceArray,
int  sourceIndex,
ref Matrix  matrix,
Vector2[]  destinationArray,
int  destinationIndex,
int  length 
)
inlinestatic

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.

Parameters
sourceArrayThe source array.
sourceIndexThe index of the first Vector2 to transform in the source array.
matrixThe Matrix to apply.
destinationArrayThe destination array into which the resulting Vector2s are written.
destinationIndexThe index of the position in the destination array where the first result Vector2 should be written.
lengthThe number of vector normals to be transformed.

Definition at line 800 of file Vector2.cs.

Member Data Documentation

Vector2 VRageMath.Vector2.One = new Vector2(1f, 1f)
static

Definition at line 14 of file Vector2.cs.

Vector2 VRageMath.Vector2.PositiveInfinity = One * float.PositiveInfinity
static

Definition at line 17 of file Vector2.cs.

Vector2 VRageMath.Vector2.UnitX = new Vector2(1f, 0f)
static

Definition at line 15 of file Vector2.cs.

Vector2 VRageMath.Vector2.UnitY = new Vector2(0f, 1f)
static

Definition at line 16 of file Vector2.cs.

float VRageMath.Vector2.X

Gets or sets the x-component of the vector.

Definition at line 23 of file Vector2.cs.

float VRageMath.Vector2.Y

Gets or sets the y-component of the vector.

Definition at line 28 of file Vector2.cs.

Vector2 VRageMath.Vector2.Zero = new Vector2()
static

Definition at line 13 of file Vector2.cs.

Property Documentation

float VRageMath.Vector2.this[int index]
getset

Definition at line 54 of file Vector2.cs.


The documentation for this struct was generated from the following file: