Quantum 3 3.0.1

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

Compressed direction with magnitude (range 0 to 1) to be used as part of input to optimize bandwidth, encoded as an angle and magnitude using two bytes. More...

Public Member Functions

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

Static Public Member Functions

static implicit operator FPVector2 (InputDirectionMagnitude inputDirection)
 Casts to FPVector2 with magnitude (range 0 to 1). Defaults to zero-vector. More...
 
static implicit operator InputDirectionMagnitude (FPVector2 direction)
 Casts from FPVector2 into encoded angle and magnitude (must be in the range 0 to 1). More...
 
static void Serialize (void *ptr, IDeterministicFrameSerializer serializer)
 Serializes an InputDirectionMagnitude 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 with magnitude (range 0 to 1) to be used as part of input to optimize bandwidth, encoded as an angle and magnitude using two bytes.

Member Function Documentation

◆ operator FPVector2()

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

Casts to FPVector2 with magnitude (range 0 to 1). Defaults to zero-vector.

◆ operator InputDirectionMagnitude()

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

Casts from FPVector2 into encoded angle and magnitude (must be in the range 0 to 1).

◆ Serialize()

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

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

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

◆ GetHashCode()

override int Quantum.InputDirectionMagnitude.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.InputDirectionMagnitude.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.