Cafu Engine
cf::ClipSys::CollModelManImplT Class Reference

This class provides an implementation of the CollModelManI interface. More...

#include "CollisionModelMan_impl.hpp"

Inheritance diagram for cf::ClipSys::CollModelManImplT:

Public Member Functions

const CollisionModelTGetCM (const std::string &FileName) override
 Loads a collision model from the file specified by FileName. More...
 
const CollisionModelTGetCM (unsigned long Width, unsigned long Height, const ArrayT< Vector3dT > &Mesh, MaterialT *Material, const double MIN_NODE_SIZE) override
 Creates a collision model from the given explicit mesh. More...
 
const CollisionModelTGetCM (const BoundingBox3T< double > &BB, MaterialT *Material) override
 Creates a collision model from the given (axis-aligned) bounding-box. More...
 
const CollisionModelTGetCM (const CollisionModelT *CollisionModel) override
 Creates another collision model from a given collision model. More...
 
const std::string & GetFileName (const CollisionModelT *CollisionModel) const override
 Returns the file name the given collision model has been loaded from (using the GetCM(const std::string& FileName) method). More...
 
void FreeCM (const CollisionModelT *CollisionModel) override
 Frees the given collision model (taking reference counting into account if necessary). More...
 
unsigned long GetUniqueCMCount () const override
 Returns the number of unique, physical collision model instances managed by this class. More...
 
- Public Member Functions inherited from cf::ClipSys::CollModelManI
virtual ~CollModelManI ()
 The virtual destructor. More...
 

Detailed Description

This class provides an implementation of the CollModelManI interface.

Member Function Documentation

void CollModelManImplT::FreeCM ( const CollisionModelT CollisionModel)
overridevirtual

Frees the given collision model (taking reference counting into account if necessary).

Parameters
CollisionModelThe collision model to be freed.

Implements cf::ClipSys::CollModelManI.

const CollisionModelT * CollModelManImplT::GetCM ( const std::string &  FileName)
overridevirtual

Loads a collision model from the file specified by FileName.

If the collision model has been loaded before, reference counting is employed.

Parameters
FileNameThe name of the file to load the collision model from.
Returns
(a pointer to) the collision model instance that has been loaded from the given file, or NULL on failure.

Implements cf::ClipSys::CollModelManI.

const CollisionModelT * CollModelManImplT::GetCM ( unsigned long  Width,
unsigned long  Height,
const ArrayT< Vector3dT > &  Mesh,
MaterialT Material,
const double  MIN_NODE_SIZE 
)
overridevirtual

Creates a collision model from the given explicit mesh.

Parameters
WidthThe width of the mesh.
HeightThe height of the mesh.
MeshThe vertices of the mesh.
MaterialThe material reported in collision results when a trace hit.
MIN_NODE_SIZEThe minimum size (side length) that a node should not fall below.
Returns
the matching collision model instance.

Implements cf::ClipSys::CollModelManI.

const CollisionModelT * CollModelManImplT::GetCM ( const BoundingBox3T< double > &  BB,
MaterialT Material 
)
overridevirtual

Creates a collision model from the given (axis-aligned) bounding-box.

Parameters
BBThe bounding box to create a collision model for.
MaterialThe material to use for the collision model.
Returns
the desired collision model.

Implements cf::ClipSys::CollModelManI.

const CollisionModelT * CollModelManImplT::GetCM ( const CollisionModelT CollisionModel)
overridevirtual

Creates another collision model from a given collision model.

a) If the given collision model has been created with other methods of this CollModelManI earlier, the implementation will simply increase the related reference counter and return the same pointer. b) If the given collision model has been created "externally" with some other means (e.g. direct instantiation of a concrete collision model class), the CollModelManI will create a record about it with a reference count of 1, assume that the original instance is not freed/deleted by the caller as long as it has a non-zero reference count, and will not attempt to delete the instance when the count finally drops to 0.

Parameters
CollisionModelThe collision model to create another collision model from.
Returns
a matching collision model instance.

Implements cf::ClipSys::CollModelManI.

const std::string & CollModelManImplT::GetFileName ( const CollisionModelT CollisionModel) const
overridevirtual

Returns the file name the given collision model has been loaded from (using the GetCM(const std::string& FileName) method).

Parameters
CollisionModelThe collision model for which return the associated file name.
Returns
the file name of the collision model, or "" (the empty string) if the model was created by another method.

Implements cf::ClipSys::CollModelManI.

unsigned long CollModelManImplT::GetUniqueCMCount ( ) const
overridevirtual

Returns the number of unique, physical collision model instances managed by this class.

Implements cf::ClipSys::CollModelManI.


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