VR-Link C# API Documentation
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Properties | Static Private Attributes
makVrl.Vector2 Struct Reference

Represents a 2D vector using two single-precision floating-point numbers. More...

+ Inheritance diagram for makVrl.Vector2:
+ Collaboration diagram for makVrl.Vector2:

Public Member Functions

 Vector2 (float value)
 Constructs a new instance.
 Vector2 (float x, float y)
 Constructs a new Vector2.
 Vector2 (Vector2 v)
 Constructs a new Vector2 from the given Vector2.
 Vector2 (Vector3f v)
 Constructs a new Vector2 from the given Vector3.
 Vector2 (Vector4 v)
 Constructs a new Vector2 from the given Vector4.
void Add (Vector2 right)
 Add the Vector passed as parameter to this instance.
void Add (ref Vector2 right)
 Add the Vector passed as parameter to this instance.
void Sub (Vector2 right)
 Subtract the Vector passed as parameter from this instance.
void Sub (ref Vector2 right)
 Subtract the Vector passed as parameter from this instance.
void Mult (float f)
 Multiply this instance by a scalar.
void Div (float f)
 Divide this instance by a scalar.
Vector2 Normalized ()
 Returns a copy of the Vector2 scaled to unit length.
void Normalize ()
 Scales the Vector2 to unit length.
void NormalizeFast ()
 Scales the Vector2 to approximately unit length.
void Scale (float sx, float sy)
 Scales the current Vector2 by the given amounts.
void Scale (Vector2 scale)
 Scales this instance by the given parameter.
void Scale (ref Vector2 scale)
 Scales this instance by the given parameter.
override string ToString ()
 Returns a System.String that represents the current Vector2.
override int GetHashCode ()
 Returns the hashcode for this instance.
override bool Equals (object obj)
 Indicates whether this instance and a specified object are equal.
bool Equals (Vector2 other)
 Indicates whether the current vector is equal to another vector.

Static Public Member Functions

static Vector2 Sub (Vector2 a, Vector2 b)
 Subtract one Vector from another
static void Sub (ref Vector2 a, ref Vector2 b, out Vector2 result)
 Subtract one Vector from another
static Vector2 Mult (Vector2 a, float f)
 Multiply a vector and a scalar
static void Mult (ref Vector2 a, float f, out Vector2 result)
 Multiply a vector and a scalar
static Vector2 Div (Vector2 a, float f)
 Divide a vector by a scalar
static void Div (ref Vector2 a, float f, out Vector2 result)
 Divide a vector by a scalar
static Vector2 Add (Vector2 a, Vector2 b)
 Adds two vectors.
static void Add (ref Vector2 a, ref Vector2 b, out Vector2 result)
 Adds two vectors.
static Vector2 Subtract (Vector2 a, Vector2 b)
 Subtract one Vector from another
static void Subtract (ref Vector2 a, ref Vector2 b, out Vector2 result)
 Subtract one Vector from another
static Vector2 Multiply (Vector2 vector, float scale)
 Multiplies a vector by a scalar.
static void Multiply (ref Vector2 vector, float scale, out Vector2 result)
 Multiplies a vector by a scalar.
static Vector2 Multiply (Vector2 vector, Vector2 scale)
 Multiplies a vector by the components a vector (scale).
static void Multiply (ref Vector2 vector, ref Vector2 scale, out Vector2 result)
 Multiplies a vector by the components of a vector (scale).
static Vector2 Divide (Vector2 vector, float scale)
 Divides a vector by a scalar.
static void Divide (ref Vector2 vector, float scale, out Vector2 result)
 Divides a vector by a scalar.
static Vector2 Divide (Vector2 vector, Vector2 scale)
 Divides a vector by the components of a vector (scale).
static void Divide (ref Vector2 vector, ref Vector2 scale, out Vector2 result)
 Divide a vector by the components of a vector (scale).
static Vector2 ComponentMin (Vector2 a, Vector2 b)
 Calculate the component-wise minimum of two vectors
static void ComponentMin (ref Vector2 a, ref Vector2 b, out Vector2 result)
 Calculate the component-wise minimum of two vectors
static Vector2 ComponentMax (Vector2 a, Vector2 b)
 Calculate the component-wise maximum of two vectors
static void ComponentMax (ref Vector2 a, ref Vector2 b, out Vector2 result)
 Calculate the component-wise maximum of two vectors
static Vector2 Min (Vector2 left, Vector2 right)
 Returns the Vector3 with the minimum magnitude
static Vector2 Max (Vector2 left, Vector2 right)
 Returns the Vector3 with the minimum magnitude
static Vector2 Clamp (Vector2 vec, Vector2 min, Vector2 max)
 Clamp a vector to the given minimum and maximum vectors
static void Clamp (ref Vector2 vec, ref Vector2 min, ref Vector2 max, out Vector2 result)
 Clamp a vector to the given minimum and maximum vectors
static Vector2 Normalize (Vector2 vec)
 Scale a vector to unit length
static void Normalize (ref Vector2 vec, out Vector2 result)
 Scale a vector to unit length
static Vector2 NormalizeFast (Vector2 vec)
 Scale a vector to approximately unit length
static void NormalizeFast (ref Vector2 vec, out Vector2 result)
 Scale a vector to approximately unit length
static float Dot (Vector2 left, Vector2 right)
 Calculate the dot (scalar) product of two vectors
static void Dot (ref Vector2 left, ref Vector2 right, out float result)
 Calculate the dot (scalar) product of two vectors
static float PerpDot (Vector2 left, Vector2 right)
 Calculate the perpendicular dot (scalar) product of two vectors
static void PerpDot (ref Vector2 left, ref Vector2 right, out float result)
 Calculate the perpendicular dot (scalar) product of two vectors
static Vector2 Lerp (Vector2 a, Vector2 b, float blend)
 Returns a new Vector that is the linear blend of the 2 given Vectors
static void Lerp (ref Vector2 a, ref Vector2 b, float blend, out Vector2 result)
 Returns a new Vector that is the linear blend of the 2 given Vectors
static Vector2 BaryCentric (Vector2 a, Vector2 b, Vector2 c, float u, float v)
 Interpolate 3 Vectors using Barycentric coordinates
static void BaryCentric (ref Vector2 a, ref Vector2 b, ref Vector2 c, float u, float v, out Vector2 result)
 Interpolate 3 Vectors using Barycentric coordinates
static Vector2 Transform (Vector2 vec, Quaternion quat)
 Transforms a vector by a quaternion rotation.
static void Transform (ref Vector2 vec, ref Quaternion quat, out Vector2 result)
 Transforms a vector by a quaternion rotation.
static Vector2 operator+ (Vector2 left, Vector2 right)
 Adds the specified instances.
static Vector2 operator- (Vector2 left, Vector2 right)
 Subtracts the specified instances.
static Vector2 operator- (Vector2 vec)
 Negates the specified instance.
static Vector2 operator* (Vector2 vec, float scale)
 Multiplies the specified instance by a scalar.
static Vector2 operator* (float scale, Vector2 vec)
 Multiplies the specified instance by a scalar.
static Vector2 operator/ (Vector2 vec, float scale)
 Divides the specified instance by a scalar.
static bool operator== (Vector2 left, Vector2 right)
 Compares the specified instances for equality.
static bool operator!= (Vector2 left, Vector2 right)
 Compares the specified instances for inequality.

Public Attributes

float X
 The X component of the Vector2.
float Y
 The Y component of the Vector2.

Static Public Attributes

static readonly Vector2 UnitX = new Vector2(1, 0)
 Defines a unit-length Vector2 that points towards the X-axis.
static readonly Vector2 UnitY = new Vector2(0, 1)
 Defines a unit-length Vector2 that points towards the Y-axis.
static readonly Vector2 Zero = new Vector2(0, 0)
 Defines a zero-length Vector2.
static readonly Vector2 One = new Vector2(1, 1)
 Defines an instance with all components set to 1.
static readonly int SizeInBytes = Marshal.SizeOf(new Vector2())
 Defines the size of the Vector2 struct in bytes.

Properties

float this[int index] [get, set]
 Gets or sets the value at the index of the Vector.
float Length [get]
 Gets the length (magnitude) of the vector.
float LengthFast [get]
 Gets an approximation of the vector length (magnitude).
float LengthSquared [get]
 Gets the square of the vector length (magnitude).
Vector2 PerpendicularRight [get]
 Gets the perpendicular vector on the right side of this vector.
Vector2 PerpendicularLeft [get]
 Gets the perpendicular vector on the left side of this vector.
Vector2 Yx [get, set]
 Gets or sets an makVrl.Vector2 with the Y and X components of this instance.

Static Private Attributes

static string listSeparator = System.Globalization.CultureInfo.CurrentCulture.TextInfo.ListSeparator

Detailed Description

Represents a 2D vector using two single-precision floating-point numbers.

The Vector2 structure is suitable for interoperation with unmanaged code requiring two consecutive floats.

Constructor & Destructor Documentation

makVrl.Vector2.Vector2 ( float  value)
inline

Constructs a new instance.

Parameters
valueThe value that will initialize this instance.

References makVrl.Vector2.X, and makVrl.Vector2.Y.

Referenced by makVrl.Vector2.Add(), makVrl.Vector2.Divide(), makVrl.Vector2.Multiply(), makVrl.Vector2.Subtract(), and makVrl.Vector2.Transform().

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

Constructs a new Vector2.

Parameters
xThe x coordinate of the net Vector2.
yThe y coordinate of the net Vector2.

References makVrl.Vector2.X, and makVrl.Vector2.Y.

makVrl.Vector2.Vector2 ( Vector2  v)
inline

Constructs a new Vector2 from the given Vector2.

Parameters
vThe Vector2 to copy components from.

References makVrl.Vector2.X, and makVrl.Vector2.Y.

makVrl.Vector2.Vector2 ( Vector3f  v)
inline

Constructs a new Vector2 from the given Vector3.

Parameters
vThe Vector3 to copy components from. Z is discarded.

References makVrl.Vector2.X, makVrl.Vector3f.X, makVrl.Vector2.Y, and makVrl.Vector3f.Y.

makVrl.Vector2.Vector2 ( Vector4  v)
inline

Constructs a new Vector2 from the given Vector4.

Parameters
vThe Vector4 to copy components from. Z and W are discarded.

References makVrl.Vector4.X, makVrl.Vector2.X, makVrl.Vector4.Y, and makVrl.Vector2.Y.

Member Function Documentation

void makVrl.Vector2.Add ( Vector2  right)
inline

Add the Vector passed as parameter to this instance.

Parameters
rightRight operand. This parameter is only read from.

References makVrl.Vector2.X, and makVrl.Vector2.Y.

Referenced by makVrl.Vector2.Add(), and makVrl.Vector2.BaryCentric().

void makVrl.Vector2.Add ( ref Vector2  right)
inline

Add the Vector passed as parameter to this instance.

Parameters
rightRight operand. This parameter is only read from.

References makVrl.Vector2.X, and makVrl.Vector2.Y.

static Vector2 makVrl.Vector2.Add ( Vector2  a,
Vector2  b 
)
inlinestatic

Adds two vectors.

Parameters
aLeft operand.
bRight operand.
Returns
Result of operation.

References makVrl.Vector2.Add().

static void makVrl.Vector2.Add ( ref Vector2  a,
ref Vector2  b,
out Vector2  result 
)
inlinestatic

Adds two vectors.

Parameters
aLeft operand.
bRight operand.
resultResult of operation.

References makVrl.Vector2.Vector2().

static Vector2 makVrl.Vector2.BaryCentric ( Vector2  a,
Vector2  b,
Vector2  c,
float  u,
float  v 
)
inlinestatic

Interpolate 3 Vectors using Barycentric coordinates

Parameters
aFirst input Vector
bSecond input Vector
cThird input Vector
uFirst Barycentric Coordinate
vSecond Barycentric Coordinate
Returns
a when u=v=0, b when u=1,v=0, c when u=0,v=1, and a linear combination of a,b,c otherwise
static void makVrl.Vector2.BaryCentric ( ref Vector2  a,
ref Vector2  b,
ref Vector2  c,
float  u,
float  v,
out Vector2  result 
)
inlinestatic

Interpolate 3 Vectors using Barycentric coordinates

Parameters
aFirst input Vector.
bSecond input Vector.
cThird input Vector.
uFirst Barycentric Coordinate.
vSecond Barycentric Coordinate.
resultOutput Vector. a when u=v=0, b when u=1,v=0, c when u=0,v=1, and a linear combination of a,b,c otherwise

References makVrl.Vector2.Add(), makVrl.Vector2.Multiply(), and makVrl.Vector2.Subtract().

static Vector2 makVrl.Vector2.Clamp ( Vector2  vec,
Vector2  min,
Vector2  max 
)
inlinestatic

Clamp a vector to the given minimum and maximum vectors

Parameters
vecInput vector
minMinimum vector
maxMaximum vector
Returns
The clamped vector

References makVrl.Vector2.X, and makVrl.Vector2.Y.

static void makVrl.Vector2.Clamp ( ref Vector2  vec,
ref Vector2  min,
ref Vector2  max,
out Vector2  result 
)
inlinestatic

Clamp a vector to the given minimum and maximum vectors

Parameters
vecInput vector
minMinimum vector
maxMaximum vector
resultThe clamped vector

References makVrl.Vector2.X.

static Vector2 makVrl.Vector2.ComponentMax ( Vector2  a,
Vector2  b 
)
inlinestatic

Calculate the component-wise maximum of two vectors

Parameters
aFirst operand
bSecond operand
Returns
The component-wise maximum

References makVrl.Vector2.X, and makVrl.Vector2.Y.

static void makVrl.Vector2.ComponentMax ( ref Vector2  a,
ref Vector2  b,
out Vector2  result 
)
inlinestatic

Calculate the component-wise maximum of two vectors

Parameters
aFirst operand
bSecond operand
resultThe component-wise maximum

References makVrl.Vector2.X.

static Vector2 makVrl.Vector2.ComponentMin ( Vector2  a,
Vector2  b 
)
inlinestatic

Calculate the component-wise minimum of two vectors

Parameters
aFirst operand
bSecond operand
Returns
The component-wise minimum

References makVrl.Vector2.X, and makVrl.Vector2.Y.

static void makVrl.Vector2.ComponentMin ( ref Vector2  a,
ref Vector2  b,
out Vector2  result 
)
inlinestatic

Calculate the component-wise minimum of two vectors

Parameters
aFirst operand
bSecond operand
resultThe component-wise minimum

References makVrl.Vector2.X.

void makVrl.Vector2.Div ( float  f)
inline

Divide this instance by a scalar.

Parameters
fScalar operand.

References makVrl.Vector2.X, and makVrl.Vector2.Y.

static Vector2 makVrl.Vector2.Div ( Vector2  a,
float  f 
)
inlinestatic

Divide a vector by a scalar

Parameters
aVector operand
fScalar operand
Returns
Result of the division

References makVrl.Vector2.X, and makVrl.Vector2.Y.

static void makVrl.Vector2.Div ( ref Vector2  a,
float  f,
out Vector2  result 
)
inlinestatic

Divide a vector by a scalar

Parameters
aVector operand
fScalar operand
resultResult of the division
static Vector2 makVrl.Vector2.Divide ( Vector2  vector,
float  scale 
)
inlinestatic

Divides a vector by a scalar.

Parameters
vectorLeft operand.
scaleRight operand.
Returns
Result of the operation.

Referenced by makVrl.Vector2.Divide().

static void makVrl.Vector2.Divide ( ref Vector2  vector,
float  scale,
out Vector2  result 
)
inlinestatic

Divides a vector by a scalar.

Parameters
vectorLeft operand.
scaleRight operand.
resultResult of the operation.

References makVrl.Vector2.Multiply().

static Vector2 makVrl.Vector2.Divide ( Vector2  vector,
Vector2  scale 
)
inlinestatic

Divides a vector by the components of a vector (scale).

Parameters
vectorLeft operand.
scaleRight operand.
Returns
Result of the operation.

References makVrl.Vector2.Divide().

static void makVrl.Vector2.Divide ( ref Vector2  vector,
ref Vector2  scale,
out Vector2  result 
)
inlinestatic

Divide a vector by the components of a vector (scale).

Parameters
vectorLeft operand.
scaleRight operand.
resultResult of the operation.

References makVrl.Vector2.Vector2().

static float makVrl.Vector2.Dot ( Vector2  left,
Vector2  right 
)
inlinestatic

Calculate the dot (scalar) product of two vectors

Parameters
leftFirst operand
rightSecond operand
Returns
The dot product of the two inputs

References makVrl.Vector2.X, and makVrl.Vector2.Y.

static void makVrl.Vector2.Dot ( ref Vector2  left,
ref Vector2  right,
out float  result 
)
inlinestatic

Calculate the dot (scalar) product of two vectors

Parameters
leftFirst operand
rightSecond operand
resultThe dot product of the two inputs
override bool makVrl.Vector2.Equals ( object  obj)
inline

Indicates whether this instance and a specified object are equal.

Parameters
objThe object to compare to.
Returns
True if the instances are equal; false otherwise.

Referenced by makVrl.Vector2.operator!=(), and makVrl.Vector2.operator==().

bool makVrl.Vector2.Equals ( Vector2  other)
inline

Indicates whether the current vector is equal to another vector.

Parameters
otherA vector to compare with this vector.
Returns
true if the current vector is equal to the vector parameter; otherwise, false.

References makVrl.Vector2.X, and makVrl.Vector2.Y.

override int makVrl.Vector2.GetHashCode ( )
inline

Returns the hashcode for this instance.

Returns
A System.Int32 containing the unique hashcode for this instance.

References makVrl.Vector2.X, and makVrl.Vector2.Y.

static Vector2 makVrl.Vector2.Lerp ( Vector2  a,
Vector2  b,
float  blend 
)
inlinestatic

Returns a new Vector that is the linear blend of the 2 given Vectors

Parameters
aFirst input vector
bSecond input vector
blendThe blend factor. a when blend=0, b when blend=1.
Returns
a when blend=0, b when blend=1, and a linear combination otherwise

References makVrl.Vector2.X, and makVrl.Vector2.Y.

static void makVrl.Vector2.Lerp ( ref Vector2  a,
ref Vector2  b,
float  blend,
out Vector2  result 
)
inlinestatic

Returns a new Vector that is the linear blend of the 2 given Vectors

Parameters
aFirst input vector
bSecond input vector
blendThe blend factor. a when blend=0, b when blend=1.
resulta when blend=0, b when blend=1, and a linear combination otherwise

References makVrl.Vector2.X.

static Vector2 makVrl.Vector2.Max ( Vector2  left,
Vector2  right 
)
inlinestatic

Returns the Vector3 with the minimum magnitude

Parameters
leftLeft operand
rightRight operand
Returns
The minimum Vector3

References makVrl.Vector2.LengthSquared.

static Vector2 makVrl.Vector2.Min ( Vector2  left,
Vector2  right 
)
inlinestatic

Returns the Vector3 with the minimum magnitude

Parameters
leftLeft operand
rightRight operand
Returns
The minimum Vector3

References makVrl.Vector2.LengthSquared.

void makVrl.Vector2.Mult ( float  f)
inline

Multiply this instance by a scalar.

Parameters
fScalar operand.

References makVrl.Vector2.X, and makVrl.Vector2.Y.

static Vector2 makVrl.Vector2.Mult ( Vector2  a,
float  f 
)
inlinestatic

Multiply a vector and a scalar

Parameters
aVector operand
fScalar operand
Returns
Result of the multiplication

References makVrl.Vector2.X, and makVrl.Vector2.Y.

static void makVrl.Vector2.Mult ( ref Vector2  a,
float  f,
out Vector2  result 
)
inlinestatic

Multiply a vector and a scalar

Parameters
aVector operand
fScalar operand
resultResult of the multiplication
static Vector2 makVrl.Vector2.Multiply ( Vector2  vector,
float  scale 
)
inlinestatic

Multiplies a vector by a scalar.

Parameters
vectorLeft operand.
scaleRight operand.
Returns
Result of the operation.

Referenced by makVrl.Vector2.BaryCentric(), makVrl.Vector2.Divide(), and makVrl.Vector2.Multiply().

static void makVrl.Vector2.Multiply ( ref Vector2  vector,
float  scale,
out Vector2  result 
)
inlinestatic

Multiplies a vector by a scalar.

Parameters
vectorLeft operand.
scaleRight operand.
resultResult of the operation.

References makVrl.Vector2.Vector2().

static Vector2 makVrl.Vector2.Multiply ( Vector2  vector,
Vector2  scale 
)
inlinestatic

Multiplies a vector by the components a vector (scale).

Parameters
vectorLeft operand.
scaleRight operand.
Returns
Result of the operation.

References makVrl.Vector2.Multiply().

static void makVrl.Vector2.Multiply ( ref Vector2  vector,
ref Vector2  scale,
out Vector2  result 
)
inlinestatic

Multiplies a vector by the components of a vector (scale).

Parameters
vectorLeft operand.
scaleRight operand.
resultResult of the operation.

References makVrl.Vector2.Vector2().

void makVrl.Vector2.Normalize ( )
inline

Scales the Vector2 to unit length.

References makVrl.Vector2.Length, makVrl.Vector2.X, and makVrl.Vector2.Y.

Referenced by makVrl.Vector2.Normalized().

static Vector2 makVrl.Vector2.Normalize ( Vector2  vec)
inlinestatic

Scale a vector to unit length

Parameters
vecThe input vector
Returns
The normalized vector

References makVrl.Vector2.Length, makVrl.Vector2.X, and makVrl.Vector2.Y.

static void makVrl.Vector2.Normalize ( ref Vector2  vec,
out Vector2  result 
)
inlinestatic

Scale a vector to unit length

Parameters
vecThe input vector
resultThe normalized vector
Vector2 makVrl.Vector2.Normalized ( )
inline

Returns a copy of the Vector2 scaled to unit length.

Returns

References makVrl.Vector2.Normalize().

void makVrl.Vector2.NormalizeFast ( )
inline

Scales the Vector2 to approximately unit length.

References makVrl.MathHelper.InverseSqrtFast(), makVrl.Vector2.X, and makVrl.Vector2.Y.

static Vector2 makVrl.Vector2.NormalizeFast ( Vector2  vec)
inlinestatic

Scale a vector to approximately unit length

Parameters
vecThe input vector
Returns
The normalized vector

References makVrl.MathHelper.InverseSqrtFast(), makVrl.Vector2.X, and makVrl.Vector2.Y.

static void makVrl.Vector2.NormalizeFast ( ref Vector2  vec,
out Vector2  result 
)
inlinestatic

Scale a vector to approximately unit length

Parameters
vecThe input vector
resultThe normalized vector

References makVrl.MathHelper.InverseSqrtFast().

static bool makVrl.Vector2.operator!= ( Vector2  left,
Vector2  right 
)
inlinestatic

Compares the specified instances for inequality.

Parameters
leftLeft operand.
rightRight operand.
Returns
True if both instances are not equal; false otherwise.

References makVrl.Vector2.Equals().

static Vector2 makVrl.Vector2.operator* ( Vector2  vec,
float  scale 
)
inlinestatic

Multiplies the specified instance by a scalar.

Parameters
vecLeft operand.
scaleRight operand.
Returns
Result of multiplication.

References makVrl.Vector2.X, and makVrl.Vector2.Y.

static Vector2 makVrl.Vector2.operator* ( float  scale,
Vector2  vec 
)
inlinestatic

Multiplies the specified instance by a scalar.

Parameters
scaleLeft operand.
vecRight operand.
Returns
Result of multiplication.

References makVrl.Vector2.X, and makVrl.Vector2.Y.

static Vector2 makVrl.Vector2.operator+ ( Vector2  left,
Vector2  right 
)
inlinestatic

Adds the specified instances.

Parameters
leftLeft operand.
rightRight operand.
Returns
Result of addition.

References makVrl.Vector2.X, and makVrl.Vector2.Y.

static Vector2 makVrl.Vector2.operator- ( Vector2  left,
Vector2  right 
)
inlinestatic

Subtracts the specified instances.

Parameters
leftLeft operand.
rightRight operand.
Returns
Result of subtraction.

References makVrl.Vector2.X, and makVrl.Vector2.Y.

static Vector2 makVrl.Vector2.operator- ( Vector2  vec)
inlinestatic

Negates the specified instance.

Parameters
vecOperand.
Returns
Result of negation.

References makVrl.Vector2.X, and makVrl.Vector2.Y.

static Vector2 makVrl.Vector2.operator/ ( Vector2  vec,
float  scale 
)
inlinestatic

Divides the specified instance by a scalar.

Parameters
vecLeft operand
scaleRight operand
Returns
Result of the division.

References makVrl.Vector2.X, and makVrl.Vector2.Y.

static bool makVrl.Vector2.operator== ( Vector2  left,
Vector2  right 
)
inlinestatic

Compares the specified instances for equality.

Parameters
leftLeft operand.
rightRight operand.
Returns
True if both instances are equal; false otherwise.

References makVrl.Vector2.Equals().

static float makVrl.Vector2.PerpDot ( Vector2  left,
Vector2  right 
)
inlinestatic

Calculate the perpendicular dot (scalar) product of two vectors

Parameters
leftFirst operand
rightSecond operand
Returns
The perpendicular dot product of the two inputs

References makVrl.Vector2.X, and makVrl.Vector2.Y.

static void makVrl.Vector2.PerpDot ( ref Vector2  left,
ref Vector2  right,
out float  result 
)
inlinestatic

Calculate the perpendicular dot (scalar) product of two vectors

Parameters
leftFirst operand
rightSecond operand
resultThe perpendicular dot product of the two inputs
void makVrl.Vector2.Scale ( float  sx,
float  sy 
)
inline

Scales the current Vector2 by the given amounts.

Parameters
sxThe scale of the X component.
syThe scale of the Y component.

References makVrl.Vector2.X, and makVrl.Vector2.Y.

void makVrl.Vector2.Scale ( Vector2  scale)
inline

Scales this instance by the given parameter.

Parameters
scaleThe scaling of the individual components.

References makVrl.Vector2.X, and makVrl.Vector2.Y.

void makVrl.Vector2.Scale ( ref Vector2  scale)
inline

Scales this instance by the given parameter.

Parameters
scaleThe scaling of the individual components.

References makVrl.Vector2.X, and makVrl.Vector2.Y.

void makVrl.Vector2.Sub ( Vector2  right)
inline

Subtract the Vector passed as parameter from this instance.

Parameters
rightRight operand. This parameter is only read from.

References makVrl.Vector2.X, and makVrl.Vector2.Y.

void makVrl.Vector2.Sub ( ref Vector2  right)
inline

Subtract the Vector passed as parameter from this instance.

Parameters
rightRight operand. This parameter is only read from.

References makVrl.Vector2.X, and makVrl.Vector2.Y.

static Vector2 makVrl.Vector2.Sub ( Vector2  a,
Vector2  b 
)
inlinestatic

Subtract one Vector from another

Parameters
aFirst operand
bSecond operand
Returns
Result of subtraction

References makVrl.Vector2.X, and makVrl.Vector2.Y.

static void makVrl.Vector2.Sub ( ref Vector2  a,
ref Vector2  b,
out Vector2  result 
)
inlinestatic

Subtract one Vector from another

Parameters
aFirst operand
bSecond operand
resultResult of subtraction
static Vector2 makVrl.Vector2.Subtract ( Vector2  a,
Vector2  b 
)
inlinestatic

Subtract one Vector from another

Parameters
aFirst operand
bSecond operand
Returns
Result of subtraction

Referenced by makVrl.Vector2.BaryCentric().

static void makVrl.Vector2.Subtract ( ref Vector2  a,
ref Vector2  b,
out Vector2  result 
)
inlinestatic

Subtract one Vector from another

Parameters
aFirst operand
bSecond operand
resultResult of subtraction

References makVrl.Vector2.Vector2().

override string makVrl.Vector2.ToString ( )
inline

Returns a System.String that represents the current Vector2.

Returns

References makVrl.Vector2.listSeparator, makVrl.Vector2.X, and makVrl.Vector2.Y.

static Vector2 makVrl.Vector2.Transform ( Vector2  vec,
Quaternion  quat 
)
inlinestatic

Transforms a vector by a quaternion rotation.

Parameters
vecThe vector to transform.
quatThe quaternion to rotate the vector by.
Returns
The result of the operation.
static void makVrl.Vector2.Transform ( ref Vector2  vec,
ref Quaternion  quat,
out Vector2  result 
)
inlinestatic

Transforms a vector by a quaternion rotation.

Parameters
vecThe vector to transform.
quatThe quaternion to rotate the vector by.
resultThe result of the operation.

References makVrl.Quaternion.Invert(), makVrl.Quaternion.Multiply(), and makVrl.Vector2.Vector2().

Member Data Documentation

string makVrl.Vector2.listSeparator = System.Globalization.CultureInfo.CurrentCulture.TextInfo.ListSeparator
staticprivate

Referenced by makVrl.Vector2.ToString().

readonly Vector2 makVrl.Vector2.One = new Vector2(1, 1)
static

Defines an instance with all components set to 1.

readonly int makVrl.Vector2.SizeInBytes = Marshal.SizeOf(new Vector2())
static

Defines the size of the Vector2 struct in bytes.

readonly Vector2 makVrl.Vector2.UnitX = new Vector2(1, 0)
static

Defines a unit-length Vector2 that points towards the X-axis.

readonly Vector2 makVrl.Vector2.UnitY = new Vector2(0, 1)
static

Defines a unit-length Vector2 that points towards the Y-axis.

float makVrl.Vector2.X
float makVrl.Vector2.Y
readonly Vector2 makVrl.Vector2.Zero = new Vector2(0, 0)
static

Defines a zero-length Vector2.

Property Documentation

float makVrl.Vector2.Length
get

Gets the length (magnitude) of the vector.

LengthFast

See Also
LengthSquared

Referenced by makVrl.Vector2.Normalize().

float makVrl.Vector2.LengthFast
get

Gets an approximation of the vector length (magnitude).

This property uses an approximation of the square root function to calculate vector magnitude, with an upper error bound of 0.001.

Length

See Also
LengthSquared
float makVrl.Vector2.LengthSquared
get

Gets the square of the vector length (magnitude).

This property avoids the costly square root operation required by the Length property. This makes it more suitable for comparisons.

Length

See Also
LengthFast

Referenced by makVrl.Vector2.Max(), and makVrl.Vector2.Min().

Vector2 makVrl.Vector2.PerpendicularLeft
get

Gets the perpendicular vector on the left side of this vector.

Vector2 makVrl.Vector2.PerpendicularRight
get

Gets the perpendicular vector on the right side of this vector.

float makVrl.Vector2.this[int index]
getset

Gets or sets the value at the index of the Vector.

Vector2 makVrl.Vector2.Yx
getset

Gets or sets an makVrl.Vector2 with the Y and X components of this instance.


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

Document ID: Generated on Mon Jun 22 21:18:40 EDT 2020 from SVN revision 213785
Copyright © 2005-2018 MAK Technologies. All Rights Reserved (www.mak.com)