Photon Quantum 3.0.0

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

The Transform2D is an entity component providing position and rotation a 2D object. More...

Inheritance diagram for Quantum.Transform2D:
Quantum.IComponent

Public Member Functions

override int GetHashCode ()
 Overrides the hash code generation of this type. More...
 
FPVector2 InverseTransformDirection (FPVector2 direction)
 Transforms a direction from world to local space. See also:

See also
TransformDirection

. More...

 
FPVector2 InverseTransformPoint (FPVector2 point)
 Transforms a point from world to local space. See also:

See also
TransformPoint

. More...

 
void Teleport (FrameBase frame, FP rotation)
 Teleport an entity to a new rotation. More...
 
void Teleport (FrameBase frame, FPVector2 position)
 Teleport an entity to a new position. More...
 
void Teleport (FrameBase frame, FPVector2 position, FP rotation)
 Teleport an entity to a new position and rotation. More...
 
void Teleport (FrameBase frame, Transform2D *transform)
 Teleport an entity to a new transform (position and rotation). More...
 
FPVector2 TransformDirection (FPVector2 direction)
 Transforms a direction from local to world space. See also:

See also
InverseTransformDirection

. More...

 
FPVector2 TransformPoint (FPVector2 point)
 Transforms a point from local to world space. See also:

See also
InverseTransformPoint

. More...

 

Static Public Member Functions

static Transform2D Create (FPVector2 position=default, FP rotation=default)
 Create method to create a new Transform2D. More...
 
static void Serialize (void *ptr, FrameSerializer serializer)
 Serializes a Transform2D into a FrameSerializer. More...
 

Public Attributes

FPVector2 Back => Left
 Calculate the back vector (same as left). More...
 
FPVector2 Forward => Right
 Calculate the forward vector (same as right). More...
 
FPVector2 Position
 The world position of the entity. More...
 
Int32 PositionTeleportFrame => _positionTeleportFrame
 Last frame when a position teleport was called. Used by view to ignore interpolation. More...
 
FP Rotation
 The rotation in radians. More...
 
Int32 RotationTeleportFrame => _rotationTeleportFrame
 Last frame when a rotation teleport was called. Used by view to ignore interpolation. More...
 

Static Public Attributes

const int SIZE = 8 + FPVector2.SIZE + FP.SIZE
 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...
 

Properties

FPVector2 Down [get]
 Calculate the down vector. More...
 
FPVector2 Left [get]
 Calculate the left vector. More...
 
FPVector2 Right [get]
 Calculate the right vector. More...
 
FPVector2 Up [get]
 Calculate the up vector. More...
 

Detailed Description

The Transform2D is an entity component providing position and rotation a 2D object.

Member Function Documentation

◆ Create()

static Transform2D Quantum.Transform2D.Create ( FPVector2  position = default,
FP  rotation = default 
)
inlinestatic

Create method to create a new Transform2D.

Parameters
positionInitial position
rotationInitial rotation
Returns

◆ Teleport() [1/4]

void Quantum.Transform2D.Teleport ( FrameBase  frame,
FPVector2  position 
)
inline

Teleport an entity to a new position.

Is important to call on large instant movements otherwise it will be interpolated and could create visual glitches.

Parameters
frameThe current frame.
positionThe world position to teleport to.

◆ Teleport() [2/4]

void Quantum.Transform2D.Teleport ( FrameBase  frame,
FP  rotation 
)
inline

Teleport an entity to a new rotation.

Is important to call on large instant rotations otherwise it will be interpolated and could create visual glitches.

Parameters
frameThe current frame.
rotationThe rotation to teleport to.

◆ Teleport() [3/4]

void Quantum.Transform2D.Teleport ( FrameBase  frame,
FPVector2  position,
FP  rotation 
)
inline

Teleport an entity to a new position and rotation.

Is important to call on large instant movements otherwise it will be interpolated and could create visual glitches.

Parameters
frameThe current frame.
positionThe world position to teleport to.
rotationThe rotation to teleport to.

◆ Teleport() [4/4]

void Quantum.Transform2D.Teleport ( FrameBase  frame,
Transform2D transform 
)
inline

Teleport an entity to a new transform (position and rotation).

Parameters
frameThe current frame.
transformTransform

◆ TransformPoint()

FPVector2 Quantum.Transform2D.TransformPoint ( FPVector2  point)
inline

Transforms a point from local to world space. See also:

See also
InverseTransformPoint

.

Parameters
pointA point in local space.
Returns
The transformed point in world space.

◆ InverseTransformPoint()

FPVector2 Quantum.Transform2D.InverseTransformPoint ( FPVector2  point)
inline

Transforms a point from world to local space. See also:

See also
TransformPoint

.

Parameters
pointA point in world space.
Returns
The transformed point in local space.

◆ TransformDirection()

FPVector2 Quantum.Transform2D.TransformDirection ( FPVector2  direction)
inline

Transforms a direction from local to world space. See also:

See also
InverseTransformDirection

.

Parameters
directionA direction in local space.
Returns
The transformed direction in world space.

◆ InverseTransformDirection()

FPVector2 Quantum.Transform2D.InverseTransformDirection ( FPVector2  direction)
inline

Transforms a direction from world to local space. See also:

See also
TransformDirection

.

Parameters
directionA direction in world space.
Returns
The transformed direction in local space.

◆ Serialize()

static void Quantum.Transform2D.Serialize ( void *  ptr,
FrameSerializer  serializer 
)
inlinestatic

Serializes a Transform2D into a FrameSerializer.

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

◆ GetHashCode()

override int Quantum.Transform2D.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.Transform2D.SIZE = 8 + FPVector2.SIZE + FP.SIZE
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.

◆ Position

FPVector2 Quantum.Transform2D.Position

The world position of the entity.

◆ Rotation

FP Quantum.Transform2D.Rotation

The rotation in radians.

◆ PositionTeleportFrame

Int32 Quantum.Transform2D.PositionTeleportFrame => _positionTeleportFrame

Last frame when a position teleport was called. Used by view to ignore interpolation.

◆ RotationTeleportFrame

Int32 Quantum.Transform2D.RotationTeleportFrame => _rotationTeleportFrame

Last frame when a rotation teleport was called. Used by view to ignore interpolation.

◆ Forward

FPVector2 Quantum.Transform2D.Forward => Right

Calculate the forward vector (same as right).

◆ Back

FPVector2 Quantum.Transform2D.Back => Left

Calculate the back vector (same as left).

Property Documentation

◆ Right

FPVector2 Quantum.Transform2D.Right
get

Calculate the right vector.

◆ Left

FPVector2 Quantum.Transform2D.Left
get

Calculate the left vector.

◆ Up

FPVector2 Quantum.Transform2D.Up
get

Calculate the up vector.

◆ Down

FPVector2 Quantum.Transform2D.Down
get

Calculate the down vector.