![]() |
VR-Link C# API Documentation
|
Represents a 2D vector using two double-precision floating-point numbers. More...
Inheritance diagram for makVrl.Vector2d:
Collaboration diagram for makVrl.Vector2d:Public Member Functions | |
| Vector2d (double value) | |
| Constructs a new instance. | |
| Vector2d (double x, double y) | |
| Constructs left vector with the given coordinates. | |
| void | Add (Vector2d right) |
| Add the Vector passed as parameter to this instance. | |
| void | Add (ref Vector2d right) |
| Add the Vector passed as parameter to this instance. | |
| void | Sub (Vector2d right) |
| Subtract the Vector passed as parameter from this instance. | |
| void | Sub (ref Vector2d right) |
| Subtract the Vector passed as parameter from this instance. | |
| void | Mult (double f) |
| Multiply this instance by a scalar. | |
| void | Div (double f) |
| Divide this instance by a scalar. | |
| Vector2d | Normalized () |
| Returns a copy of the Vector2d scaled to unit length. | |
| void | Normalize () |
| Scales the Vector2 to unit length. | |
| void | Scale (double sx, double sy) |
| Scales the current Vector2 by the given amounts. | |
| void | Scale (Vector2d scale) |
| Scales this instance by the given parameter. | |
| void | Scale (ref Vector2d scale) |
| Scales this instance by the given parameter. | |
| override string | ToString () |
| Returns a System.String that represents the current instance. | |
| 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 (Vector2d other) |
| Indicates whether the current vector is equal to another vector. | |
Static Public Member Functions | |
| static Vector2d | Sub (Vector2d a, Vector2d b) |
| Subtract one Vector from another | |
| static void | Sub (ref Vector2d a, ref Vector2d b, out Vector2d result) |
| Subtract one Vector from another | |
| static Vector2d | Mult (Vector2d a, double d) |
| Multiply a vector and a scalar | |
| static void | Mult (ref Vector2d a, double d, out Vector2d result) |
| Multiply a vector and a scalar | |
| static Vector2d | Div (Vector2d a, double d) |
| Divide a vector by a scalar | |
| static void | Div (ref Vector2d a, double d, out Vector2d result) |
| Divide a vector by a scalar | |
| static Vector2d | Add (Vector2d a, Vector2d b) |
| Adds two vectors. | |
| static void | Add (ref Vector2d a, ref Vector2d b, out Vector2d result) |
| Adds two vectors. | |
| static Vector2d | Subtract (Vector2d a, Vector2d b) |
| Subtract one Vector from another | |
| static void | Subtract (ref Vector2d a, ref Vector2d b, out Vector2d result) |
| Subtract one Vector from another | |
| static Vector2d | Multiply (Vector2d vector, double scale) |
| Multiplies a vector by a scalar. | |
| static void | Multiply (ref Vector2d vector, double scale, out Vector2d result) |
| Multiplies a vector by a scalar. | |
| static Vector2d | Multiply (Vector2d vector, Vector2d scale) |
| Multiplies a vector by the components a vector (scale). | |
| static void | Multiply (ref Vector2d vector, ref Vector2d scale, out Vector2d result) |
| Multiplies a vector by the components of a vector (scale). | |
| static Vector2d | Divide (Vector2d vector, double scale) |
| Divides a vector by a scalar. | |
| static void | Divide (ref Vector2d vector, double scale, out Vector2d result) |
| Divides a vector by a scalar. | |
| static Vector2d | Divide (Vector2d vector, Vector2d scale) |
| Divides a vector by the components of a vector (scale). | |
| static void | Divide (ref Vector2d vector, ref Vector2d scale, out Vector2d result) |
| Divide a vector by the components of a vector (scale). | |
| static Vector2d | Min (Vector2d a, Vector2d b) |
| Calculate the component-wise minimum of two vectors | |
| static void | Min (ref Vector2d a, ref Vector2d b, out Vector2d result) |
| Calculate the component-wise minimum of two vectors | |
| static Vector2d | Max (Vector2d a, Vector2d b) |
| Calculate the component-wise maximum of two vectors | |
| static void | Max (ref Vector2d a, ref Vector2d b, out Vector2d result) |
| Calculate the component-wise maximum of two vectors | |
| static Vector2d | Clamp (Vector2d vec, Vector2d min, Vector2d max) |
| Clamp a vector to the given minimum and maximum vectors | |
| static void | Clamp (ref Vector2d vec, ref Vector2d min, ref Vector2d max, out Vector2d result) |
| Clamp a vector to the given minimum and maximum vectors | |
| static Vector2d | Normalize (Vector2d vec) |
| Scale a vector to unit length | |
| static void | Normalize (ref Vector2d vec, out Vector2d result) |
| Scale a vector to unit length | |
| static Vector2d | NormalizeFast (Vector2d vec) |
| Scale a vector to approximately unit length | |
| static void | NormalizeFast (ref Vector2d vec, out Vector2d result) |
| Scale a vector to approximately unit length | |
| static double | Dot (Vector2d left, Vector2d right) |
| Calculate the dot (scalar) product of two vectors | |
| static void | Dot (ref Vector2d left, ref Vector2d right, out double result) |
| Calculate the dot (scalar) product of two vectors | |
| static Vector2d | Lerp (Vector2d a, Vector2d b, double blend) |
| Returns a new Vector that is the linear blend of the 2 given Vectors | |
| static void | Lerp (ref Vector2d a, ref Vector2d b, double blend, out Vector2d result) |
| Returns a new Vector that is the linear blend of the 2 given Vectors | |
| static Vector2d | BaryCentric (Vector2d a, Vector2d b, Vector2d c, double u, double v) |
| Interpolate 3 Vectors using Barycentric coordinates | |
| static void | BaryCentric (ref Vector2d a, ref Vector2d b, ref Vector2d c, double u, double v, out Vector2d result) |
| Interpolate 3 Vectors using Barycentric coordinates | |
| static Vector2d | Transform (Vector2d vec, Quaterniond quat) |
| Transforms a vector by a quaternion rotation. | |
| static void | Transform (ref Vector2d vec, ref Quaterniond quat, out Vector2d result) |
| Transforms a vector by a quaternion rotation. | |
| static Vector2d | operator+ (Vector2d left, Vector2d right) |
| Adds two instances. | |
| static Vector2d | operator- (Vector2d left, Vector2d right) |
| Subtracts two instances. | |
| static Vector2d | operator- (Vector2d vec) |
| Negates an instance. | |
| static Vector2d | operator* (Vector2d vec, double f) |
| Multiplies an instance by a scalar. | |
| static Vector2d | operator* (double f, Vector2d vec) |
| Multiply an instance by a scalar. | |
| static Vector2d | operator/ (Vector2d vec, double f) |
| Divides an instance by a scalar. | |
| static bool | operator== (Vector2d left, Vector2d right) |
| Compares two instances for equality. | |
| static bool | operator!= (Vector2d left, Vector2d right) |
| Compares two instances for ienquality. | |
| static | operator Vector2d (Vector2 v2) |
| Converts makVrl.Vector2 to makVrl.Vector2d. | |
| static | operator Vector2 (Vector2d v2d) |
| Converts makVrl.Vector2d to makVrl.Vector2. | |
Public Attributes | |
| double | X |
| The X coordinate of this instance. | |
| double | Y |
| The Y coordinate of this instance. | |
Static Public Attributes | |
| static readonly Vector2d | UnitX = new Vector2d(1, 0) |
| Defines a unit-length Vector2d that points towards the X-axis. | |
| static readonly Vector2d | UnitY = new Vector2d(0, 1) |
| Defines a unit-length Vector2d that points towards the Y-axis. | |
| static readonly Vector2d | Zero = new Vector2d(0, 0) |
| Defines a zero-length Vector2d. | |
| static readonly Vector2d | One = new Vector2d(1, 1) |
| Defines an instance with all components set to 1. | |
| static readonly int | SizeInBytes = Marshal.SizeOf(new Vector2d()) |
| Defines the size of the Vector2d struct in bytes. | |
Properties | |
| double | this[int index] [get, set] |
| Gets or sets the value at the index of the Vector. | |
| double | Length [get] |
| Gets the length (magnitude) of the vector. | |
| double | LengthSquared [get] |
| Gets the square of the vector length (magnitude). | |
| Vector2d | PerpendicularRight [get] |
| Gets the perpendicular vector on the right side of this vector. | |
| Vector2d | PerpendicularLeft [get] |
| Gets the perpendicular vector on the left side of this vector. | |
| Vector2d | Yx [get, set] |
| Gets or sets an makVrl.Vector2d with the Y and X components of this instance. | |
Static Private Attributes | |
| static string | listSeparator = System.Globalization.CultureInfo.CurrentCulture.TextInfo.ListSeparator |
Represents a 2D vector using two double-precision floating-point numbers.
|
inline |
Constructs a new instance.
| value | The value that will initialize this instance. |
References makVrl.Vector2d.X, and makVrl.Vector2d.Y.
Referenced by makVrl.Vector2d.Add(), makVrl.Vector2d.Divide(), makVrl.Vector2d.Multiply(), makVrl.Vector2d.operator Vector2d(), makVrl.Vector2d.Subtract(), and makVrl.Vector2d.Transform().
|
inline |
Constructs left vector with the given coordinates.
| x | The X coordinate. |
| y | The Y coordinate. |
References makVrl.Vector2d.X, and makVrl.Vector2d.Y.
|
inline |
Add the Vector passed as parameter to this instance.
| right | Right operand. This parameter is only read from. |
References makVrl.Vector2d.X, and makVrl.Vector2d.Y.
Referenced by makVrl.Vector2d.Add(), and makVrl.Vector2d.BaryCentric().
|
inline |
Add the Vector passed as parameter to this instance.
| right | Right operand. This parameter is only read from. |
References makVrl.Vector2d.X, and makVrl.Vector2d.Y.
Adds two vectors.
| a | Left operand. |
| b | Right operand. |
References makVrl.Vector2d.Add().
|
inlinestatic |
Adds two vectors.
| a | Left operand. |
| b | Right operand. |
| result | Result of operation. |
References makVrl.Vector2d.Vector2d().
|
inlinestatic |
Interpolate 3 Vectors using Barycentric coordinates
| a | First input Vector |
| b | Second input Vector |
| c | Third input Vector |
| u | First Barycentric Coordinate |
| v | Second Barycentric Coordinate |
|
inlinestatic |
Interpolate 3 Vectors using Barycentric coordinates
| a | First input Vector. |
| b | Second input Vector. |
| c | Third input Vector. |
| u | First Barycentric Coordinate. |
| v | Second Barycentric Coordinate. |
| 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 |
References makVrl.Vector2d.Add(), makVrl.Vector2d.Multiply(), and makVrl.Vector2d.Subtract().
Clamp a vector to the given minimum and maximum vectors
| vec | Input vector |
| min | Minimum vector |
| max | Maximum vector |
References makVrl.Vector2d.X, and makVrl.Vector2d.Y.
|
inlinestatic |
Clamp a vector to the given minimum and maximum vectors
| vec | Input vector |
| min | Minimum vector |
| max | Maximum vector |
| result | The clamped vector |
References makVrl.Vector2d.X.
|
inline |
Divide this instance by a scalar.
| f | Scalar operand. |
References makVrl.Vector2d.X, and makVrl.Vector2d.Y.
Divide a vector by a scalar
| a | Vector operand |
| d | Scalar operand |
References makVrl.Vector2d.X, and makVrl.Vector2d.Y.
Divide a vector by a scalar
| a | Vector operand |
| d | Scalar operand |
| result | Result of the division |
Divides a vector by a scalar.
| vector | Left operand. |
| scale | Right operand. |
Referenced by makVrl.Vector2d.Divide().
|
inlinestatic |
Divides a vector by a scalar.
| vector | Left operand. |
| scale | Right operand. |
| result | Result of the operation. |
References makVrl.Vector2d.Multiply().
Divides a vector by the components of a vector (scale).
| vector | Left operand. |
| scale | Right operand. |
References makVrl.Vector2d.Divide().
|
inlinestatic |
Divide a vector by the components of a vector (scale).
| vector | Left operand. |
| scale | Right operand. |
| result | Result of the operation. |
References makVrl.Vector2d.Vector2d().
Calculate the dot (scalar) product of two vectors
| left | First operand |
| right | Second operand |
References makVrl.Vector2d.X, and makVrl.Vector2d.Y.
|
inlinestatic |
Calculate the dot (scalar) product of two vectors
| left | First operand |
| right | Second operand |
| result | The dot product of the two inputs |
|
inline |
Indicates whether this instance and a specified object are equal.
| obj | The object to compare to. |
Referenced by makVrl.Vector2d.operator!=(), and makVrl.Vector2d.operator==().
|
inline |
Indicates whether the current vector is equal to another vector.
| other | A vector to compare with this vector. |
References makVrl.Vector2d.X, and makVrl.Vector2d.Y.
|
inline |
Returns the hashcode for this instance.
References makVrl.Vector2d.X, and makVrl.Vector2d.Y.
Returns a new Vector that is the linear blend of the 2 given Vectors
| a | First input vector |
| b | Second input vector |
| blend | The blend factor. a when blend=0, b when blend=1. |
References makVrl.Vector2d.X, and makVrl.Vector2d.Y.
|
inlinestatic |
Returns a new Vector that is the linear blend of the 2 given Vectors
| a | First input vector |
| b | Second input vector |
| blend | The blend factor. a when blend=0, b when blend=1. |
| result | a when blend=0, b when blend=1, and a linear combination otherwise |
References makVrl.Vector2d.X.
Calculate the component-wise maximum of two vectors
| a | First operand |
| b | Second operand |
References makVrl.Vector2d.X, and makVrl.Vector2d.Y.
|
inlinestatic |
Calculate the component-wise maximum of two vectors
| a | First operand |
| b | Second operand |
| result | The component-wise maximum |
References makVrl.Vector2d.X.
Calculate the component-wise minimum of two vectors
| a | First operand |
| b | Second operand |
References makVrl.Vector2d.X, and makVrl.Vector2d.Y.
|
inlinestatic |
Calculate the component-wise minimum of two vectors
| a | First operand |
| b | Second operand |
| result | The component-wise minimum |
References makVrl.Vector2d.X.
|
inline |
Multiply this instance by a scalar.
| f | Scalar operand. |
References makVrl.Vector2d.X, and makVrl.Vector2d.Y.
Multiply a vector and a scalar
| a | Vector operand |
| d | Scalar operand |
References makVrl.Vector2d.X, and makVrl.Vector2d.Y.
Multiply a vector and a scalar
| a | Vector operand |
| d | Scalar operand |
| result | Result of the multiplication |
Multiplies a vector by a scalar.
| vector | Left operand. |
| scale | Right operand. |
Referenced by makVrl.Vector2d.BaryCentric(), makVrl.Vector2d.Divide(), and makVrl.Vector2d.Multiply().
|
inlinestatic |
Multiplies a vector by a scalar.
| vector | Left operand. |
| scale | Right operand. |
| result | Result of the operation. |
References makVrl.Vector2d.Vector2d().
Multiplies a vector by the components a vector (scale).
| vector | Left operand. |
| scale | Right operand. |
References makVrl.Vector2d.Multiply().
|
inlinestatic |
Multiplies a vector by the components of a vector (scale).
| vector | Left operand. |
| scale | Right operand. |
| result | Result of the operation. |
References makVrl.Vector2d.Vector2d().
|
inline |
Scales the Vector2 to unit length.
References makVrl.Vector2d.Length, makVrl.Vector2d.X, and makVrl.Vector2d.Y.
Referenced by makVrl.Vector2d.Normalized().
Scale a vector to unit length
| vec | The input vector |
References makVrl.Vector2d.Length, makVrl.Vector2d.X, and makVrl.Vector2d.Y.
Scale a vector to unit length
| vec | The input vector |
| result | The normalized vector |
|
inline |
Returns a copy of the Vector2d scaled to unit length.
References makVrl.Vector2d.Normalize().
Scale a vector to approximately unit length
| vec | The input vector |
References makVrl.MathHelper.InverseSqrtFast(), makVrl.Vector2d.X, and makVrl.Vector2d.Y.
Scale a vector to approximately unit length
| vec | The input vector |
| result | The normalized vector |
References makVrl.MathHelper.InverseSqrtFast().
Converts makVrl.Vector2d to makVrl.Vector2.
| v2d | The Vector2d to convert. |
References makVrl.Vector2d.X, and makVrl.Vector2d.Y.
Converts makVrl.Vector2 to makVrl.Vector2d.
| v2 | The Vector2 to convert. |
References makVrl.Vector2d.Vector2d(), makVrl.Vector2.X, and makVrl.Vector2.Y.
Compares two instances for ienquality.
| left | The left instance. |
| right | The right instance. |
References makVrl.Vector2d.Equals().
Multiplies an instance by a scalar.
| vec | The instance. |
| f | The scalar. |
References makVrl.Vector2d.X, and makVrl.Vector2d.Y.
Multiply an instance by a scalar.
| f | The scalar. |
| vec | The instance. |
References makVrl.Vector2d.X, and makVrl.Vector2d.Y.
Adds two instances.
| left | The left instance. |
| right | The right instance. |
References makVrl.Vector2d.X, and makVrl.Vector2d.Y.
Subtracts two instances.
| left | The left instance. |
| right | The right instance. |
References makVrl.Vector2d.X, and makVrl.Vector2d.Y.
Negates an instance.
| vec | The instance. |
References makVrl.Vector2d.X, and makVrl.Vector2d.Y.
Divides an instance by a scalar.
| vec | The instance. |
| f | The scalar. |
References makVrl.Vector2d.X, and makVrl.Vector2d.Y.
Compares two instances for equality.
| left | The left instance. |
| right | The right instance. |
References makVrl.Vector2d.Equals().
|
inline |
Scales the current Vector2 by the given amounts.
| sx | The scale of the X component. |
| sy | The scale of the Y component. |
References makVrl.Vector2d.X, and makVrl.Vector2d.Y.
|
inline |
Scales this instance by the given parameter.
| scale | The scaling of the individual components. |
References makVrl.Vector2d.X, and makVrl.Vector2d.Y.
|
inline |
Scales this instance by the given parameter.
| scale | The scaling of the individual components. |
References makVrl.Vector2d.X, and makVrl.Vector2d.Y.
|
inline |
Subtract the Vector passed as parameter from this instance.
| right | Right operand. This parameter is only read from. |
References makVrl.Vector2d.X, and makVrl.Vector2d.Y.
|
inline |
Subtract the Vector passed as parameter from this instance.
| right | Right operand. This parameter is only read from. |
References makVrl.Vector2d.X, and makVrl.Vector2d.Y.
Subtract one Vector from another
| a | First operand |
| b | Second operand |
References makVrl.Vector2d.X, and makVrl.Vector2d.Y.
|
inlinestatic |
Subtract one Vector from another
| a | First operand |
| b | Second operand |
| result | Result of subtraction |
Subtract one Vector from another
| a | First operand |
| b | Second operand |
Referenced by makVrl.Vector2d.BaryCentric().
|
inlinestatic |
Subtract one Vector from another
| a | First operand |
| b | Second operand |
| result | Result of subtraction |
References makVrl.Vector2d.Vector2d().
|
inline |
Returns a System.String that represents the current instance.
References makVrl.Vector2d.listSeparator, makVrl.Vector2d.X, and makVrl.Vector2d.Y.
|
inlinestatic |
Transforms a vector by a quaternion rotation.
| vec | The vector to transform. |
| quat | The quaternion to rotate the vector by. |
|
inlinestatic |
Transforms a vector by a quaternion rotation.
| vec | The vector to transform. |
| quat | The quaternion to rotate the vector by. |
| result | The result of the operation. |
References makVrl.Quaterniond.Invert(), makVrl.Quaterniond.Multiply(), and makVrl.Vector2d.Vector2d().
|
staticprivate |
Referenced by makVrl.Vector2d.ToString().
Defines an instance with all components set to 1.
|
static |
Defines the size of the Vector2d struct in bytes.
Defines a unit-length Vector2d that points towards the X-axis.
Defines a unit-length Vector2d that points towards the Y-axis.
| double makVrl.Vector2d.X |
The X coordinate of this instance.
Referenced by makVrl.Vector2d.Add(), makVrl.Vector2d.Clamp(), makVrl.Vector2d.Div(), makVrl.Vector2d.Dot(), makVrl.Vector2d.Equals(), makVrl.Vector2d.GetHashCode(), makVrl.Vector2d.Lerp(), makVrl.Vector2d.Max(), makVrl.Vector2d.Min(), makVrl.Vector2d.Mult(), makVrl.Vector2d.Normalize(), makVrl.Vector2d.NormalizeFast(), makVrl.Vector2d.operator Vector2(), makVrl.Vector2d.operator*(), makVrl.Vector2d.operator+(), makVrl.Vector2d.operator-(), makVrl.Vector2d.operator/(), makVrl.Vector2d.Scale(), makVrl.Vector2d.Sub(), makVrl.Vector2d.ToString(), makVrl.Vector2d.Vector2d(), makVrl.Vector3d.Vector3d(), and makVrl.Vector4d.Vector4d().
| double makVrl.Vector2d.Y |
The Y coordinate of this instance.
Referenced by makVrl.Vector2d.Add(), makVrl.Vector2d.Clamp(), makVrl.Vector2d.Div(), makVrl.Vector2d.Dot(), makVrl.Vector2d.Equals(), makVrl.Vector2d.GetHashCode(), makVrl.Vector2d.Lerp(), makVrl.Vector2d.Max(), makVrl.Vector2d.Min(), makVrl.Vector2d.Mult(), makVrl.Vector2d.Normalize(), makVrl.Vector2d.NormalizeFast(), makVrl.Vector2d.operator Vector2(), makVrl.Vector2d.operator*(), makVrl.Vector2d.operator+(), makVrl.Vector2d.operator-(), makVrl.Vector2d.operator/(), makVrl.Vector2d.Scale(), makVrl.Vector2d.Sub(), makVrl.Vector2d.ToString(), makVrl.Vector2d.Vector2d(), makVrl.Vector3d.Vector3d(), and makVrl.Vector4d.Vector4d().
|
get |
Gets the length (magnitude) of the vector.
Referenced by makVrl.Vector2d.Normalize().
|
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.
|
get |
Gets the perpendicular vector on the left side of this vector.
|
get |
Gets the perpendicular vector on the right side of this vector.
|
getset |
Gets or sets the value at the index of the Vector.
|
getset |
Gets or sets an makVrl.Vector2d with the Y and X components of this instance.