Photon Quantum 3.0.0

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

A component that tracks the collisions (trigger and non-trigger) this entity is involved in. The tracked metadata is used to raise physics callbacks according to the callback Flags set. More...

Inheritance diagram for Quantum.PhysicsCallbacks2D:
Quantum.IComponent

Public Member Functions

void AddCollision (FrameBase f, AssetGuid mapGuid, int staticColliderId, bool isTrigger)
 Adds a collision with a static collider to the collisions tracked by this component using the staticColliderId as reference. More...
 
void AddCollision (FrameBase f, EntityRef entity)
 Adds a collision with an entity to the collisions tracked by this component. More...
 
bool IsCollidingWith (FrameBase f, AssetGuid mapGuid, int staticColliderId, out int index)
 Checks if a collision between the entity owner of this component and a given static collider is already being tracked. More...
 
bool IsCollidingWith (FrameBase f, EntityRef entity, out int index)
 Checks if a collision between the entity owner of this component and another entity is already being tracked. More...
 

Static Public Member Functions

static void Serialize (void *ptr, FrameSerializer serializer)
 Serializes a PhysicsCallbacks2D into a FrameSerializer. More...
 

Public Attributes

CallbackFlags Flags
 Represents which collision callbacks will be called for the entity. See CallbackFlags for more information. More...
 

Static Public Attributes

const int SIZE = sizeof(CallbackFlags) + Ptr.SIZE + sizeof(int) + 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...
 

Properties

Ptr ListBufferPtr [get]
 The pointer to the list of metadata of collisions being tracked. More...
 
int ListCount [get]
 The number of collisions currently being tracked. More...
 

Detailed Description

A component that tracks the collisions (trigger and non-trigger) this entity is involved in. The tracked metadata is used to raise physics callbacks according to the callback Flags set.

Member Function Documentation

◆ IsCollidingWith() [1/2]

bool Quantum.PhysicsCallbacks2D.IsCollidingWith ( FrameBase  f,
EntityRef  entity,
out int  index 
)
inline

Checks if a collision between the entity owner of this component and another entity is already being tracked.

Parameters
fThe frame.
entityThe other entity reference.
indexThe index of the PhysicsCommon.CollisionCallbackInfo in the list. -1 if the collision is not yet being tracked.
Returns
Returns true if it find the entity in the PhysicsCommon.CollisionCallbackInfo list.

◆ IsCollidingWith() [2/2]

bool Quantum.PhysicsCallbacks2D.IsCollidingWith ( FrameBase  f,
AssetGuid  mapGuid,
int  staticColliderId,
out int  index 
)
inline

Checks if a collision between the entity owner of this component and a given static collider is already being tracked.

Parameters
fThe frame.
mapGuidThe map guid of a scene.
staticColliderIdThe static collier id to find.
indexThe index of the PhysicsCommon.CollisionCallbackInfo of the list. -1 if the collision is not yet being tracked.
Returns
Returns true if it find the index in the PhysicsCommon.CollisionCallbackInfo list.

◆ AddCollision() [1/2]

void Quantum.PhysicsCallbacks2D.AddCollision ( FrameBase  f,
EntityRef  entity 
)
inline

Adds a collision with an entity to the collisions tracked by this component.

Parameters
fThe frame.
entityThe Entity to add to the tracking list.

◆ AddCollision() [2/2]

void Quantum.PhysicsCallbacks2D.AddCollision ( FrameBase  f,
AssetGuid  mapGuid,
int  staticColliderId,
bool  isTrigger 
)
inline

Adds a collision with a static collider to the collisions tracked by this component using the staticColliderId as reference.

Parameters
fThe frame.
mapGuidThe map guid of a scene.
staticColliderIdThe static collier id.
isTriggerIf the collider is trigger.

◆ Serialize()

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

Serializes a PhysicsCallbacks2D into a FrameSerializer.

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

Member Data Documentation

◆ SIZE

const int Quantum.PhysicsCallbacks2D.SIZE = sizeof(CallbackFlags) + Ptr.SIZE + sizeof(int) + 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.

◆ Flags

CallbackFlags Quantum.PhysicsCallbacks2D.Flags

Represents which collision callbacks will be called for the entity. See CallbackFlags for more information.

Property Documentation

◆ ListCount

int Quantum.PhysicsCallbacks2D.ListCount
get

The number of collisions currently being tracked.

◆ ListBufferPtr

Ptr Quantum.PhysicsCallbacks2D.ListBufferPtr
get

The pointer to the list of metadata of collisions being tracked.