Quantum 3 3.0.1

Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
Quantum.InputDirection Struct Reference

Compressed direction (always normalized) to be used as part of input to optimize bandwidth, encoded as an angle using a single byte (2 degrees of accuracy). More...

Public Member Functions

override int GetHashCode ()
 Overrides the hash code generation of this type. More...
 

Static Public Member Functions

static implicit operator FPVector2 (InputDirection inputDirection)
 Casts to normalized FPVector2. Defaults to zero-vector. More...
 
static implicit operator InputDirection (FPVector2 direction)
 Casts from normalized FPVector2 into encoded angle. More...
 
static void Serialize (void *ptr, IDeterministicFrameSerializer serializer)
 Serializes an InputDirection into a FrameSerializer to write or read from a frame snapshot. More...
 

Static Public Attributes

const int SIZE = sizeof(int)
 The size of the component (or struct/type) in-memory inside the Frame data-buffers or stack (when passed as value parameter). Not related to the snapshot payload this occupies, which is bit-packed and compressed. More...
 

Detailed Description

Compressed direction (always normalized) to be used as part of input to optimize bandwidth, encoded as an angle using a single byte (2 degrees of accuracy).

Member Function Documentation

◆ operator FPVector2()

static implicit Quantum.InputDirection.operator FPVector2 ( InputDirection  inputDirection)
inlinestatic

Casts to normalized FPVector2. Defaults to zero-vector.

◆ operator InputDirection()

static implicit Quantum.InputDirection.operator InputDirection ( FPVector2  direction)
inlinestatic

Casts from normalized FPVector2 into encoded angle.

◆ Serialize()

static void Quantum.InputDirection.Serialize ( void *  ptr,
IDeterministicFrameSerializer  serializer 
)
inlinestatic

Serializes an InputDirection into a FrameSerializer to write or read from a frame snapshot.

Parameters
ptrThe pointer to the InputDirection.
serializerThe FrameSerializer instance into which the struct will be serialized.

◆ GetHashCode()

override int Quantum.InputDirection.GetHashCode ( )
inline

Overrides the hash code generation of this type.

Returns
A hash code of the current state of this instance.

Member Data Documentation

◆ SIZE

const int Quantum.InputDirection.SIZE = sizeof(int)
static

The size of the component (or struct/type) in-memory inside the Frame data-buffers or stack (when passed as value parameter). Not related to the snapshot payload this occupies, which is bit-packed and compressed.