Klamp't  0.8.1
Public Types | Public Member Functions | Public Attributes | List of all members
RobotWorld Class Reference

The main world class containing multiple robots, objects, and static geometries (terrains). Lights and other viewport information may also be stored here. More...

#include <World.h>

Public Types

typedef shared_ptr< Geometry::AnyCollisionGeometry3D > GeometryPtr
 
typedef shared_ptr< GLDraw::GeometryAppearance > AppearancePtr
 

Public Member Functions

bool LoadXML (const char *fn)
 
bool SaveXML (const char *fn, const char *elementDir=NULL)
 
void InitCollisions ()
 
void UpdateGeometry ()
 
void SetGLLights ()
 
void DrawGL ()
 
int NumIDs () const
 
int GetID (const string &name, int link=-1) const
 
string GetName (int id) const
 
int IsTerrain (int id) const
 Returns the index of the terrain or -1 otherwise.
 
int IsRigidObject (int id) const
 Returns the index of the rigid object or -1 otherwise.
 
int IsRobot (int id) const
 Returns the index of the robot or -1 otherwise.
 
pair< int, int > IsRobotLink (int id) const
 Returns the index of the robot link or -1,-1 otherwise.
 
int TerrainID (int index) const
 
int RigidObjectID (int index) const
 
int RobotID (int index) const
 
int RobotLinkID (int index, int link) const
 
GeometryPtr GetGeometry (int id)
 
AppearancePtr GetAppearance (int id)
 
RigidTransform GetTransform (int id) const
 
void SetTransform (int id, const RigidTransform &T)
 
int LoadRobot (const string &fn)
 
int AddRobot (const string &name, Robot *robot=NULL)
 
void DeleteRobot (const string &name)
 
RobotGetRobot (const string &name)
 
ViewRobotGetRobotView (const string &name)
 
int LoadTerrain (const string &fn)
 
int AddTerrain (const string &name, Terrain *terrain=NULL)
 
void DeleteTerrain (const string &name)
 
TerrainGetTerrain (const string &name)
 
int LoadRigidObject (const string &fn)
 
int AddRigidObject (const string &name, RigidObject *obj=NULL)
 
void DeleteRigidObject (const string &name)
 
RigidObjectGetRigidObject (const string &name)
 
int RayCast (const Ray3D &r, Vector3 &worldpt)
 Returns the ID of the entity the ray hits, or -1 if nothing was hit.
 
RobotRayCastRobot (const Ray3D &r, int &body, Vector3 &localpt)
 
RigidObjectRayCastObject (const Ray3D &r, Vector3 &localpt)
 
int LoadElement (const string &fn)
 
bool CanLoadElementExt (const char *ext) const
 Returns true if the given extension is loadable as an element.
 

Public Attributes

Camera::Camera camera
 
Camera::Viewport viewport
 
vector< GLDraw::GLLight > lights
 
GLDraw::GLColor background
 
vector< shared_ptr< Robot > > robots
 
vector< shared_ptr< Terrain > > terrains
 
vector< shared_ptr< RigidObject > > rigidObjects
 
vector< ViewRobotrobotViews
 

Detailed Description

The main world class containing multiple robots, objects, and static geometries (terrains). Lights and other viewport information may also be stored here.

Member Function Documentation

int RobotWorld::LoadElement ( const string &  fn)

Loads an element from the file, using its extension to figure out what type it is.


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