Mac Guides | Samples

MonoMac.OpenGL.Vector2 Structure

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

See Also: Vector2

Syntax

public struct Vector2 : IEquatable<Vector2>

Remarks

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

Requirements

Namespace: MonoMac.OpenGL
Assembly: XamMac (in XamMac.dll)
Assembly Versions: 0.0.0.0

The members of MonoMac.OpenGL.Vector2 are listed below.

See Also: ValueType

Public Constructors

Constructs a new Vector2 from the given Vector2.
Constructs a new Vector2 from the given Vector3.
Constructs a new Vector2 from the given Vector4.
Constructs a new instance.
Constructs a new Vector2.

Public Fields

static readonly
OneVector2. Defines an instance with all components set to 1.
static readonly
SizeInBytesInt32. Defines the size of the Vector2 struct in bytes.
static readonly
UnitXVector2. Defines a unit-length Vector2 that points towards the X-axis.
static readonly
UnitYVector2. Defines a unit-length Vector2 that points towards the Y-axis.
XSingle. The X component of the Vector2.
YSingle. The Y component of the Vector2.
static readonly
ZeroVector2. Defines a zero-length Vector2.

Public Properties

[read-only]
LengthSingle. Gets the length (magnitude) of the vector.
[read-only]
LengthFastSingle. Gets an approximation of the vector length (magnitude).
[read-only]
LengthSquaredSingle. Gets the square of the vector length (magnitude).
[read-only]
PerpendicularLeftVector2. Gets the perpendicular vector on the left side of this vector.
[read-only]
PerpendicularRightVector2. Gets the perpendicular vector on the right side of this vector.

Public Methods

Add(Vector2)
Add the Vector passed as parameter to this instance.
Add(ref Vector2)
Add the Vector passed as parameter to this instance.
static
Add(Vector2, Vector2) : Vector2
Adds two vectors.
static
Add(ref Vector2, ref Vector2, out Vector2)
Adds two vectors.
static
BaryCentric(Vector2, Vector2, Vector2, Single, Single) : Vector2
Interpolate 3 Vectors using Barycentric coordinates
static
BaryCentric(ref Vector2, ref Vector2, ref Vector2, Single, Single, out Vector2)
Interpolate 3 Vectors using Barycentric coordinates
static
Clamp(Vector2, Vector2, Vector2) : Vector2
Clamp a vector to the given minimum and maximum vectors
static
Clamp(ref Vector2, ref Vector2, ref Vector2, out Vector2)
Clamp a vector to the given minimum and maximum vectors
static
ComponentMax(Vector2, Vector2) : Vector2
Calculate the component-wise maximum of two vectors
static
ComponentMax(ref Vector2, ref Vector2, out Vector2)
Calculate the component-wise maximum of two vectors
static
ComponentMin(Vector2, Vector2) : Vector2
Calculate the component-wise minimum of two vectors
static
ComponentMin(ref Vector2, ref Vector2, out Vector2)
Calculate the component-wise minimum of two vectors
Div(Single)
Divide this instance by a scalar.
static
Div(Vector2, Single) : Vector2
Divide a vector by a scalar
static
Div(ref Vector2, Single, out Vector2)
Divide a vector by a scalar
static
Divide(Vector2, Vector2) : Vector2
Divides a vector by the components of a vector (scale).
static
Divide(Vector2, Single) : Vector2
Divides a vector by a scalar.
static
Divide(ref Vector2, ref Vector2, out Vector2)
Divide a vector by the components of a vector (scale).
static
Divide(ref Vector2, Single, out Vector2)
Divides a vector by a scalar.
static
Dot(Vector2, Vector2) : Single
Calculate the dot (scalar) product of two vectors
static
Dot(ref Vector2, ref Vector2, out Single)
Calculate the dot (scalar) product of two vectors
Equals(Vector2) : Boolean
Indicates whether the current vector is equal to another vector.
override
Equals(Object) : Boolean
Indicates whether this instance and a specified object are equal.
override
GetHashCode() : Int32
Returns the hashcode for this instance.
static
Lerp(Vector2, Vector2, Single) : Vector2
Returns a new Vector that is the linear blend of the 2 given Vectors
static
Lerp(ref Vector2, ref Vector2, Single, out Vector2)
Returns a new Vector that is the linear blend of the 2 given Vectors
static
Max(Vector2, Vector2) : Vector2
Returns the Vector3 with the minimum magnitude
static
Min(Vector2, Vector2) : Vector2
Returns the Vector3 with the minimum magnitude
Mult(Single)
Multiply this instance by a scalar.
static
Mult(Vector2, Single) : Vector2
Multiply a vector and a scalar
static
Mult(ref Vector2, Single, out Vector2)
Multiply a vector and a scalar
static
Multiply(Vector2, Vector2) : Vector2
Multiplies a vector by the components a vector (scale).
static
Multiply(Vector2, Single) : Vector2
Multiplies a vector by a scalar.
static
Multiply(ref Vector2, ref Vector2, out Vector2)
Multiplies a vector by the components of a vector (scale).
static
Multiply(ref Vector2, Single, out Vector2)
Multiplies a vector by a scalar.
Normalize()
Scales the Vector2 to unit length.
static
Normalize(Vector2) : Vector2
Scale a vector to unit length
static
Normalize(ref Vector2, out Vector2)
Scale a vector to unit length
NormalizeFast()
Scales the Vector2 to approximately unit length.
static
NormalizeFast(Vector2) : Vector2
Scale a vector to approximately unit length
static
NormalizeFast(ref Vector2, out Vector2)
Scale a vector to approximately unit length
Scale(Vector2)
Scales this instance by the given parameter.
Scale(ref Vector2)
Scales this instance by the given parameter.
Scale(Single, Single)
Scales the current Vector2 by the given amounts.
Sub(Vector2)
Subtract the Vector passed as parameter from this instance.
Sub(ref Vector2)
Subtract the Vector passed as parameter from this instance.
static
Sub(Vector2, Vector2) : Vector2
Subtract one Vector from another
static
Sub(ref Vector2, ref Vector2, out Vector2)
Subtract one Vector from another
static
Subtract(Vector2, Vector2) : Vector2
Subtract one Vector from another
static
Subtract(ref Vector2, ref Vector2, out Vector2)
Subtract one Vector from another
override
ToString() : String
Returns a System.String that represents the current Vector2.
static
Transform(Vector2, Quaternion) : Vector2
Transforms a vector by a quaternion rotation.
static
Transform(ref Vector2, ref Quaternion, out Vector2)
Transforms a vector by a quaternion rotation.

Public Operators

static
Addition(Vector2, Vector2) Adds the specified instances.
static
Division(Vector2, Single) Divides the specified instance by a scalar.
static
Equality(Vector2, Vector2) Compares the specified instances for equality.
static
Inequality(Vector2, Vector2) Compares the specified instances for inequality.
static
Multiply(Vector2, Single) Multiplies the specified instance by a scalar.
static
Multiply(Single, Vector2) Multiplies the specified instance by a scalar.
static
Subtraction(Vector2, Vector2) Subtracts the specified instances.
static
UnaryNegation Negates the specified instance.