PROTO::KLUDGE  0.1
Quick prototyping library for games using SDL and OpenGL.
pk::SensorData Class Reference

A class wrapping some user data for Box2D fixtures. Includes data for number of contacts being made to the sensor and an ID useful for identifying fixtures when a contact triggers a Box2D contact listener event. More...

#include <SensorData.hpp>

Collaboration diagram for pk::SensorData:
Collaboration graph

Public Member Functions

 SensorData ()
 Default constructor. More...
 
 SensorData (int id)
 Preferred constructor. More...
 
 ~SensorData ()
 
void contactMade ()
 Increments the number of contacts made to the sensor. Call this function inside a Box2D contact listener function when filtering contacts. More...
 
void contactEnded ()
 Decrements the number of contacts made to the sensor. Call this function inside a Box2D contact listener function when filtering contacts. More...
 
int getContacts ()
 Get the number of contacts currently being made to the sensor. More...
 
int getID ()
 

Private Attributes

int m_id
 the sensor's ID. More...
 
int m_contacts
 the number of contacts made with the sensor. More...
 

Detailed Description

A class wrapping some user data for Box2D fixtures. Includes data for number of contacts being made to the sensor and an ID useful for identifying fixtures when a contact triggers a Box2D contact listener event.

Constructor & Destructor Documentation

◆ SensorData() [1/2]

pk::SensorData::SensorData ( )

Default constructor.

◆ SensorData() [2/2]

pk::SensorData::SensorData ( int  id)
inline

Preferred constructor.

◆ ~SensorData()

pk::SensorData::~SensorData ( )
inline

Member Function Documentation

◆ contactEnded()

pk::SensorData::contactEnded ( )
inline

Decrements the number of contacts made to the sensor. Call this function inside a Box2D contact listener function when filtering contacts.

◆ contactMade()

pk::SensorData::contactMade ( )
inline

Increments the number of contacts made to the sensor. Call this function inside a Box2D contact listener function when filtering contacts.

◆ getContacts()

pk::SensorData::getContacts ( )
inline

Get the number of contacts currently being made to the sensor.

Returns
int - the number of contacts given as an int.

◆ getID()

int pk::SensorData::getID ( )
inline

Member Data Documentation

◆ m_contacts

int pk::SensorData::m_contacts
private

the number of contacts made with the sensor.

◆ m_id

int pk::SensorData::m_id
private

the sensor's ID.


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