Shift
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Pages
Shift.Vector2 Struct Reference

Describes a 2D-vector. More...

Inheritance diagram for Shift.Vector2:

Public Member Functions

 Vector2 (float x, float y)
 Constructs a 2d vector with X and Y from two values. More...
 
 Vector2 (float value)
 Constructs a 2d vector with X and Y set to the same value. More...
 
override bool Equals (object obj)
 Compares whether current instance is equal to specified Object. More...
 
bool Equals (Vector2 other)
 Compares whether current instance is equal to specified Vector2. More...
 
override int GetHashCode ()
 Gets the hash code of this Vector2. More...
 
float Length ()
 Returns the length of this Vector2. More...
 
float LengthSquared ()
 Returns the squared length of this Vector2. More...
 
void Normalize ()
 Turns this Vector2 to a unit vector with the same direction. More...
 
override string ToString ()
 Returns a String representation of this Vector2 in the format: {X:[X] Y:[Y]} More...
 
Point ToPoint ()
 Gets a Point representation for this object. More...
 

Static Public Member Functions

static Vector2 operator- (Vector2 value)
 Inverts values in the specified Vector2. More...
 
static Vector2 operator+ (Vector2 value1, Vector2 value2)
 Adds two vectors. More...
 
static Vector2 operator- (Vector2 value1, Vector2 value2)
 Subtracts a Vector2 from a Vector2. 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 the components of vector by a scalar. More...
 
static Vector2 operator* (float scaleFactor, Vector2 value)
 Multiplies the components of vector by a scalar. More...
 
static Vector2 operator/ (Vector2 value1, Vector2 value2)
 Divides the components of a Vector2 by the components of another Vector2. More...
 
static Vector2 operator/ (Vector2 value1, float divider)
 Divides the components of a Vector2 by a scalar. More...
 
static bool operator== (Vector2 value1, Vector2 value2)
 Compares whether two Vector2 instances are equal. More...
 
static bool operator!= (Vector2 value1, Vector2 value2)
 Compares whether two Vector2 instances are not equal. More...
 
static Vector2 Add (Vector2 value1, Vector2 value2)
 Performs vector addition on value1 and value2 . More...
 
static void Add (ref Vector2 value1, ref Vector2 value2, out Vector2 result)
 Performs vector addition on value1 and value2 , storing the result of the addition in result . More...
 
static Vector2 Barycentric (Vector2 value1, Vector2 value2, Vector2 value3, float amount1, float amount2)
 Creates a new Vector2 that contains the cartesian coordinates of a vector specified in barycentric coordinates and relative to 2d-triangle. More...
 
static void Barycentric (ref Vector2 value1, ref Vector2 value2, ref Vector2 value3, float amount1, float amount2, out Vector2 result)
 Creates a new Vector2 that contains the cartesian coordinates of a vector specified in barycentric coordinates and relative to 2d-triangle. More...
 
static Vector2 CatmullRom (Vector2 value1, Vector2 value2, Vector2 value3, Vector2 value4, float amount)
 Creates a new Vector2 that contains CatmullRom interpolation of the specified vectors. More...
 
static void CatmullRom (ref Vector2 value1, ref Vector2 value2, ref Vector2 value3, ref Vector2 value4, float amount, out Vector2 result)
 Creates a new Vector2 that contains CatmullRom interpolation of the specified vectors. More...
 
static Vector2 Clamp (Vector2 value1, Vector2 min, Vector2 max)
 Clamps the specified value within a range. More...
 
static void Clamp (ref Vector2 value1, ref Vector2 min, ref Vector2 max, out Vector2 result)
 Clamps the specified value within a range. More...
 
static float Distance (Vector2 value1, Vector2 value2)
 Returns the distance between two vectors. More...
 
static void Distance (ref Vector2 value1, ref Vector2 value2, out float result)
 Returns the distance between two vectors. More...
 
static float DistanceSquared (Vector2 value1, Vector2 value2)
 Returns the squared distance between two vectors. More...
 
static void DistanceSquared (ref Vector2 value1, ref Vector2 value2, out float result)
 Returns the squared distance between two vectors. More...
 
static Vector2 Divide (Vector2 value1, Vector2 value2)
 Divides the components of a Vector2 by the components of another Vector2. More...
 
static void Divide (ref Vector2 value1, ref Vector2 value2, out Vector2 result)
 Divides the components of a Vector2 by the components of another Vector2. More...
 
static Vector2 Divide (Vector2 value1, float divider)
 Divides the components of a Vector2 by a scalar. More...
 
static void Divide (ref Vector2 value1, float divider, out Vector2 result)
 Divides the components of a Vector2 by a scalar. More...
 
static float Dot (Vector2 value1, Vector2 value2)
 Returns a dot product of two vectors. More...
 
static void Dot (ref Vector2 value1, ref Vector2 value2, out float result)
 Returns a dot product of two vectors. More...
 
static Vector2 Hermite (Vector2 value1, Vector2 tangent1, Vector2 value2, Vector2 tangent2, float amount)
 Creates a new Vector2 that contains hermite spline interpolation. More...
 
static void Hermite (ref Vector2 value1, ref Vector2 tangent1, ref Vector2 value2, ref Vector2 tangent2, float amount, out Vector2 result)
 Creates a new Vector2 that contains hermite spline interpolation. More...
 
static Vector2 Lerp (Vector2 value1, Vector2 value2, float amount)
 Creates a new Vector2 that contains linear interpolation of the specified vectors. More...
 
static void Lerp (ref Vector2 value1, ref Vector2 value2, float amount, out Vector2 result)
 Creates a new Vector2 that contains linear interpolation of the specified vectors. More...
 
static Vector2 LerpPrecise (Vector2 value1, Vector2 value2, float amount)
 Creates a new Vector2 that contains linear interpolation of the specified vectors. Uses MathHelper.LerpPrecise on MathHelper for the interpolation. Less efficient but more precise compared to Vector2.Lerp(Vector2, Vector2, float). See remarks section of MathHelper.LerpPrecise on MathHelper for more info. More...
 
static void LerpPrecise (ref Vector2 value1, ref Vector2 value2, float amount, out Vector2 result)
 Creates a new Vector2 that contains linear interpolation of the specified vectors. Uses MathHelper.LerpPrecise on MathHelper for the interpolation. Less efficient but more precise compared to Vector2.Lerp(ref Vector2, ref Vector2, float, out Vector2). See remarks section of MathHelper.LerpPrecise on MathHelper for more info. More...
 
static Vector2 Max (Vector2 value1, Vector2 value2)
 Creates a new Vector2 that contains a maximal values from the two vectors. More...
 
static void Max (ref Vector2 value1, ref Vector2 value2, out Vector2 result)
 Creates a new Vector2 that contains a maximal values from the two vectors. More...
 
static Vector2 Min (Vector2 value1, Vector2 value2)
 Creates a new Vector2 that contains a minimal values from the two vectors. More...
 
static void Min (ref Vector2 value1, ref Vector2 value2, out Vector2 result)
 Creates a new Vector2 that contains a minimal values from the two vectors. More...
 
static Vector2 Multiply (Vector2 value1, Vector2 value2)
 Creates a new Vector2 that contains a multiplication of two vectors. More...
 
static void Multiply (ref Vector2 value1, ref Vector2 value2, out Vector2 result)
 Creates a new Vector2 that contains a multiplication of two vectors. More...
 
static Vector2 Multiply (Vector2 value1, float scaleFactor)
 Creates a new Vector2 that contains a multiplication of Vector2 and a scalar. More...
 
static void Multiply (ref Vector2 value1, float scaleFactor, out Vector2 result)
 Creates a new Vector2 that contains a multiplication of Vector2 and a scalar. More...
 
static Vector2 Negate (Vector2 value)
 Creates a new Vector2 that contains the specified vector inversion. More...
 
static void Negate (ref Vector2 value, out Vector2 result)
 Creates a new Vector2 that contains the specified vector inversion. More...
 
static Vector2 Normalize (Vector2 value)
 Creates a new Vector2 that contains a normalized values from another vector. More...
 
static void Normalize (ref Vector2 value, out Vector2 result)
 Creates a new Vector2 that contains a normalized values from another vector. More...
 
static Vector2 Reflect (Vector2 vector, Vector2 normal)
 Creates a new Vector2 that contains reflect vector of the given vector and normal. More...
 
static void Reflect (ref Vector2 vector, ref Vector2 normal, out Vector2 result)
 Creates a new Vector2 that contains reflect vector of the given vector and normal. More...
 
static Vector2 SmoothStep (Vector2 value1, Vector2 value2, float amount)
 Creates a new Vector2 that contains cubic interpolation of the specified vectors. More...
 
static void SmoothStep (ref Vector2 value1, ref Vector2 value2, float amount, out Vector2 result)
 Creates a new Vector2 that contains cubic interpolation of the specified vectors. More...
 
static Vector2 Subtract (Vector2 value1, Vector2 value2)
 Creates a new Vector2 that contains subtraction of on Vector2 from a another. More...
 
static void Subtract (ref Vector2 value1, ref Vector2 value2, out Vector2 result)
 Creates a new Vector2 that contains subtraction of on Vector2 from a another. More...
 
static Vector2 Transform (Vector2 position, Matrix matrix)
 Creates a new Vector2 that contains a transformation of 2d-vector by the specified Matrix. More...
 
static void Transform (ref Vector2 position, ref Matrix matrix, out Vector2 result)
 Creates a new Vector2 that contains a transformation of 2d-vector by the specified Matrix. More...
 
static Vector2 Transform (Vector2 value, Quaternion rotation)
 Creates a new Vector2 that contains a transformation of 2d-vector by the specified Quaternion, representing the rotation. More...
 
static void Transform (ref Vector2 value, ref Quaternion rotation, out Vector2 result)
 Creates a new Vector2 that contains a transformation of 2d-vector by the specified Quaternion, representing the rotation. More...
 
static void Transform (Vector2[] sourceArray, int sourceIndex, ref Matrix matrix, Vector2[] destinationArray, int destinationIndex, int length)
 Apply transformation on vectors within array of Vector2 by the specified Matrix and places the results in an another array. More...
 
static void Transform (Vector2[] sourceArray, int sourceIndex, ref Quaternion rotation, Vector2[] destinationArray, int destinationIndex, int length)
 Apply transformation on vectors within array of Vector2 by the specified Quaternion and places the results in an another array. More...
 
static void Transform (Vector2[] sourceArray, ref Matrix matrix, Vector2[] destinationArray)
 Apply transformation on all vectors within array of Vector2 by the specified Matrix and places the results in an another array. More...
 
static void Transform (Vector2[] sourceArray, ref Quaternion rotation, Vector2[] destinationArray)
 Apply transformation on all vectors within array of Vector2 by the specified Quaternion and places the results in an another array. More...
 
static Vector2 TransformNormal (Vector2 normal, Matrix matrix)
 Creates a new Vector2 that contains a transformation of the specified normal by the specified Matrix. More...
 
static void TransformNormal (ref Vector2 normal, ref Matrix matrix, out Vector2 result)
 Creates a new Vector2 that contains a transformation of the specified normal by the specified Matrix. More...
 
static void TransformNormal (Vector2[] sourceArray, int sourceIndex, ref Matrix matrix, Vector2[] destinationArray, int destinationIndex, int length)
 Apply transformation on normals within array of Vector2 by the specified Matrix and places the results in an another array. More...
 
static void TransformNormal (Vector2[] sourceArray, ref Matrix matrix, Vector2[] destinationArray)
 Apply transformation on all normals within array of Vector2 by the specified Matrix and places the results in an another array. More...
 

Public Attributes

float X
 The x coordinate of this Vector2. More...
 
float Y
 The y coordinate of this Vector2. More...
 

Static Public Attributes

static readonly int SizeInBytes = System.Runtime.InteropServices.Marshal.SizeOf(new Vector2())
 Defines the size of the Vector2 struct in bytes. More...
 

Properties

static Vector2 Zero [get]
 Returns a Vector2 with components 0, 0. More...
 
static Vector2 One [get]
 Returns a Vector2 with components 1, 1. More...
 
static Vector2 UnitX [get]
 Returns a Vector2 with components 1, 0. More...
 
static Vector2 UnitY [get]
 Returns a Vector2 with components 0, 1. More...
 

Detailed Description

Describes a 2D-vector.

Definition at line 12 of file Vector2.cs.

Constructor & Destructor Documentation

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

Constructs a 2d vector with X and Y from two values.

Parameters
xThe x coordinate in 2d-space.
yThe y coordinate in 2d-space.

Definition at line 84 of file Vector2.cs.

Shift.Vector2.Vector2 ( float  value)
inline

Constructs a 2d vector with X and Y set to the same value.

Parameters
valueThe x and y coordinates in 2d-space.

Definition at line 94 of file Vector2.cs.

Member Function Documentation

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

Performs vector addition on value1 and value2 .

Parameters
value1The first vector to add.
value2The second vector to add.
Returns
The result of the vector addition.

Definition at line 232 of file Vector2.cs.

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

Performs vector addition on value1 and value2 , storing the result of the addition in result .

Parameters
value1The first vector to add.
value2The second vector to add.
resultThe result of the vector addition.

Definition at line 247 of file Vector2.cs.

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

Creates a new Vector2 that contains the cartesian coordinates of a vector specified in barycentric coordinates and relative to 2d-triangle.

Parameters
value1The first vector of 2d-triangle.
value2The second vector of 2d-triangle.
value3The third vector of 2d-triangle.
amount1Barycentric scalar b2 which represents a weighting factor towards second vector of 2d-triangle.
amount2Barycentric scalar b3 which represents a weighting factor towards third vector of 2d-triangle.
Returns
The cartesian translation of barycentric coordinates.

Definition at line 262 of file Vector2.cs.

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

Creates a new Vector2 that contains the cartesian coordinates of a vector specified in barycentric coordinates and relative to 2d-triangle.

Parameters
value1The first vector of 2d-triangle.
value2The second vector of 2d-triangle.
value3The third vector of 2d-triangle.
amount1Barycentric scalar b2 which represents a weighting factor towards second vector of 2d-triangle.
amount2Barycentric scalar b3 which represents a weighting factor towards third vector of 2d-triangle.
resultThe cartesian translation of barycentric coordinates as an output parameter.

Definition at line 278 of file Vector2.cs.

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

Creates a new Vector2 that contains CatmullRom interpolation of the specified vectors.

Parameters
value1The first vector in interpolation.
value2The second vector in interpolation.
value3The third vector in interpolation.
value4The fourth vector in interpolation.
amountWeighting factor.
Returns
The result of CatmullRom interpolation.

Definition at line 293 of file Vector2.cs.

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

Creates a new Vector2 that contains CatmullRom interpolation of the specified vectors.

Parameters
value1The first vector in interpolation.
value2The second vector in interpolation.
value3The third vector in interpolation.
value4The fourth vector in interpolation.
amountWeighting factor.
resultThe result of CatmullRom interpolation as an output parameter.

Definition at line 309 of file Vector2.cs.

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

Clamps the specified value within a range.

Parameters
value1The value to clamp.
minThe min value.
maxThe max value.
Returns
The clamped value.

Definition at line 322 of file Vector2.cs.

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

Clamps the specified value within a range.

Parameters
value1The value to clamp.
minThe min value.
maxThe max value.
resultThe clamped value as an output parameter.

Definition at line 336 of file Vector2.cs.

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

Returns the distance between two vectors.

Parameters
value1The first vector.
value2The second vector.
Returns
The distance between two vectors.

Definition at line 348 of file Vector2.cs.

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

Returns the distance between two vectors.

Parameters
value1The first vector.
value2The second vector.
resultThe distance between two vectors as an output parameter.

Definition at line 360 of file Vector2.cs.

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

Returns the squared distance between two vectors.

Parameters
value1The first vector.
value2The second vector.
Returns
The squared distance between two vectors.

Definition at line 372 of file Vector2.cs.

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

Returns the squared distance between two vectors.

Parameters
value1The first vector.
value2The second vector.
resultThe squared distance between two vectors as an output parameter.

Definition at line 384 of file Vector2.cs.

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

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

Parameters
value1Source Vector2.
value2Divisor Vector2.
Returns
The result of dividing the vectors.

Definition at line 396 of file Vector2.cs.

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

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

Parameters
value1Source Vector2.
value2Divisor Vector2.
resultThe result of dividing the vectors as an output parameter.

Definition at line 409 of file Vector2.cs.

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

Divides the components of a Vector2 by a scalar.

Parameters
value1Source Vector2.
dividerDivisor scalar.
Returns
The result of dividing a vector by a scalar.

Definition at line 421 of file Vector2.cs.

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

Divides the components of a Vector2 by a scalar.

Parameters
value1Source Vector2.
dividerDivisor scalar.
resultThe result of dividing a vector by a scalar as an output parameter.

Definition at line 435 of file Vector2.cs.

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

Returns a dot product of two vectors.

Parameters
value1The first vector.
value2The second vector.
Returns
The dot product of two vectors.

Definition at line 448 of file Vector2.cs.

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

Returns a dot product of two vectors.

Parameters
value1The first vector.
value2The second vector.
resultThe dot product of two vectors as an output parameter.

Definition at line 459 of file Vector2.cs.

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

Compares whether current instance is equal to specified Object.

Parameters
objThe Object to compare.
Returns
true if the instances are equal; false otherwise.

Definition at line 469 of file Vector2.cs.

bool Shift.Vector2.Equals ( Vector2  other)
inline

Compares whether current instance is equal to specified Vector2.

Parameters
otherThe Vector2 to compare.
Returns
true if the instances are equal; false otherwise.

Definition at line 484 of file Vector2.cs.

override int Shift.Vector2.GetHashCode ( )
inline

Gets the hash code of this Vector2.

Returns
Hash code of this Vector2.

Definition at line 493 of file Vector2.cs.

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

Creates a new Vector2 that contains hermite spline interpolation.

Parameters
value1The first position vector.
tangent1The first tangent vector.
value2The second position vector.
tangent2The second tangent vector.
amountWeighting factor.
Returns
The hermite spline interpolation vector.

Definition at line 507 of file Vector2.cs.

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

Creates a new Vector2 that contains hermite spline interpolation.

Parameters
value1The first position vector.
tangent1The first tangent vector.
value2The second position vector.
tangent2The second tangent vector.
amountWeighting factor.
resultThe hermite spline interpolation vector as an output parameter.

Definition at line 521 of file Vector2.cs.

float Shift.Vector2.Length ( )
inline

Returns the length of this Vector2.

Returns
The length of this Vector2.

Definition at line 531 of file Vector2.cs.

float Shift.Vector2.LengthSquared ( )
inline

Returns the squared length of this Vector2.

Returns
The squared length of this Vector2.

Definition at line 540 of file Vector2.cs.

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

Creates a new Vector2 that contains linear interpolation of the specified vectors.

Parameters
value1The first vector.
value2The second vector.
amountWeighting value(between 0.0 and 1.0).
Returns
The result of linear interpolation of the specified vectors.

Definition at line 552 of file Vector2.cs.

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

Creates a new Vector2 that contains linear interpolation of the specified vectors.

Parameters
value1The first vector.
value2The second vector.
amountWeighting value(between 0.0 and 1.0).
resultThe result of linear interpolation of the specified vectors as an output parameter.

Definition at line 566 of file Vector2.cs.

static Vector2 Shift.Vector2.LerpPrecise ( Vector2  value1,
Vector2  value2,
float  amount 
)
inlinestatic

Creates a new Vector2 that contains linear interpolation of the specified vectors. Uses MathHelper.LerpPrecise on MathHelper for the interpolation. Less efficient but more precise compared to Vector2.Lerp(Vector2, Vector2, float). See remarks section of MathHelper.LerpPrecise on MathHelper for more info.

Parameters
value1The first vector.
value2The second vector.
amountWeighting value(between 0.0 and 1.0).
Returns
The result of linear interpolation of the specified vectors.

Definition at line 582 of file Vector2.cs.

static void Shift.Vector2.LerpPrecise ( ref Vector2  value1,
ref Vector2  value2,
float  amount,
out Vector2  result 
)
inlinestatic

Creates a new Vector2 that contains linear interpolation of the specified vectors. Uses MathHelper.LerpPrecise on MathHelper for the interpolation. Less efficient but more precise compared to Vector2.Lerp(ref Vector2, ref Vector2, float, out Vector2). See remarks section of MathHelper.LerpPrecise on MathHelper for more info.

Parameters
value1The first vector.
value2The second vector.
amountWeighting value(between 0.0 and 1.0).
resultThe result of linear interpolation of the specified vectors as an output parameter.

Definition at line 599 of file Vector2.cs.

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

Creates a new Vector2 that contains a maximal values from the two vectors.

Parameters
value1The first vector.
value2The second vector.
Returns
The Vector2 with maximal values from the two vectors.

Definition at line 611 of file Vector2.cs.

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

Creates a new Vector2 that contains a maximal values from the two vectors.

Parameters
value1The first vector.
value2The second vector.
resultThe Vector2 with maximal values from the two vectors as an output parameter.

Definition at line 623 of file Vector2.cs.

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

Creates a new Vector2 that contains a minimal values from the two vectors.

Parameters
value1The first vector.
value2The second vector.
Returns
The Vector2 with minimal values from the two vectors.

Definition at line 635 of file Vector2.cs.

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

Creates a new Vector2 that contains a minimal values from the two vectors.

Parameters
value1The first vector.
value2The second vector.
resultThe Vector2 with minimal values from the two vectors as an output parameter.

Definition at line 647 of file Vector2.cs.

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

Creates a new Vector2 that contains a multiplication of two vectors.

Parameters
value1Source Vector2.
value2Source Vector2.
Returns
The result of the vector multiplication.

Definition at line 659 of file Vector2.cs.

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

Creates a new Vector2 that contains a multiplication of two vectors.

Parameters
value1Source Vector2.
value2Source Vector2.
resultThe result of the vector multiplication as an output parameter.

Definition at line 672 of file Vector2.cs.

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

Creates a new Vector2 that contains a multiplication of Vector2 and a scalar.

Parameters
value1Source Vector2.
scaleFactorScalar value.
Returns
The result of the vector multiplication with a scalar.

Definition at line 684 of file Vector2.cs.

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

Creates a new Vector2 that contains a multiplication of Vector2 and a scalar.

Parameters
value1Source Vector2.
scaleFactorScalar value.
resultThe result of the multiplication with a scalar as an output parameter.

Definition at line 697 of file Vector2.cs.

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

Creates a new Vector2 that contains the specified vector inversion.

Parameters
valueSource Vector2.
Returns
The result of the vector inversion.

Definition at line 708 of file Vector2.cs.

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

Creates a new Vector2 that contains the specified vector inversion.

Parameters
valueSource Vector2.
resultThe result of the vector inversion as an output parameter.

Definition at line 720 of file Vector2.cs.

void Shift.Vector2.Normalize ( )
inline

Turns this Vector2 to a unit vector with the same direction.

Definition at line 729 of file Vector2.cs.

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

Creates a new Vector2 that contains a normalized values from another vector.

Parameters
valueSource Vector2.
Returns
Unit vector.

Definition at line 741 of file Vector2.cs.

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

Creates a new Vector2 that contains a normalized values from another vector.

Parameters
valueSource Vector2.
resultUnit vector as an output parameter.

Definition at line 754 of file Vector2.cs.

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

Compares whether two Vector2 instances are not equal.

Parameters
value1Vector2 instance on the left of the not equal sign.
value2Vector2 instance on the right of the not equal sign.
Returns
true if the instances are not equal; false otherwise.

Definition at line 221 of file Vector2.cs.

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

Multiplies the components of two vectors by each other.

Parameters
value1Source Vector2 on the left of the mul sign.
value2Source Vector2 on the right of the mul sign.
Returns
Result of the vector multiplication.

Definition at line 144 of file Vector2.cs.

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

Multiplies the components of vector by a scalar.

Parameters
valueSource Vector2 on the left of the mul sign.
scaleFactorScalar value on the right of the mul sign.
Returns
Result of the vector multiplication with a scalar.

Definition at line 157 of file Vector2.cs.

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

Multiplies the components of vector by a scalar.

Parameters
scaleFactorScalar value on the left of the mul sign.
valueSource Vector2 on the right of the mul sign.
Returns
Result of the vector multiplication with a scalar.

Definition at line 170 of file Vector2.cs.

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

Adds two vectors.

Parameters
value1Source Vector2 on the left of the add sign.
value2Source Vector2 on the right of the add sign.
Returns
Sum of the vectors.

Definition at line 118 of file Vector2.cs.

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

Inverts values in the specified Vector2.

Parameters
valueSource Vector2 on the right of the sub sign.
Returns
Result of the inversion.

Definition at line 105 of file Vector2.cs.

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

Subtracts a Vector2 from a Vector2.

Parameters
value1Source Vector2 on the left of the sub sign.
value2Source Vector2 on the right of the sub sign.
Returns
Result of the vector subtraction.

Definition at line 131 of file Vector2.cs.

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

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

Parameters
value1Source Vector2 on the left of the div sign.
value2Divisor Vector2 on the right of the div sign.
Returns
The result of dividing the vectors.

Definition at line 183 of file Vector2.cs.

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

Divides the components of a Vector2 by a scalar.

Parameters
value1Source Vector2 on the left of the div sign.
dividerDivisor scalar on the right of the div sign.
Returns
The result of dividing a vector by a scalar.

Definition at line 196 of file Vector2.cs.

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

Compares whether two Vector2 instances are equal.

Parameters
value1Vector2 instance on the left of the equal sign.
value2Vector2 instance on the right of the equal sign.
Returns
true if the instances are equal; false otherwise.

Definition at line 210 of file Vector2.cs.

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

Creates a new Vector2 that contains reflect vector of the given vector and normal.

Parameters
vectorSource Vector2.
normalReflection normal.
Returns
Reflected vector.

Definition at line 767 of file Vector2.cs.

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

Creates a new Vector2 that contains reflect vector of the given vector and normal.

Parameters
vectorSource Vector2.
normalReflection normal.
resultReflected vector as an output parameter.

Definition at line 782 of file Vector2.cs.

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

Creates a new Vector2 that contains cubic interpolation of the specified vectors.

Parameters
value1Source Vector2.
value2Source Vector2.
amountWeighting value.
Returns
Cubic interpolation of the specified vectors.

Definition at line 796 of file Vector2.cs.

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

Creates a new Vector2 that contains cubic interpolation of the specified vectors.

Parameters
value1Source Vector2.
value2Source Vector2.
amountWeighting value.
resultCubic interpolation of the specified vectors as an output parameter.

Definition at line 810 of file Vector2.cs.

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

Creates a new Vector2 that contains subtraction of on Vector2 from a another.

Parameters
value1Source Vector2.
value2Source Vector2.
Returns
The result of the vector subtraction.

Definition at line 822 of file Vector2.cs.

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

Creates a new Vector2 that contains subtraction of on Vector2 from a another.

Parameters
value1Source Vector2.
value2Source Vector2.
resultThe result of the vector subtraction as an output parameter.

Definition at line 835 of file Vector2.cs.

Point Shift.Vector2.ToPoint ( )
inline

Gets a Point representation for this object.

Returns
A Point representation for this object.

Definition at line 855 of file Vector2.cs.

override string Shift.Vector2.ToString ( )
inline

Returns a String representation of this Vector2 in the format: {X:[X] Y:[Y]}

Returns
A String representation of this Vector2.

Definition at line 846 of file Vector2.cs.

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

Creates a new Vector2 that contains a transformation of 2d-vector by the specified Matrix.

Parameters
positionSource Vector2.
matrixThe transformation Matrix.
Returns
Transformed Vector2.

Definition at line 866 of file Vector2.cs.

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

Creates a new Vector2 that contains a transformation of 2d-vector by the specified Matrix.

Parameters
positionSource Vector2.
matrixThe transformation Matrix.
resultTransformed Vector2 as an output parameter.

Definition at line 877 of file Vector2.cs.

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

Creates a new Vector2 that contains a transformation of 2d-vector by the specified Quaternion, representing the rotation.

Parameters
valueSource Vector2.
rotationThe Quaternion which contains rotation transformation.
Returns
Transformed Vector2.

Definition at line 891 of file Vector2.cs.

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

Creates a new Vector2 that contains a transformation of 2d-vector by the specified Quaternion, representing the rotation.

Parameters
valueSource Vector2.
rotationThe Quaternion which contains rotation transformation.
resultTransformed Vector2 as an output parameter.

Definition at line 903 of file Vector2.cs.

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

Apply transformation on vectors within array of Vector2 by the specified Matrix and places the results in an another array.

Parameters
sourceArraySource array.
sourceIndexThe starting index of transformation in the source array.
matrixThe transformation Matrix.
destinationArrayDestination array.
destinationIndexThe starting index in the destination array, where the first Vector2 should be written.
lengthThe number of vectors to be transformed.

Definition at line 927 of file Vector2.cs.

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

Apply transformation on vectors within array of Vector2 by the specified Quaternion and places the results in an another array.

Parameters
sourceArraySource array.
sourceIndexThe starting index of transformation in the source array.
rotationThe Quaternion which contains rotation transformation.
destinationArrayDestination array.
destinationIndexThe starting index in the destination array, where the first Vector2 should be written.
lengthThe number of vectors to be transformed.

Definition at line 964 of file Vector2.cs.

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

Apply transformation on all vectors within array of Vector2 by the specified Matrix and places the results in an another array.

Parameters
sourceArraySource array.
matrixThe transformation Matrix.
destinationArrayDestination array.

Definition at line 1003 of file Vector2.cs.

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

Apply transformation on all vectors within array of Vector2 by the specified Quaternion and places the results in an another array.

Parameters
sourceArraySource array.
rotationThe Quaternion which contains rotation transformation.
destinationArrayDestination array.

Definition at line 1018 of file Vector2.cs.

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

Creates a new Vector2 that contains a transformation of the specified normal by the specified Matrix.

Parameters
normalSource Vector2 which represents a normal vector.
matrixThe transformation Matrix.
Returns
Transformed normal.

Definition at line 1033 of file Vector2.cs.

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

Creates a new Vector2 that contains a transformation of the specified normal by the specified Matrix.

Parameters
normalSource Vector2 which represents a normal vector.
matrixThe transformation Matrix.
resultTransformed normal as an output parameter.

Definition at line 1044 of file Vector2.cs.

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

Apply transformation on normals within array of Vector2 by the specified Matrix and places the results in an another array.

Parameters
sourceArraySource array.
sourceIndexThe starting index of transformation in the source array.
matrixThe transformation Matrix.
destinationArrayDestination array.
destinationIndexThe starting index in the destination array, where the first Vector2 should be written.
lengthThe number of normals to be transformed.

Definition at line 1062 of file Vector2.cs.

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

Apply transformation on all normals within array of Vector2 by the specified Matrix and places the results in an another array.

Parameters
sourceArraySource array.
matrixThe transformation Matrix.
destinationArrayDestination array.

Definition at line 1096 of file Vector2.cs.

Member Data Documentation

readonly int Shift.Vector2.SizeInBytes = System.Runtime.InteropServices.Marshal.SizeOf(new Vector2())
static

Defines the size of the Vector2 struct in bytes.

Definition at line 17 of file Vector2.cs.

float Shift.Vector2.X

The x coordinate of this Vector2.

Definition at line 60 of file Vector2.cs.

float Shift.Vector2.Y

The y coordinate of this Vector2.

Definition at line 66 of file Vector2.cs.

Property Documentation

Vector2 Shift.Vector2.One
staticget

Returns a Vector2 with components 1, 1.

Definition at line 36 of file Vector2.cs.

Vector2 Shift.Vector2.UnitX
staticget

Returns a Vector2 with components 1, 0.

Definition at line 44 of file Vector2.cs.

Vector2 Shift.Vector2.UnitY
staticget

Returns a Vector2 with components 0, 1.

Definition at line 52 of file Vector2.cs.

Vector2 Shift.Vector2.Zero
staticget

Returns a Vector2 with components 0, 0.

Definition at line 28 of file Vector2.cs.


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