iOS Guides | Samples

OpenTK.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: OpenTK
Assembly: Xamarin.iOS (in Xamarin.iOS.dll)
Assembly Versions: 0.0.0.0

The members of OpenTK.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 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
static
Add(ref Vector2, ref Vector2, out Vector2)
Add two Vectors
static
BaryCentric(Vector2, Vector2, Vector2, Single, Single) : Vector2
static
BaryCentric(ref Vector2, ref Vector2, ref Vector2, Single, Single, out Vector2)
static
Clamp(Vector2, Vector2, Vector2) : Vector2
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
static
ComponentMax(ref Vector2, ref Vector2, out Vector2)
Calculate the component-wise maximum of two vectors
static
ComponentMin(Vector2, Vector2) : Vector2
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
static
Div(ref Vector2, Single, out Vector2)
static
Divide(Vector2, Vector2) : Vector2
static
Divide(Vector2, Single) : Vector2
static
Divide(ref Vector2, ref Vector2, out Vector2)
static
Divide(ref Vector2, Single, out Vector2)
static
Dot(Vector2, Vector2) : Single
Calculate the dot (scalar) product of two vectors
static
Dot(ref Vector2, ref Vector2, out Single)
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
static
Lerp(ref Vector2, ref Vector2, Single, out Vector2)
static
Max(Vector2, Vector2) : Vector2
static
Min(Vector2, Vector2) : Vector2
Mult(Single)
Multiply this instance by a scalar.
static
Mult(Vector2, Single) : Vector2
static
Mult(ref Vector2, Single, out Vector2)
static
Multiply(Vector2, Vector2) : Vector2
static
Multiply(Vector2, Single) : Vector2
static
Multiply(ref Vector2, ref Vector2, out Vector2)
static
Multiply(ref Vector2, Single, out Vector2)
Normalize()
Scales the Vector2 to unit length.
static
Normalize(Vector2) : Vector2
static
Normalize(ref Vector2, out Vector2)
Scale a vector to unit length
NormalizeFast()
Scales the Vector2 to approximately unit length.
static
NormalizeFast(Vector2) : Vector2
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
static
Sub(ref Vector2, ref Vector2, out Vector2)
Subtract one Vector from another
static
Subtract(Vector2, Vector2) : Vector2
static
Subtract(ref Vector2, ref Vector2, out Vector2)
override
ToString() : String
Returns a System.String that represents the current Vector2.
static
Transform(Vector2, Quaternion) : Vector2
static
Transform(ref Vector2, ref Quaternion, out Vector2)

Public Operators

static
Addition(Vector2, Vector2)
static
Division(Vector2, Single)
static
Equality(Vector2, Vector2) Compares the specified instances for equality.
static
Inequality(Vector2, Vector2) Compares the specified instances for inequality.
static
Multiply(Vector2, Single)
static
Multiply(Single, Vector2)
static
Subtraction(Vector2, Vector2)
static
UnaryNegation