Vulkan Schnee 0.0.1 (22840dc8)
High-performance rendering engine
Loading...
Searching...
No Matches
Engine::Components::PhysicsBody Class Reference

Component that manages a physics rigid body for an entity. More...

#include <PhysicsBodyComponent.h>

Inheritance diagram for Engine::Components::PhysicsBody:
Collaboration diagram for Engine::Components::PhysicsBody:

Classes

struct  BodyCallbackSubscription

Public Types

using PhysicsBodyCallbackHandle = std::uint64_t
 Opaque handle for registered collision callbacks.

Public Member Functions

 PhysicsBody (Entities::Scene *scene, entt::entity entity, std::shared_ptr< Entities::SceneNode > sceneNode)
 Constructs a PhysicsBodyComponent.
 ~PhysicsBody () override
 Destroys the physics body and releases Bullet resources.
void beginPlay () override
 Called when the component is added to the scene or the game starts.
void endPlay () override
 Called when the component is removed or the game ends.
bool drawImGui () override
 Draws component-specific ImGui inspector controls.
void setMass (float mass)
 Sets the mass of the rigid body.
float getMass () const
 Gets the mass of the rigid body.
void setFriction (float friction)
 Sets the friction coefficient.
float getFriction () const
 Gets the friction coefficient.
void setRestitution (float restitution)
 Sets the restitution (bounciness).
float getRestitution () const
 Gets the restitution.
void setKinematic (bool kinematic)
 Sets whether the body is kinematic. Kinematic bodies are moved by code, not physics.
bool isKinematic () const
 Checks if the body is kinematic.
void setStatic (bool isStatic)
 Sets whether the body is static (immovable).
bool isStatic () const
 Checks if the body is static.
void teleport (const glm::vec3 &position)
 Teleports the body to a new position.
void teleport (const glm::vec3 &position, const glm::quat &rotation)
 Teleports the body to a new position and rotation.
void setLinearVelocity (const glm::vec3 &velocity)
 Sets the linear velocity.
glm::vec3 getLinearVelocity () const
 Gets the linear velocity.
void setAngularVelocity (const glm::vec3 &velocity)
 Sets the angular velocity.
glm::vec3 getAngularVelocity () const
 Gets the angular velocity.
void registerCollision (Components::Collision *collision)
 Registers a collision component with this body. Called by CollisionComponent::beginPlay().
void unregisterCollision (Components::Collision *collision)
 Unregisters a collision component from this body. Called by CollisionComponent::endPlay().
void markShapeDirty ()
 Marks the collision shape as needing rebuild. Called when a collision component's shape changes.
void markCollisionFiltersDirty ()
 Marks collision filters as needing update on the rigid body.
void rebuildIfDirty ()
 Rebuilds the collision shape if dirty.
btRigidBody * getRigidBody () const
 Gets the Bullet rigid body.
Entities::Actor * getHitActor () const
 Gets the actor owning this physics body when the owning entity is an actor.
Physics::PhysicsBodyHandle getPhysicsBodyHandle () const
 Gets the physics-engine registration handle for this body.
void setPhysicsBodyHandle (Physics::PhysicsBodyHandle handle)
 Sets the physics-engine registration handle for this body.
const std::vector< Components::Collision * > & getCollisions () const
 Gets collision components registered with this body.
Components::Collision * findCollisionForShape (const btCollisionShape *shape) const
 Finds the collision component that owns a Bullet collision shape.
btDiscreteDynamicsWorld * getDynamicsWorld () const
 Gets the Bullet dynamics world.
void processCollisions ()
 Processes collision events and dispatches callbacks. Called after physics step.
template<typename ActorType, typename Callback>
PhysicsBodyCallbackHandle onOverlapBegin (Callback &&callback)
 Registers a callback for overlap begin events with actors of ActorType.
template<typename ActorType, typename Callback>
PhysicsBodyCallbackHandle onOverlapStay (Callback &&callback)
 Registers a callback for overlap stay events with actors of ActorType.
template<typename ActorType, typename Callback>
PhysicsBodyCallbackHandle onOverlapEnd (Callback &&callback)
 Registers a callback for overlap end events with actors of ActorType.
template<typename ActorType, typename Callback>
PhysicsBodyCallbackHandle onCollisionBegin (Callback &&callback)
 Registers a callback for blocking collision begin events with actors of ActorType.
template<typename ActorType, typename Callback>
PhysicsBodyCallbackHandle onCollisionStay (Callback &&callback)
 Registers a callback for blocking collision stay events with actors of ActorType.
template<typename ActorType, typename Callback>
PhysicsBodyCallbackHandle onCollisionEnd (Callback &&callback)
 Registers a callback for blocking collision end events with actors of ActorType.
void removeCollisionCallback (PhysicsBodyCallbackHandle handle)
 Removes a previously registered collision callback.
void dispatchCollisionEvent (const Physics::CollisionEvent &event)
 Dispatches a collision event to callbacks matching its type and response.
void debugDraw () const
 Draws debug visualization of all collision shapes.
Public Member Functions inherited from Engine::Components::Logic
 Logic (Entities::Scene *owningScene)
 Constructs a logic component owned by a scene.
 Logic (const Entities::SpawnContext &context)
 Constructs a logic component from spawn context data.
virtual ~Logic ()=default
 Destroys the logic component.
virtual std::string getComponentName () const
 Gets the component type name for debugging/UI.
virtual bool drawImGuiName ()
 Used to alter the name of the entity in the outliner.
virtual void tick (double deltaTime)
 Called every frame if ticking is enabled.
bool hasBegunPlay () const
 Checks whether beginPlay() has been called without a matching endPlay().
bool canTick () const
 Checks if the component is currently set to tick.
void setCanTick (bool enable)
 Enables or disables ticking for this component.
Entities::Entity * getOwningEntity () const
 Gets the entity this component belongs to.

Static Public Attributes

static constexpr bool IsUnique = true
 Only one physics body may be attached per entity.
static constexpr const char * ComponentName = "PhysicsBody"
 Component type name.
Static Public Attributes inherited from Engine::Components::Logic
static constexpr bool IsUnique = false
 Defines whether multiple instances of this component can exist on the same entity. Defaults to false (multiple allowed). Override in derived classes with static constexpr bool IsUnique = true; if needed.
static constexpr const char * ComponentName = "Logic"
 Fallback component type name. Derived classes may override getComponentName() for custom labels.

Private Member Functions

void rebuildCollisionShape ()
void createRigidBody ()
void destroyRigidBody ()
void updateEcsComponent ()
void applyCollisionFlags ()
void readdRigidBodyWithCurrentFilters ()
std::uint16_t getBulletCollisionGroup () const
std::uint16_t getBulletCollisionMask () const
bool shouldUseNoContactResponse () const
Core::PhysicsEngine * getPhysicsEngine () const
PhysicsBodyCallbackHandle addBodyCallback (std::vector< BodyCallbackSubscription > &callbacks, std::function< void(const Physics::CollisionEvent &)> callback)
void clearCallbacks ()

Private Attributes

entt::entity entity_
std::weak_ptr< Entities::SceneNode > sceneNode_
std::vector< Components::Collision * > collisions_
btCompoundShape * compoundShape_ = nullptr
btRigidBody * rigidBody_ = nullptr
float mass_ = 1.0f
float friction_ = 0.5f
float restitution_ = 0.0f
bool isKinematic_ = false
bool isStatic_ = false
bool shapeDirty_ = true
bool isInitialized_ = false
bool collisionFiltersDirty_ = true
Physics::PhysicsBodyHandle bodyHandle_
PhysicsBodyCallbackHandle nextCallbackHandle_ = 1
std::vector< BodyCallbackSubscription > overlapBeginCallbacks_
std::vector< BodyCallbackSubscription > overlapStayCallbacks_
std::vector< BodyCallbackSubscription > overlapEndCallbacks_
std::vector< BodyCallbackSubscription > collisionBeginCallbacks_
std::vector< BodyCallbackSubscription > collisionStayCallbacks_
std::vector< BodyCallbackSubscription > collisionEndCallbacks_
std::set< Components::Collision * > previousCollisions_

Additional Inherited Members

Protected Member Functions inherited from Engine::Components::Logic
Entities::Scene * getScene () const
 Gets the scene this component belongs to.
Core::SceneManager * getSceneManager () const
 Helper to get the SceneManager from the owning scene.

Detailed Description

Component that manages a physics rigid body for an entity.

PhysicsBodyComponent is unique per entity and manages the Bullet rigid body. CollisionComponents register with this component to define collision shapes. When multiple collision shapes exist, they are combined into a compound shape.

Definition at line 40 of file PhysicsBodyComponent.h.

Member Typedef Documentation

◆ PhysicsBodyCallbackHandle

Opaque handle for registered collision callbacks.

Definition at line 44 of file PhysicsBodyComponent.h.

Constructor & Destructor Documentation

◆ PhysicsBody()

Engine::Components::PhysicsBody::PhysicsBody ( Entities::Scene * scene,
entt::entity entity,
std::shared_ptr< Entities::SceneNode > sceneNode )

Constructs a PhysicsBodyComponent.

Parameters
sceneThe owning scene.
entityThe ECS entity associated with this component.
sceneNodeThe scene node for transform access.

◆ ~PhysicsBody()

Engine::Components::PhysicsBody::~PhysicsBody ( )
override

Destroys the physics body and releases Bullet resources.

Member Function Documentation

◆ addBodyCallback()

PhysicsBodyCallbackHandle Engine::Components::PhysicsBody::addBodyCallback ( std::vector< BodyCallbackSubscription > & callbacks,
std::function< void(const Physics::CollisionEvent &)> callback )
private

Referenced by onCollisionBegin(), onCollisionEnd(), onCollisionStay(), onOverlapBegin(), onOverlapEnd(), and onOverlapStay().

Here is the caller graph for this function:

◆ applyCollisionFlags()

void Engine::Components::PhysicsBody::applyCollisionFlags ( )
private

◆ beginPlay()

void Engine::Components::PhysicsBody::beginPlay ( )
overridevirtual

Called when the component is added to the scene or the game starts.

Reimplemented from Engine::Components::Logic.

◆ clearCallbacks()

void Engine::Components::PhysicsBody::clearCallbacks ( )
private

◆ createRigidBody()

void Engine::Components::PhysicsBody::createRigidBody ( )
private

◆ debugDraw()

void Engine::Components::PhysicsBody::debugDraw ( ) const

Draws debug visualization of all collision shapes.

Iterates through registered CollisionComponents and calls their debugDraw(). Uses the current world transform from the SceneNode.

◆ destroyRigidBody()

void Engine::Components::PhysicsBody::destroyRigidBody ( )
private

◆ dispatchCollisionEvent()

void Engine::Components::PhysicsBody::dispatchCollisionEvent ( const Physics::CollisionEvent & event)

Dispatches a collision event to callbacks matching its type and response.

Parameters
eventCollision event to dispatch.

◆ drawImGui()

bool Engine::Components::PhysicsBody::drawImGui ( )
overridevirtual

Draws component-specific ImGui inspector controls.

Returns
true if the component drew its own inspector UI.

Reimplemented from Engine::Components::Logic.

◆ endPlay()

void Engine::Components::PhysicsBody::endPlay ( )
overridevirtual

Called when the component is removed or the game ends.

Reimplemented from Engine::Components::Logic.

◆ findCollisionForShape()

Components::Collision * Engine::Components::PhysicsBody::findCollisionForShape ( const btCollisionShape * shape) const
nodiscard

Finds the collision component that owns a Bullet collision shape.

Parameters
shapeBullet collision shape to look up.
Returns
Matching collision component, or nullptr when not found.

◆ getAngularVelocity()

glm::vec3 Engine::Components::PhysicsBody::getAngularVelocity ( ) const
nodiscard

Gets the angular velocity.

Returns
Angular velocity in rad/s.

◆ getBulletCollisionGroup()

std::uint16_t Engine::Components::PhysicsBody::getBulletCollisionGroup ( ) const
nodiscardprivate

◆ getBulletCollisionMask()

std::uint16_t Engine::Components::PhysicsBody::getBulletCollisionMask ( ) const
nodiscardprivate

◆ getCollisions()

const std::vector< Components::Collision * > & Engine::Components::PhysicsBody::getCollisions ( ) const
inlinenodiscard

Gets collision components registered with this body.

Returns
Registered collision component list.

Definition at line 232 of file PhysicsBodyComponent.h.

References collisions_.

◆ getDynamicsWorld()

btDiscreteDynamicsWorld * Engine::Components::PhysicsBody::getDynamicsWorld ( ) const
nodiscard

Gets the Bullet dynamics world.

Returns
Pointer to the dynamics world, or nullptr if physics engine unavailable.

◆ getFriction()

float Engine::Components::PhysicsBody::getFriction ( ) const
inlinenodiscard

Gets the friction coefficient.

Returns
Friction value.

Definition at line 90 of file PhysicsBodyComponent.h.

References friction_.

◆ getHitActor()

Entities::Actor * Engine::Components::PhysicsBody::getHitActor ( ) const
nodiscard

Gets the actor owning this physics body when the owning entity is an actor.

Returns
Actor pointer, or nullptr when the body is not owned by an actor

Referenced by Engine::Components::Collision::onOverlapBegin(), and Engine::Components::Collision::onOverlapEnd().

Here is the caller graph for this function:

◆ getLinearVelocity()

glm::vec3 Engine::Components::PhysicsBody::getLinearVelocity ( ) const
nodiscard

Gets the linear velocity.

Returns
Velocity in m/s.

◆ getMass()

float Engine::Components::PhysicsBody::getMass ( ) const
inlinenodiscard

Gets the mass of the rigid body.

Returns
Mass in kilograms.

Definition at line 78 of file PhysicsBodyComponent.h.

References mass_.

◆ getPhysicsBodyHandle()

Physics::PhysicsBodyHandle Engine::Components::PhysicsBody::getPhysicsBodyHandle ( ) const
inlinenodiscard

Gets the physics-engine registration handle for this body.

Returns
Physics body handle, or an invalid handle when unregistered.

Definition at line 220 of file PhysicsBodyComponent.h.

References bodyHandle_.

◆ getPhysicsEngine()

Core::PhysicsEngine * Engine::Components::PhysicsBody::getPhysicsEngine ( ) const
nodiscardprivate

◆ getRestitution()

float Engine::Components::PhysicsBody::getRestitution ( ) const
inlinenodiscard

Gets the restitution.

Returns
Restitution value.

Definition at line 102 of file PhysicsBodyComponent.h.

References restitution_.

◆ getRigidBody()

btRigidBody * Engine::Components::PhysicsBody::getRigidBody ( ) const
inlinenodiscard

Gets the Bullet rigid body.

Returns
Pointer to the rigid body, or nullptr if not created.

Definition at line 208 of file PhysicsBodyComponent.h.

References rigidBody_.

◆ isKinematic()

bool Engine::Components::PhysicsBody::isKinematic ( ) const
inlinenodiscard

Checks if the body is kinematic.

Returns
True if kinematic.

Definition at line 115 of file PhysicsBodyComponent.h.

References isKinematic_.

◆ isStatic()

bool Engine::Components::PhysicsBody::isStatic ( ) const
inlinenodiscard

Checks if the body is static.

Returns
True if static.

Definition at line 127 of file PhysicsBodyComponent.h.

References isStatic_.

Referenced by setStatic().

Here is the caller graph for this function:

◆ markCollisionFiltersDirty()

void Engine::Components::PhysicsBody::markCollisionFiltersDirty ( )

Marks collision filters as needing update on the rigid body.

◆ markShapeDirty()

void Engine::Components::PhysicsBody::markShapeDirty ( )

Marks the collision shape as needing rebuild. Called when a collision component's shape changes.

◆ onCollisionBegin()

template<typename ActorType, typename Callback>
PhysicsBodyCallbackHandle Engine::Components::PhysicsBody::onCollisionBegin ( Callback && callback)
inline

Registers a callback for blocking collision begin events with actors of ActorType.

Parameters
callbackCallable invoked with the collision event and matched actor.
Returns
Handle that can remove the callback.

Definition at line 326 of file PhysicsBodyComponent.h.

References addBodyCallback(), and collisionBeginCallbacks_.

Here is the call graph for this function:

◆ onCollisionEnd()

template<typename ActorType, typename Callback>
PhysicsBodyCallbackHandle Engine::Components::PhysicsBody::onCollisionEnd ( Callback && callback)
inline

Registers a callback for blocking collision end events with actors of ActorType.

Parameters
callbackCallable invoked with the collision event and matched actor.
Returns
Handle that can remove the callback.

Definition at line 368 of file PhysicsBodyComponent.h.

References addBodyCallback(), and collisionEndCallbacks_.

Here is the call graph for this function:

◆ onCollisionStay()

template<typename ActorType, typename Callback>
PhysicsBodyCallbackHandle Engine::Components::PhysicsBody::onCollisionStay ( Callback && callback)
inline

Registers a callback for blocking collision stay events with actors of ActorType.

Parameters
callbackCallable invoked with the collision event and matched actor.
Returns
Handle that can remove the callback.

Definition at line 347 of file PhysicsBodyComponent.h.

References addBodyCallback(), and collisionStayCallbacks_.

Here is the call graph for this function:

◆ onOverlapBegin()

template<typename ActorType, typename Callback>
PhysicsBodyCallbackHandle Engine::Components::PhysicsBody::onOverlapBegin ( Callback && callback)
inline

Registers a callback for overlap begin events with actors of ActorType.

Parameters
callbackCallable invoked with the collision event and matched actor.
Returns
Handle that can remove the callback.

Definition at line 263 of file PhysicsBodyComponent.h.

References addBodyCallback(), and overlapBeginCallbacks_.

Here is the call graph for this function:

◆ onOverlapEnd()

template<typename ActorType, typename Callback>
PhysicsBodyCallbackHandle Engine::Components::PhysicsBody::onOverlapEnd ( Callback && callback)
inline

Registers a callback for overlap end events with actors of ActorType.

Parameters
callbackCallable invoked with the collision event and matched actor.
Returns
Handle that can remove the callback.

Definition at line 305 of file PhysicsBodyComponent.h.

References addBodyCallback(), and overlapEndCallbacks_.

Here is the call graph for this function:

◆ onOverlapStay()

template<typename ActorType, typename Callback>
PhysicsBodyCallbackHandle Engine::Components::PhysicsBody::onOverlapStay ( Callback && callback)
inline

Registers a callback for overlap stay events with actors of ActorType.

Parameters
callbackCallable invoked with the collision event and matched actor.
Returns
Handle that can remove the callback.

Definition at line 284 of file PhysicsBodyComponent.h.

References addBodyCallback(), and overlapStayCallbacks_.

Here is the call graph for this function:

◆ processCollisions()

void Engine::Components::PhysicsBody::processCollisions ( )

Processes collision events and dispatches callbacks. Called after physics step.

◆ readdRigidBodyWithCurrentFilters()

void Engine::Components::PhysicsBody::readdRigidBodyWithCurrentFilters ( )
private

◆ rebuildCollisionShape()

void Engine::Components::PhysicsBody::rebuildCollisionShape ( )
private

◆ rebuildIfDirty()

void Engine::Components::PhysicsBody::rebuildIfDirty ( )

Rebuilds the collision shape if dirty.

◆ registerCollision()

void Engine::Components::PhysicsBody::registerCollision ( Components::Collision * collision)

Registers a collision component with this body. Called by CollisionComponent::beginPlay().

Parameters
collisionThe collision component to register.

◆ removeCollisionCallback()

void Engine::Components::PhysicsBody::removeCollisionCallback ( PhysicsBodyCallbackHandle handle)

Removes a previously registered collision callback.

Parameters
handleCallback handle returned from a registration method.

◆ setAngularVelocity()

void Engine::Components::PhysicsBody::setAngularVelocity ( const glm::vec3 & velocity)

Sets the angular velocity.

Parameters
velocityAngular velocity in rad/s.

◆ setFriction()

void Engine::Components::PhysicsBody::setFriction ( float friction)

Sets the friction coefficient.

Parameters
frictionFriction value (0.0 = ice, 0.5 = wood, 1.0 = high friction).

◆ setKinematic()

void Engine::Components::PhysicsBody::setKinematic ( bool kinematic)

Sets whether the body is kinematic. Kinematic bodies are moved by code, not physics.

Parameters
kinematicTrue for kinematic, false for dynamic.

◆ setLinearVelocity()

void Engine::Components::PhysicsBody::setLinearVelocity ( const glm::vec3 & velocity)

Sets the linear velocity.

Parameters
velocityVelocity in m/s.

◆ setMass()

void Engine::Components::PhysicsBody::setMass ( float mass)

Sets the mass of the rigid body.

Parameters
massMass in kilograms. 0 = static object.

◆ setPhysicsBodyHandle()

void Engine::Components::PhysicsBody::setPhysicsBodyHandle ( Physics::PhysicsBodyHandle handle)
inline

Sets the physics-engine registration handle for this body.

Parameters
handleNew physics body handle.

Definition at line 226 of file PhysicsBodyComponent.h.

References bodyHandle_.

◆ setRestitution()

void Engine::Components::PhysicsBody::setRestitution ( float restitution)

Sets the restitution (bounciness).

Parameters
restitution0.0 = no bounce, 1.0 = full energy preserved.

◆ setStatic()

void Engine::Components::PhysicsBody::setStatic ( bool isStatic)

Sets whether the body is static (immovable).

Parameters
isStaticTrue for static, false for dynamic.

References isStatic().

Here is the call graph for this function:

◆ shouldUseNoContactResponse()

bool Engine::Components::PhysicsBody::shouldUseNoContactResponse ( ) const
nodiscardprivate

◆ teleport() [1/2]

void Engine::Components::PhysicsBody::teleport ( const glm::vec3 & position)

Teleports the body to a new position.

Parameters
positionNew world position.

◆ teleport() [2/2]

void Engine::Components::PhysicsBody::teleport ( const glm::vec3 & position,
const glm::quat & rotation )

Teleports the body to a new position and rotation.

Parameters
positionNew world position.
rotationNew world rotation.

◆ unregisterCollision()

void Engine::Components::PhysicsBody::unregisterCollision ( Components::Collision * collision)

Unregisters a collision component from this body. Called by CollisionComponent::endPlay().

Parameters
collisionThe collision component to unregister.

◆ updateEcsComponent()

void Engine::Components::PhysicsBody::updateEcsComponent ( )
private

Member Data Documentation

◆ bodyHandle_

Physics::PhysicsBodyHandle Engine::Components::PhysicsBody::bodyHandle_
private

Definition at line 446 of file PhysicsBodyComponent.h.

Referenced by getPhysicsBodyHandle(), and setPhysicsBodyHandle().

◆ collisionBeginCallbacks_

std::vector<BodyCallbackSubscription> Engine::Components::PhysicsBody::collisionBeginCallbacks_
private

Definition at line 451 of file PhysicsBodyComponent.h.

Referenced by onCollisionBegin().

◆ collisionEndCallbacks_

std::vector<BodyCallbackSubscription> Engine::Components::PhysicsBody::collisionEndCallbacks_
private

Definition at line 453 of file PhysicsBodyComponent.h.

Referenced by onCollisionEnd().

◆ collisionFiltersDirty_

bool Engine::Components::PhysicsBody::collisionFiltersDirty_ = true
private

Definition at line 445 of file PhysicsBodyComponent.h.

◆ collisions_

std::vector<Components::Collision*> Engine::Components::PhysicsBody::collisions_
private

Definition at line 434 of file PhysicsBodyComponent.h.

Referenced by getCollisions().

◆ collisionStayCallbacks_

std::vector<BodyCallbackSubscription> Engine::Components::PhysicsBody::collisionStayCallbacks_
private

Definition at line 452 of file PhysicsBodyComponent.h.

Referenced by onCollisionStay().

◆ ComponentName

const char* Engine::Components::PhysicsBody::ComponentName = "PhysicsBody"
staticconstexpr

Component type name.

Definition at line 43 of file PhysicsBodyComponent.h.

◆ compoundShape_

btCompoundShape* Engine::Components::PhysicsBody::compoundShape_ = nullptr
private

Definition at line 435 of file PhysicsBodyComponent.h.

◆ entity_

entt::entity Engine::Components::PhysicsBody::entity_
private

Definition at line 431 of file PhysicsBodyComponent.h.

◆ friction_

float Engine::Components::PhysicsBody::friction_ = 0.5f
private

Definition at line 439 of file PhysicsBodyComponent.h.

Referenced by getFriction().

◆ isInitialized_

bool Engine::Components::PhysicsBody::isInitialized_ = false
private

Definition at line 444 of file PhysicsBodyComponent.h.

◆ isKinematic_

bool Engine::Components::PhysicsBody::isKinematic_ = false
private

Definition at line 441 of file PhysicsBodyComponent.h.

Referenced by isKinematic().

◆ isStatic_

bool Engine::Components::PhysicsBody::isStatic_ = false
private

Definition at line 442 of file PhysicsBodyComponent.h.

Referenced by isStatic().

◆ IsUnique

bool Engine::Components::PhysicsBody::IsUnique = true
staticconstexpr

Only one physics body may be attached per entity.

Definition at line 42 of file PhysicsBodyComponent.h.

◆ mass_

float Engine::Components::PhysicsBody::mass_ = 1.0f
private

Definition at line 438 of file PhysicsBodyComponent.h.

Referenced by getMass().

◆ nextCallbackHandle_

PhysicsBodyCallbackHandle Engine::Components::PhysicsBody::nextCallbackHandle_ = 1
private

Definition at line 447 of file PhysicsBodyComponent.h.

◆ overlapBeginCallbacks_

std::vector<BodyCallbackSubscription> Engine::Components::PhysicsBody::overlapBeginCallbacks_
private

Definition at line 448 of file PhysicsBodyComponent.h.

Referenced by onOverlapBegin().

◆ overlapEndCallbacks_

std::vector<BodyCallbackSubscription> Engine::Components::PhysicsBody::overlapEndCallbacks_
private

Definition at line 450 of file PhysicsBodyComponent.h.

Referenced by onOverlapEnd().

◆ overlapStayCallbacks_

std::vector<BodyCallbackSubscription> Engine::Components::PhysicsBody::overlapStayCallbacks_
private

Definition at line 449 of file PhysicsBodyComponent.h.

Referenced by onOverlapStay().

◆ previousCollisions_

std::set<Components::Collision*> Engine::Components::PhysicsBody::previousCollisions_
private

Definition at line 456 of file PhysicsBodyComponent.h.

◆ restitution_

float Engine::Components::PhysicsBody::restitution_ = 0.0f
private

Definition at line 440 of file PhysicsBodyComponent.h.

Referenced by getRestitution().

◆ rigidBody_

btRigidBody* Engine::Components::PhysicsBody::rigidBody_ = nullptr
private

Definition at line 436 of file PhysicsBodyComponent.h.

Referenced by getRigidBody().

◆ sceneNode_

std::weak_ptr<Entities::SceneNode> Engine::Components::PhysicsBody::sceneNode_
private

Definition at line 432 of file PhysicsBodyComponent.h.

◆ shapeDirty_

bool Engine::Components::PhysicsBody::shapeDirty_ = true
private

Definition at line 443 of file PhysicsBodyComponent.h.


The documentation for this class was generated from the following file: