Show / Hide Table of Contents

    Struct Vector4

    Represents a 4D vector using four single-precision floating-point numbers.

    Implements
    System.IEquatable<Vector4>
    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 Vector4 : IEquatable<Vector4>
    Remarks

    The Vector4 structure is suitable for interoperation with unmanaged code requiring four consecutive floats.

    Constructors

    | Improve this Doc View Source

    Vector4(Vector2)

    Constructs a new Vector4 from the given Vector2.

    Declaration
    public Vector4(Vector2 v)
    Parameters
    Type Name Description
    Vector2 v

    The Vector2 to copy components from.

    | Improve this Doc View Source

    Vector4(Vector3)

    Constructs a new Vector4 from the given Vector3. The w component is initialized to 0.

    Declaration
    public Vector4(Vector3 v)
    Parameters
    Type Name Description
    Vector3 v

    The Vector3 to copy components from.

    Remarks
    Vector4(Vector3, Single)
    | Improve this Doc View Source

    Vector4(Vector3, Single)

    Constructs a new Vector4 from the specified Vector3 and w component.

    Declaration
    public Vector4(Vector3 v, float w)
    Parameters
    Type Name Description
    Vector3 v

    The Vector3 to copy components from.

    System.Single w

    The w component of the new Vector4.

    | Improve this Doc View Source

    Vector4(Vector4)

    Constructs a new Vector4 from the given Vector4.

    Declaration
    public Vector4(Vector4 v)
    Parameters
    Type Name Description
    Vector4 v

    The Vector4 to copy components from.

    | Improve this Doc View Source

    Vector4(Single)

    Constructs a new instance.

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

    The value that will initialize this instance.

    | Improve this Doc View Source

    Vector4(Single, Single, Single, Single)

    Constructs a new Vector4.

    Declaration
    public Vector4(float x, float y, float z, float w)
    Parameters
    Type Name Description
    System.Single x

    The x component of the Vector4.

    System.Single y

    The y component of the Vector4.

    System.Single z

    The z component of the Vector4.

    System.Single w

    The w component of the Vector4.

    Fields

    | Improve this Doc View Source

    One

    Defines an instance with all components set to 1.

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

    SizeInBytes

    Defines the size of the Vector4 struct in bytes.

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

    UnitW

    Defines a unit-length Vector4 that points towards the W-axis.

    Declaration
    public static readonly Vector4 UnitW
    Field Value
    Type Description
    Vector4
    | Improve this Doc View Source

    UnitX

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

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

    UnitY

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

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

    UnitZ

    Defines a unit-length Vector4 that points towards the Z-axis.

    Declaration
    public static readonly Vector4 UnitZ
    Field Value
    Type Description
    Vector4
    | Improve this Doc View Source

    W

    The W component of the Vector4.

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

    X

    The X component of the Vector4.

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

    Y

    The Y component of the Vector4.

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

    Z

    The Z component of the Vector4.

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

    Zero

    Defines a zero-length Vector4.

    Declaration
    public static readonly Vector4 Zero
    Field Value
    Type Description
    Vector4

    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

    Wx

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

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

    Wxy

    Gets or sets an OpenTK.Vector3 with the W, X, and Y components of this instance.

    Declaration
    public Vector3 Wxy { get; set; }
    Property Value
    Type Description
    Vector3
    | Improve this Doc View Source

    Wxyz

    Gets or sets an OpenTK.Vector4 with the W, X, Y, and Z components of this instance.

    Declaration
    public Vector4 Wxyz { get; set; }
    Property Value
    Type Description
    Vector4
    | Improve this Doc View Source

    Wxz

    Gets or sets an OpenTK.Vector3 with the W, X, and Z components of this instance.

    Declaration
    public Vector3 Wxz { get; set; }
    Property Value
    Type Description
    Vector3
    | Improve this Doc View Source

    Wxzy

    Gets or sets an OpenTK.Vector4 with the W, X, Z, and Y components of this instance.

    Declaration
    public Vector4 Wxzy { get; set; }
    Property Value
    Type Description
    Vector4
    | Improve this Doc View Source

    Wy

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

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

    Wyx

    Gets or sets an OpenTK.Vector3 with the W, Y, and X components of this instance.

    Declaration
    public Vector3 Wyx { get; set; }
    Property Value
    Type Description
    Vector3
    | Improve this Doc View Source

    Wyxz

    Gets or sets an OpenTK.Vector4 with the W, Y, X, and Z components of this instance.

    Declaration
    public Vector4 Wyxz { get; set; }
    Property Value
    Type Description
    Vector4
    | Improve this Doc View Source

    Wyz

    Gets or sets an OpenTK.Vector3 with the W, Y, and Z components of this instance.

    Declaration
    public Vector3 Wyz { get; set; }
    Property Value
    Type Description
    Vector3
    | Improve this Doc View Source

    Wyzx

    Gets or sets an OpenTK.Vector4 with the W, Y, Z, and X components of this instance.

    Declaration
    public Vector4 Wyzx { get; set; }
    Property Value
    Type Description
    Vector4
    | Improve this Doc View Source

    Wz

    Gets or sets an OpenTK.Vector2 with the W and Z components of this instance.

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

    Wzx

    Gets or sets an OpenTK.Vector3 with the W, Z, and X components of this instance.

    Declaration
    public Vector3 Wzx { get; set; }
    Property Value
    Type Description
    Vector3
    | Improve this Doc View Source

    Wzxy

    Gets or sets an OpenTK.Vector4 with the W, Z, X, and Y components of this instance.

    Declaration
    public Vector4 Wzxy { get; set; }
    Property Value
    Type Description
    Vector4
    | Improve this Doc View Source

    Wzy

    Gets or sets an OpenTK.Vector3 with the W, Z, and Y components of this instance.

    Declaration
    public Vector3 Wzy { get; set; }
    Property Value
    Type Description
    Vector3
    | Improve this Doc View Source

    Wzyw

    Gets an OpenTK.Vector4 with the W, Z, Y, and W components of this instance.

    Declaration
    public Vector4 Wzyw { get; set; }
    Property Value
    Type Description
    Vector4
    | Improve this Doc View Source

    Wzyx

    Gets or sets an OpenTK.Vector4 with the W, Z, Y, and X components of this instance.

    Declaration
    public Vector4 Wzyx { get; set; }
    Property Value
    Type Description
    Vector4
    | Improve this Doc View Source

    Xw

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

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

    Xwy

    Gets or sets an OpenTK.Vector3 with the X, W, and Y components of this instance.

    Declaration
    public Vector3 Xwy { get; set; }
    Property Value
    Type Description
    Vector3
    | Improve this Doc View Source

    Xwyz

    Gets or sets an OpenTK.Vector4 with the X, W, Y, and Z components of this instance.

    Declaration
    public Vector4 Xwyz { get; set; }
    Property Value
    Type Description
    Vector4
    | Improve this Doc View Source

    Xwz

    Gets or sets an OpenTK.Vector3 with the X, W, and Z components of this instance.

    Declaration
    public Vector3 Xwz { get; set; }
    Property Value
    Type Description
    Vector3
    | Improve this Doc View Source

    Xwzy

    Gets or sets an OpenTK.Vector4 with the X, W, Z, and Y components of this instance.

    Declaration
    public Vector4 Xwzy { get; set; }
    Property Value
    Type Description
    Vector4
    | Improve this Doc View Source

    Xy

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

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

    Xyw

    Gets or sets an OpenTK.Vector3 with the X, Y, and Z components of this instance.

    Declaration
    public Vector3 Xyw { get; set; }
    Property Value
    Type Description
    Vector3
    | Improve this Doc View Source

    Xywz

    Gets or sets an OpenTK.Vector4 with the X, Y, W, and Z components of this instance.

    Declaration
    public Vector4 Xywz { get; set; }
    Property Value
    Type Description
    Vector4
    | Improve this Doc View Source

    Xyz

    Gets or sets an OpenTK.Vector3 with the X, Y, and Z components of this instance.

    Declaration
    public Vector3 Xyz { get; set; }
    Property Value
    Type Description
    Vector3
    | Improve this Doc View Source

    Xz

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

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

    Xzw

    Gets or sets an OpenTK.Vector3 with the X, Z, and W components of this instance.

    Declaration
    public Vector3 Xzw { get; set; }
    Property Value
    Type Description
    Vector3
    | Improve this Doc View Source

    Xzwy

    Gets or sets an OpenTK.Vector4 with the X, Z, W, and Y components of this instance.

    Declaration
    public Vector4 Xzwy { get; set; }
    Property Value
    Type Description
    Vector4
    | Improve this Doc View Source

    Xzy

    Gets or sets an OpenTK.Vector3 with the X, Z, and Y components of this instance.

    Declaration
    public Vector3 Xzy { get; set; }
    Property Value
    Type Description
    Vector3
    | Improve this Doc View Source

    Xzyw

    Gets or sets an OpenTK.Vector4 with the X, Z, Y, and W components of this instance.

    Declaration
    public Vector4 Xzyw { get; set; }
    Property Value
    Type Description
    Vector4
    | Improve this Doc View Source

    Yw

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

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

    Ywx

    Gets or sets an OpenTK.Vector3 with the Y, W, and X components of this instance.

    Declaration
    public Vector3 Ywx { get; set; }
    Property Value
    Type Description
    Vector3
    | Improve this Doc View Source

    Ywxz

    Gets or sets an OpenTK.Vector4 with the Y, W, X, and Z components of this instance.

    Declaration
    public Vector4 Ywxz { get; set; }
    Property Value
    Type Description
    Vector4
    | Improve this Doc View Source

    Ywz

    Gets an OpenTK.Vector3 with the Y, W, and Z components of this instance.

    Declaration
    public Vector3 Ywz { get; set; }
    Property Value
    Type Description
    Vector3
    | Improve this Doc View Source

    Ywzx

    Gets or sets an OpenTK.Vector4 with the Y, W, Z, and X components of this instance.

    Declaration
    public Vector4 Ywzx { get; set; }
    Property Value
    Type Description
    Vector4
    | 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
    | Improve this Doc View Source

    Yxw

    Gets or sets an OpenTK.Vector3 with the Y, X, and W components of this instance.

    Declaration
    public Vector3 Yxw { get; set; }
    Property Value
    Type Description
    Vector3
    | Improve this Doc View Source

    Yxwz

    Gets or sets an OpenTK.Vector4 with the Y, X, W, and Z components of this instance.

    Declaration
    public Vector4 Yxwz { get; set; }
    Property Value
    Type Description
    Vector4
    | Improve this Doc View Source

    Yxz

    Gets or sets an OpenTK.Vector3 with the Y, X, and Z components of this instance.

    Declaration
    public Vector3 Yxz { get; set; }
    Property Value
    Type Description
    Vector3
    | Improve this Doc View Source

    Yxzw

    Gets or sets an OpenTK.Vector4 with the Y, X, Z, and W components of this instance.

    Declaration
    public Vector4 Yxzw { get; set; }
    Property Value
    Type Description
    Vector4
    | Improve this Doc View Source

    Yywz

    Gets an OpenTK.Vector4 with the Y, Y, W, and Z components of this instance.

    Declaration
    public Vector4 Yywz { get; set; }
    Property Value
    Type Description
    Vector4
    | Improve this Doc View Source

    Yyzw

    Gets an OpenTK.Vector4 with the Y, Y, Z, and W components of this instance.

    Declaration
    public Vector4 Yyzw { get; set; }
    Property Value
    Type Description
    Vector4
    | Improve this Doc View Source

    Yz

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

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

    Yzw

    Gets or sets an OpenTK.Vector3 with the Y, Z, and W components of this instance.

    Declaration
    public Vector3 Yzw { get; set; }
    Property Value
    Type Description
    Vector3
    | Improve this Doc View Source

    Yzwx

    Gets or sets an OpenTK.Vector4 with the Y, Z, W, and X components of this instance.

    Declaration
    public Vector4 Yzwx { get; set; }
    Property Value
    Type Description
    Vector4
    | Improve this Doc View Source

    Yzx

    Gets or sets an OpenTK.Vector3 with the Y, Z, and X components of this instance.

    Declaration
    public Vector3 Yzx { get; set; }
    Property Value
    Type Description
    Vector3
    | Improve this Doc View Source

    Yzxw

    Gets or sets an OpenTK.Vector4 with the Y, Z, X, and W components of this instance.

    Declaration
    public Vector4 Yzxw { get; set; }
    Property Value
    Type Description
    Vector4
    | Improve this Doc View Source

    Zw

    Gets an OpenTK.Vector2 with the Z and W components of this instance.

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

    Zwx

    Gets or sets an OpenTK.Vector3 with the Z, W, and X components of this instance.

    Declaration
    public Vector3 Zwx { get; set; }
    Property Value
    Type Description
    Vector3
    | Improve this Doc View Source

    Zwxy

    Gets or sets an OpenTK.Vector4 with the Z, W, X, and Y components of this instance.

    Declaration
    public Vector4 Zwxy { get; set; }
    Property Value
    Type Description
    Vector4
    | Improve this Doc View Source

    Zwy

    Gets or sets an OpenTK.Vector3 with the Z, W, and Y components of this instance.

    Declaration
    public Vector3 Zwy { get; set; }
    Property Value
    Type Description
    Vector3
    | Improve this Doc View Source

    Zwyx

    Gets or sets an OpenTK.Vector4 with the Z, W, Y, and X components of this instance.

    Declaration
    public Vector4 Zwyx { get; set; }
    Property Value
    Type Description
    Vector4
    | Improve this Doc View Source

    Zwzy

    Gets an OpenTK.Vector4 with the Z, W, Z, and Y components of this instance.

    Declaration
    public Vector4 Zwzy { get; set; }
    Property Value
    Type Description
    Vector4
    | Improve this Doc View Source

    Zx

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

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

    Zxw

    Gets or sets an OpenTK.Vector3 with the Z, X, and W components of this instance.

    Declaration
    public Vector3 Zxw { get; set; }
    Property Value
    Type Description
    Vector3
    | Improve this Doc View Source

    Zxwy

    Gets or sets an OpenTK.Vector4 with the Z, X, W, and Y components of this instance.

    Declaration
    public Vector4 Zxwy { get; set; }
    Property Value
    Type Description
    Vector4
    | Improve this Doc View Source

    Zxy

    Gets or sets an OpenTK.Vector3 with the Z, X, and Y components of this instance.

    Declaration
    public Vector3 Zxy { get; set; }
    Property Value
    Type Description
    Vector3
    | Improve this Doc View Source

    Zxyw

    Gets or sets an OpenTK.Vector4 with the Z, X, Y, and Z components of this instance.

    Declaration
    public Vector4 Zxyw { get; set; }
    Property Value
    Type Description
    Vector4
    | Improve this Doc View Source

    Zy

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

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

    Zyw

    Gets or sets an OpenTK.Vector3 with the Z, Y, and W components of this instance.

    Declaration
    public Vector3 Zyw { get; set; }
    Property Value
    Type Description
    Vector3
    | Improve this Doc View Source

    Zywx

    Gets or sets an OpenTK.Vector4 with the Z, Y, W, and X components of this instance.

    Declaration
    public Vector4 Zywx { get; set; }
    Property Value
    Type Description
    Vector4
    | Improve this Doc View Source

    Zyx

    Gets or sets an OpenTK.Vector3 with the Z, Y, and X components of this instance.

    Declaration
    public Vector3 Zyx { get; set; }
    Property Value
    Type Description
    Vector3
    | Improve this Doc View Source

    Zyxw

    Gets or sets an OpenTK.Vector4 with the Z, Y, X, and W components of this instance.

    Declaration
    public Vector4 Zyxw { get; set; }
    Property Value
    Type Description
    Vector4

    Methods

    | Improve this Doc View Source

    Add(Vector4)

    Add the Vector passed as parameter to this instance.

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

    Right operand. This parameter is only read from.

    | Improve this Doc View Source

    Add(Vector4, Vector4)

    Adds two vectors.

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

    Left operand.

    Vector4 b

    Right operand.

    Returns
    Type Description
    Vector4

    Result of operation.

    | Improve this Doc View Source

    Add(ref Vector4)

    Add the Vector passed as parameter to this instance.

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

    Right operand. This parameter is only read from.

    | Improve this Doc View Source

    Add(ref Vector4, ref Vector4, out Vector4)

    Adds two vectors.

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

    Left operand.

    Vector4 b

    Right operand.

    Vector4 result

    Result of operation.

    | Improve this Doc View Source

    BaryCentric(Vector4, Vector4, Vector4, Single, Single)

    Interpolate 3 Vectors using Barycentric coordinates

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

    First input Vector

    Vector4 b

    Second input Vector

    Vector4 c

    Third input Vector

    System.Single u

    First Barycentric Coordinate

    System.Single v

    Second Barycentric Coordinate

    Returns
    Type Description
    Vector4

    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 Vector4, ref Vector4, ref Vector4, Single, Single, out Vector4)

    Interpolate 3 Vectors using Barycentric coordinates

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

    First input Vector.

    Vector4 b

    Second input Vector.

    Vector4 c

    Third input Vector.

    System.Single u

    First Barycentric Coordinate.

    System.Single v

    Second Barycentric Coordinate.

    Vector4 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(Vector4, Vector4, Vector4)

    Clamp a vector to the given minimum and maximum vectors

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

    Input vector

    Vector4 min

    Minimum vector

    Vector4 max

    Maximum vector

    Returns
    Type Description
    Vector4

    The clamped vector

    | Improve this Doc View Source

    Clamp(ref Vector4, ref Vector4, ref Vector4, out Vector4)

    Clamp a vector to the given minimum and maximum vectors

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

    Input vector

    Vector4 min

    Minimum vector

    Vector4 max

    Maximum vector

    Vector4 result

    The clamped vector

    | Improve this Doc View Source

    Div(Vector4, Single)

    Divide a vector by a scalar

    Declaration
    public static Vector4 Div(Vector4 a, float f)
    Parameters
    Type Name Description
    Vector4 a

    Vector operand

    System.Single f

    Scalar operand

    Returns
    Type Description
    Vector4

    Result of the division

    | Improve this Doc View Source

    Div(ref Vector4, Single, out Vector4)

    Divide a vector by a scalar

    Declaration
    public static void Div(ref Vector4 a, float f, out Vector4 result)
    Parameters
    Type Name Description
    Vector4 a

    Vector operand

    System.Single f

    Scalar operand

    Vector4 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(Vector4, Vector4)

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

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

    Left operand.

    Vector4 scale

    Right operand.

    Returns
    Type Description
    Vector4

    Result of the operation.

    | Improve this Doc View Source

    Divide(Vector4, Single)

    Divides a vector by a scalar.

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

    Left operand.

    System.Single scale

    Right operand.

    Returns
    Type Description
    Vector4

    Result of the operation.

    | Improve this Doc View Source

    Divide(ref Vector4, ref Vector4, out Vector4)

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

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

    Left operand.

    Vector4 scale

    Right operand.

    Vector4 result

    Result of the operation.

    | Improve this Doc View Source

    Divide(ref Vector4, Single, out Vector4)

    Divides a vector by a scalar.

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

    Left operand.

    System.Single scale

    Right operand.

    Vector4 result

    Result of the operation.

    | Improve this Doc View Source

    Dot(Vector4, Vector4)

    Calculate the dot product of two vectors

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

    First operand

    Vector4 right

    Second operand

    Returns
    Type Description
    System.Single

    The dot product of the two inputs

    | Improve this Doc View Source

    Dot(ref Vector4, ref Vector4, out Single)

    Calculate the dot product of two vectors

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

    First operand

    Vector4 right

    Second operand

    System.Single result

    The dot product of the two inputs

    | Improve this Doc View Source

    Equals(Vector4)

    Indicates whether the current vector is equal to another vector.

    Declaration
    public bool Equals(Vector4 other)
    Parameters
    Type Name Description
    Vector4 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(Vector4, Vector4, Single)

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

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

    First input vector

    Vector4 b

    Second input vector

    System.Single blend

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

    Returns
    Type Description
    Vector4

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

    | Improve this Doc View Source

    Lerp(ref Vector4, ref Vector4, Single, out Vector4)

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

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

    First input vector

    Vector4 b

    Second input vector

    System.Single blend

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

    Vector4 result

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

    | Improve this Doc View Source

    Max(Vector4, Vector4)

    Calculate the component-wise maximum of two vectors

    Declaration
    public static Vector4 Max(Vector4 a, Vector4 b)
    Parameters
    Type Name Description
    Vector4 a

    First operand

    Vector4 b

    Second operand

    Returns
    Type Description
    Vector4

    The component-wise maximum

    | Improve this Doc View Source

    Max(ref Vector4, ref Vector4, out Vector4)

    Calculate the component-wise maximum of two vectors

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

    First operand

    Vector4 b

    Second operand

    Vector4 result

    The component-wise maximum

    | Improve this Doc View Source

    Min(Vector4, Vector4)

    Calculate the component-wise minimum of two vectors

    Declaration
    public static Vector4 Min(Vector4 a, Vector4 b)
    Parameters
    Type Name Description
    Vector4 a

    First operand

    Vector4 b

    Second operand

    Returns
    Type Description
    Vector4

    The component-wise minimum

    | Improve this Doc View Source

    Min(ref Vector4, ref Vector4, out Vector4)

    Calculate the component-wise minimum of two vectors

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

    First operand

    Vector4 b

    Second operand

    Vector4 result

    The component-wise minimum

    | Improve this Doc View Source

    Mult(Vector4, Single)

    Multiply a vector and a scalar

    Declaration
    public static Vector4 Mult(Vector4 a, float f)
    Parameters
    Type Name Description
    Vector4 a

    Vector operand

    System.Single f

    Scalar operand

    Returns
    Type Description
    Vector4

    Result of the multiplication

    | Improve this Doc View Source

    Mult(ref Vector4, Single, out Vector4)

    Multiply a vector and a scalar

    Declaration
    public static void Mult(ref Vector4 a, float f, out Vector4 result)
    Parameters
    Type Name Description
    Vector4 a

    Vector operand

    System.Single f

    Scalar operand

    Vector4 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(Vector4, Vector4)

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

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

    Left operand.

    Vector4 scale

    Right operand.

    Returns
    Type Description
    Vector4

    Result of the operation.

    | Improve this Doc View Source

    Multiply(Vector4, Single)

    Multiplies a vector by a scalar.

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

    Left operand.

    System.Single scale

    Right operand.

    Returns
    Type Description
    Vector4

    Result of the operation.

    | Improve this Doc View Source

    Multiply(ref Vector4, ref Vector4, out Vector4)

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

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

    Left operand.

    Vector4 scale

    Right operand.

    Vector4 result

    Result of the operation.

    | Improve this Doc View Source

    Multiply(ref Vector4, Single, out Vector4)

    Multiplies a vector by a scalar.

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

    Left operand.

    System.Single scale

    Right operand.

    Vector4 result

    Result of the operation.

    | Improve this Doc View Source

    Normalize()

    Scales the Vector4 to unit length.

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

    Normalize(Vector4)

    Scale a vector to unit length

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

    The input vector

    Returns
    Type Description
    Vector4

    The normalized vector

    | Improve this Doc View Source

    Normalize(ref Vector4, out Vector4)

    Scale a vector to unit length

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

    The input vector

    Vector4 result

    The normalized vector

    | Improve this Doc View Source

    Normalized()

    Returns a copy of the Vector4 scaled to unit length.

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

    NormalizeFast()

    Scales the Vector4 to approximately unit length.

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

    NormalizeFast(Vector4)

    Scale a vector to approximately unit length

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

    The input vector

    Returns
    Type Description
    Vector4

    The normalized vector

    | Improve this Doc View Source

    NormalizeFast(ref Vector4, out Vector4)

    Scale a vector to approximately unit length

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

    The input vector

    Vector4 result

    The normalized vector

    | Improve this Doc View Source

    Scale(Vector4)

    Scales this instance by the given parameter.

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

    The scaling of the individual components.

    | Improve this Doc View Source

    Scale(ref Vector4)

    Scales this instance by the given parameter.

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

    The scaling of the individual components.

    | Improve this Doc View Source

    Scale(Single, Single, Single, Single)

    Scales the current Vector4 by the given amounts.

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

    The scale of the X component.

    System.Single sy

    The scale of the Y component.

    System.Single sz

    The scale of the Z component.

    System.Single sw

    The scale of the Z component.

    | Improve this Doc View Source

    Sub(Vector4)

    Subtract the Vector passed as parameter from this instance.

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

    Right operand. This parameter is only read from.

    | Improve this Doc View Source

    Sub(Vector4, Vector4)

    Subtract one Vector from another

    Declaration
    public static Vector4 Sub(Vector4 a, Vector4 b)
    Parameters
    Type Name Description
    Vector4 a

    First operand

    Vector4 b

    Second operand

    Returns
    Type Description
    Vector4

    Result of subtraction

    | Improve this Doc View Source

    Sub(ref Vector4)

    Subtract the Vector passed as parameter from this instance.

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

    Right operand. This parameter is only read from.

    | Improve this Doc View Source

    Sub(ref Vector4, ref Vector4, out Vector4)

    Subtract one Vector from another

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

    First operand

    Vector4 b

    Second operand

    Vector4 result

    Result of subtraction

    | Improve this Doc View Source

    Subtract(Vector4, Vector4)

    Subtract one Vector from another

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

    First operand

    Vector4 b

    Second operand

    Returns
    Type Description
    Vector4

    Result of subtraction

    | Improve this Doc View Source

    Subtract(ref Vector4, ref Vector4, out Vector4)

    Subtract one Vector from another

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

    First operand

    Vector4 b

    Second operand

    Vector4 result

    Result of subtraction

    | Improve this Doc View Source

    ToString()

    Returns a System.String that represents the current Vector4.

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

    Transform(Matrix4, Vector4)

    Transform a Vector by the given Matrix using right-handed notation

    Declaration
    public static Vector4 Transform(Matrix4 mat, Vector4 vec)
    Parameters
    Type Name Description
    Matrix4 mat

    The desired transformation

    Vector4 vec

    The vector to transform

    Returns
    Type Description
    Vector4
    | Improve this Doc View Source

    Transform(ref Matrix4, ref Vector4, out Vector4)

    Transform a Vector by the given Matrix using right-handed notation

    Declaration
    public static void Transform(ref Matrix4 mat, ref Vector4 vec, out Vector4 result)
    Parameters
    Type Name Description
    Matrix4 mat

    The desired transformation

    Vector4 vec

    The vector to transform

    Vector4 result

    The transformed vector

    | Improve this Doc View Source

    Transform(Vector4, Matrix4)

    Transform a Vector by the given Matrix

    Declaration
    public static Vector4 Transform(Vector4 vec, Matrix4 mat)
    Parameters
    Type Name Description
    Vector4 vec

    The vector to transform

    Matrix4 mat

    The desired transformation

    Returns
    Type Description
    Vector4

    The transformed vector

    | Improve this Doc View Source

    Transform(Vector4, Quaternion)

    Transforms a vector by a quaternion rotation.

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

    The vector to transform.

    Quaternion quat

    The quaternion to rotate the vector by.

    Returns
    Type Description
    Vector4

    The result of the operation.

    | Improve this Doc View Source

    Transform(ref Vector4, ref Matrix4, out Vector4)

    Transform a Vector by the given Matrix

    Declaration
    public static void Transform(ref Vector4 vec, ref Matrix4 mat, out Vector4 result)
    Parameters
    Type Name Description
    Vector4 vec

    The vector to transform

    Matrix4 mat

    The desired transformation

    Vector4 result

    The transformed vector

    | Improve this Doc View Source

    Transform(ref Vector4, ref Quaternion, out Vector4)

    Transforms a vector by a quaternion rotation.

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

    The vector to transform.

    Quaternion quat

    The quaternion to rotate the vector by.

    Vector4 result

    The result of the operation.

    Operators

    | Improve this Doc View Source

    Addition(Vector4, Vector4)

    Adds two instances.

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

    The first instance.

    Vector4 right

    The second instance.

    Returns
    Type Description
    Vector4

    The result of the calculation.

    | Improve this Doc View Source

    Division(Vector4, Single)

    Divides an instance by a scalar.

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

    The instance.

    System.Single scale

    The scalar.

    Returns
    Type Description
    Vector4

    The result of the calculation.

    | Improve this Doc View Source

    Equality(Vector4, Vector4)

    Compares two instances for equality.

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

    The first instance.

    Vector4 right

    The second instance.

    Returns
    Type Description
    System.Boolean

    True, if left equals right; false otherwise.

    | Improve this Doc View Source

    Explicit(Vector4 to IntPtr)

    Returns a pointer to the first element of the specified instance.

    Declaration
    public static explicit operator IntPtr(Vector4 v)
    Parameters
    Type Name Description
    Vector4 v

    The instance.

    Returns
    Type Description
    System.IntPtr

    A pointer to the first element of v.

    | Improve this Doc View Source

    Explicit(Vector4 to Single*)

    Returns a pointer to the first element of the specified instance.

    Declaration
    [CLSCompliant(false)]
    public static explicit operator float *(Vector4 v)
    Parameters
    Type Name Description
    Vector4 v

    The instance.

    Returns
    Type Description
    System.Single*

    A pointer to the first element of v.

    | Improve this Doc View Source

    Inequality(Vector4, Vector4)

    Compares two instances for inequality.

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

    The first instance.

    Vector4 right

    The second instance.

    Returns
    Type Description
    System.Boolean

    True, if left does not equa lright; false otherwise.

    | Improve this Doc View Source

    Multiply(Matrix4, Vector4)

    Transform a Vector by the given Matrix using right-handed notation

    Declaration
    public static Vector4 operator *(Matrix4 mat, Vector4 vec)
    Parameters
    Type Name Description
    Matrix4 mat

    The desired transformation

    Vector4 vec

    The vector to transform

    Returns
    Type Description
    Vector4

    The transformed vector

    | Improve this Doc View Source

    Multiply(Quaternion, Vector4)

    Transforms a vector by a quaternion rotation.

    Declaration
    public static Vector4 operator *(Quaternion quat, Vector4 vec)
    Parameters
    Type Name Description
    Quaternion quat

    The quaternion to rotate the vector by.

    Vector4 vec

    The vector to transform.

    Returns
    Type Description
    Vector4

    The transformed vector

    | Improve this Doc View Source

    Multiply(Vector4, Matrix4)

    Transform a Vector by the given Matrix.

    Declaration
    public static Vector4 operator *(Vector4 vec, Matrix4 mat)
    Parameters
    Type Name Description
    Vector4 vec

    The vector to transform

    Matrix4 mat

    The desired transformation

    Returns
    Type Description
    Vector4

    The transformed vector

    | Improve this Doc View Source

    Multiply(Vector4, Vector4)

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

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

    Right operand.

    Vector4 scale

    Left operand.

    Returns
    Type Description
    Vector4

    Result of multiplication.

    | Improve this Doc View Source

    Multiply(Vector4, Single)

    Multiplies an instance by a scalar.

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

    The instance.

    System.Single scale

    The scalar.

    Returns
    Type Description
    Vector4

    The result of the calculation.

    | Improve this Doc View Source

    Multiply(Single, Vector4)

    Multiplies an instance by a scalar.

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

    The scalar.

    Vector4 vec

    The instance.

    Returns
    Type Description
    Vector4

    The result of the calculation.

    | Improve this Doc View Source

    Subtraction(Vector4, Vector4)

    Subtracts two instances.

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

    The first instance.

    Vector4 right

    The second instance.

    Returns
    Type Description
    Vector4

    The result of the calculation.

    | Improve this Doc View Source

    UnaryNegation(Vector4)

    Negates an instance.

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

    The instance.

    Returns
    Type Description
    Vector4

    The result of the calculation.

    Implements

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