CheeseEngine
A 2D Game Engine
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
CollideEvent Struct Reference

Fired when two solid physical bodies collide. More...

#include <Events.hpp>

Inheritance diagram for CollideEvent:
[legend]
Collaboration diagram for CollideEvent:
[legend]

Public Member Functions

 CollideEvent ()=default
 Default constructor for line-by-line initialization.
 
 CollideEvent (entt::entity a, entt::entity b, glm::vec2 normal, float f)
 Initializes a collision event with specific physics data.
 
- Public Member Functions inherited from Event
virtual ~Event ()=default
 Virtual destructor to ensure proper polymorphic cleanup.
 

Public Attributes

entt::entity entityA
 ID of the entity that initiated the contact.
 
entt::entity entityB
 ID of the entity that was hit.
 
glm::vec2 normal
 Collision normal vector (direction of the impact)
 
float force
 Magnitude of the collision impulse.
 

Detailed Description

Fired when two solid physical bodies collide.

Constructor & Destructor Documentation

◆ CollideEvent() [1/2]

CollideEvent::CollideEvent ( )
default

Default constructor for line-by-line initialization.

Parameters
None
Return values
None

◆ CollideEvent() [2/2]

CollideEvent::CollideEvent ( entt::entity  a,
entt::entity  b,
glm::vec2  normal,
float  f 
)
inline

Initializes a collision event with specific physics data.

Parameters
a: ID of the first entity
b: ID of the second entity
nx: X component of the collision normal vector
ny: Y component of the collision normal vector
f: Force of the impact
Return values
None

Member Data Documentation

◆ entityA

entt::entity CollideEvent::entityA

ID of the entity that initiated the contact.

◆ entityB

entt::entity CollideEvent::entityB

ID of the entity that was hit.

◆ force

float CollideEvent::force

Magnitude of the collision impulse.

◆ normal

glm::vec2 CollideEvent::normal

Collision normal vector (direction of the impact)


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