Show / Hide Table of Contents

    Struct Vector2

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

    Implements
    System.IEquatable<Vector2>
    Inherited Members
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetType()
    System.Object.ReferenceEquals(System.Object, System.Object)
    Namespace: AGS.API
    Assembly: AGS.API.dll
    Syntax
    public struct Vector2 : IEquatable<Vector2>
    Remarks

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

    Constructors

    | Improve this Doc View Source

    Vector2(Vector2)

    Constructs a new Vector2 from the given Vector2.

    Declaration
    [Obsolete]
    public Vector2(Vector2 v)
    Parameters
    Type Name Description
    Vector2 v

    The Vector2 to copy components from.

    | Improve this Doc View Source

    Vector2(Vector3)

    Constructs a new Vector2 from the given Vector3.

    Declaration
    [Obsolete]
    public Vector2(Vector3 v)
    Parameters
    Type Name Description
    Vector3 v

    The Vector3 to copy components from. Z is discarded.

    | Improve this Doc View Source

    Vector2(Single)

    Constructs a new instance.

    Declaration
    public Vector2(float value)
    Parameters
    Type Name Description
    System.Single value

    The value that will initialize this instance.

    | Improve this Doc View Source

    Vector2(Single, Single)

    Constructs a new Vector2.

    Declaration
    public Vector2(float x, float y)
    Parameters
    Type Name Description
    System.Single x

    The x coordinate of the net Vector2.

    System.Single y

    The y coordinate of the net Vector2.

    Fields

    | Improve this Doc View Source

    One

    Defines an instance with all components set to 1.

    Declaration
    public static readonly Vector2 One
    Field Value
    Type Description
    Vector2
    | Improve this Doc View Source

    SizeInBytes

    Defines the size of the Vector2 struct in bytes.

    Declaration
    public static readonly int SizeInBytes
    Field Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    UnitX

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

    Declaration
    public static readonly Vector2 UnitX
    Field Value
    Type Description
    Vector2
    | Improve this Doc View Source

    UnitY

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

    Declaration
    public static readonly Vector2 UnitY
    Field Value
    Type Description
    Vector2
    | Improve this Doc View Source

    X

    The X component of the Vector2.

    Declaration
    public float X
    Field Value
    Type Description
    System.Single
    | Improve this Doc View Source

    Y

    The Y component of the Vector2.

    Declaration
    public float Y
    Field Value
    Type Description
    System.Single
    | Improve this Doc View Source

    Zero

    Defines a zero-length Vector2.

    Declaration
    public static readonly Vector2 Zero
    Field Value
    Type Description
    Vector2

    Properties

    | Improve this Doc View Source

    Item[Int32]

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

    Declaration
    public float this[int index] { get; set; }
    Parameters
    Type Name Description
    System.Int32 index
    Property Value
    Type Description
    System.Single
    | Improve this Doc View Source

    Length

    Gets the length (magnitude) of the vector.

    Declaration
    public float Length { get; }
    Property Value
    Type Description
    System.Single
    See Also
    LengthSquared
    | Improve this Doc View Source

    LengthFast

    Gets an approximation of the vector length (magnitude).

    Declaration
    public float LengthFast { get; }
    Property Value
    Type Description
    System.Single
    Remarks

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

    See Also
    LengthSquared
    | Improve this Doc View Source

    LengthSquared

    Gets the square of the vector length (magnitude).

    Declaration
    public float LengthSquared { get; }
    Property Value
    Type Description
    System.Single
    Remarks

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

    See Also
    LengthFast
    | Improve this Doc View Source

    PerpendicularLeft

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

    Declaration
    public Vector2 PerpendicularLeft { get; }
    Property Value
    Type Description
    Vector2
    | Improve this Doc View Source

    PerpendicularRight

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

    Declaration
    public Vector2 PerpendicularRight { get; }
    Property Value
    Type Description
    Vector2
    | Improve this Doc View Source

    Yx

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

    Declaration
    public Vector2 Yx { get; set; }
    Property Value
    Type Description
    Vector2

    Methods

    | Improve this Doc View Source

    Add(Vector2)

    Add the Vector passed as parameter to this instance.

    Declaration
    [CLSCompliant(false)]
    [Obsolete("Use static Add() method instead.")]
    public void Add(Vector2 right)
    Parameters
    Type Name Description
    Vector2 right

    Right operand. This parameter is only read from.

    | Improve this Doc View Source

    Add(Vector2, Vector2)

    Adds two vectors.

    Declaration
    public static Vector2 Add(Vector2 a, Vector2 b)
    Parameters
    Type Name Description
    Vector2 a

    Left operand.

    Vector2 b

    Right operand.

    Returns
    Type Description
    Vector2

    Result of operation.

    | Improve this Doc View Source

    Add(ref Vector2)

    Add the Vector passed as parameter to this instance.

    Declaration
    [CLSCompliant(false)]
    [Obsolete("Use static Add() method instead.")]
    public void Add(ref Vector2 right)
    Parameters
    Type Name Description
    Vector2 right

    Right operand. This parameter is only read from.

    | Improve this Doc View Source

    Add(ref Vector2, ref Vector2, out Vector2)

    Adds two vectors.

    Declaration
    public static void Add(ref Vector2 a, ref Vector2 b, out Vector2 result)
    Parameters
    Type Name Description
    Vector2 a

    Left operand.

    Vector2 b

    Right operand.

    Vector2 result

    Result of operation.

    | Improve this Doc View Source

    BaryCentric(Vector2, Vector2, Vector2, Single, Single)

    Interpolate 3 Vectors using Barycentric coordinates

    Declaration
    public static Vector2 BaryCentric(Vector2 a, Vector2 b, Vector2 c, float u, float v)
    Parameters
    Type Name Description
    Vector2 a

    First input Vector

    Vector2 b

    Second input Vector

    Vector2 c

    Third input Vector

    System.Single u

    First Barycentric Coordinate

    System.Single v

    Second Barycentric Coordinate

    Returns
    Type Description
    Vector2

    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

    | Improve this Doc View Source

    BaryCentric(ref Vector2, ref Vector2, ref Vector2, Single, Single, out Vector2)

    Interpolate 3 Vectors using Barycentric coordinates

    Declaration
    public static void BaryCentric(ref Vector2 a, ref Vector2 b, ref Vector2 c, float u, float v, out Vector2 result)
    Parameters
    Type Name Description
    Vector2 a

    First input Vector.

    Vector2 b

    Second input Vector.

    Vector2 c

    Third input Vector.

    System.Single u

    First Barycentric Coordinate.

    System.Single v

    Second Barycentric Coordinate.

    Vector2 result

    Output 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

    | Improve this Doc View Source

    Clamp(Vector2, Vector2, Vector2)

    Clamp a vector to the given minimum and maximum vectors

    Declaration
    public static Vector2 Clamp(Vector2 vec, Vector2 min, Vector2 max)
    Parameters
    Type Name Description
    Vector2 vec

    Input vector

    Vector2 min

    Minimum vector

    Vector2 max

    Maximum vector

    Returns
    Type Description
    Vector2

    The clamped vector

    | Improve this Doc View Source

    Clamp(ref Vector2, ref Vector2, ref Vector2, out Vector2)

    Clamp a vector to the given minimum and maximum vectors

    Declaration
    public static void Clamp(ref Vector2 vec, ref Vector2 min, ref Vector2 max, out Vector2 result)
    Parameters
    Type Name Description
    Vector2 vec

    Input vector

    Vector2 min

    Minimum vector

    Vector2 max

    Maximum vector

    Vector2 result

    The clamped vector

    | Improve this Doc View Source

    ComponentMax(Vector2, Vector2)

    Calculate the component-wise maximum of two vectors

    Declaration
    public static Vector2 ComponentMax(Vector2 a, Vector2 b)
    Parameters
    Type Name Description
    Vector2 a

    First operand

    Vector2 b

    Second operand

    Returns
    Type Description
    Vector2

    The component-wise maximum

    | Improve this Doc View Source

    ComponentMax(ref Vector2, ref Vector2, out Vector2)

    Calculate the component-wise maximum of two vectors

    Declaration
    public static void ComponentMax(ref Vector2 a, ref Vector2 b, out Vector2 result)
    Parameters
    Type Name Description
    Vector2 a

    First operand

    Vector2 b

    Second operand

    Vector2 result

    The component-wise maximum

    | Improve this Doc View Source

    ComponentMin(Vector2, Vector2)

    Calculate the component-wise minimum of two vectors

    Declaration
    public static Vector2 ComponentMin(Vector2 a, Vector2 b)
    Parameters
    Type Name Description
    Vector2 a

    First operand

    Vector2 b

    Second operand

    Returns
    Type Description
    Vector2

    The component-wise minimum

    | Improve this Doc View Source

    ComponentMin(ref Vector2, ref Vector2, out Vector2)

    Calculate the component-wise minimum of two vectors

    Declaration
    public static void ComponentMin(ref Vector2 a, ref Vector2 b, out Vector2 result)
    Parameters
    Type Name Description
    Vector2 a

    First operand

    Vector2 b

    Second operand

    Vector2 result

    The component-wise minimum

    | Improve this Doc View Source

    Div(Vector2, Single)

    Divide a vector by a scalar

    Declaration
    [Obsolete("Use static Divide() method instead.")]
    public static Vector2 Div(Vector2 a, float f)
    Parameters
    Type Name Description
    Vector2 a

    Vector operand

    System.Single f

    Scalar operand

    Returns
    Type Description
    Vector2

    Result of the division

    | Improve this Doc View Source

    Div(ref Vector2, Single, out Vector2)

    Divide a vector by a scalar

    Declaration
    [Obsolete("Use static Divide() method instead.")]
    public static void Div(ref Vector2 a, float f, out Vector2 result)
    Parameters
    Type Name Description
    Vector2 a

    Vector operand

    System.Single f

    Scalar operand

    Vector2 result

    Result of the division

    | Improve this Doc View Source

    Div(Single)

    Divide this instance by a scalar.

    Declaration
    [Obsolete("Use static Divide() method instead.")]
    public void Div(float f)
    Parameters
    Type Name Description
    System.Single f

    Scalar operand.

    | Improve this Doc View Source

    Divide(Vector2, Vector2)

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

    Declaration
    public static Vector2 Divide(Vector2 vector, Vector2 scale)
    Parameters
    Type Name Description
    Vector2 vector

    Left operand.

    Vector2 scale

    Right operand.

    Returns
    Type Description
    Vector2

    Result of the operation.

    | Improve this Doc View Source

    Divide(Vector2, Single)

    Divides a vector by a scalar.

    Declaration
    public static Vector2 Divide(Vector2 vector, float scale)
    Parameters
    Type Name Description
    Vector2 vector

    Left operand.

    System.Single scale

    Right operand.

    Returns
    Type Description
    Vector2

    Result of the operation.

    | Improve this Doc View Source

    Divide(ref Vector2, ref Vector2, out Vector2)

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

    Declaration
    public static void Divide(ref Vector2 vector, ref Vector2 scale, out Vector2 result)
    Parameters
    Type Name Description
    Vector2 vector

    Left operand.

    Vector2 scale

    Right operand.

    Vector2 result

    Result of the operation.

    | Improve this Doc View Source

    Divide(ref Vector2, Single, out Vector2)

    Divides a vector by a scalar.

    Declaration
    public static void Divide(ref Vector2 vector, float scale, out Vector2 result)
    Parameters
    Type Name Description
    Vector2 vector

    Left operand.

    System.Single scale

    Right operand.

    Vector2 result

    Result of the operation.

    | Improve this Doc View Source

    Dot(Vector2, Vector2)

    Calculate the dot (scalar) product of two vectors

    Declaration
    public static float Dot(Vector2 left, Vector2 right)
    Parameters
    Type Name Description
    Vector2 left

    First operand

    Vector2 right

    Second operand

    Returns
    Type Description
    System.Single

    The dot product of the two inputs

    | Improve this Doc View Source

    Dot(ref Vector2, ref Vector2, out Single)

    Calculate the dot (scalar) product of two vectors

    Declaration
    public static void Dot(ref Vector2 left, ref Vector2 right, out float result)
    Parameters
    Type Name Description
    Vector2 left

    First operand

    Vector2 right

    Second operand

    System.Single result

    The dot product of the two inputs

    | Improve this Doc View Source

    Equals(Vector2)

    Indicates whether the current vector is equal to another vector.

    Declaration
    public bool Equals(Vector2 other)
    Parameters
    Type Name Description
    Vector2 other

    A vector to compare with this vector.

    Returns
    Type Description
    System.Boolean

    true if the current vector is equal to the vector parameter; otherwise, false.

    | Improve this Doc View Source

    Equals(Object)

    Indicates whether this instance and a specified object are equal.

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    System.Object obj

    The object to compare to.

    Returns
    Type Description
    System.Boolean

    True if the instances are equal; false otherwise.

    Overrides
    System.ValueType.Equals(System.Object)
    | Improve this Doc View Source

    GetHashCode()

    Returns the hashcode for this instance.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    System.Int32

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

    Overrides
    System.ValueType.GetHashCode()
    | Improve this Doc View Source

    Lerp(Vector2, Vector2, Single)

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

    Declaration
    public static Vector2 Lerp(Vector2 a, Vector2 b, float blend)
    Parameters
    Type Name Description
    Vector2 a

    First input vector

    Vector2 b

    Second input vector

    System.Single blend

    The blend factor. a when blend=0, b when blend=1.

    Returns
    Type Description
    Vector2

    a when blend=0, b when blend=1, and a linear combination otherwise

    | Improve this Doc View Source

    Lerp(ref Vector2, ref Vector2, Single, out Vector2)

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

    Declaration
    public static void Lerp(ref Vector2 a, ref Vector2 b, float blend, out Vector2 result)
    Parameters
    Type Name Description
    Vector2 a

    First input vector

    Vector2 b

    Second input vector

    System.Single blend

    The blend factor. a when blend=0, b when blend=1.

    Vector2 result

    a when blend=0, b when blend=1, and a linear combination otherwise

    | Improve this Doc View Source

    Max(Vector2, Vector2)

    Returns the Vector3 with the minimum magnitude

    Declaration
    public static Vector2 Max(Vector2 left, Vector2 right)
    Parameters
    Type Name Description
    Vector2 left

    Left operand

    Vector2 right

    Right operand

    Returns
    Type Description
    Vector2

    The minimum Vector3

    | Improve this Doc View Source

    Min(Vector2, Vector2)

    Returns the Vector3 with the minimum magnitude

    Declaration
    public static Vector2 Min(Vector2 left, Vector2 right)
    Parameters
    Type Name Description
    Vector2 left

    Left operand

    Vector2 right

    Right operand

    Returns
    Type Description
    Vector2

    The minimum Vector3

    | Improve this Doc View Source

    Mult(Vector2, Single)

    Multiply a vector and a scalar

    Declaration
    [Obsolete("Use static Multiply() method instead.")]
    public static Vector2 Mult(Vector2 a, float f)
    Parameters
    Type Name Description
    Vector2 a

    Vector operand

    System.Single f

    Scalar operand

    Returns
    Type Description
    Vector2

    Result of the multiplication

    | Improve this Doc View Source

    Mult(ref Vector2, Single, out Vector2)

    Multiply a vector and a scalar

    Declaration
    [Obsolete("Use static Multiply() method instead.")]
    public static void Mult(ref Vector2 a, float f, out Vector2 result)
    Parameters
    Type Name Description
    Vector2 a

    Vector operand

    System.Single f

    Scalar operand

    Vector2 result

    Result of the multiplication

    | Improve this Doc View Source

    Mult(Single)

    Multiply this instance by a scalar.

    Declaration
    [Obsolete("Use static Multiply() method instead.")]
    public void Mult(float f)
    Parameters
    Type Name Description
    System.Single f

    Scalar operand.

    | Improve this Doc View Source

    Multiply(Vector2, Vector2)

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

    Declaration
    public static Vector2 Multiply(Vector2 vector, Vector2 scale)
    Parameters
    Type Name Description
    Vector2 vector

    Left operand.

    Vector2 scale

    Right operand.

    Returns
    Type Description
    Vector2

    Result of the operation.

    | Improve this Doc View Source

    Multiply(Vector2, Single)

    Multiplies a vector by a scalar.

    Declaration
    public static Vector2 Multiply(Vector2 vector, float scale)
    Parameters
    Type Name Description
    Vector2 vector

    Left operand.

    System.Single scale

    Right operand.

    Returns
    Type Description
    Vector2

    Result of the operation.

    | Improve this Doc View Source

    Multiply(ref Vector2, ref Vector2, out Vector2)

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

    Declaration
    public static void Multiply(ref Vector2 vector, ref Vector2 scale, out Vector2 result)
    Parameters
    Type Name Description
    Vector2 vector

    Left operand.

    Vector2 scale

    Right operand.

    Vector2 result

    Result of the operation.

    | Improve this Doc View Source

    Multiply(ref Vector2, Single, out Vector2)

    Multiplies a vector by a scalar.

    Declaration
    public static void Multiply(ref Vector2 vector, float scale, out Vector2 result)
    Parameters
    Type Name Description
    Vector2 vector

    Left operand.

    System.Single scale

    Right operand.

    Vector2 result

    Result of the operation.

    | Improve this Doc View Source

    Normalize()

    Scales the Vector2 to unit length.

    Declaration
    public void Normalize()
    | Improve this Doc View Source

    Normalize(Vector2)

    Scale a vector to unit length

    Declaration
    public static Vector2 Normalize(Vector2 vec)
    Parameters
    Type Name Description
    Vector2 vec

    The input vector

    Returns
    Type Description
    Vector2

    The normalized vector

    | Improve this Doc View Source

    Normalize(ref Vector2, out Vector2)

    Scale a vector to unit length

    Declaration
    public static void Normalize(ref Vector2 vec, out Vector2 result)
    Parameters
    Type Name Description
    Vector2 vec

    The input vector

    Vector2 result

    The normalized vector

    | Improve this Doc View Source

    Normalized()

    Returns a copy of the Vector2 scaled to unit length.

    Declaration
    public Vector2 Normalized()
    Returns
    Type Description
    Vector2
    | Improve this Doc View Source

    NormalizeFast()

    Scales the Vector2 to approximately unit length.

    Declaration
    public void NormalizeFast()
    | Improve this Doc View Source

    NormalizeFast(Vector2)

    Scale a vector to approximately unit length

    Declaration
    public static Vector2 NormalizeFast(Vector2 vec)
    Parameters
    Type Name Description
    Vector2 vec

    The input vector

    Returns
    Type Description
    Vector2

    The normalized vector

    | Improve this Doc View Source

    NormalizeFast(ref Vector2, out Vector2)

    Scale a vector to approximately unit length

    Declaration
    public static void NormalizeFast(ref Vector2 vec, out Vector2 result)
    Parameters
    Type Name Description
    Vector2 vec

    The input vector

    Vector2 result

    The normalized vector

    | Improve this Doc View Source

    PerpDot(Vector2, Vector2)

    Calculate the perpendicular dot (scalar) product of two vectors

    Declaration
    public static float PerpDot(Vector2 left, Vector2 right)
    Parameters
    Type Name Description
    Vector2 left

    First operand

    Vector2 right

    Second operand

    Returns
    Type Description
    System.Single

    The perpendicular dot product of the two inputs

    | Improve this Doc View Source

    PerpDot(ref Vector2, ref Vector2, out Single)

    Calculate the perpendicular dot (scalar) product of two vectors

    Declaration
    public static void PerpDot(ref Vector2 left, ref Vector2 right, out float result)
    Parameters
    Type Name Description
    Vector2 left

    First operand

    Vector2 right

    Second operand

    System.Single result

    The perpendicular dot product of the two inputs

    | Improve this Doc View Source

    Scale(Vector2)

    Scales this instance by the given parameter.

    Declaration
    [CLSCompliant(false)]
    [Obsolete("Use static Multiply() method instead.")]
    public void Scale(Vector2 scale)
    Parameters
    Type Name Description
    Vector2 scale

    The scaling of the individual components.

    | Improve this Doc View Source

    Scale(ref Vector2)

    Scales this instance by the given parameter.

    Declaration
    [CLSCompliant(false)]
    [Obsolete("Use static Multiply() method instead.")]
    public void Scale(ref Vector2 scale)
    Parameters
    Type Name Description
    Vector2 scale

    The scaling of the individual components.

    | Improve this Doc View Source

    Scale(Single, Single)

    Scales the current Vector2 by the given amounts.

    Declaration
    [Obsolete("Use static Multiply() method instead.")]
    public void Scale(float sx, float sy)
    Parameters
    Type Name Description
    System.Single sx

    The scale of the X component.

    System.Single sy

    The scale of the Y component.

    | Improve this Doc View Source

    Sub(Vector2)

    Subtract the Vector passed as parameter from this instance.

    Declaration
    [CLSCompliant(false)]
    [Obsolete("Use static Subtract() method instead.")]
    public void Sub(Vector2 right)
    Parameters
    Type Name Description
    Vector2 right

    Right operand. This parameter is only read from.

    | Improve this Doc View Source

    Sub(Vector2, Vector2)

    Subtract one Vector from another

    Declaration
    [Obsolete("Use static Subtract() method instead.")]
    public static Vector2 Sub(Vector2 a, Vector2 b)
    Parameters
    Type Name Description
    Vector2 a

    First operand

    Vector2 b

    Second operand

    Returns
    Type Description
    Vector2

    Result of subtraction

    | Improve this Doc View Source

    Sub(ref Vector2)

    Subtract the Vector passed as parameter from this instance.

    Declaration
    [CLSCompliant(false)]
    [Obsolete("Use static Subtract() method instead.")]
    public void Sub(ref Vector2 right)
    Parameters
    Type Name Description
    Vector2 right

    Right operand. This parameter is only read from.

    | Improve this Doc View Source

    Sub(ref Vector2, ref Vector2, out Vector2)

    Subtract one Vector from another

    Declaration
    [Obsolete("Use static Subtract() method instead.")]
    public static void Sub(ref Vector2 a, ref Vector2 b, out Vector2 result)
    Parameters
    Type Name Description
    Vector2 a

    First operand

    Vector2 b

    Second operand

    Vector2 result

    Result of subtraction

    | Improve this Doc View Source

    Subtract(Vector2, Vector2)

    Subtract one Vector from another

    Declaration
    public static Vector2 Subtract(Vector2 a, Vector2 b)
    Parameters
    Type Name Description
    Vector2 a

    First operand

    Vector2 b

    Second operand

    Returns
    Type Description
    Vector2

    Result of subtraction

    | Improve this Doc View Source

    Subtract(ref Vector2, ref Vector2, out Vector2)

    Subtract one Vector from another

    Declaration
    public static void Subtract(ref Vector2 a, ref Vector2 b, out Vector2 result)
    Parameters
    Type Name Description
    Vector2 a

    First operand

    Vector2 b

    Second operand

    Vector2 result

    Result of subtraction

    | Improve this Doc View Source

    ToString()

    Returns a System.String that represents the current Vector2.

    Declaration
    public override string ToString()
    Returns
    Type Description
    System.String
    Overrides
    System.ValueType.ToString()
    | Improve this Doc View Source

    Transform(Vector2, Quaternion)

    Transforms a vector by a quaternion rotation.

    Declaration
    public static Vector2 Transform(Vector2 vec, Quaternion quat)
    Parameters
    Type Name Description
    Vector2 vec

    The vector to transform.

    Quaternion quat

    The quaternion to rotate the vector by.

    Returns
    Type Description
    Vector2

    The result of the operation.

    | Improve this Doc View Source

    Transform(ref Vector2, ref Quaternion, out Vector2)

    Transforms a vector by a quaternion rotation.

    Declaration
    public static void Transform(ref Vector2 vec, ref Quaternion quat, out Vector2 result)
    Parameters
    Type Name Description
    Vector2 vec

    The vector to transform.

    Quaternion quat

    The quaternion to rotate the vector by.

    Vector2 result

    The result of the operation.

    Operators

    | Improve this Doc View Source

    Addition(Vector2, Vector2)

    Adds the specified instances.

    Declaration
    public static Vector2 operator +(Vector2 left, Vector2 right)
    Parameters
    Type Name Description
    Vector2 left

    Left operand.

    Vector2 right

    Right operand.

    Returns
    Type Description
    Vector2

    Result of addition.

    | Improve this Doc View Source

    Division(Vector2, Single)

    Divides the specified instance by a scalar.

    Declaration
    public static Vector2 operator /(Vector2 vec, float scale)
    Parameters
    Type Name Description
    Vector2 vec

    Left operand

    System.Single scale

    Right operand

    Returns
    Type Description
    Vector2

    Result of the division.

    | Improve this Doc View Source

    Equality(Vector2, Vector2)

    Compares the specified instances for equality.

    Declaration
    public static bool operator ==(Vector2 left, Vector2 right)
    Parameters
    Type Name Description
    Vector2 left

    Left operand.

    Vector2 right

    Right operand.

    Returns
    Type Description
    System.Boolean

    True if both instances are equal; false otherwise.

    | Improve this Doc View Source

    Inequality(Vector2, Vector2)

    Compares the specified instances for inequality.

    Declaration
    public static bool operator !=(Vector2 left, Vector2 right)
    Parameters
    Type Name Description
    Vector2 left

    Left operand.

    Vector2 right

    Right operand.

    Returns
    Type Description
    System.Boolean

    True if both instances are not equal; false otherwise.

    | Improve this Doc View Source

    Multiply(Vector2, Vector2)

    Component-wise multiplication between the specified instance by a scale vector.

    Declaration
    public static Vector2 operator *(Vector2 vec, Vector2 scale)
    Parameters
    Type Name Description
    Vector2 vec

    Right operand.

    Vector2 scale

    Left operand.

    Returns
    Type Description
    Vector2

    Result of multiplication.

    | Improve this Doc View Source

    Multiply(Vector2, Single)

    Multiplies the specified instance by a scalar.

    Declaration
    public static Vector2 operator *(Vector2 vec, float scale)
    Parameters
    Type Name Description
    Vector2 vec

    Left operand.

    System.Single scale

    Right operand.

    Returns
    Type Description
    Vector2

    Result of multiplication.

    | Improve this Doc View Source

    Multiply(Single, Vector2)

    Multiplies the specified instance by a scalar.

    Declaration
    public static Vector2 operator *(float scale, Vector2 vec)
    Parameters
    Type Name Description
    System.Single scale

    Left operand.

    Vector2 vec

    Right operand.

    Returns
    Type Description
    Vector2

    Result of multiplication.

    | Improve this Doc View Source

    Subtraction(Vector2, Vector2)

    Subtracts the specified instances.

    Declaration
    public static Vector2 operator -(Vector2 left, Vector2 right)
    Parameters
    Type Name Description
    Vector2 left

    Left operand.

    Vector2 right

    Right operand.

    Returns
    Type Description
    Vector2

    Result of subtraction.

    | Improve this Doc View Source

    UnaryNegation(Vector2)

    Negates the specified instance.

    Declaration
    public static Vector2 operator -(Vector2 vec)
    Parameters
    Type Name Description
    Vector2 vec

    Operand.

    Returns
    Type Description
    Vector2

    Result of negation.

    Implements

    System.IEquatable<T>
    • Improve this Doc
    • View Source
    Back to top Generated by DocFX