TDME2 1.9.121
Public Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
CollisionResponse Class Referencefinal

Collision response. More...

#include <tdme/engine/physics/CollisionResponse.h>

Collaboration diagram for CollisionResponse:
Collaboration graph

Public Member Functions

 CollisionResponse ()
 Public constructor. More...
 
void reset ()
 Reset. More...
 
CollisionResponse_EntityaddResponse (float distance)
 Adds a collision response entity. More...
 
int32_t getEntityCount ()
 
CollisionResponse_EntitygetSelectedEntity ()
 
CollisionResponse_EntitygetEntity (int32_t idx)
 Selects entity at given index. More...
 
CollisionResponseselectEntity (int32_t idx)
 Selects entity at given index. More...
 
bool hasEntitySelected ()
 
float getDistance ()
 
bool hasPenetration ()
 
float getPenetration ()
 
const Vector3getNormal ()
 
const vector< Vector3 > & getHitPoints ()
 
int32_t getHitPointCount ()
 
Vector3getHitPoint (int32_t idx)
 Get hit point of given index. More...
 

Private Attributes

vector< CollisionResponse_Entityentities
 
CollisionResponse_EntityselectedEntity { nullptr }
 
vector< Vector3fallbackHitPointsVector
 

Static Private Attributes

static constexpr int32_t HITPOINT_COUNT { 30 }
 

Friends

class CollisionResponse_Entity
 
class CollisionDetection
 
class World
 

Detailed Description

Collision response.

Author
Andreas Drewke
Version
$Id$

Definition at line 27 of file CollisionResponse.h.

Constructor & Destructor Documentation

◆ CollisionResponse()

CollisionResponse ( )
inline

Public constructor.

Definition at line 43 of file CollisionResponse.h.

Member Function Documentation

◆ addResponse()

CollisionResponse_Entity * addResponse ( float  distance)
inline

Adds a collision response entity.

Parameters
distancedistance
Returns
Entity or null

Definition at line 59 of file CollisionResponse.h.

◆ getDistance()

float getDistance ( )
inline
Returns
collision distance or negative penetration

Definition at line 115 of file CollisionResponse.h.

◆ getEntity()

CollisionResponse_Entity * getEntity ( int32_t  idx)
inline

Selects entity at given index.

Parameters
idxidx
Returns

Definition at line 89 of file CollisionResponse.h.

◆ getEntityCount()

int32_t getEntityCount ( )
inline
Returns
entity count

Definition at line 73 of file CollisionResponse.h.

◆ getHitPoint()

Vector3 * getHitPoint ( int32_t  idx)
inline

Get hit point of given index.

Parameters
ii
Returns
hit point for given hit points index

Definition at line 165 of file CollisionResponse.h.

◆ getHitPointCount()

int32_t getHitPointCount ( )
inline
Returns
hit point count

Definition at line 155 of file CollisionResponse.h.

◆ getHitPoints()

const vector< Vector3 > & getHitPoints ( )
inline
Returns
get hit points

Definition at line 147 of file CollisionResponse.h.

◆ getNormal()

const Vector3 * getNormal ( )
inline
Returns
normal

Definition at line 139 of file CollisionResponse.h.

◆ getPenetration()

float getPenetration ( )
inline
Returns
penetration

Definition at line 131 of file CollisionResponse.h.

◆ getSelectedEntity()

CollisionResponse_Entity * getSelectedEntity ( )
inline
Returns
selected entity

Definition at line 80 of file CollisionResponse.h.

◆ hasEntitySelected()

bool hasEntitySelected ( )
inline
Returns
if collision entity is selected

Definition at line 108 of file CollisionResponse.h.

◆ hasPenetration()

bool hasPenetration ( )
inline
Returns
if we have a penetration

Definition at line 123 of file CollisionResponse.h.

◆ reset()

void reset ( )
inline

Reset.

Definition at line 49 of file CollisionResponse.h.

◆ selectEntity()

CollisionResponse * selectEntity ( int32_t  idx)
inline

Selects entity at given index.

Parameters
idxidx
Returns

Definition at line 99 of file CollisionResponse.h.

Friends And Related Function Documentation

◆ CollisionDetection

friend class CollisionDetection
friend

Definition at line 30 of file CollisionResponse.h.

◆ CollisionResponse_Entity

friend class CollisionResponse_Entity
friend

Definition at line 29 of file CollisionResponse.h.

◆ World

friend class World
friend

Definition at line 31 of file CollisionResponse.h.

Member Data Documentation

◆ entities

vector<CollisionResponse_Entity> entities
private

Definition at line 35 of file CollisionResponse.h.

◆ fallbackHitPointsVector

vector<Vector3> fallbackHitPointsVector
private

Definition at line 37 of file CollisionResponse.h.

◆ HITPOINT_COUNT

constexpr int32_t HITPOINT_COUNT { 30 }
staticconstexprprivate

Definition at line 34 of file CollisionResponse.h.

◆ selectedEntity

CollisionResponse_Entity* selectedEntity { nullptr }
private

Definition at line 36 of file CollisionResponse.h.


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