Skip to content

Actor

Class

Source: Actor.h

Inherits from: Entity

Description

An Entity capable of physical interaction and collision.

Adds collision layers and masks for dynamic game objects like players, enemies, and projectiles.

Inheritance

EntityActor

Properties

NameTypeDescription
entityIduint16_tUnique id per CollisionSystem registration; used for pair deduplication.
queryIdintUsed for optimized grid queries.
layerpixelroot32::physics::CollisionLayerThe collision layer this actor belongs to.
maskpixelroot32::physics::CollisionLayerThe collision layers this actor interacts with.
collisionSystempixelroot32::physics::CollisionSystem*Reference to the collision system.

Methods

bool isInLayer(uint16_t targetLayer) const

virtual Rect getHitBox()

virtual bool isPhysicsBody() const

virtual void onCollision(Actor* other)

Description:

Callback invoked when a collision occurs. Notification only — no physics changes.

Parameters:

  • other: The actor that this actor collided with.

Released under the MIT License.