OpenTK.Vector3h Struct Reference

3-component Vector of the Half type. Occupies 6 Byte total. More...

List of all members.

Public Member Functions

 Vector3h (Half x, Half y, Half z)
 The new Half3 instance will avoid conversion and copy directly from the Half parameters.
 Vector3h (Single x, Single y, Single z)
 The new Half3 instance will convert the 3 parameters into 16-bit half-precision floating-point.
 Vector3h (Single x, Single y, Single z, bool throwOnError)
 The new Half3 instance will convert the 3 parameters into 16-bit half-precision floating-point.
 Vector3h (Vector3 v)
 The new Half3 instance will convert the Vector3 into 16-bit half-precision floating-point.
 Vector3h (Vector3 v, bool throwOnError)
 The new Half3 instance will convert the Vector3 into 16-bit half-precision floating-point.
 Vector3h (ref Vector3 v)
 The new Half3 instance will convert the Vector3 into 16-bit half-precision floating-point. This is the fastest constructor.
 Vector3h (ref Vector3 v, bool throwOnError)
 The new Half3 instance will convert the Vector3 into 16-bit half-precision floating-point.
 Vector3h (Vector3d v)
 The new Half3 instance will convert the Vector3d into 16-bit half-precision floating-point.
 Vector3h (Vector3d v, bool throwOnError)
 The new Half3 instance will convert the Vector3d into 16-bit half-precision floating-point.
 Vector3h (ref Vector3d v)
 The new Half3 instance will convert the Vector3d into 16-bit half-precision floating-point. This is the faster constructor.
 Vector3h (ref Vector3d v, bool throwOnError)
 The new Half3 instance will convert the Vector3d into 16-bit half-precision floating-point.
Vector3 ToVector3 ()
 Returns this Half3 instance's contents as Vector3.
Vector3d ToVector3d ()
 Returns this Half3 instance's contents as Vector3d.
 Vector3h (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 and Z components of this instance by reading from a Stream.
void ToBinaryStream (BinaryWriter bin)
 Writes the X,Y and Z components of this instance into a Stream.
bool Equals (Vector3h other)
 Returns a value indicating whether this instance is equal to a specified OpenTK.Half3 vector.
override string ToString ()
 Returns a string that contains this Half3's numbers in human-legible form.

Static Public Member Functions

static operator Vector3h (Vector3 v3f)
 Converts OpenTK.Vector3 to OpenTK.Half3.
static operator Vector3h (Vector3d v3d)
 Converts OpenTK.Vector3d to OpenTK.Half3.
static operator Vector3 (Vector3h h3)
 Converts OpenTK.Half3 to OpenTK.Vector3.
static operator Vector3d (Vector3h h3)
 Converts OpenTK.Half3 to OpenTK.Vector3d.
static byte[] GetBytes (Vector3h h)
 Returns the Half3 as an array of bytes.
static Vector3h FromBytes (byte[] value, int startIndex)
 Converts an array of bytes into Half3.

Public Attributes

Half X
 The X component of the Half3.
Half Y
 The Y component of the Half3.
Half Z
 The Z component of the Half3.

Static Public Attributes

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

Properties

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

Detailed Description

3-component Vector of the Half type. Occupies 6 Byte total.

Definition at line 37 of file Vector3h.cs.


Constructor & Destructor Documentation

OpenTK.Vector3h.Vector3h ( Half  x,
Half  y,
Half  z 
)

The new Half3 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.

Definition at line 60 of file Vector3h.cs.

00061         {
00062             this.X = x;
00063             this.Y = y;
00064             this.Z = z;
00065         }

OpenTK.Vector3h.Vector3h ( Single  x,
Single  y,
Single  z 
)

The new Half3 instance will convert the 3 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.

Definition at line 73 of file Vector3h.cs.

00074         {
00075             X = new Half(x);
00076             Y = new Half(y);
00077             Z = new Half(z);
00078         }

OpenTK.Vector3h.Vector3h ( Single  x,
Single  y,
Single  z,
bool  throwOnError 
)

The new Half3 instance will convert the 3 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.
throwOnError Enable checks that will throw if the conversion result is not meaningful.

Definition at line 87 of file Vector3h.cs.

00088         {
00089             X = new Half(x, throwOnError);
00090             Y = new Half(y, throwOnError);
00091             Z = new Half(z, throwOnError);
00092         }

OpenTK.Vector3h.Vector3h ( Vector3  v  ) 

The new Half3 instance will convert the Vector3 into 16-bit half-precision floating-point.

Parameters:
v OpenTK.Vector3

Definition at line 99 of file Vector3h.cs.

00100         {
00101             X = new Half(v.X);
00102             Y = new Half(v.Y);
00103             Z = new Half(v.Z);
00104         }

OpenTK.Vector3h.Vector3h ( Vector3  v,
bool  throwOnError 
)

The new Half3 instance will convert the Vector3 into 16-bit half-precision floating-point.

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

Definition at line 112 of file Vector3h.cs.

00113         {
00114             X = new Half(v.X, throwOnError);
00115             Y = new Half(v.Y, throwOnError);
00116             Z = new Half(v.Z, throwOnError);
00117         }

OpenTK.Vector3h.Vector3h ( ref Vector3  v  ) 

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

Parameters:
v OpenTK.Vector3

Definition at line 124 of file Vector3h.cs.

00125         {
00126             X = new Half(v.X);
00127             Y = new Half(v.Y);
00128             Z = new Half(v.Z);
00129         }

OpenTK.Vector3h.Vector3h ( ref Vector3  v,
bool  throwOnError 
)

The new Half3 instance will convert the Vector3 into 16-bit half-precision floating-point.

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

Definition at line 136 of file Vector3h.cs.

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

OpenTK.Vector3h.Vector3h ( Vector3d  v  ) 

The new Half3 instance will convert the Vector3d into 16-bit half-precision floating-point.

Parameters:
v OpenTK.Vector3d

Definition at line 147 of file Vector3h.cs.

00148         {
00149             X = new Half(v.X);
00150             Y = new Half(v.Y);
00151             Z = new Half(v.Z);
00152         }

OpenTK.Vector3h.Vector3h ( Vector3d  v,
bool  throwOnError 
)

The new Half3 instance will convert the Vector3d into 16-bit half-precision floating-point.

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

Definition at line 159 of file Vector3h.cs.

00160         {
00161             X = new Half(v.X, throwOnError);
00162             Y = new Half(v.Y, throwOnError);
00163             Z = new Half(v.Z, throwOnError);
00164         }

OpenTK.Vector3h.Vector3h ( ref Vector3d  v  ) 

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

Parameters:
v OpenTK.Vector3d

Definition at line 172 of file Vector3h.cs.

00173         {
00174             X = new Half(v.X);
00175             Y = new Half(v.Y);
00176             Z = new Half(v.Z);
00177         }

OpenTK.Vector3h.Vector3h ( ref Vector3d  v,
bool  throwOnError 
)

The new Half3 instance will convert the Vector3d into 16-bit half-precision floating-point.

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

Definition at line 185 of file Vector3h.cs.

00186         {
00187             X = new Half(v.X, throwOnError);
00188             Y = new Half(v.Y, throwOnError);
00189             Z = new Half(v.Z, throwOnError);
00190         }

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

Constructor used by ISerializable to deserialize the object.

Parameters:
info 
context 

Definition at line 281 of file Vector3h.cs.

00282         {
00283             this.X = (Half)info.GetValue("X", typeof(Half));
00284             this.Y = (Half)info.GetValue("Y", typeof(Half));
00285             this.Z = (Half)info.GetValue("Z", typeof(Half));
00286         }


Member Function Documentation

bool OpenTK.Vector3h.Equals ( Vector3h  other  ) 

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

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

Definition at line 327 of file Vector3h.cs.

00328         {
00329             return (this.X.Equals(other.X) && this.Y.Equals(other.Y) && this.Z.Equals(other.Z));
00330         }

void OpenTK.Vector3h.FromBinaryStream ( BinaryReader  bin  ) 

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

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

Definition at line 304 of file Vector3h.cs.

00305         {
00306             X.FromBinaryStream(bin);
00307             Y.FromBinaryStream(bin);
00308             Z.FromBinaryStream(bin);
00309         }

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

Converts an array of bytes into Half3.

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

Definition at line 370 of file Vector3h.cs.

00371         {
00372             Vector3h h3 = new Vector3h();
00373             h3.X = Half.FromBytes(value, startIndex);
00374             h3.Y = Half.FromBytes(value, startIndex + 2);
00375             h3.Z = Half.FromBytes(value, startIndex + 4);
00376             return h3;
00377         }

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

Returns the Half3 as an array of bytes.

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

Definition at line 349 of file Vector3h.cs.

00350         {
00351             byte[] result = new byte[SizeInBytes];
00352 
00353             byte[] temp = Half.GetBytes(h.X);
00354             result[0] = temp[0];
00355             result[1] = temp[1];
00356             temp = Half.GetBytes(h.Y);
00357             result[2] = temp[0];
00358             result[3] = temp[1];
00359             temp = Half.GetBytes(h.Z);
00360             result[4] = temp[0];
00361             result[5] = temp[1];
00362 
00363             return result;
00364         }

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

Used by ISerialize to serialize the object.

Parameters:
info 
context 

Definition at line 291 of file Vector3h.cs.

00292         {
00293             info.AddValue("X", this.X);
00294             info.AddValue("Y", this.Y);
00295             info.AddValue("Z", this.Z);
00296         }

static OpenTK.Vector3h.operator Vector3 ( Vector3h  h3  )  [explicit, static]

Converts OpenTK.Half3 to OpenTK.Vector3.

Parameters:
h3 The Half3 to convert.
Returns:
The resulting Vector3.

Definition at line 246 of file Vector3h.cs.

00247         {
00248             Vector3 result = new Vector3();
00249             result.X = h3.X.ToSingle();
00250             result.Y = h3.Y.ToSingle();
00251             result.Z = h3.Z.ToSingle();
00252             return result;
00253         }

static OpenTK.Vector3h.operator Vector3d ( Vector3h  h3  )  [explicit, static]

Converts OpenTK.Half3 to OpenTK.Vector3d.

Parameters:
h3 The Half3 to convert.
Returns:
The resulting Vector3d.

Definition at line 258 of file Vector3h.cs.

00259         {
00260             Vector3d result = new Vector3d();
00261             result.X = h3.X.ToSingle();
00262             result.Y = h3.Y.ToSingle();
00263             result.Z = h3.Z.ToSingle();
00264             return result;
00265         }

static OpenTK.Vector3h.operator Vector3h ( Vector3d  v3d  )  [explicit, static]

Converts OpenTK.Vector3d to OpenTK.Half3.

Parameters:
v3d The Vector3d to convert.
Returns:
The resulting Half vector.

Definition at line 238 of file Vector3h.cs.

00239         {
00240             return new Vector3h(v3d);
00241         }

static OpenTK.Vector3h.operator Vector3h ( Vector3  v3f  )  [explicit, static]

Converts OpenTK.Vector3 to OpenTK.Half3.

Parameters:
v3f The Vector3 to convert.
Returns:
The resulting Half vector.

Definition at line 230 of file Vector3h.cs.

00231         {
00232             return new Vector3h(v3f);
00233         }

void OpenTK.Vector3h.ToBinaryStream ( BinaryWriter  bin  ) 

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

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

Definition at line 313 of file Vector3h.cs.

00314         {
00315             X.ToBinaryStream(bin);
00316             Y.ToBinaryStream(bin);
00317             Z.ToBinaryStream(bin);
00318         }

override string OpenTK.Vector3h.ToString (  ) 

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

Definition at line 337 of file Vector3h.cs.

00338         {
00339             return String.Format("({0}, {1}, {2})", X.ToString(), Y.ToString(), Z.ToString());
00340         }

Vector3 OpenTK.Vector3h.ToVector3 (  ) 

Returns this Half3 instance's contents as Vector3.

Returns:
OpenTK.Vector3

Definition at line 210 of file Vector3h.cs.

00211         {
00212             return new Vector3(X, Y, Z);
00213         }

Vector3d OpenTK.Vector3h.ToVector3d (  ) 

Returns this Half3 instance's contents as Vector3d.

Definition at line 218 of file Vector3h.cs.

00219         {
00220             return new Vector3d(X, Y, Z);
00221         }


Member Data Documentation

readonly int OpenTK.Vector3h.SizeInBytes = 6 [static]

The size in bytes for an instance of the Half3 struct is 6.

Definition at line 272 of file Vector3h.cs.

The X component of the Half3.

Definition at line 42 of file Vector3h.cs.

The Y component of the Half3.

Definition at line 45 of file Vector3h.cs.

The Z component of the Half3.

Definition at line 48 of file Vector3h.cs.


Property Documentation

Vector2h OpenTK.Vector3h.Xy [get, set]

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

Definition at line 200 of file Vector3h.cs.

 All Classes Functions Variables Enumerations Properties Events

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