The Open Toolkit library  1.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events
OpenTK.Vector2h Struct Reference

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

Inherits ISerializable, and IEquatable< Vector2h >.

Public Member Functions

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

Static Public Member Functions

static operator Vector2h (Vector2 v)
 Converts OpenTK.Vector2 to OpenTK.Half2. More...
 
static operator Vector2h (Vector2d v)
 Converts OpenTK.Vector2d to OpenTK.Half2. More...
 
static operator Vector2 (Vector2h h)
 Converts OpenTK.Half2 to OpenTK.Vector2. More...
 
static operator Vector2d (Vector2h h)
 Converts OpenTK.Half2 to OpenTK.Vector2d. More...
 
static byte[] GetBytes (Vector2h h)
 Returns the Half2 as an array of bytes. More...
 
static Vector2h FromBytes (byte[] value, int startIndex)
 Converts an array of bytes into Half2. More...
 

Public Attributes

Half X
 The X component of the Half2. More...
 
Half Y
 The Y component of the Half2. More...
 

Static Public Attributes

static readonly int SizeInBytes = 4
 The size in bytes for an instance of the Half2 struct is 4. More...
 

Properties

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

Detailed Description

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

Constructor & Destructor Documentation

OpenTK.Vector2h.Vector2h ( Half  value)

Constructs a new instance.

Parameters
valueThe value that will initialize this instance.
OpenTK.Vector2h.Vector2h ( Single  value)

Constructs a new instance.

Parameters
valueThe value that will initialize this instance.
OpenTK.Vector2h.Vector2h ( Half  x,
Half  y 
)

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

Parameters
xAn Half instance of a 16-bit half-precision floating-point number.
yAn Half instance of a 16-bit half-precision floating-point number.
OpenTK.Vector2h.Vector2h ( Single  x,
Single  y 
)

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

Parameters
x32-bit single-precision floating-point number.
y32-bit single-precision floating-point number.
OpenTK.Vector2h.Vector2h ( Single  x,
Single  y,
bool  throwOnError 
)

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

Parameters
x32-bit single-precision floating-point number.
y32-bit single-precision floating-point number.
throwOnErrorEnable checks that will throw if the conversion result is not meaningful.
OpenTK.Vector2h.Vector2h ( Vector2  v)

The new Half2 instance will convert the Vector2 into 16-bit half-precision floating-point.

Parameters
vOpenTK.Vector2
OpenTK.Vector2h.Vector2h ( Vector2  v,
bool  throwOnError 
)

The new Half2 instance will convert the Vector2 into 16-bit half-precision floating-point.

Parameters
vOpenTK.Vector2
throwOnErrorEnable checks that will throw if the conversion result is not meaningful.
OpenTK.Vector2h.Vector2h ( ref Vector2  v)

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

Parameters
vOpenTK.Vector2
OpenTK.Vector2h.Vector2h ( ref Vector2  v,
bool  throwOnError 
)

The new Half2 instance will convert the Vector2 into 16-bit half-precision floating-point.

Parameters
vOpenTK.Vector2
throwOnErrorEnable checks that will throw if the conversion result is not meaningful.
OpenTK.Vector2h.Vector2h ( Vector2d  v)

The new Half2 instance will convert the Vector2d into 16-bit half-precision floating-point.

Parameters
vOpenTK.Vector2d
OpenTK.Vector2h.Vector2h ( Vector2d  v,
bool  throwOnError 
)

The new Half2 instance will convert the Vector2d into 16-bit half-precision floating-point.

Parameters
vOpenTK.Vector2d
throwOnErrorEnable checks that will throw if the conversion result is not meaningful.
OpenTK.Vector2h.Vector2h ( ref Vector2d  v)

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

Parameters
vOpenTK.Vector2d
OpenTK.Vector2h.Vector2h ( ref Vector2d  v,
bool  throwOnError 
)

The new Half2 instance will convert the Vector2d into 16-bit half-precision floating-point.

Parameters
vOpenTK.Vector2d
throwOnErrorEnable checks that will throw if the conversion result is not meaningful.
OpenTK.Vector2h.Vector2h ( SerializationInfo  info,
StreamingContext  context 
)

Constructor used by ISerializable to deserialize the object.

Parameters
info
context

Member Function Documentation

bool OpenTK.Vector2h.Equals ( Vector2h  other)

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

Parameters
otherOpenTK.Half2 to compare to this instance..
Returns
True, if other is equal to this instance; false otherwise.
void OpenTK.Vector2h.FromBinaryStream ( BinaryReader  bin)

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

Parameters
binA BinaryReader instance associated with an open Stream.
static Vector2h OpenTK.Vector2h.FromBytes ( byte[]  value,
int  startIndex 
)
static

Converts an array of bytes into Half2.

Parameters
valueA Half2 in it's byte[] representation.
startIndexThe starting position within value.
Returns
A new Half2 instance.
static byte [] OpenTK.Vector2h.GetBytes ( Vector2h  h)
static

Returns the Half2 as an array of bytes.

Parameters
hThe Half2 to convert.
Returns
The input as byte array.
void OpenTK.Vector2h.GetObjectData ( SerializationInfo  info,
StreamingContext  context 
)

Used by ISerialize to serialize the object.

Parameters
info
context
static OpenTK.Vector2h.operator Vector2 ( Vector2h  h)
explicitstatic

Converts OpenTK.Half2 to OpenTK.Vector2.

Parameters
hThe Half2 to convert.
Returns
The resulting Vector2.
static OpenTK.Vector2h.operator Vector2d ( Vector2h  h)
explicitstatic

Converts OpenTK.Half2 to OpenTK.Vector2d.

Parameters
hThe Half2 to convert.
Returns
The resulting Vector2d.
static OpenTK.Vector2h.operator Vector2h ( Vector2  v)
explicitstatic

Converts OpenTK.Vector2 to OpenTK.Half2.

Parameters
vThe Vector2 to convert.
Returns
The resulting Half vector.
static OpenTK.Vector2h.operator Vector2h ( Vector2d  v)
explicitstatic

Converts OpenTK.Vector2d to OpenTK.Half2.

Parameters
vThe Vector2d to convert.
Returns
The resulting Half vector.
void OpenTK.Vector2h.ToBinaryStream ( BinaryWriter  bin)

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

Parameters
binA BinaryWriter instance associated with an open Stream.
override string OpenTK.Vector2h.ToString ( )

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

Vector2 OpenTK.Vector2h.ToVector2 ( )

Returns this Half2 instance's contents as Vector2.

Returns
OpenTK.Vector2
Vector2d OpenTK.Vector2h.ToVector2d ( )

Returns this Half2 instance's contents as Vector2d.

Member Data Documentation

readonly int OpenTK.Vector2h.SizeInBytes = 4
static

The size in bytes for an instance of the Half2 struct is 4.

Half OpenTK.Vector2h.X

The X component of the Half2.

Half OpenTK.Vector2h.Y

The Y component of the Half2.

Property Documentation

Vector2h OpenTK.Vector2h.Yx
getset

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