OpenTK.Vector4h Struct Reference

4-component Vector of the Half type. Occupies 8 Byte total. More...

List of all members.

Public Member Functions

 Vector4h (Half x, Half y, Half z, Half w)
 The new Half4 instance will avoid conversion and copy directly from the Half parameters.
 Vector4h (Single x, Single y, Single z, Single w)
 The new Half4 instance will convert the 4 parameters into 16-bit half-precision floating-point.
 Vector4h (Single x, Single y, Single z, Single w, bool throwOnError)
 The new Half4 instance will convert the 4 parameters into 16-bit half-precision floating-point.
 Vector4h (Vector4 v)
 The new Half4 instance will convert the Vector4 into 16-bit half-precision floating-point.
 Vector4h (Vector4 v, bool throwOnError)
 The new Half4 instance will convert the Vector4 into 16-bit half-precision floating-point.
 Vector4h (ref Vector4 v)
 The new Half4 instance will convert the Vector4 into 16-bit half-precision floating-point. This is the fastest constructor.
 Vector4h (ref Vector4 v, bool throwOnError)
 The new Half4 instance will convert the Vector4 into 16-bit half-precision floating-point.
 Vector4h (Vector4d v)
 The new Half4 instance will convert the Vector4d into 16-bit half-precision floating-point.
 Vector4h (Vector4d v, bool throwOnError)
 The new Half4 instance will convert the Vector4d into 16-bit half-precision floating-point.
 Vector4h (ref Vector4d v)
 The new Half4 instance will convert the Vector4d into 16-bit half-precision floating-point. This is the faster constructor.
 Vector4h (ref Vector4d v, bool throwOnError)
 The new Half4 instance will convert the Vector4d into 16-bit half-precision floating-point.
Vector4 ToVector4 ()
 Returns this Half4 instance's contents as Vector4.
Vector4d ToVector4d ()
 Returns this Half4 instance's contents as Vector4d.
 Vector4h (SerializationInfo info, StreamingContext context)
 Constructor used by ISerializable to deserialize the object.
void GetObjectData (SerializationInfo info, StreamingContext context)
 Used by ISerialize to serialize the object.
void FromBinaryStream (BinaryReader bin)
 Updates the X,Y,Z and W components of this instance by reading from a Stream.
void ToBinaryStream (BinaryWriter bin)
 Writes the X,Y,Z and W components of this instance into a Stream.
bool Equals (Vector4h other)
 Returns a value indicating whether this instance is equal to a specified OpenTK.Half4 vector.
override string ToString ()
 Returns a string that contains this Half4's numbers in human-legible form.

Static Public Member Functions

static operator Vector4h (Vector4 v4f)
 Converts OpenTK.Vector4 to OpenTK.Half4.
static operator Vector4h (Vector4d v4d)
 Converts OpenTK.Vector4d to OpenTK.Half4.
static operator Vector4 (Vector4h h4)
 Converts OpenTK.Half4 to OpenTK.Vector4.
static operator Vector4d (Vector4h h4)
 Converts OpenTK.Half4 to OpenTK.Vector4d.
static byte[] GetBytes (Vector4h h)
 Returns the Half4 as an array of bytes.
static Vector4h FromBytes (byte[] value, int startIndex)
 Converts an array of bytes into Half4.

Public Attributes

Half X
 The X component of the Half4.
Half Y
 The Y component of the Half4.
Half Z
 The Z component of the Half4.
Half W
 The W component of the Half4.

Static Public Attributes

static readonly int SizeInBytes = 8
 The size in bytes for an instance of the Half4 struct is 8.

Properties

Vector2h Xy [get, set]
 Gets or sets an OpenTK.Vector2h with the X and Y components of this instance.
Vector3h Xyz [get, set]
 Gets or sets an OpenTK.Vector3h with the X, Y and Z components of this instance.

Detailed Description

4-component Vector of the Half type. Occupies 8 Byte total.

Definition at line 37 of file Vector4h.cs.


Constructor & Destructor Documentation

OpenTK.Vector4h.Vector4h ( Half  x,
Half  y,
Half  z,
Half  w 
)

The new Half4 instance will avoid conversion and copy directly from the Half parameters.

Parameters:
x An Half instance of a 16-bit half-precision floating-point number.
y An Half instance of a 16-bit half-precision floating-point number.
z An Half instance of a 16-bit half-precision floating-point number.
w An Half instance of a 16-bit half-precision floating-point number.

Definition at line 64 of file Vector4h.cs.

00065         {
00066             this.X = x;
00067             this.Y = y;
00068             this.Z = z;
00069             this.W = w;
00070         }

OpenTK.Vector4h.Vector4h ( Single  x,
Single  y,
Single  z,
Single  w 
)

The new Half4 instance will convert the 4 parameters into 16-bit half-precision floating-point.

Parameters:
x 32-bit single-precision floating-point number.
y 32-bit single-precision floating-point number.
z 32-bit single-precision floating-point number.
w 32-bit single-precision floating-point number.

Definition at line 79 of file Vector4h.cs.

00080         {
00081             X = new Half(x);
00082             Y = new Half(y);
00083             Z = new Half(z);
00084             W = new Half(w);
00085         }

OpenTK.Vector4h.Vector4h ( Single  x,
Single  y,
Single  z,
Single  w,
bool  throwOnError 
)

The new Half4 instance will convert the 4 parameters into 16-bit half-precision floating-point.

Parameters:
x 32-bit single-precision floating-point number.
y 32-bit single-precision floating-point number.
z 32-bit single-precision floating-point number.
w 32-bit single-precision floating-point number.
throwOnError Enable checks that will throw if the conversion result is not meaningful.

Definition at line 95 of file Vector4h.cs.

00096         {
00097             X = new Half(x, throwOnError);
00098             Y = new Half(y, throwOnError);
00099             Z = new Half(z, throwOnError);
00100             W = new Half(w, throwOnError);
00101         }

OpenTK.Vector4h.Vector4h ( Vector4  v  ) 

The new Half4 instance will convert the Vector4 into 16-bit half-precision floating-point.

Parameters:
v OpenTK.Vector4

Definition at line 108 of file Vector4h.cs.

00109         {
00110             X = new Half(v.X);
00111             Y = new Half(v.Y);
00112             Z = new Half(v.Z);
00113             W = new Half(v.W);
00114         }

OpenTK.Vector4h.Vector4h ( Vector4  v,
bool  throwOnError 
)

The new Half4 instance will convert the Vector4 into 16-bit half-precision floating-point.

Parameters:
v OpenTK.Vector4
throwOnError Enable checks that will throw if the conversion result is not meaningful.

Definition at line 122 of file Vector4h.cs.

00123         {
00124             X = new Half(v.X, throwOnError);
00125             Y = new Half(v.Y, throwOnError);
00126             Z = new Half(v.Z, throwOnError);
00127             W = new Half(v.W, throwOnError);
00128         }

OpenTK.Vector4h.Vector4h ( ref Vector4  v  ) 

The new Half4 instance will convert the Vector4 into 16-bit half-precision floating-point. This is the fastest constructor.

Parameters:
v OpenTK.Vector4

Definition at line 135 of file Vector4h.cs.

00136         {
00137             X = new Half(v.X);
00138             Y = new Half(v.Y);
00139             Z = new Half(v.Z);
00140             W = new Half(v.W);
00141         }

OpenTK.Vector4h.Vector4h ( ref Vector4  v,
bool  throwOnError 
)

The new Half4 instance will convert the Vector4 into 16-bit half-precision floating-point.

Parameters:
v OpenTK.Vector4
throwOnError Enable checks that will throw if the conversion result is not meaningful.

Definition at line 148 of file Vector4h.cs.

00149         {
00150             X = new Half(v.X, throwOnError);
00151             Y = new Half(v.Y, throwOnError);
00152             Z = new Half(v.Z, throwOnError);
00153             W = new Half(v.W, throwOnError);
00154         }

OpenTK.Vector4h.Vector4h ( Vector4d  v  ) 

The new Half4 instance will convert the Vector4d into 16-bit half-precision floating-point.

Parameters:
v OpenTK.Vector4d

Definition at line 160 of file Vector4h.cs.

00161         {
00162             X = new Half(v.X);
00163             Y = new Half(v.Y);
00164             Z = new Half(v.Z);
00165             W = new Half(v.W);
00166         }

OpenTK.Vector4h.Vector4h ( Vector4d  v,
bool  throwOnError 
)

The new Half4 instance will convert the Vector4d into 16-bit half-precision floating-point.

Parameters:
v OpenTK.Vector4d
throwOnError Enable checks that will throw if the conversion result is not meaningful.

Definition at line 173 of file Vector4h.cs.

00174         {
00175             X = new Half(v.X, throwOnError);
00176             Y = new Half(v.Y, throwOnError);
00177             Z = new Half(v.Z, throwOnError);
00178             W = new Half(v.W, throwOnError);
00179         }

OpenTK.Vector4h.Vector4h ( ref Vector4d  v  ) 

The new Half4 instance will convert the Vector4d into 16-bit half-precision floating-point. This is the faster constructor.

Parameters:
v OpenTK.Vector4d

Definition at line 187 of file Vector4h.cs.

00188         {
00189             X = new Half(v.X);
00190             Y = new Half(v.Y);
00191             Z = new Half(v.Z);
00192             W = new Half(v.W);
00193         }

OpenTK.Vector4h.Vector4h ( ref Vector4d  v,
bool  throwOnError 
)

The new Half4 instance will convert the Vector4d into 16-bit half-precision floating-point.

Parameters:
v OpenTK.Vector4d
throwOnError Enable checks that will throw if the conversion result is not meaningful.

Definition at line 201 of file Vector4h.cs.

00202         {
00203             X = new Half(v.X, throwOnError);
00204             Y = new Half(v.Y, throwOnError);
00205             Z = new Half(v.Z, throwOnError);
00206             W = new Half(v.W, throwOnError);
00207         }

OpenTK.Vector4h.Vector4h ( SerializationInfo  info,
StreamingContext  context 
)

Constructor used by ISerializable to deserialize the object.

Parameters:
info 
context 

Definition at line 306 of file Vector4h.cs.

00307         {
00308             this.X = (Half)info.GetValue("X", typeof(Half));
00309             this.Y = (Half)info.GetValue("Y", typeof(Half));
00310             this.Z = (Half)info.GetValue("Z", typeof(Half));
00311             this.W = (Half)info.GetValue("W", typeof(Half));
00312         }


Member Function Documentation

bool OpenTK.Vector4h.Equals ( Vector4h  other  ) 

Returns a value indicating whether this instance is equal to a specified OpenTK.Half4 vector.

Parameters:
other OpenTK.Half4 to compare to this instance..
Returns:
True, if other is equal to this instance; false otherwise.

Definition at line 356 of file Vector4h.cs.

00357         {
00358             return (this.X.Equals(other.X) && this.Y.Equals(other.Y) && this.Z.Equals(other.Z) && this.W.Equals(other.W));
00359         }

void OpenTK.Vector4h.FromBinaryStream ( BinaryReader  bin  ) 

Updates the X,Y,Z and W components of this instance by reading from a Stream.

Parameters:
bin A BinaryReader instance associated with an open Stream.

Definition at line 331 of file Vector4h.cs.

00332         {
00333             X.FromBinaryStream(bin);
00334             Y.FromBinaryStream(bin);
00335             Z.FromBinaryStream(bin);
00336             W.FromBinaryStream(bin);
00337         }

static Vector4h OpenTK.Vector4h.FromBytes ( byte[]  value,
int  startIndex 
) [static]

Converts an array of bytes into Half4.

Parameters:
value A Half4 in it's byte[] representation.
startIndex The starting position within value.
Returns:
A new Half4 instance.

Definition at line 402 of file Vector4h.cs.

00403         {
00404             Vector4h h4 = new Vector4h();
00405             h4.X = Half.FromBytes(value, startIndex);
00406             h4.Y = Half.FromBytes(value, startIndex + 2);
00407             h4.Z = Half.FromBytes(value, startIndex + 4);
00408             h4.W = Half.FromBytes(value, startIndex + 6);
00409             return h4;
00410         }

static byte [] OpenTK.Vector4h.GetBytes ( Vector4h  h  )  [static]

Returns the Half4 as an array of bytes.

Parameters:
h The Half4 to convert.
Returns:
The input as byte array.

Definition at line 378 of file Vector4h.cs.

00379         {
00380             byte[] result = new byte[SizeInBytes];
00381 
00382             byte[] temp = Half.GetBytes(h.X);
00383             result[0] = temp[0];
00384             result[1] = temp[1];
00385             temp = Half.GetBytes(h.Y);
00386             result[2] = temp[0];
00387             result[3] = temp[1];
00388             temp = Half.GetBytes(h.Z);
00389             result[4] = temp[0];
00390             result[5] = temp[1];
00391             temp = Half.GetBytes(h.W);
00392             result[6] = temp[0];
00393             result[7] = temp[1];
00394 
00395             return result;
00396         }

void OpenTK.Vector4h.GetObjectData ( SerializationInfo  info,
StreamingContext  context 
)

Used by ISerialize to serialize the object.

Parameters:
info 
context 

Definition at line 317 of file Vector4h.cs.

00318         {
00319             info.AddValue("X", this.X);
00320             info.AddValue("Y", this.Y);
00321             info.AddValue("Z", this.Z);
00322             info.AddValue("W", this.W);
00323         }

static OpenTK.Vector4h.operator Vector4 ( Vector4h  h4  )  [explicit, static]

Converts OpenTK.Half4 to OpenTK.Vector4.

Parameters:
h4 The Half4 to convert.
Returns:
The resulting Vector4.

Definition at line 269 of file Vector4h.cs.

00270         {
00271             Vector4 result = new Vector4();
00272             result.X = h4.X.ToSingle();
00273             result.Y = h4.Y.ToSingle();
00274             result.Z = h4.Z.ToSingle();
00275             result.W = h4.W.ToSingle();
00276             return result;
00277         }

static OpenTK.Vector4h.operator Vector4d ( Vector4h  h4  )  [explicit, static]

Converts OpenTK.Half4 to OpenTK.Vector4d.

Parameters:
h4 The Half4 to convert.
Returns:
The resulting Vector4d.

Definition at line 282 of file Vector4h.cs.

00283         {
00284             Vector4d result = new Vector4d();
00285             result.X = h4.X.ToSingle();
00286             result.Y = h4.Y.ToSingle();
00287             result.Z = h4.Z.ToSingle();
00288             result.W = h4.W.ToSingle();
00289             return result;
00290         }

static OpenTK.Vector4h.operator Vector4h ( Vector4d  v4d  )  [explicit, static]

Converts OpenTK.Vector4d to OpenTK.Half4.

Parameters:
v4d The Vector4d to convert.
Returns:
The resulting Half vector.

Definition at line 261 of file Vector4h.cs.

00262         {
00263             return new Vector4h(v4d);
00264         }

static OpenTK.Vector4h.operator Vector4h ( Vector4  v4f  )  [explicit, static]

Converts OpenTK.Vector4 to OpenTK.Half4.

Parameters:
v4f The Vector4 to convert.
Returns:
The resulting Half vector.

Definition at line 253 of file Vector4h.cs.

00254         {
00255             return new Vector4h(v4f);
00256         }

void OpenTK.Vector4h.ToBinaryStream ( BinaryWriter  bin  ) 

Writes the X,Y,Z and W components of this instance into a Stream.

Parameters:
bin A BinaryWriter instance associated with an open Stream.

Definition at line 341 of file Vector4h.cs.

00342         {
00343             X.ToBinaryStream(bin);
00344             Y.ToBinaryStream(bin);
00345             Z.ToBinaryStream(bin);
00346             W.ToBinaryStream(bin);
00347         }

override string OpenTK.Vector4h.ToString (  ) 

Returns a string that contains this Half4's numbers in human-legible form.

Definition at line 366 of file Vector4h.cs.

00367         {
00368             return String.Format("({0}, {1}, {2}, {3})", X.ToString(), Y.ToString(), Z.ToString(), W.ToString());
00369         }

Vector4 OpenTK.Vector4h.ToVector4 (  ) 

Returns this Half4 instance's contents as Vector4.

Returns:
OpenTK.Vector4

Definition at line 233 of file Vector4h.cs.

00234         {
00235             return new Vector4(X, Y, Z, W);
00236         }

Vector4d OpenTK.Vector4h.ToVector4d (  ) 

Returns this Half4 instance's contents as Vector4d.

Definition at line 241 of file Vector4h.cs.

00242         {
00243             return new Vector4d(X, Y, Z, W);
00244         }


Member Data Documentation

readonly int OpenTK.Vector4h.SizeInBytes = 8 [static]

The size in bytes for an instance of the Half4 struct is 8.

Definition at line 297 of file Vector4h.cs.

The W component of the Half4.

Definition at line 51 of file Vector4h.cs.

The X component of the Half4.

Definition at line 42 of file Vector4h.cs.

The Y component of the Half4.

Definition at line 45 of file Vector4h.cs.

The Z component of the Half4.

Definition at line 48 of file Vector4h.cs.


Property Documentation

Vector2h OpenTK.Vector4h.Xy [get, set]

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

Definition at line 217 of file Vector4h.cs.

Vector3h OpenTK.Vector4h.Xyz [get, set]

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

Definition at line 223 of file Vector4h.cs.

 All Classes Functions Variables Enumerations Properties Events

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