YourGameLib
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
yourgame::util::Collision Class Reference

Represents a Collision between two rigid bodies. More...

#include <physenv.h>

Collaboration diagram for yourgame::util::Collision:
Collaboration graph
[legend]

Public Member Functions

 Collision (RigidBody *body0, RigidBody *body1, float impulse)
 Constructor.
 
bool involves (const std::string &name) const
 Checks if rigid body with name name is involved in this Collision.
 
bool involves2 (const std::string &nameA, const std::string &nameB) const
 Checks if this Collision happened between rigid bodies with names nameA and nameB.
 

Public Attributes

RigidBodym_body0
 
RigidBodym_body1
 
float m_impulse
 

Detailed Description

Represents a Collision between two rigid bodies.

Constructor & Destructor Documentation

◆ Collision()

yourgame::util::Collision::Collision ( RigidBody body0,
RigidBody body1,
float  impulse 
)
inline

Constructor.

Parameters
body0pointer to rigid body (first collision partner)
body1pointer to rigid body (second collision partner)
impulseimpulse of the collision

Member Function Documentation

◆ involves()

bool yourgame::util::Collision::involves ( const std::string &  name) const
inline

Checks if rigid body with name name is involved in this Collision.

Parameters
namename of rigid body
Returns
true if rigid body with name name is involved in this Collision, false otherwise

◆ involves2()

bool yourgame::util::Collision::involves2 ( const std::string &  nameA,
const std::string &  nameB 
) const
inline

Checks if this Collision happened between rigid bodies with names nameA and nameB.

Parameters
nameAname of first rigid body
nameBname of second rigid body
Returns
true if collision happened between these two, false otherwise

Member Data Documentation

◆ m_body0

RigidBody* yourgame::util::Collision::m_body0

◆ m_body1

RigidBody* yourgame::util::Collision::m_body1

◆ m_impulse

float yourgame::util::Collision::m_impulse

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