CollisionMap Class Reference

#include <CollisionMap.h>

Collaboration diagram for CollisionMap:

List of all members.


Public Member Functions

 CollisionMap ()
 CollisionMap (CollisionObject *user)
 ~CollisionMap ()
bool loadCollisionWorld (std::string cfgFile)
std::vector< CollisionData * > & checkCollision (TransformationData trans, std::vector< CollisionData * > &dst)
CollisionObjectgetTileCollisionMap (unsigned tileId)
CollisionLineSetloadCollisionLineSet (std::string vrmlFile, TransformationData trans)

Protected Attributes

std::vector< CollisionObject * > objects
 list of all loaded CollisionLineSet for the Tiles
std::map< unsigned,
CollisionObject * > 
objectMap
 Map containing all loaded CollisionMaps.
std::map< unsigned,
CollisionObject * > 
tileMap
 Map containing the CollisionMaps for each Tile.
CollisionObjectuser
 DEPRECATED: CollisionObject for the user.

Constructor & Destructor Documentation

CollisionMap::CollisionMap (  ) 

Empty constructor.

CollisionMap::CollisionMap ( CollisionObject user  ) 

Constructor stores collision object for user.

CollisionMap::~CollisionMap (  ) 

Destructor frees all loaded CollisionObjects.


Member Function Documentation

std::vector< CollisionData * > & CollisionMap::checkCollision ( TransformationData  trans,
std::vector< CollisionData * > &  dst 
)

DEPRECATED: Checks the collision between the user and the Tiles. The method checks for collisions between the users's shape passed in the constructor and the CollisionLineSets of the Tiles.

Parameters:
trans Transformation of the User in world coordinates
dst Vector where to write the found collisions to
Returns:
Destination vector (same as second parameter)

CollisionObject * CollisionMap::getTileCollisionMap ( unsigned  tileId  ) 

Returns the CollisionLineSet for the Tile with the passed Id. The method checks if a CollisionLineSet is loaded for the Tile with the passed ID. If so the corresponding CollisionLineSet is returned.

Parameters:
tileId ID of the Tile of which the CollisionLineSet is searched
Returns:
CollisionLineSet of the Tile, NULL if not found

CollisionLineSet * CollisionMap::loadCollisionLineSet ( std::string  vrmlFile,
TransformationData  trans 
)

Loads the CollisionLineSet out of the passed vrmlFile and sets the Transformation of the CollisionLineSet to the passed parameter. This method is only used by the loadCollisionWorld method as helper method.

Parameters:
vrmlFile url to the File containing the CollisionLines
trans Transformation of the CollisionLineSet
Returns:
CollisionLineSet loaded from the passed VRML-File

bool CollisionMap::loadCollisionWorld ( std::string  cfgFile  ) 

Loads the CollisionLineSets for each Tile. The method parses the passed config file which contains the urls of the appropriate CollisionLineSet-Files for each Tile. The CollisionLineSets are then loaded and stored in a map which allows to get the matching CollisionLineSet via the ID of a Tile.

Parameters:
cfgFile config file containing the urls of the CollisionLineSet-files
Returns:
true if the file could be parsed correctly, false otherwise


Member Data Documentation

std::map<unsigned, CollisionObject*> CollisionMap::objectMap [protected]

Map containing all loaded CollisionMaps.

std::vector<CollisionObject*> CollisionMap::objects [protected]

list of all loaded CollisionLineSet for the Tiles

std::map<unsigned, CollisionObject*> CollisionMap::tileMap [protected]

Map containing the CollisionMaps for each Tile.

DEPRECATED: CollisionObject for the user.


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

Generated on Wed Oct 20 16:11:55 2010 for inVRs by doxygen 1.5.8