Removing unsafe deleteObject function.

This commit is contained in:
Faerbit 2015-03-16 16:15:12 +01:00
parent 761d25e9c7
commit 73f7ec6a70
2 changed files with 0 additions and 13 deletions

View File

@ -35,7 +35,6 @@ void Level::load() {
//Expose the class Level and its functions to Lua
luabridge::getGlobalNamespace(luaState)
.beginClass<Level>("Level")
.addFunction("deleteObject", &Level::deleteObject)
.addFunction("getObjectCount", &Level::getPhysicsObjectsVectorSize)
.addFunction("moveObject", &Level::moveObject)
.addFunction("resetPlayer", &Level::resetPlayer)
@ -206,17 +205,6 @@ void Level::moveObject(int objectIndex, float strength, float xPos, float yPos,
physics.addPositionConstraint(objectIndex, strength, position);
}
//should not be used since objects does not get synchronized and deletion is not implemented in pyhsics
void Level::deleteObject(int objectIndex){
physicsObjects.erase(physicsObjects.begin() + objectIndex);
for(unsigned int i = 0; i<triggers.size(); i++) {
if(triggers.at(i).deleteNotification(objectIndex)){
triggers.erase(triggers.begin() + i);
i--;
}
}
}
void Level::resetPlayer(){
Loader loader = Loader();
glm::vec3 newPosition = loader.reloadPlayerPosition(xmlFilePath, this);

View File

@ -45,7 +45,6 @@ class Level {
Skydome* getSkydome();
std::vector<Object*>* getObjects();
std::vector<Object*>* getPhysicsObjects();
void deleteObject(int objectIndex);
void moveObject(int objectIndex, float strength, float xPos, float yPos, float zPos);
void setStrength(float strength);
void setSkydomeObject(Skydome object);