git-svn-id: https://reactphysics3d.googlecode.com/svn/trunk@108 92aac97c-a6ce-11dd-a772-7fcde58d38e6

This commit is contained in:
chappuis.daniel 2009-02-25 17:18:08 +00:00
parent 8e0a7740dd
commit 7c1f174388

View File

@ -46,24 +46,24 @@ Context::Context() {
Context::~Context() {
// Delete all the objects in vectObjects
for(unsigned int i=0; i<vectObjects.size(); ++i) {
delete vectObjects[0];
delete vectObjects[i];
}
}
// Method to get an object from the context
Object& Context::getObject(int objectIndex) const {
// WE HAVE TO ADD HERE AN EXCEPTION IMPLEMENTATION
// TODO : WE HAVE TO ADD HERE AN EXCEPTION IMPLEMENTATION
// Return the object from the context
return (*vectObjects.at(objectIndex)); // THROWN AN EXCEPTION IF INDEX IS OUT OF THE BOUNDS
return (*vectObjects.at(objectIndex)); // TODO : THROWN AN EXCEPTION IF INDEX IS OUT OF THE BOUNDS
}
// Method for adding an object into the context
void Context::addObject(Object* object) {
if (object != NULL) {
// Add the object into the context
vectObjects.push_back(object);
}
if (object != NULL) {
// Add the object into the context
vectObjects.push_back(object);
}
}
// Method to remove an object from the context