OpenTK.Vector3 Struct Reference

Represents a 3D vector using three single-precision floating-point numbers. More...

List of all members.

Public Member Functions

 Vector3 (float x, float y, float z)
 Constructs a new Vector3.
 Vector3 (Vector2 v)
 Constructs a new Vector3 from the given Vector2.
 Vector3 (Vector3 v)
 Constructs a new Vector3 from the given Vector3.
 Vector3 (Vector4 v)
 Constructs a new Vector3 from the given Vector4.
void Add (Vector3 right)
 Add the Vector passed as parameter to this instance.
void Add (ref Vector3 right)
 Add the Vector passed as parameter to this instance.
void Sub (Vector3 right)
 Subtract the Vector passed as parameter from this instance.
void Sub (ref Vector3 right)
 Subtract the Vector passed as parameter from this instance.
void Mult (float f)
 Multiply this instance by a scalar.
void Div (float f)
 Divide this instance by a scalar.
void Normalize ()
 Scales the Vector3 to unit length.
void NormalizeFast ()
 Scales the Vector3 to approximately unit length.
void Scale (float sx, float sy, float sz)
 Scales the current Vector3 by the given amounts.
void Scale (Vector3 scale)
 Scales this instance by the given parameter.
void Scale (ref Vector3 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 (Vector3 other)
 Indicates whether the current vector is equal to another vector.

Static Public Member Functions

static Vector3 Sub (Vector3 a, Vector3 b)
 Subtract one Vector from another.
static void Sub (ref Vector3 a, ref Vector3 b, out Vector3 result)
 Subtract one Vector from another.
static Vector3 Mult (Vector3 a, float f)
 Multiply a vector and a scalar.
static void Mult (ref Vector3 a, float f, out Vector3 result)
 Multiply a vector and a scalar.
static Vector3 Div (Vector3 a, float f)
 Divide a vector by a scalar.
static void Div (ref Vector3 a, float f, out Vector3 result)
 Divide a vector by a scalar.
static Vector3 Add (Vector3 a, Vector3 b)
 Adds two vectors.
static void Add (ref Vector3 a, ref Vector3 b, out Vector3 result)
 Adds two vectors.
static Vector3 Subtract (Vector3 a, Vector3 b)
 Subtract one Vector from another.
static void Subtract (ref Vector3 a, ref Vector3 b, out Vector3 result)
 Subtract one Vector from another.
static Vector3 Multiply (Vector3 vector, float scale)
 Multiplies a vector by a scalar.
static void Multiply (ref Vector3 vector, float scale, out Vector3 result)
 Multiplies a vector by a scalar.
static Vector3 Multiply (Vector3 vector, Vector3 scale)
 Multiplies a vector by the components a vector (scale).
static void Multiply (ref Vector3 vector, ref Vector3 scale, out Vector3 result)
 Multiplies a vector by the components of a vector (scale).
static Vector3 Divide (Vector3 vector, float scale)
 Divides a vector by a scalar.
static void Divide (ref Vector3 vector, float scale, out Vector3 result)
 Divides a vector by a scalar.
static Vector3 Divide (Vector3 vector, Vector3 scale)
 Divides a vector by the components of a vector (scale).
static void Divide (ref Vector3 vector, ref Vector3 scale, out Vector3 result)
 Divide a vector by the components of a vector (scale).
static Vector3 ComponentMin (Vector3 a, Vector3 b)
 Calculate the component-wise minimum of two vectors.
static void ComponentMin (ref Vector3 a, ref Vector3 b, out Vector3 result)
 Calculate the component-wise minimum of two vectors.
static Vector3 ComponentMax (Vector3 a, Vector3 b)
 Calculate the component-wise maximum of two vectors.
static void ComponentMax (ref Vector3 a, ref Vector3 b, out Vector3 result)
 Calculate the component-wise maximum of two vectors.
static Vector3 Min (Vector3 left, Vector3 right)
 Returns the Vector3 with the minimum magnitude.
static Vector3 Max (Vector3 left, Vector3 right)
 Returns the Vector3 with the minimum magnitude.
static Vector3 Clamp (Vector3 vec, Vector3 min, Vector3 max)
 Clamp a vector to the given minimum and maximum vectors.
static void Clamp (ref Vector3 vec, ref Vector3 min, ref Vector3 max, out Vector3 result)
 Clamp a vector to the given minimum and maximum vectors.
static Vector3 Normalize (Vector3 vec)
 Scale a vector to unit length.
static void Normalize (ref Vector3 vec, out Vector3 result)
 Scale a vector to unit length.
static Vector3 NormalizeFast (Vector3 vec)
 Scale a vector to approximately unit length.
static void NormalizeFast (ref Vector3 vec, out Vector3 result)
 Scale a vector to approximately unit length.
static float Dot (Vector3 left, Vector3 right)
 Calculate the dot (scalar) product of two vectors.
static void Dot (ref Vector3 left, ref Vector3 right, out float result)
 Calculate the dot (scalar) product of two vectors.
static Vector3 Cross (Vector3 left, Vector3 right)
 Caclulate the cross (vector) product of two vectors.
static void Cross (ref Vector3 left, ref Vector3 right, out Vector3 result)
 Caclulate the cross (vector) product of two vectors.
static Vector3 Lerp (Vector3 a, Vector3 b, float blend)
 Returns a new Vector that is the linear blend of the 2 given Vectors.
static void Lerp (ref Vector3 a, ref Vector3 b, float blend, out Vector3 result)
 Returns a new Vector that is the linear blend of the 2 given Vectors.
static Vector3 BaryCentric (Vector3 a, Vector3 b, Vector3 c, float u, float v)
 Interpolate 3 Vectors using Barycentric coordinates.
static void BaryCentric (ref Vector3 a, ref Vector3 b, ref Vector3 c, float u, float v, out Vector3 result)
 Interpolate 3 Vectors using Barycentric coordinates.
static Vector3 TransformVector (Vector3 vec, Matrix4 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 Vector3 vec, ref Matrix4 mat, out Vector3 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 Vector3 TransformNormal (Vector3 norm, Matrix4 mat)
 Transform a Normal by the given Matrix.
static void TransformNormal (ref Vector3 norm, ref Matrix4 mat, out Vector3 result)
 Transform a Normal by the given Matrix.
static Vector3 TransformNormalInverse (Vector3 norm, Matrix4 invMat)
 Transform a Normal by the (transpose of the) given Matrix.
static void TransformNormalInverse (ref Vector3 norm, ref Matrix4 invMat, out Vector3 result)
 Transform a Normal by the (transpose of the) given Matrix.
static Vector3 TransformPosition (Vector3 pos, Matrix4 mat)
 Transform a Position by the given Matrix.
static void TransformPosition (ref Vector3 pos, ref Matrix4 mat, out Vector3 result)
 Transform a Position by the given Matrix.
static Vector3 Transform (Vector3 vec, Matrix4 mat)
 Transform a Vector by the given Matrix.
static void Transform (ref Vector3 vec, ref Matrix4 mat, out Vector3 result)
 Transform a Vector by the given Matrix.
static Vector3 Transform (Vector3 vec, Quaternion quat)
 Transforms a vector by a quaternion rotation.
static void Transform (ref Vector3 vec, ref Quaternion quat, out Vector3 result)
 Transforms a vector by a quaternion rotation.
static Vector3 TransformPerspective (Vector3 vec, Matrix4 mat)
 Transform a Vector3 by the given Matrix, and project the resulting Vector4 back to a Vector3.
static void TransformPerspective (ref Vector3 vec, ref Matrix4 mat, out Vector3 result)
 Transform a Vector3 by the given Matrix, and project the resulting Vector4 back to a Vector3.
static float CalculateAngle (Vector3 first, Vector3 second)
 Calculates the angle (in radians) between two vectors.
static void CalculateAngle (ref Vector3 first, ref Vector3 second, out float result)
 Calculates the angle (in radians) between two vectors.
static Vector3 operator+ (Vector3 left, Vector3 right)
 Adds two instances.
static Vector3 operator- (Vector3 left, Vector3 right)
 Subtracts two instances.
static Vector3 operator- (Vector3 vec)
 Negates an instance.
static Vector3 operator* (Vector3 vec, float scale)
 Multiplies an instance by a scalar.
static Vector3 operator* (float scale, Vector3 vec)
 Multiplies an instance by a scalar.
static Vector3 operator/ (Vector3 vec, float scale)
 Divides an instance by a scalar.
static bool operator== (Vector3 left, Vector3 right)
 Compares two instances for equality.
static bool operator!= (Vector3 left, Vector3 right)
 Compares two instances for inequality.

Public Attributes

float X
 The X component of the Vector3.
float Y
 The Y component of the Vector3.
float Z
 The Z component of the Vector3.

Static Public Attributes

static readonly Vector3 UnitX = new Vector3(1, 0, 0)
 Defines a unit-length Vector3 that points towards the X-axis.
static readonly Vector3 UnitY = new Vector3(0, 1, 0)
 Defines a unit-length Vector3 that points towards the Y-axis.
static readonly Vector3 UnitZ = new Vector3(0, 0, 1)
 / Defines a unit-length Vector3 that points towards the Z-axis.
static readonly Vector3 Zero = new Vector3(0, 0, 0)
 Defines a zero-length Vector3.
static readonly Vector3 One = new Vector3(1, 1, 1)
 Defines an instance with all components set to 1.
static readonly int SizeInBytes = Marshal.SizeOf(new Vector3())
 Defines the size of the Vector3 struct in bytes.

Properties

float Length [get]
 Gets the length (magnitude) of the vector.
float LengthFast [get]
 Gets an approximation of the vector length (magnitude).
float LengthSquared [get]
 Gets the square of the vector length (magnitude).
Vector2 Xy [get, set]
 Gets or sets an OpenTK.Vector2 with the X and Y components of this instance.

Detailed Description

Represents a 3D vector using three single-precision floating-point numbers.

The Vector3 structure is suitable for interoperation with unmanaged code requiring three consecutive floats.

Definition at line 38 of file Vector3.cs.


Constructor & Destructor Documentation

OpenTK.Vector3.Vector3 ( float  x,
float  y,
float  z 
)

Constructs a new Vector3.

Parameters:
x The x component of the Vector3.
y The y component of the Vector3.
z The z component of the Vector3.

Definition at line 67 of file Vector3.cs.

00068         {
00069             X = x;
00070             Y = y;
00071             Z = z;
00072         }

OpenTK.Vector3.Vector3 ( Vector2  v  ) 

Constructs a new Vector3 from the given Vector2.

Parameters:
v The Vector2 to copy components from.

Definition at line 78 of file Vector3.cs.

00079         {
00080             X = v.X;
00081             Y = v.Y;
00082             Z = 0.0f;
00083         }

OpenTK.Vector3.Vector3 ( Vector3  v  ) 

Constructs a new Vector3 from the given Vector3.

Parameters:
v The Vector3 to copy components from.

Definition at line 89 of file Vector3.cs.

00090         {
00091             X = v.X;
00092             Y = v.Y;
00093             Z = v.Z;
00094         }

OpenTK.Vector3.Vector3 ( Vector4  v  ) 

Constructs a new Vector3 from the given Vector4.

Parameters:
v The Vector4 to copy components from.

Definition at line 100 of file Vector3.cs.

00101         {
00102             X = v.X;
00103             Y = v.Y;
00104             Z = v.Z;
00105         }


Member Function Documentation

static void OpenTK.Vector3.Add ( ref Vector3  a,
ref Vector3  b,
out Vector3  result 
) [static]

Adds two vectors.

Parameters:
a Left operand.
b Right operand.
result Result of operation.

Definition at line 483 of file Vector3.cs.

00484         {
00485             result = new Vector3(a.X + b.X, a.Y + b.Y, a.Z + b.Z);
00486         }

static Vector3 OpenTK.Vector3.Add ( Vector3  a,
Vector3  b 
) [static]

Adds two vectors.

Parameters:
a Left operand.
b Right operand.
Returns:
Result of operation.

Definition at line 471 of file Vector3.cs.

00472         {
00473             Add(ref a, ref b, out a);
00474             return a;
00475         }

void OpenTK.Vector3.Add ( ref Vector3  right  ) 

Add the Vector passed as parameter to this instance.

Parameters:
right Right operand. This parameter is only read from.

Definition at line 129 of file Vector3.cs.

00130         {
00131             this.X += right.X;
00132             this.Y += right.Y;
00133             this.Z += right.Z;
00134         }

void OpenTK.Vector3.Add ( Vector3  right  ) 

Add the Vector passed as parameter to this instance.

Parameters:
right Right operand. This parameter is only read from.

Definition at line 118 of file Vector3.cs.

00119         {
00120             this.X += right.X;
00121             this.Y += right.Y;
00122             this.Z += right.Z;
00123         }

static void OpenTK.Vector3.BaryCentric ( ref Vector3  a,
ref Vector3  b,
ref Vector3  c,
float  u,
float  v,
out Vector3  result 
) [static]

Interpolate 3 Vectors using Barycentric coordinates.

Parameters:
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 917 of file Vector3.cs.

00918         {
00919             result = a; // copy
00920 
00921             Vector3 temp = b; // copy
00922             Subtract(ref temp, ref a, out temp);
00923             Multiply(ref temp, u, out temp);
00924             Add(ref result, ref temp, out result);
00925 
00926             temp = c; // copy
00927             Subtract(ref temp, ref a, out temp);
00928             Multiply(ref temp, v, out temp);
00929             Add(ref result, ref temp, out result);
00930         }

static Vector3 OpenTK.Vector3.BaryCentric ( Vector3  a,
Vector3  b,
Vector3  c,
float  u,
float  v 
) [static]

Interpolate 3 Vectors using Barycentric coordinates.

Parameters:
a First input Vector
b Second input Vector
c Third input Vector
u First Barycentric Coordinate
v Second Barycentric Coordinate
Returns:
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 905 of file Vector3.cs.

00906         {
00907             return a + u * (b - a) + v * (c - a);
00908         }

static void OpenTK.Vector3.CalculateAngle ( ref Vector3  first,
ref Vector3  second,
out float  result 
) [static]

Calculates the angle (in radians) between two vectors.

Parameters:
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 1174 of file Vector3.cs.

01175         {
01176             float temp;
01177             Vector3.Dot(ref first, ref second, out temp);
01178             result = (float)System.Math.Acos(temp / (first.Length * second.Length));
01179         }

static float OpenTK.Vector3.CalculateAngle ( Vector3  first,
Vector3  second 
) [static]

Calculates the angle (in radians) between two vectors.

Parameters:
first The first vector.
second The second vector.
Returns:
Angle (in radians) between the vectors.

Note that the returned angle is never bigger than the constant Pi.

Definition at line 1164 of file Vector3.cs.

01165         {
01166             return (float)System.Math.Acos((Vector3.Dot(first, second)) / (first.Length * second.Length));
01167         }

static void OpenTK.Vector3.Clamp ( ref Vector3  vec,
ref Vector3  min,
ref Vector3  max,
out Vector3  result 
) [static]

Clamp a vector to the given minimum and maximum vectors.

Parameters:
vec Input vector
min Minimum vector
max Maximum vector
result The clamped vector

Definition at line 733 of file Vector3.cs.

00734         {
00735             result.X = vec.X < min.X ? min.X : vec.X > max.X ? max.X : vec.X;
00736             result.Y = vec.Y < min.Y ? min.Y : vec.Y > max.Y ? max.Y : vec.Y;
00737             result.Z = vec.Z < min.Z ? min.Z : vec.Z > max.Z ? max.Z : vec.Z;
00738         }

static Vector3 OpenTK.Vector3.Clamp ( Vector3  vec,
Vector3  min,
Vector3  max 
) [static]

Clamp a vector to the given minimum and maximum vectors.

Parameters:
vec Input vector
min Minimum vector
max Maximum vector
Returns:
The clamped vector

Definition at line 718 of file Vector3.cs.

00719         {
00720             vec.X = vec.X < min.X ? min.X : vec.X > max.X ? max.X : vec.X;
00721             vec.Y = vec.Y < min.Y ? min.Y : vec.Y > max.Y ? max.Y : vec.Y;
00722             vec.Z = vec.Z < min.Z ? min.Z : vec.Z > max.Z ? max.Z : vec.Z;
00723             return vec;
00724         }

static void OpenTK.Vector3.ComponentMax ( ref Vector3  a,
ref Vector3  b,
out Vector3  result 
) [static]

Calculate the component-wise maximum of two vectors.

Parameters:
a First operand
b Second operand
result The component-wise maximum

Definition at line 670 of file Vector3.cs.

00671         {
00672             result.X = a.X > b.X ? a.X : b.X;
00673             result.Y = a.Y > b.Y ? a.Y : b.Y;
00674             result.Z = a.Z > b.Z ? a.Z : b.Z;
00675         }

static Vector3 OpenTK.Vector3.ComponentMax ( Vector3  a,
Vector3  b 
) [static]

Calculate the component-wise maximum of two vectors.

Parameters:
a First operand
b Second operand
Returns:
The component-wise maximum

Definition at line 656 of file Vector3.cs.

00657         {
00658             a.X = a.X > b.X ? a.X : b.X;
00659             a.Y = a.Y > b.Y ? a.Y : b.Y;
00660             a.Z = a.Z > b.Z ? a.Z : b.Z;
00661             return a;
00662         }

static void OpenTK.Vector3.ComponentMin ( ref Vector3  a,
ref Vector3  b,
out Vector3  result 
) [static]

Calculate the component-wise minimum of two vectors.

Parameters:
a First operand
b Second operand
result The component-wise minimum

Definition at line 639 of file Vector3.cs.

00640         {
00641             result.X = a.X < b.X ? a.X : b.X;
00642             result.Y = a.Y < b.Y ? a.Y : b.Y;
00643             result.Z = a.Z < b.Z ? a.Z : b.Z;
00644         }

static Vector3 OpenTK.Vector3.ComponentMin ( Vector3  a,
Vector3  b 
) [static]

Calculate the component-wise minimum of two vectors.

Parameters:
a First operand
b Second operand
Returns:
The component-wise minimum

Definition at line 625 of file Vector3.cs.

00626         {
00627             a.X = a.X < b.X ? a.X : b.X;
00628             a.Y = a.Y < b.Y ? a.Y : b.Y;
00629             a.Z = a.Z < b.Z ? a.Z : b.Z;
00630             return a;
00631         }

static void OpenTK.Vector3.Cross ( ref Vector3  left,
ref Vector3  right,
out Vector3  result 
) [static]

Caclulate the cross (vector) product of two vectors.

Parameters:
left First operand
right Second operand
Returns:
The cross product of the two inputs
Parameters:
result The cross product of the two inputs

Definition at line 852 of file Vector3.cs.

00853         {
00854             result = new Vector3(left.Y * right.Z - left.Z * right.Y,
00855                 left.Z * right.X - left.X * right.Z,
00856                 left.X * right.Y - left.Y * right.X);
00857         }

static Vector3 OpenTK.Vector3.Cross ( Vector3  left,
Vector3  right 
) [static]

Caclulate the cross (vector) product of two vectors.

Parameters:
left First operand
right Second operand
Returns:
The cross product of the two inputs

Definition at line 838 of file Vector3.cs.

00839         {
00840             Vector3 result;
00841             Cross(ref left, ref right, out result);
00842             return result;
00843         }

static void OpenTK.Vector3.Div ( ref Vector3  a,
float  f,
out Vector3  result 
) [static]

Divide a vector by a scalar.

Parameters:
a Vector operand
f Scalar operand
result Result of the division

Definition at line 451 of file Vector3.cs.

00452         {
00453             float mult = 1.0f / f;
00454             result.X = a.X * mult;
00455             result.Y = a.Y * mult;
00456             result.Z = a.Z * mult;
00457         }

static Vector3 OpenTK.Vector3.Div ( Vector3  a,
float  f 
) [static]

Divide a vector by a scalar.

Parameters:
a Vector operand
f Scalar operand
Returns:
Result of the division

Definition at line 435 of file Vector3.cs.

00436         {
00437             float mult = 1.0f / f;
00438             a.X *= mult;
00439             a.Y *= mult;
00440             a.Z *= mult;
00441             return a;
00442         }

void OpenTK.Vector3.Div ( float  f  ) 

Divide this instance by a scalar.

Parameters:
f Scalar operand.

Definition at line 182 of file Vector3.cs.

00183         {
00184             float mult = 1.0f / f;
00185             this.X *= mult;
00186             this.Y *= mult;
00187             this.Z *= mult;
00188         }

static void OpenTK.Vector3.Divide ( ref Vector3  vector,
ref Vector3  scale,
out Vector3  result 
) [static]

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

Parameters:
vector Left operand.
scale Right operand.
result Result of the operation.

Definition at line 610 of file Vector3.cs.

00611         {
00612             result = new Vector3(vector.X / scale.X, vector.Y / scale.Y, vector.Z / scale.Z);
00613         }

static Vector3 OpenTK.Vector3.Divide ( Vector3  vector,
Vector3  scale 
) [static]

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

Parameters:
vector Left operand.
scale Right operand.
Returns:
Result of the operation.

Definition at line 598 of file Vector3.cs.

00599         {
00600             Divide(ref vector, ref scale, out vector);
00601             return vector;
00602         }

static void OpenTK.Vector3.Divide ( ref Vector3  vector,
float  scale,
out Vector3  result 
) [static]

Divides a vector by a scalar.

Parameters:
vector Left operand.
scale Right operand.
result Result of the operation.

Definition at line 587 of file Vector3.cs.

00588         {
00589             Multiply(ref vector, 1 / scale, out result);
00590         }

static Vector3 OpenTK.Vector3.Divide ( Vector3  vector,
float  scale 
) [static]

Divides a vector by a scalar.

Parameters:
vector Left operand.
scale Right operand.
Returns:
Result of the operation.

Definition at line 575 of file Vector3.cs.

00576         {
00577             Divide(ref vector, scale, out vector);
00578             return vector;
00579         }

static void OpenTK.Vector3.Dot ( ref Vector3  left,
ref Vector3  right,
out float  result 
) [static]

Calculate the dot (scalar) product of two vectors.

Parameters:
left First operand
right Second operand
result The dot product of the two inputs

Definition at line 823 of file Vector3.cs.

00824         {
00825             result = left.X * right.X + left.Y * right.Y + left.Z * right.Z;
00826         }

static float OpenTK.Vector3.Dot ( Vector3  left,
Vector3  right 
) [static]

Calculate the dot (scalar) product of two vectors.

Parameters:
left First operand
right Second operand
Returns:
The dot product of the two inputs

Definition at line 812 of file Vector3.cs.

00813         {
00814             return left.X * right.X + left.Y * right.Y + left.Z * right.Z;
00815         }

bool OpenTK.Vector3.Equals ( Vector3  other  ) 

Indicates whether the current vector is equal to another vector.

Parameters:
other A vector to compare with this vector.
Returns:
true if the current vector is equal to the vector parameter; otherwise, false.

Definition at line 1359 of file Vector3.cs.

01360         {
01361             return
01362                 X == other.X &&
01363                 Y == other.Y &&
01364                 Z == other.Z;
01365         }

override bool OpenTK.Vector3.Equals ( object  obj  ) 

Indicates whether this instance and a specified object are equal.

Parameters:
obj The object to compare to.
Returns:
True if the instances are equal; false otherwise.

Definition at line 1340 of file Vector3.cs.

01341         {
01342             if (!(obj is Vector3))
01343                 return false;
01344 
01345             return this.Equals((Vector3)obj);
01346         }

override int OpenTK.Vector3.GetHashCode (  ) 

Returns the hashcode for this instance.

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

Definition at line 1326 of file Vector3.cs.

01327         {
01328             return X.GetHashCode() ^ Y.GetHashCode() ^ Z.GetHashCode();
01329         }

static void OpenTK.Vector3.Lerp ( ref Vector3  a,
ref Vector3  b,
float  blend,
out Vector3  result 
) [static]

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

Parameters:
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 885 of file Vector3.cs.

00886         {
00887             result.X = blend * (b.X - a.X) + a.X;
00888             result.Y = blend * (b.Y - a.Y) + a.Y;
00889             result.Z = blend * (b.Z - a.Z) + a.Z;
00890         }

static Vector3 OpenTK.Vector3.Lerp ( Vector3  a,
Vector3  b,
float  blend 
) [static]

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

Parameters:
a First input vector
b Second input vector
blend The blend factor. a when blend=0, b when blend=1.
Returns:
a when blend=0, b when blend=1, and a linear combination otherwise

Definition at line 870 of file Vector3.cs.

00871         {
00872             a.X = blend * (b.X - a.X) + a.X;
00873             a.Y = blend * (b.Y - a.Y) + a.Y;
00874             a.Z = blend * (b.Z - a.Z) + a.Z;
00875             return a;
00876         }

static Vector3 OpenTK.Vector3.Max ( Vector3  left,
Vector3  right 
) [static]

Returns the Vector3 with the minimum magnitude.

Parameters:
left Left operand
right Right operand
Returns:
The minimum Vector3

Definition at line 702 of file Vector3.cs.

00703         {
00704             return left.LengthSquared >= right.LengthSquared ? left : right;
00705         }

static Vector3 OpenTK.Vector3.Min ( Vector3  left,
Vector3  right 
) [static]

Returns the Vector3 with the minimum magnitude.

Parameters:
left Left operand
right Right operand
Returns:
The minimum Vector3

Definition at line 687 of file Vector3.cs.

00688         {
00689             return left.LengthSquared < right.LengthSquared ? left : right;
00690         }

static void OpenTK.Vector3.Mult ( ref Vector3  a,
float  f,
out Vector3  result 
) [static]

Multiply a vector and a scalar.

Parameters:
a Vector operand
f Scalar operand
result Result of the multiplication

Definition at line 417 of file Vector3.cs.

00418         {
00419             result.X = a.X * f;
00420             result.Y = a.Y * f;
00421             result.Z = a.Z * f;
00422         }

static Vector3 OpenTK.Vector3.Mult ( Vector3  a,
float  f 
) [static]

Multiply a vector and a scalar.

Parameters:
a Vector operand
f Scalar operand
Returns:
Result of the multiplication

Definition at line 402 of file Vector3.cs.

00403         {
00404             a.X *= f;
00405             a.Y *= f;
00406             a.Z *= f;
00407             return a;
00408         }

void OpenTK.Vector3.Mult ( float  f  ) 

Multiply this instance by a scalar.

Parameters:
f Scalar operand.

Definition at line 168 of file Vector3.cs.

00169         {
00170             this.X *= f;
00171             this.Y *= f;
00172             this.Z *= f;
00173         }

static void OpenTK.Vector3.Multiply ( ref Vector3  vector,
ref Vector3  scale,
out Vector3  result 
) [static]

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

Parameters:
vector Left operand.
scale Right operand.
result Result of the operation.

Definition at line 560 of file Vector3.cs.

00561         {
00562             result = new Vector3(vector.X * scale.X, vector.Y * scale.Y, vector.Z * scale.Z);
00563         }

static Vector3 OpenTK.Vector3.Multiply ( Vector3  vector,
Vector3  scale 
) [static]

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

Parameters:
vector Left operand.
scale Right operand.
Returns:
Result of the operation.

Definition at line 548 of file Vector3.cs.

00549         {
00550             Multiply(ref vector, ref scale, out vector);
00551             return vector;
00552         }

static void OpenTK.Vector3.Multiply ( ref Vector3  vector,
float  scale,
out Vector3  result 
) [static]

Multiplies a vector by a scalar.

Parameters:
vector Left operand.
scale Right operand.
result Result of the operation.

Definition at line 537 of file Vector3.cs.

00538         {
00539             result = new Vector3(vector.X * scale, vector.Y * scale, vector.Z * scale);
00540         }

static Vector3 OpenTK.Vector3.Multiply ( Vector3  vector,
float  scale 
) [static]

Multiplies a vector by a scalar.

Parameters:
vector Left operand.
scale Right operand.
Returns:
Result of the operation.

Definition at line 525 of file Vector3.cs.

00526         {
00527             Multiply(ref vector, scale, out vector);
00528             return vector;
00529         }

static void OpenTK.Vector3.Normalize ( ref Vector3  vec,
out Vector3  result 
) [static]

Scale a vector to unit length.

Parameters:
vec The input vector
result The normalized vector

Definition at line 763 of file Vector3.cs.

00764         {
00765             float scale = 1.0f / vec.Length;
00766             result.X = vec.X * scale;
00767             result.Y = vec.Y * scale;
00768             result.Z = vec.Z * scale;
00769         }

static Vector3 OpenTK.Vector3.Normalize ( Vector3  vec  )  [static]

Scale a vector to unit length.

Parameters:
vec The input vector
Returns:
The normalized vector

Definition at line 749 of file Vector3.cs.

00750         {
00751             float scale = 1.0f / vec.Length;
00752             vec.X *= scale;
00753             vec.Y *= scale;
00754             vec.Z *= scale;
00755             return vec;
00756         }

void OpenTK.Vector3.Normalize (  ) 

Scales the Vector3 to unit length.

Definition at line 256 of file Vector3.cs.

00257         {
00258             float scale = 1.0f / this.Length;
00259             X *= scale;
00260             Y *= scale;
00261             Z *= scale;
00262         }

static void OpenTK.Vector3.NormalizeFast ( ref Vector3  vec,
out Vector3  result 
) [static]

Scale a vector to approximately unit length.

Parameters:
vec The input vector
result The normalized vector

Definition at line 794 of file Vector3.cs.

00795         {
00796             float scale = MathHelper.InverseSqrtFast(vec.X * vec.X + vec.Y * vec.Y + vec.Z * vec.Z);
00797             result.X = vec.X * scale;
00798             result.Y = vec.Y * scale;
00799             result.Z = vec.Z * scale;
00800         }

static Vector3 OpenTK.Vector3.NormalizeFast ( Vector3  vec  )  [static]

Scale a vector to approximately unit length.

Parameters:
vec The input vector
Returns:
The normalized vector

Definition at line 780 of file Vector3.cs.

00781         {
00782             float scale = MathHelper.InverseSqrtFast(vec.X * vec.X + vec.Y * vec.Y + vec.Z * vec.Z);
00783             vec.X *= scale;
00784             vec.Y *= scale;
00785             vec.Z *= scale;
00786             return vec;
00787         }

void OpenTK.Vector3.NormalizeFast (  ) 

Scales the Vector3 to approximately unit length.

Definition at line 271 of file Vector3.cs.

00272         {
00273             float scale = MathHelper.InverseSqrtFast(X * X + Y * Y + Z * Z);
00274             X *= scale;
00275             Y *= scale;
00276             Z *= scale;
00277         }

static bool OpenTK.Vector3.operator!= ( Vector3  left,
Vector3  right 
) [static]

Compares two instances for inequality.

Parameters:
left The first instance.
right The second instance.
Returns:
True, if left does not equa lright; false otherwise.

Definition at line 1298 of file Vector3.cs.

01299         {
01300             return !left.Equals(right);
01301         }

static Vector3 OpenTK.Vector3.operator* ( float  scale,
Vector3  vec 
) [static]

Multiplies an instance by a scalar.

Parameters:
scale The scalar.
vec The instance.
Returns:
The result of the calculation.

Definition at line 1258 of file Vector3.cs.

01259         {
01260             vec.X *= scale;
01261             vec.Y *= scale;
01262             vec.Z *= scale;
01263             return vec;
01264         }

static Vector3 OpenTK.Vector3.operator* ( Vector3  vec,
float  scale 
) [static]

Multiplies an instance by a scalar.

Parameters:
vec The instance.
scale The scalar.
Returns:
The result of the calculation.

Definition at line 1244 of file Vector3.cs.

01245         {
01246             vec.X *= scale;
01247             vec.Y *= scale;
01248             vec.Z *= scale;
01249             return vec;
01250         }

static Vector3 OpenTK.Vector3.operator+ ( Vector3  left,
Vector3  right 
) [static]

Adds two instances.

Parameters:
left The first instance.
right The second instance.
Returns:
The result of the calculation.

Definition at line 1203 of file Vector3.cs.

01204         {
01205             left.X += right.X;
01206             left.Y += right.Y;
01207             left.Z += right.Z;
01208             return left;
01209         }

static Vector3 OpenTK.Vector3.operator- ( Vector3  vec  )  [static]

Negates an instance.

Parameters:
vec The instance.
Returns:
The result of the calculation.

Definition at line 1230 of file Vector3.cs.

01231         {
01232             vec.X = -vec.X;
01233             vec.Y = -vec.Y;
01234             vec.Z = -vec.Z;
01235             return vec;
01236         }

static Vector3 OpenTK.Vector3.operator- ( Vector3  left,
Vector3  right 
) [static]

Subtracts two instances.

Parameters:
left The first instance.
right The second instance.
Returns:
The result of the calculation.

Definition at line 1217 of file Vector3.cs.

01218         {
01219             left.X -= right.X;
01220             left.Y -= right.Y;
01221             left.Z -= right.Z;
01222             return left;
01223         }

static Vector3 OpenTK.Vector3.operator/ ( Vector3  vec,
float  scale 
) [static]

Divides an instance by a scalar.

Parameters:
vec The instance.
scale The scalar.
Returns:
The result of the calculation.

Definition at line 1272 of file Vector3.cs.

01273         {
01274             float mult = 1.0f / scale;
01275             vec.X *= mult;
01276             vec.Y *= mult;
01277             vec.Z *= mult;
01278             return vec;
01279         }

static bool OpenTK.Vector3.operator== ( Vector3  left,
Vector3  right 
) [static]

Compares two instances for equality.

Parameters:
left The first instance.
right The second instance.
Returns:
True, if left equals right; false otherwise.

Definition at line 1287 of file Vector3.cs.

01288         {
01289             return left.Equals(right);
01290         }

void OpenTK.Vector3.Scale ( ref Vector3  scale  ) 

Scales this instance by the given parameter.

Parameters:
scale The scaling of the individual components.

Definition at line 311 of file Vector3.cs.

00312         {
00313             this.X *= scale.X;
00314             this.Y *= scale.Y;
00315             this.Z *= scale.Z;
00316         }

void OpenTK.Vector3.Scale ( Vector3  scale  ) 

Scales this instance by the given parameter.

Parameters:
scale The scaling of the individual components.

Definition at line 300 of file Vector3.cs.

00301         {
00302             this.X *= scale.X;
00303             this.Y *= scale.Y;
00304             this.Z *= scale.Z;
00305         }

void OpenTK.Vector3.Scale ( float  sx,
float  sy,
float  sz 
)

Scales the current Vector3 by the given amounts.

Parameters:
sx The scale of the X component.
sy The scale of the Y component.
sz The scale of the Z component.

Definition at line 290 of file Vector3.cs.

00291         {
00292             this.X = X * sx;
00293             this.Y = Y * sy;
00294             this.Z = Z * sz;
00295         }

static void OpenTK.Vector3.Sub ( ref Vector3  a,
ref Vector3  b,
out Vector3  result 
) [static]

Subtract one Vector from another.

Parameters:
a First operand
b Second operand
result Result of subtraction

Definition at line 384 of file Vector3.cs.

00385         {
00386             result.X = a.X - b.X;
00387             result.Y = a.Y - b.Y;
00388             result.Z = a.Z - b.Z;
00389         }

static Vector3 OpenTK.Vector3.Sub ( Vector3  a,
Vector3  b 
) [static]

Subtract one Vector from another.

Parameters:
a First operand
b Second operand
Returns:
Result of subtraction

Definition at line 369 of file Vector3.cs.

00370         {
00371             a.X -= b.X;
00372             a.Y -= b.Y;
00373             a.Z -= b.Z;
00374             return a;
00375         }

void OpenTK.Vector3.Sub ( ref Vector3  right  ) 

Subtract the Vector passed as parameter from this instance.

Parameters:
right Right operand. This parameter is only read from.

Definition at line 154 of file Vector3.cs.

00155         {
00156             this.X -= right.X;
00157             this.Y -= right.Y;
00158             this.Z -= right.Z;
00159         }

void OpenTK.Vector3.Sub ( Vector3  right  ) 

Subtract the Vector passed as parameter from this instance.

Parameters:
right Right operand. This parameter is only read from.

Definition at line 143 of file Vector3.cs.

00144         {
00145             this.X -= right.X;
00146             this.Y -= right.Y;
00147             this.Z -= right.Z;
00148         }

static void OpenTK.Vector3.Subtract ( ref Vector3  a,
ref Vector3  b,
out Vector3  result 
) [static]

Subtract one Vector from another.

Parameters:
a First operand
b Second operand
result Result of subtraction

Definition at line 510 of file Vector3.cs.

00511         {
00512             result = new Vector3(a.X - b.X, a.Y - b.Y, a.Z - b.Z);
00513         }

static Vector3 OpenTK.Vector3.Subtract ( Vector3  a,
Vector3  b 
) [static]

Subtract one Vector from another.

Parameters:
a First operand
b Second operand
Returns:
Result of subtraction

Definition at line 498 of file Vector3.cs.

00499         {
00500             Subtract(ref a, ref b, out a);
00501             return a;
00502         }

override string OpenTK.Vector3.ToString (  ) 

Returns a System.String that represents the current Vector3.

Returns:

Definition at line 1313 of file Vector3.cs.

01314         {
01315             return String.Format("({0}, {1}, {2})", X, Y, Z);
01316         }

static void OpenTK.Vector3.Transform ( ref Vector3  vec,
ref Quaternion  quat,
out Vector3  result 
) [static]

Transforms a vector by a quaternion rotation.

Parameters:
vec The vector to transform.
quat The quaternion to rotate the vector by.
result The result of the operation.

Definition at line 1116 of file Vector3.cs.

01117         {
01118             // Since vec.W == 0, we can optimize quat * vec * quat^-1 as follows:
01119             // vec + 2.0 * cross(quat.xyz, cross(quat.xyz, vec) + quat.w * vec)
01120             Vector3 xyz = quat.Xyz, temp, temp2;
01121             Vector3.Cross(ref xyz, ref vec, out temp);
01122             Vector3.Multiply(ref vec, quat.W, out temp2);
01123             Vector3.Add(ref temp, ref temp2, out temp);
01124             Vector3.Cross(ref xyz, ref temp, out temp);
01125             Vector3.Multiply(ref temp, 2, out temp);
01126             Vector3.Add(ref vec, ref temp, out result);
01127         }

static Vector3 OpenTK.Vector3.Transform ( Vector3  vec,
Quaternion  quat 
) [static]

Transforms a vector by a quaternion rotation.

Parameters:
vec The vector to transform.
quat The quaternion to rotate the vector by.
Returns:
The result of the operation.

Definition at line 1103 of file Vector3.cs.

01104         {
01105             Vector3 result;
01106             Transform(ref vec, ref quat, out result);
01107             return result;
01108         }

static void OpenTK.Vector3.Transform ( ref Vector3  vec,
ref Matrix4  mat,
out Vector3  result 
) [static]

Transform a Vector by the given Matrix.

Parameters:
vec The vector to transform
mat The desired transformation
result The transformed vector

Definition at line 1090 of file Vector3.cs.

01091         {
01092             Vector4 v4 = new Vector4(vec.X, vec.Y, vec.Z, 1.0f);
01093             Vector4.Transform(ref v4, ref mat, out v4);
01094             result = v4.Xyz;
01095         }

static Vector3 OpenTK.Vector3.Transform ( Vector3  vec,
Matrix4  mat 
) [static]

Transform a Vector by the given Matrix.

Parameters:
vec The vector to transform
mat The desired transformation
Returns:
The transformed vector

Definition at line 1079 of file Vector3.cs.

01080         {
01081             Vector3 result;
01082             Transform(ref vec, ref mat, out result);
01083             return result;
01084         }

static void OpenTK.Vector3.TransformNormal ( ref Vector3  norm,
ref Matrix4  mat,
out Vector3  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

Parameters:
norm The normal to transform
mat The desired transformation
result The transformed normal

Definition at line 994 of file Vector3.cs.

00995         {
00996             Matrix4 Inverse = Matrix4.Invert(mat);
00997             Vector3.TransformNormalInverse(ref norm, ref Inverse, out result);
00998         }

static Vector3 OpenTK.Vector3.TransformNormal ( Vector3  norm,
Matrix4  mat 
) [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

Parameters:
norm The normal to transform
mat The desired transformation
Returns:
The transformed normal

Definition at line 980 of file Vector3.cs.

00981         {
00982             mat.Invert();
00983             return TransformNormalInverse(norm, mat);
00984         }

static void OpenTK.Vector3.TransformNormalInverse ( ref Vector3  norm,
ref Matrix4  invMat,
out Vector3  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

Parameters:
norm The normal to transform
invMat The inverse of the desired transformation
result The transformed normal

Definition at line 1025 of file Vector3.cs.

01026         {
01027             result.X = norm.X * invMat.Row0.X +
01028                        norm.Y * invMat.Row0.Y +
01029                        norm.Z * invMat.Row0.Z;
01030 
01031             result.Y = norm.X * invMat.Row1.X +
01032                        norm.Y * invMat.Row1.Y +
01033                        norm.Z * invMat.Row1.Z;
01034 
01035             result.Z = norm.X * invMat.Row2.X +
01036                        norm.Y * invMat.Row2.Y +
01037                        norm.Z * invMat.Row2.Z;
01038         }

static Vector3 OpenTK.Vector3.TransformNormalInverse ( Vector3  norm,
Matrix4  invMat 
) [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

Parameters:
norm The normal to transform
invMat The inverse of the desired transformation
Returns:
The transformed normal

Definition at line 1008 of file Vector3.cs.

01009         {
01010             Vector3 n;
01011             n.X = Vector3.Dot(norm, new Vector3(invMat.Row0));
01012             n.Y = Vector3.Dot(norm, new Vector3(invMat.Row1));
01013             n.Z = Vector3.Dot(norm, new Vector3(invMat.Row2));
01014             return n;
01015         }

static void OpenTK.Vector3.TransformPerspective ( ref Vector3  vec,
ref Matrix4  mat,
out Vector3  result 
) [static]

Transform a Vector3 by the given Matrix, and project the resulting Vector4 back to a Vector3.

Parameters:
vec The vector to transform
mat The desired transformation
result The transformed vector

Definition at line 1144 of file Vector3.cs.

01145         {
01146             Vector4 v = new Vector4(vec);
01147             Vector4.Transform(ref v, ref mat, out v);
01148             result.X = v.X / v.W;
01149             result.Y = v.Y / v.W;
01150             result.Z = v.Z / v.W;
01151         }

static Vector3 OpenTK.Vector3.TransformPerspective ( Vector3  vec,
Matrix4  mat 
) [static]

Transform a Vector3 by the given Matrix, and project the resulting Vector4 back to a Vector3.

Parameters:
vec The vector to transform
mat The desired transformation
Returns:
The transformed vector

Definition at line 1133 of file Vector3.cs.

01134         {
01135             Vector3 result;
01136             TransformPerspective(ref vec, ref mat, out result);
01137             return result;
01138         }

static void OpenTK.Vector3.TransformPosition ( ref Vector3  pos,
ref Matrix4  mat,
out Vector3  result 
) [static]

Transform a Position by the given Matrix.

Parameters:
pos The position to transform
mat The desired transformation
result The transformed position

Definition at line 1057 of file Vector3.cs.

01058         {
01059             result.X = pos.X * mat.Row0.X +
01060                        pos.Y * mat.Row1.X +
01061                        pos.Z * mat.Row2.X +
01062                        mat.Row3.X;
01063 
01064             result.Y = pos.X * mat.Row0.Y +
01065                        pos.Y * mat.Row1.Y +
01066                        pos.Z * mat.Row2.Y +
01067                        mat.Row3.Y;
01068 
01069             result.Z = pos.X * mat.Row0.Z +
01070                        pos.Y * mat.Row1.Z +
01071                        pos.Z * mat.Row2.Z +
01072                        mat.Row3.Z;
01073         }

static Vector3 OpenTK.Vector3.TransformPosition ( Vector3  pos,
Matrix4  mat 
) [static]

Transform a Position by the given Matrix.

Parameters:
pos The position to transform
mat The desired transformation
Returns:
The transformed position

Definition at line 1044 of file Vector3.cs.

01045         {
01046             Vector3 p;
01047             p.X = Vector3.Dot(pos, new Vector3(mat.Column0)) + mat.Row3.X;
01048             p.Y = Vector3.Dot(pos, new Vector3(mat.Column1)) + mat.Row3.Y;
01049             p.Z = Vector3.Dot(pos, new Vector3(mat.Column2)) + mat.Row3.Z;
01050             return p;
01051         }

static void OpenTK.Vector3.TransformVector ( ref Vector3  vec,
ref Matrix4  mat,
out Vector3  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.

Parameters:
vec The vector to transform
mat The desired transformation
result The transformed vector

Definition at line 957 of file Vector3.cs.

00958         {
00959             result.X = vec.X * mat.Row0.X +
00960                        vec.Y * mat.Row1.X +
00961                        vec.Z * mat.Row2.X;
00962 
00963             result.Y = vec.X * mat.Row0.Y +
00964                        vec.Y * mat.Row1.Y +
00965                        vec.Z * mat.Row2.Y;
00966 
00967             result.Z = vec.X * mat.Row0.Z +
00968                        vec.Y * mat.Row1.Z +
00969                        vec.Z * mat.Row2.Z;
00970         }

static Vector3 OpenTK.Vector3.TransformVector ( Vector3  vec,
Matrix4  mat 
) [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.

Parameters:
vec The vector to transform
mat The desired transformation
Returns:
The transformed vector

Definition at line 942 of file Vector3.cs.

00943         {
00944             Vector3 v;
00945             v.X = Vector3.Dot(vec, new Vector3(mat.Column0));
00946             v.Y = Vector3.Dot(vec, new Vector3(mat.Column1));
00947             v.Z = Vector3.Dot(vec, new Vector3(mat.Column2));
00948             return v;
00949         }


Member Data Documentation

readonly Vector3 OpenTK.Vector3.One = new Vector3(1, 1, 1) [static]

Defines an instance with all components set to 1.

Definition at line 349 of file Vector3.cs.

readonly int OpenTK.Vector3.SizeInBytes = Marshal.SizeOf(new Vector3()) [static]

Defines the size of the Vector3 struct in bytes.

Definition at line 354 of file Vector3.cs.

readonly Vector3 OpenTK.Vector3.UnitX = new Vector3(1, 0, 0) [static]

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

Definition at line 329 of file Vector3.cs.

readonly Vector3 OpenTK.Vector3.UnitY = new Vector3(0, 1, 0) [static]

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

Definition at line 334 of file Vector3.cs.

readonly Vector3 OpenTK.Vector3.UnitZ = new Vector3(0, 0, 1) [static]

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

Definition at line 339 of file Vector3.cs.

The X component of the Vector3.

Definition at line 45 of file Vector3.cs.

The Y component of the Vector3.

Definition at line 50 of file Vector3.cs.

The Z component of the Vector3.

Definition at line 55 of file Vector3.cs.

readonly Vector3 OpenTK.Vector3.Zero = new Vector3(0, 0, 0) [static]

Defines a zero-length Vector3.

Definition at line 344 of file Vector3.cs.


Property Documentation

float OpenTK.Vector3.Length [get]

Gets the length (magnitude) of the vector.

LengthFast

See also:
LengthSquared

Definition at line 200 of file Vector3.cs.

float OpenTK.Vector3.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.

Length

See also:
LengthSquared

Definition at line 221 of file Vector3.cs.

float OpenTK.Vector3.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.

Length

See also:
LengthFast

Definition at line 242 of file Vector3.cs.

Vector2 OpenTK.Vector3.Xy [get, set]

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

Definition at line 1191 of file Vector3.cs.

 All Classes Functions Variables Enumerations Properties Events

Generated on Tue Mar 9 14:59:16 2010 for The Open Toolkit library by  doxygen 1.6.1