Bullet Physics Block Toy
Game Physics with a 3D Physics Engine
Loading...
Searching...
No Matches
CCommon Class Reference

The common variables class. More...

#include <Common.h>

Inheritance diagram for CCommon:
Collaboration diagram for CCommon:

Protected Attributes

const float m_fFloorHt = 1.0f
 Floor height.
 
const Vector3 m_vPlanePos
 Plane position.
 
const Vector3 m_vPlaneSize
 Plane size.
 
const bool m_bWireFrame = false
 Draw in wireframe.
 
const float m_fMoonRadius = 25.0f
 Moon radius.
 
const float m_fBallRadius = 2.0f
 Ball radius.
 
const Vector3 m_vBoxSize = Vector3(9.0f, 6.0f, 6.0f)
 Box size.

 
const float m_fTetrahedronSize = 16.0f
 Tetrahedron size.
 
const float m_fIcosahedronSize = 16.0f
 Icosahedron size.
 
const float m_fDodecahedronSize = 16.0f
 Dodecahedron size.
 
const float m_fTeapotSize = 8.0f
 Teapot size.
 

Static Protected Attributes

static CRendererm_pRenderer = nullptr
 Pointer to the renderer.
 
static Sage::CCamera * m_pCamera = nullptr
 Pointer to the camera.
 
static CObjectManagerm_pObjectManager = nullptr
 Pointer to object manager.
 
static btDiscreteDynamicsWorld * m_pPhysicsWorld = nullptr
 Pointer to physics engine.
 
static btDefaultCollisionConfiguration * m_pConfig = nullptr
 Bullet physics configuration.
 
static btCollisionDispatcher * m_pDispatcher = nullptr
 Bullet physics dispatcher.
 
static btBroadphaseInterface * m_pBroadphase = nullptr
 Bullet physics broadphase.
 
static btSequentialImpulseConstraintSolver * m_pSolver = nullptr
 Bullet physics constraint solver.
 
static btAlignedObjectArray< btCollisionShape * > m_btCollisionShapes
 Collision shapes.
 
static bool m_bCollisionSoundsMuted = false
 Mute collision sounds.
 

Detailed Description

CCommon is a singleton class that encapsulates things that are common to different game components, including game state variables. Making it a singleton class means that we can avoid passing its member variables around as parameters, which makes the code minisculely faster, and more importantly, reduces function clutter.

Member Data Documentation

◆ m_vPlanePos

const Vector3 CCommon::m_vPlanePos
protected
Initial value:
=
Vector3(0.0f, -m_fFloorHt/2.0f, 100.0f)
const float m_fFloorHt
Floor height.
Definition Common.h:36

◆ m_vPlaneSize

const Vector3 CCommon::m_vPlaneSize
protected
Initial value:
=
Vector3(600.0f, m_fFloorHt, 600.0f)