Represents a 3D vector using three double-precision floating-point numbers. More...
Public Member Functions | |
| Vector3d (double x, double y, double z) | |
| Constructs a new Vector3. | |
| Vector3d (Vector2d v) | |
| Constructs a new instance from the given Vector2d. | |
| Vector3d (Vector3d v) | |
| Constructs a new instance from the given Vector3d. | |
| Vector3d (Vector4d v) | |
| Constructs a new instance from the given Vector4d. | |
| void | Add (Vector3d right) |
| Add the Vector passed as parameter to this instance. | |
| void | Add (ref Vector3d right) |
| Add the Vector passed as parameter to this instance. | |
| void | Sub (Vector3d right) |
| Subtract the Vector passed as parameter from this instance. | |
| void | Sub (ref Vector3d 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. | |
| void | Normalize () |
| Scales the Vector3d to unit length. | |
| void | NormalizeFast () |
| Scales the Vector3d to approximately unit length. | |
| void | Scale (double sx, double sy, double sz) |
| Scales the current Vector3d by the given amounts. | |
| void | Scale (Vector3d scale) |
| Scales this instance by the given parameter. | |
| void | Scale (ref Vector3d scale) |
| Scales this instance by the given parameter. | |
| override string | ToString () |
| Returns a System.String that represents the current Vector3. | |
| 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 (Vector3d other) |
| Indicates whether the current vector is equal to another vector. | |
Static Public Member Functions | |
| static Vector3d | Sub (Vector3d a, Vector3d b) |
| Subtract one Vector from another. | |
| static void | Sub (ref Vector3d a, ref Vector3d b, out Vector3d result) |
| Subtract one Vector from another. | |
| static Vector3d | Mult (Vector3d a, double f) |
| Multiply a vector and a scalar. | |
| static void | Mult (ref Vector3d a, double f, out Vector3d result) |
| Multiply a vector and a scalar. | |
| static Vector3d | Div (Vector3d a, double f) |
| Divide a vector by a scalar. | |
| static void | Div (ref Vector3d a, double f, out Vector3d result) |
| Divide a vector by a scalar. | |
| static Vector3d | Add (Vector3d a, Vector3d b) |
| Adds two vectors. | |
| static void | Add (ref Vector3d a, ref Vector3d b, out Vector3d result) |
| Adds two vectors. | |
| static Vector3d | Subtract (Vector3d a, Vector3d b) |
| Subtract one Vector from another. | |
| static void | Subtract (ref Vector3d a, ref Vector3d b, out Vector3d result) |
| Subtract one Vector from another. | |
| static Vector3d | Multiply (Vector3d vector, double scale) |
| Multiplies a vector by a scalar. | |
| static void | Multiply (ref Vector3d vector, double scale, out Vector3d result) |
| Multiplies a vector by a scalar. | |
| static Vector3d | Multiply (Vector3d vector, Vector3d scale) |
| Multiplies a vector by the components a vector (scale). | |
| static void | Multiply (ref Vector3d vector, ref Vector3d scale, out Vector3d result) |
| Multiplies a vector by the components of a vector (scale). | |
| static Vector3d | Divide (Vector3d vector, double scale) |
| Divides a vector by a scalar. | |
| static void | Divide (ref Vector3d vector, double scale, out Vector3d result) |
| Divides a vector by a scalar. | |
| static Vector3d | Divide (Vector3d vector, Vector3d scale) |
| Divides a vector by the components of a vector (scale). | |
| static void | Divide (ref Vector3d vector, ref Vector3d scale, out Vector3d result) |
| Divide a vector by the components of a vector (scale). | |
| static Vector3d | ComponentMin (Vector3d a, Vector3d b) |
| Calculate the component-wise minimum of two vectors. | |
| static void | ComponentMin (ref Vector3d a, ref Vector3d b, out Vector3d result) |
| Calculate the component-wise minimum of two vectors. | |
| static Vector3d | ComponentMax (Vector3d a, Vector3d b) |
| Calculate the component-wise maximum of two vectors. | |
| static void | ComponentMax (ref Vector3d a, ref Vector3d b, out Vector3d result) |
| Calculate the component-wise maximum of two vectors. | |
| static Vector3d | Min (Vector3d left, Vector3d right) |
| Returns the Vector3d with the minimum magnitude. | |
| static Vector3d | Max (Vector3d left, Vector3d right) |
| Returns the Vector3d with the minimum magnitude. | |
| static Vector3d | Clamp (Vector3d vec, Vector3d min, Vector3d max) |
| Clamp a vector to the given minimum and maximum vectors. | |
| static void | Clamp (ref Vector3d vec, ref Vector3d min, ref Vector3d max, out Vector3d result) |
| Clamp a vector to the given minimum and maximum vectors. | |
| static Vector3d | Normalize (Vector3d vec) |
| Scale a vector to unit length. | |
| static void | Normalize (ref Vector3d vec, out Vector3d result) |
| Scale a vector to unit length. | |
| static Vector3d | NormalizeFast (Vector3d vec) |
| Scale a vector to approximately unit length. | |
| static void | NormalizeFast (ref Vector3d vec, out Vector3d result) |
| Scale a vector to approximately unit length. | |
| static double | Dot (Vector3d left, Vector3d right) |
| Calculate the dot (scalar) product of two vectors. | |
| static void | Dot (ref Vector3d left, ref Vector3d right, out double result) |
| Calculate the dot (scalar) product of two vectors. | |
| static Vector3d | Cross (Vector3d left, Vector3d right) |
| Caclulate the cross (vector) product of two vectors. | |
| static void | Cross (ref Vector3d left, ref Vector3d right, out Vector3d result) |
| Caclulate the cross (vector) product of two vectors. | |
| static Vector3d | Lerp (Vector3d a, Vector3d b, double blend) |
| Returns a new Vector that is the linear blend of the 2 given Vectors. | |
| static void | Lerp (ref Vector3d a, ref Vector3d b, double blend, out Vector3d result) |
| Returns a new Vector that is the linear blend of the 2 given Vectors. | |
| static Vector3d | BaryCentric (Vector3d a, Vector3d b, Vector3d c, double u, double v) |
| Interpolate 3 Vectors using Barycentric coordinates. | |
| static void | BaryCentric (ref Vector3d a, ref Vector3d b, ref Vector3d c, double u, double v, out Vector3d result) |
| Interpolate 3 Vectors using Barycentric coordinates. | |
| static Vector3d | TransformVector (Vector3d vec, Matrix4d mat) |
| Transform a direction vector by the given Matrix Assumes the matrix has a bottom row of (0,0,0,1), that is the translation part is ignored. | |
| static void | TransformVector (ref Vector3d vec, ref Matrix4d mat, out Vector3d result) |
| Transform a direction vector by the given Matrix Assumes the matrix has a bottom row of (0,0,0,1), that is the translation part is ignored. | |
| static Vector3d | TransformNormal (Vector3d norm, Matrix4d mat) |
| Transform a Normal by the given Matrix. | |
| static void | TransformNormal (ref Vector3d norm, ref Matrix4d mat, out Vector3d result) |
| Transform a Normal by the given Matrix. | |
| static Vector3d | TransformNormalInverse (Vector3d norm, Matrix4d invMat) |
| Transform a Normal by the (transpose of the) given Matrix. | |
| static void | TransformNormalInverse (ref Vector3d norm, ref Matrix4d invMat, out Vector3d result) |
| Transform a Normal by the (transpose of the) given Matrix. | |
| static Vector3d | TransformPosition (Vector3d pos, Matrix4d mat) |
| Transform a Position by the given Matrix. | |
| static void | TransformPosition (ref Vector3d pos, ref Matrix4d mat, out Vector3d result) |
| Transform a Position by the given Matrix. | |
| static Vector3d | Transform (Vector3d vec, Matrix4d mat) |
| Transform a Vector by the given Matrix. | |
| static void | Transform (ref Vector3d vec, ref Matrix4d mat, out Vector3d result) |
| Transform a Vector by the given Matrix. | |
| static Vector3d | Transform (Vector3d vec, Quaterniond quat) |
| Transforms a vector by a quaternion rotation. | |
| static void | Transform (ref Vector3d vec, ref Quaterniond quat, out Vector3d result) |
| Transforms a vector by a quaternion rotation. | |
| static Vector3d | TransformPerspective (Vector3d vec, Matrix4d mat) |
| Transform a Vector3d by the given Matrix, and project the resulting Vector4 back to a Vector3. | |
| static void | TransformPerspective (ref Vector3d vec, ref Matrix4d mat, out Vector3d result) |
| Transform a Vector3d by the given Matrix, and project the resulting Vector4d back to a Vector3d. | |
| static double | CalculateAngle (Vector3d first, Vector3d second) |
| Calculates the angle (in radians) between two vectors. | |
| static void | CalculateAngle (ref Vector3d first, ref Vector3d second, out double result) |
| Calculates the angle (in radians) between two vectors. | |
| static Vector3d | operator+ (Vector3d left, Vector3d right) |
| Adds two instances. | |
| static Vector3d | operator- (Vector3d left, Vector3d right) |
| Subtracts two instances. | |
| static Vector3d | operator- (Vector3d vec) |
| Negates an instance. | |
| static Vector3d | operator* (Vector3d vec, double scale) |
| Multiplies an instance by a scalar. | |
| static Vector3d | operator* (double scale, Vector3d vec) |
| Multiplies an instance by a scalar. | |
| static Vector3d | operator/ (Vector3d vec, double scale) |
| Divides an instance by a scalar. | |
| static bool | operator== (Vector3d left, Vector3d right) |
| Compares two instances for equality. | |
| static bool | operator!= (Vector3d left, Vector3d right) |
| Compares two instances for inequality. | |
| static | operator Vector3d (Vector3 v3) |
| Converts OpenTK.Vector3 to OpenTK.Vector3d. | |
| static | operator Vector3 (Vector3d v3d) |
| Converts OpenTK.Vector3d to OpenTK.Vector3. | |
Public Attributes | |
| double | X |
| The X component of the Vector3. | |
| double | Y |
| The Y component of the Vector3. | |
| double | Z |
| The Z component of the Vector3. | |
Static Public Attributes | |
| static readonly Vector3d | UnitX = new Vector3d(1, 0, 0) |
| Defines a unit-length Vector3d that points towards the X-axis. | |
| static readonly Vector3d | UnitY = new Vector3d(0, 1, 0) |
| Defines a unit-length Vector3d that points towards the Y-axis. | |
| static readonly Vector3d | UnitZ = new Vector3d(0, 0, 1) |
| / Defines a unit-length Vector3d that points towards the Z-axis. | |
| static readonly Vector3d | Zero = new Vector3d(0, 0, 0) |
| Defines a zero-length Vector3. | |
| static readonly Vector3d | One = new Vector3d(1, 1, 1) |
| Defines an instance with all components set to 1. | |
| static readonly int | SizeInBytes = Marshal.SizeOf(new Vector3d()) |
| Defines the size of the Vector3d struct in bytes. | |
Properties | |
| double | Length [get] |
| Gets the length (magnitude) of the vector. | |
| double | LengthFast [get] |
| Gets an approximation of the vector length (magnitude). | |
| double | LengthSquared [get] |
| Gets the square of the vector length (magnitude). | |
| Vector2d | Xy [get, set] |
| Gets or sets an OpenTK.Vector2d with the X and Y components of this instance. | |
Represents a 3D vector using three double-precision floating-point numbers.
Definition at line 36 of file Vector3d.cs.
| OpenTK.Vector3d.Vector3d | ( | double | x, | |
| double | y, | |||
| double | z | |||
| ) |
| OpenTK.Vector3d.Vector3d | ( | Vector2d | v | ) |
| OpenTK.Vector3d.Vector3d | ( | Vector3d | v | ) |
| OpenTK.Vector3d.Vector3d | ( | Vector4d | v | ) |
Adds two vectors.
| a | Left operand. | |
| b | Right operand. | |
| result | Result of operation. |
Definition at line 482 of file Vector3d.cs.
00483 { 00484 result = new Vector3d(a.X + b.X, a.Y + b.Y, a.Z + b.Z); 00485 }
Adds two vectors.
| a | Left operand. | |
| b | Right operand. |
Definition at line 470 of file Vector3d.cs.
00471 { 00472 Add(ref a, ref b, out a); 00473 return a; 00474 }
| void OpenTK.Vector3d.Add | ( | ref Vector3d | right | ) |
Add the Vector passed as parameter to this instance.
| right | Right operand. This parameter is only read from. |
Definition at line 128 of file Vector3d.cs.
| void OpenTK.Vector3d.Add | ( | Vector3d | right | ) |
Add the Vector passed as parameter to this instance.
| right | Right operand. This parameter is only read from. |
Definition at line 117 of file Vector3d.cs.
| static void OpenTK.Vector3d.BaryCentric | ( | ref Vector3d | a, | |
| ref Vector3d | b, | |||
| ref Vector3d | c, | |||
| double | u, | |||
| double | v, | |||
| out Vector3d | result | |||
| ) | [static] |
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 |
Definition at line 916 of file Vector3d.cs.
00917 { 00918 result = a; // copy 00919 00920 Vector3d temp = b; // copy 00921 Subtract(ref temp, ref a, out temp); 00922 Multiply(ref temp, u, out temp); 00923 Add(ref result, ref temp, out result); 00924 00925 temp = c; // copy 00926 Subtract(ref temp, ref a, out temp); 00927 Multiply(ref temp, v, out temp); 00928 Add(ref result, ref temp, out result); 00929 }
| static Vector3d OpenTK.Vector3d.BaryCentric | ( | Vector3d | a, | |
| Vector3d | b, | |||
| Vector3d | c, | |||
| double | u, | |||
| double | v | |||
| ) | [static] |
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 |
Definition at line 904 of file Vector3d.cs.
| static void OpenTK.Vector3d.CalculateAngle | ( | ref Vector3d | first, | |
| ref Vector3d | second, | |||
| out double | result | |||
| ) | [static] |
Calculates the angle (in radians) between two vectors.
| first | The first vector. | |
| second | The second vector. | |
| result | Angle (in radians) between the vectors. |
Note that the returned angle is never bigger than the constant Pi.
Definition at line 1172 of file Vector3d.cs.
01173 { 01174 double temp; 01175 Vector3d.Dot(ref first, ref second, out temp); 01176 result = System.Math.Acos(temp / (first.Length * second.Length)); 01177 }
Calculates the angle (in radians) between two vectors.
| first | The first vector. | |
| second | The second vector. |
Note that the returned angle is never bigger than the constant Pi.
Definition at line 1162 of file Vector3d.cs.
01163 { 01164 return System.Math.Acos((Vector3d.Dot(first, second)) / (first.Length * second.Length)); 01165 }
| static void OpenTK.Vector3d.Clamp | ( | ref Vector3d | vec, | |
| ref Vector3d | min, | |||
| ref Vector3d | max, | |||
| out Vector3d | result | |||
| ) | [static] |
Clamp a vector to the given minimum and maximum vectors.
| vec | Input vector | |
| min | Minimum vector | |
| max | Maximum vector | |
| result | The clamped vector |
Definition at line 732 of file Vector3d.cs.
Clamp a vector to the given minimum and maximum vectors.
| vec | Input vector | |
| min | Minimum vector | |
| max | Maximum vector |
Definition at line 717 of file Vector3d.cs.
| static void OpenTK.Vector3d.ComponentMax | ( | ref Vector3d | a, | |
| ref Vector3d | b, | |||
| out Vector3d | result | |||
| ) | [static] |
Calculate the component-wise maximum of two vectors.
| a | First operand | |
| b | Second operand | |
| result | The component-wise maximum |
Definition at line 669 of file Vector3d.cs.
Calculate the component-wise maximum of two vectors.
| a | First operand | |
| b | Second operand |
Definition at line 655 of file Vector3d.cs.
| static void OpenTK.Vector3d.ComponentMin | ( | ref Vector3d | a, | |
| ref Vector3d | b, | |||
| out Vector3d | result | |||
| ) | [static] |
Calculate the component-wise minimum of two vectors.
| a | First operand | |
| b | Second operand | |
| result | The component-wise minimum |
Definition at line 638 of file Vector3d.cs.
Calculate the component-wise minimum of two vectors.
| a | First operand | |
| b | Second operand |
Definition at line 624 of file Vector3d.cs.
| static void OpenTK.Vector3d.Cross | ( | ref Vector3d | left, | |
| ref Vector3d | right, | |||
| out Vector3d | result | |||
| ) | [static] |
Caclulate the cross (vector) product of two vectors.
| left | First operand | |
| right | Second operand |
| result | The cross product of the two inputs |
Definition at line 851 of file Vector3d.cs.
00852 { 00853 result = new Vector3d(left.Y * right.Z - left.Z * right.Y, 00854 left.Z * right.X - left.X * right.Z, 00855 left.X * right.Y - left.Y * right.X); 00856 }
Caclulate the cross (vector) product of two vectors.
| left | First operand | |
| right | Second operand |
Definition at line 837 of file Vector3d.cs.
Divide a vector by a scalar.
| a | Vector operand | |
| f | Scalar operand | |
| result | Result of the division |
Definition at line 450 of file Vector3d.cs.
Divide a vector by a scalar.
| a | Vector operand | |
| f | Scalar operand |
Definition at line 434 of file Vector3d.cs.
| void OpenTK.Vector3d.Div | ( | double | f | ) |
Divide this instance by a scalar.
| f | Scalar operand. |
Definition at line 181 of file Vector3d.cs.
| static void OpenTK.Vector3d.Divide | ( | ref Vector3d | vector, | |
| ref Vector3d | scale, | |||
| out Vector3d | result | |||
| ) | [static] |
Divide a vector by the components of a vector (scale).
| vector | Left operand. | |
| scale | Right operand. | |
| result | Result of the operation. |
Definition at line 609 of file Vector3d.cs.
00610 { 00611 result = new Vector3d(vector.X / scale.X, vector.Y / scale.Y, vector.Z / scale.Z); 00612 }
Divides a vector by the components of a vector (scale).
| vector | Left operand. | |
| scale | Right operand. |
Definition at line 597 of file Vector3d.cs.
00598 { 00599 Divide(ref vector, ref scale, out vector); 00600 return vector; 00601 }
| static void OpenTK.Vector3d.Divide | ( | ref Vector3d | vector, | |
| double | scale, | |||
| out Vector3d | result | |||
| ) | [static] |
Divides a vector by a scalar.
| vector | Left operand. | |
| scale | Right operand. | |
| result | Result of the operation. |
Definition at line 586 of file Vector3d.cs.
00587 { 00588 Multiply(ref vector, 1 / scale, out result); 00589 }
Divides a vector by a scalar.
| vector | Left operand. | |
| scale | Right operand. |
Definition at line 574 of file Vector3d.cs.
00575 { 00576 Divide(ref vector, scale, out vector); 00577 return vector; 00578 }
| static void OpenTK.Vector3d.Dot | ( | ref Vector3d | left, | |
| ref Vector3d | right, | |||
| out double | result | |||
| ) | [static] |
Calculate the dot (scalar) product of two vectors.
| left | First operand | |
| right | Second operand | |
| result | The dot product of the two inputs |
Definition at line 822 of file Vector3d.cs.
Calculate the dot (scalar) product of two vectors.
| left | First operand | |
| right | Second operand |
Definition at line 811 of file Vector3d.cs.
| bool OpenTK.Vector3d.Equals | ( | Vector3d | other | ) |
Indicates whether the current vector is equal to another vector.
| other | A vector to compare with this vector. |
Definition at line 1373 of file Vector3d.cs.
| override bool OpenTK.Vector3d.Equals | ( | object | obj | ) |
Indicates whether this instance and a specified object are equal.
| obj | The object to compare to. |
Definition at line 1354 of file Vector3d.cs.
01355 { 01356 if (!(obj is Vector3)) 01357 return false; 01358 01359 return this.Equals((Vector3)obj); 01360 }
| override int OpenTK.Vector3d.GetHashCode | ( | ) |
Returns the hashcode for this instance.
Definition at line 1340 of file Vector3d.cs.
| static void OpenTK.Vector3d.Lerp | ( | ref Vector3d | a, | |
| ref Vector3d | b, | |||
| double | blend, | |||
| out Vector3d | result | |||
| ) | [static] |
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 |
Definition at line 884 of file Vector3d.cs.
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. |
Definition at line 869 of file Vector3d.cs.
Returns the Vector3d with the minimum magnitude.
| left | Left operand | |
| right | Right operand |
Definition at line 701 of file Vector3d.cs.
Returns the Vector3d with the minimum magnitude.
| left | Left operand | |
| right | Right operand |
Definition at line 686 of file Vector3d.cs.
Multiply a vector and a scalar.
| a | Vector operand | |
| f | Scalar operand | |
| result | Result of the multiplication |
Definition at line 416 of file Vector3d.cs.
Multiply a vector and a scalar.
| a | Vector operand | |
| f | Scalar operand |
Definition at line 401 of file Vector3d.cs.
| void OpenTK.Vector3d.Mult | ( | double | f | ) |
Multiply this instance by a scalar.
| f | Scalar operand. |
Definition at line 167 of file Vector3d.cs.
| static void OpenTK.Vector3d.Multiply | ( | ref Vector3d | vector, | |
| ref Vector3d | scale, | |||
| out Vector3d | result | |||
| ) | [static] |
Multiplies a vector by the components of a vector (scale).
| vector | Left operand. | |
| scale | Right operand. | |
| result | Result of the operation. |
Definition at line 559 of file Vector3d.cs.
00560 { 00561 result = new Vector3d(vector.X * scale.X, vector.Y * scale.Y, vector.Z * scale.Z); 00562 }
Multiplies a vector by the components a vector (scale).
| vector | Left operand. | |
| scale | Right operand. |
Definition at line 547 of file Vector3d.cs.
00548 { 00549 Multiply(ref vector, ref scale, out vector); 00550 return vector; 00551 }
| static void OpenTK.Vector3d.Multiply | ( | ref Vector3d | vector, | |
| double | scale, | |||
| out Vector3d | result | |||
| ) | [static] |
Multiplies a vector by a scalar.
| vector | Left operand. | |
| scale | Right operand. | |
| result | Result of the operation. |
Definition at line 536 of file Vector3d.cs.
00537 { 00538 result = new Vector3d(vector.X * scale, vector.Y * scale, vector.Z * scale); 00539 }
Multiplies a vector by a scalar.
| vector | Left operand. | |
| scale | Right operand. |
Definition at line 524 of file Vector3d.cs.
00525 { 00526 Multiply(ref vector, scale, out vector); 00527 return vector; 00528 }
Scale a vector to unit length.
| vec | The input vector | |
| result | The normalized vector |
Definition at line 762 of file Vector3d.cs.
Scale a vector to unit length.
| vec | The input vector |
Definition at line 748 of file Vector3d.cs.
| void OpenTK.Vector3d.Normalize | ( | ) |
Scale a vector to approximately unit length.
| vec | The input vector | |
| result | The normalized vector |
Definition at line 793 of file Vector3d.cs.
Scale a vector to approximately unit length.
| vec | The input vector |
Definition at line 779 of file Vector3d.cs.
| void OpenTK.Vector3d.NormalizeFast | ( | ) |
Converts OpenTK.Vector3d to OpenTK.Vector3.
| v3d | The Vector3d to convert. |
Definition at line 1312 of file Vector3d.cs.
Converts OpenTK.Vector3 to OpenTK.Vector3d.
| v3 | The Vector3 to convert. |
Definition at line 1304 of file Vector3d.cs.
01305 { 01306 return new Vector3d(v3.X, v3.Y, v3.Z); 01307 }
Compares two instances for inequality.
| left | The first instance. | |
| right | The second instance. |
Definition at line 1296 of file Vector3d.cs.
Multiplies an instance by a scalar.
| scale | The scalar. | |
| vec | The instance. |
Definition at line 1256 of file Vector3d.cs.
Multiplies an instance by a scalar.
| vec | The instance. | |
| scale | The scalar. |
Definition at line 1242 of file Vector3d.cs.
Adds two instances.
| left | The first instance. | |
| right | The second instance. |
Definition at line 1201 of file Vector3d.cs.
Negates an instance.
| vec | The instance. |
Definition at line 1228 of file Vector3d.cs.
Subtracts two instances.
| left | The first instance. | |
| right | The second instance. |
Definition at line 1215 of file Vector3d.cs.
Divides an instance by a scalar.
| vec | The instance. | |
| scale | The scalar. |
Definition at line 1270 of file Vector3d.cs.
Compares two instances for equality.
| left | The first instance. | |
| right | The second instance. |
Definition at line 1285 of file Vector3d.cs.
| void OpenTK.Vector3d.Scale | ( | ref Vector3d | scale | ) |
Scales this instance by the given parameter.
| scale | The scaling of the individual components. |
Definition at line 310 of file Vector3d.cs.
| void OpenTK.Vector3d.Scale | ( | Vector3d | scale | ) |
Scales this instance by the given parameter.
| scale | The scaling of the individual components. |
Definition at line 299 of file Vector3d.cs.
| void OpenTK.Vector3d.Scale | ( | double | sx, | |
| double | sy, | |||
| double | sz | |||
| ) |
Subtract one Vector from another.
| a | First operand | |
| b | Second operand | |
| result | Result of subtraction |
Definition at line 383 of file Vector3d.cs.
Subtract one Vector from another.
| a | First operand | |
| b | Second operand |
Definition at line 368 of file Vector3d.cs.
| void OpenTK.Vector3d.Sub | ( | ref Vector3d | right | ) |
Subtract the Vector passed as parameter from this instance.
| right | Right operand. This parameter is only read from. |
Definition at line 153 of file Vector3d.cs.
| void OpenTK.Vector3d.Sub | ( | Vector3d | right | ) |
Subtract the Vector passed as parameter from this instance.
| right | Right operand. This parameter is only read from. |
Definition at line 142 of file Vector3d.cs.
| static void OpenTK.Vector3d.Subtract | ( | ref Vector3d | a, | |
| ref Vector3d | b, | |||
| out Vector3d | result | |||
| ) | [static] |
Subtract one Vector from another.
| a | First operand | |
| b | Second operand | |
| result | Result of subtraction |
Definition at line 509 of file Vector3d.cs.
00510 { 00511 result = new Vector3d(a.X - b.X, a.Y - b.Y, a.Z - b.Z); 00512 }
Subtract one Vector from another.
| a | First operand | |
| b | Second operand |
Definition at line 497 of file Vector3d.cs.
00498 { 00499 Subtract(ref a, ref b, out a); 00500 return a; 00501 }
| override string OpenTK.Vector3d.ToString | ( | ) |
| static void OpenTK.Vector3d.Transform | ( | ref Vector3d | vec, | |
| ref Quaterniond | quat, | |||
| out Vector3d | result | |||
| ) | [static] |
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. |
Definition at line 1112 of file Vector3d.cs.
01113 { 01114 // Since vec.W == 0, we can optimize quat * vec * quat^-1 as follows: 01115 // vec + 2.0 * cross(quat.xyz, cross(quat.xyz, vec) + quat.w * vec) 01116 Vector3d xyz = quat.Xyz, temp, temp2; 01117 Vector3d.Cross(ref xyz, ref vec, out temp); 01118 Vector3d.Multiply(ref vec, quat.W, out temp2); 01119 Vector3d.Add(ref temp, ref temp2, out temp); 01120 Vector3d.Cross(ref xyz, ref temp, out temp); 01121 Vector3d.Multiply(ref temp, 2, out temp); 01122 Vector3d.Add(ref vec, ref temp, out result); 01123 }
| static Vector3d OpenTK.Vector3d.Transform | ( | Vector3d | vec, | |
| Quaterniond | quat | |||
| ) | [static] |
Transforms a vector by a quaternion rotation.
| vec | The vector to transform. | |
| quat | The quaternion to rotate the vector by. |
Definition at line 1099 of file Vector3d.cs.
| static void OpenTK.Vector3d.Transform | ( | ref Vector3d | vec, | |
| ref Matrix4d | mat, | |||
| out Vector3d | result | |||
| ) | [static] |
Transform a Vector by the given Matrix.
| vec | The vector to transform | |
| mat | The desired transformation | |
| result | The transformed vector |
Definition at line 1086 of file Vector3d.cs.
Transform a Vector by the given Matrix.
| vec | The vector to transform | |
| mat | The desired transformation |
Definition at line 1075 of file Vector3d.cs.
| static void OpenTK.Vector3d.TransformNormal | ( | ref Vector3d | norm, | |
| ref Matrix4d | mat, | |||
| out Vector3d | result | |||
| ) | [static] |
Transform a Normal by the given Matrix.
This calculates the inverse of the given matrix, use TransformNormalInverse if you already have the inverse to avoid this extra calculation
| norm | The normal to transform | |
| mat | The desired transformation | |
| result | The transformed normal |
Definition at line 992 of file Vector3d.cs.
00993 { 00994 Matrix4d Inverse = Matrix4d.Invert(mat); 00995 Vector3d.TransformNormalInverse(ref norm, ref Inverse, out result); 00996 }
Transform a Normal by the given Matrix.
This calculates the inverse of the given matrix, use TransformNormalInverse if you already have the inverse to avoid this extra calculation
| norm | The normal to transform | |
| mat | The desired transformation |
Definition at line 978 of file Vector3d.cs.
00979 { 00980 mat.Invert(); 00981 return TransformNormalInverse(norm, mat); 00982 }
| static void OpenTK.Vector3d.TransformNormalInverse | ( | ref Vector3d | norm, | |
| ref Matrix4d | invMat, | |||
| out Vector3d | result | |||
| ) | [static] |
Transform a Normal by the (transpose of the) given Matrix.
This version doesn't calculate the inverse matrix. Use this version if you already have the inverse of the desired transform to hand
| norm | The normal to transform | |
| invMat | The inverse of the desired transformation | |
| result | The transformed normal |
Definition at line 1022 of file Vector3d.cs.
01023 { 01024 result.X = norm.X * invMat.Row0.X + 01025 norm.Y * invMat.Row0.Y + 01026 norm.Z * invMat.Row0.Z; 01027 01028 result.Y = norm.X * invMat.Row1.X + 01029 norm.Y * invMat.Row1.Y + 01030 norm.Z * invMat.Row1.Z; 01031 01032 result.Z = norm.X * invMat.Row2.X + 01033 norm.Y * invMat.Row2.Y + 01034 norm.Z * invMat.Row2.Z; 01035 }
Transform a Normal by the (transpose of the) given Matrix.
This version doesn't calculate the inverse matrix. Use this version if you already have the inverse of the desired transform to hand
| norm | The normal to transform | |
| invMat | The inverse of the desired transformation |
Definition at line 1006 of file Vector3d.cs.
| static void OpenTK.Vector3d.TransformPerspective | ( | ref Vector3d | vec, | |
| ref Matrix4d | mat, | |||
| out Vector3d | result | |||
| ) | [static] |
Transform a Vector3d by the given Matrix, and project the resulting Vector4d back to a Vector3d.
| vec | The vector to transform | |
| mat | The desired transformation | |
| result | The transformed vector |
Definition at line 1142 of file Vector3d.cs.
Transform a Vector3d by the given Matrix, and project the resulting Vector4 back to a Vector3.
| vec | The vector to transform | |
| mat | The desired transformation |
Definition at line 1131 of file Vector3d.cs.
01132 { 01133 Vector3d result; 01134 TransformPerspective(ref vec, ref mat, out result); 01135 return result; 01136 }
| static void OpenTK.Vector3d.TransformPosition | ( | ref Vector3d | pos, | |
| ref Matrix4d | mat, | |||
| out Vector3d | result | |||
| ) | [static] |
Transform a Position by the given Matrix.
| pos | The position to transform | |
| mat | The desired transformation | |
| result | The transformed position |
Definition at line 1053 of file Vector3d.cs.
01054 { 01055 result.X = pos.X * mat.Row0.X + 01056 pos.Y * mat.Row1.X + 01057 pos.Z * mat.Row2.X + 01058 mat.Row3.X; 01059 01060 result.Y = pos.X * mat.Row0.Y + 01061 pos.Y * mat.Row1.Y + 01062 pos.Z * mat.Row2.Y + 01063 mat.Row3.Y; 01064 01065 result.Z = pos.X * mat.Row0.Z + 01066 pos.Y * mat.Row1.Z + 01067 pos.Z * mat.Row2.Z + 01068 mat.Row3.Z; 01069 }
Transform a Position by the given Matrix.
| pos | The position to transform | |
| mat | The desired transformation |
Definition at line 1041 of file Vector3d.cs.
| static void OpenTK.Vector3d.TransformVector | ( | ref Vector3d | vec, | |
| ref Matrix4d | mat, | |||
| out Vector3d | result | |||
| ) | [static] |
Transform a direction vector by the given Matrix Assumes the matrix has a bottom row of (0,0,0,1), that is the translation part is ignored.
| vec | The vector to transform | |
| mat | The desired transformation | |
| result | The transformed vector |
Definition at line 955 of file Vector3d.cs.
00956 { 00957 result.X = vec.X * mat.Row0.X + 00958 vec.Y * mat.Row1.X + 00959 vec.Z * mat.Row2.X; 00960 00961 result.Y = vec.X * mat.Row0.Y + 00962 vec.Y * mat.Row1.Y + 00963 vec.Z * mat.Row2.Y; 00964 00965 result.Z = vec.X * mat.Row0.Z + 00966 vec.Y * mat.Row1.Z + 00967 vec.Z * mat.Row2.Z; 00968 }
Transform a direction vector by the given Matrix Assumes the matrix has a bottom row of (0,0,0,1), that is the translation part is ignored.
| vec | The vector to transform | |
| mat | The desired transformation |
Definition at line 941 of file Vector3d.cs.
readonly Vector3d OpenTK.Vector3d.One = new Vector3d(1, 1, 1) [static] |
Defines an instance with all components set to 1.
Definition at line 348 of file Vector3d.cs.
readonly int OpenTK.Vector3d.SizeInBytes = Marshal.SizeOf(new Vector3d()) [static] |
Defines the size of the Vector3d struct in bytes.
Definition at line 353 of file Vector3d.cs.
readonly Vector3d OpenTK.Vector3d.UnitX = new Vector3d(1, 0, 0) [static] |
Defines a unit-length Vector3d that points towards the X-axis.
Definition at line 328 of file Vector3d.cs.
readonly Vector3d OpenTK.Vector3d.UnitY = new Vector3d(0, 1, 0) [static] |
Defines a unit-length Vector3d that points towards the Y-axis.
Definition at line 333 of file Vector3d.cs.
readonly Vector3d OpenTK.Vector3d.UnitZ = new Vector3d(0, 0, 1) [static] |
/ Defines a unit-length Vector3d that points towards the Z-axis.
Definition at line 338 of file Vector3d.cs.
| double OpenTK.Vector3d.X |
The X component of the Vector3.
Definition at line 43 of file Vector3d.cs.
| double OpenTK.Vector3d.Y |
The Y component of the Vector3.
Definition at line 48 of file Vector3d.cs.
| double OpenTK.Vector3d.Z |
The Z component of the Vector3.
Definition at line 53 of file Vector3d.cs.
readonly Vector3d OpenTK.Vector3d.Zero = new Vector3d(0, 0, 0) [static] |
Defines a zero-length Vector3.
Definition at line 343 of file Vector3d.cs.
double OpenTK.Vector3d.Length [get] |
Gets the length (magnitude) of the vector.
Definition at line 199 of file Vector3d.cs.
double OpenTK.Vector3d.LengthFast [get] |
Gets an approximation of the vector length (magnitude).
This property uses an approximation of the square root function to calculate vector magnitude, with an upper error bound of 0.001.
Definition at line 220 of file Vector3d.cs.
double OpenTK.Vector3d.LengthSquared [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.
Definition at line 241 of file Vector3d.cs.
Vector2d OpenTK.Vector3d.Xy [get, set] |
Gets or sets an OpenTK.Vector2d with the X and Y components of this instance.
Definition at line 1189 of file Vector3d.cs.
1.6.1