The Transform2D is an entity component providing position and rotation a 2D object. More...
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:
. More... | |
FPVector2 | InverseTransformPoint (FPVector2 point) |
Transforms a point from world to local space. See also:
. 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:
. More... | |
FPVector2 | TransformPoint (FPVector2 point) |
Transforms a point from local to world space. See also:
. 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... | |
The Transform2D is an entity component providing position and rotation a 2D object.
|
inlinestatic |
Create method to create a new Transform2D.
position | Initial position |
rotation | Initial rotation |
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.
frame | The current frame. |
position | The world position to teleport to. |
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.
frame | The current frame. |
rotation | The rotation to teleport to. |
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.
frame | The current frame. |
position | The world position to teleport to. |
rotation | The rotation to teleport to. |
|
inline |
Teleport an entity to a new transform (position and rotation).
frame | The current frame. |
transform | Transform |
Transforms a point from local to world space. See also:
.
point | A point in local space. |
Transforms a point from world to local space. See also:
.
point | A point in world space. |
Transforms a direction from local to world space. See also:
.
direction | A direction in local space. |
Transforms a direction from world to local space. See also:
.
direction | A direction in world space. |
|
inlinestatic |
Serializes a Transform2D into a FrameSerializer.
ptr | The pointer to the Transform2D. |
serializer | The FrameSerializer instance into which the struct will be serialized. |
|
inline |
Overrides the hash code generation of this type.
|
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.
FPVector2 Quantum.Transform2D.Position |
The world position of the entity.
FP Quantum.Transform2D.Rotation |
The rotation in radians.
Int32 Quantum.Transform2D.PositionTeleportFrame => _positionTeleportFrame |
Last frame when a position teleport was called. Used by view to ignore interpolation.
Int32 Quantum.Transform2D.RotationTeleportFrame => _rotationTeleportFrame |
Last frame when a rotation teleport was called. Used by view to ignore interpolation.
|
get |
Calculate the right vector.
|
get |
Calculate the left vector.
|
get |
Calculate the up vector.
|
get |
Calculate the down vector.