Tramway SDK
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
tram::Physics::CollisionModel Class Reference

#include <collisionmodel.h>

Inheritance diagram for tram::Physics::CollisionModel:
tram::Resource

Public Member Functions

 CollisionModel (name_t mName)
 
void LoadFromDisk ()
 Loads the collision model from disk. More...
 
void LoadFromMemory ()
 
void Unload ()
 
collisionshape_t GetShape ()
 
- Public Member Functions inherited from tram::Resource
 Resource (name_t name)
 
Resource::Status GetStatus () const
 
name_t GetName () const
 
size_t GetReferences () const
 
bool IsLoadFailed () const
 
void AddReference ()
 
void RemoveReference ()
 
void Load ()
 

Static Public Member Functions

static CollisionModelFind (name_t model_name)
 Finds a model. More...
 

Protected Attributes

collisionshape_t shape
 
- Protected Attributes inherited from tram::Resource
Status status = UNLOADED
 
name_t name
 
bool load_fail = false
 
size_t references = 0
 

Additional Inherited Members

- Public Types inherited from tram::Resource
enum  Status { UNLOADED , LOADED , READY }
 

Constructor & Destructor Documentation

◆ CollisionModel()

tram::Physics::CollisionModel::CollisionModel ( name_t  mName)
inline

Member Function Documentation

◆ Find()

CollisionModel * tram::Physics::CollisionModel::Find ( name_t  model_name)
static

Finds a model.

Will either return a pointer to a model that already exists with that name, or will create a new one.

Returns
Always will return a pointer to a CollisionModel.

◆ GetShape()

collisionshape_t tram::Physics::CollisionModel::GetShape ( )
inline

◆ LoadFromDisk()

void tram::Physics::CollisionModel::LoadFromDisk ( )
virtual

Loads the collision model from disk.

If the collision model file can't be found, the model will be replaced with a 25cm wide cube.

Implements tram::Resource.

◆ LoadFromMemory()

void tram::Physics::CollisionModel::LoadFromMemory ( )
inlinevirtual

Implements tram::Resource.

◆ Unload()

void tram::Physics::CollisionModel::Unload ( )
inlinevirtual

Implements tram::Resource.

Member Data Documentation

◆ shape

collisionshape_t tram::Physics::CollisionModel::shape
protected

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