Collision Math Toy
Ian Parberry's "Introduction to Game Physics"
Public Member Functions | Private Attributes | Friends | List of all members
CObject Class Reference

The game object. More...

#include <Object.h>

Inheritance diagram for CObject:

Public Member Functions

 CObject (CShape *, const CObjDesc &)
 Constructor.
 
const CAabb2D & GetAABB () const
 Get AABB. More...
 
CShape * GetShape () const
 Get pointer to shape. More...
 
const eMotion GetMotionType () const
 Get motion type. More...
 

Private Attributes

eSprite m_eUnlitSprite
 Unlit sprite.
 
eSprite m_eLitSprite
 Unlit sprite.
 
Vector2 m_vSpriteOffset
 Sprite offset in local coordinates.
 
eSound m_eSound
 Collision sound.
 
XMFLOAT4 m_f4Tint
 Color overlay.
 
CShape * m_pShape
 Pointer to shape.

 
bool m_bRecentHit = false
 Was hit recently.
 
float m_fLastHitTime = 0.0f
 Time of last hit.
 
int m_nScore = 0
 Score for collision.
 

Friends

class CObjectManager
 

Detailed Description

CObject is the abstract representation of an object. Notice that CObject has no move or draw functions. Moving and drawing is now handled by CShape.

Member Function Documentation

◆ GetAABB()

const CAabb2D & CObject::GetAABB ( ) const

Reader function for the object's AABB. It gets this by querying the oblect's shape's AABB.

Returns
The object's AABB.

◆ GetMotionType()

const eMotion CObject::GetMotionType ( ) const

Reader function for the object's motion type. It gets this by querying the object's shape's motion type.

Returns
The object's motion type.

◆ GetShape()

CShape * CObject::GetShape ( ) const

Reader function for the object's shape type.

Returns
The object's shape type.