Removing unsafe deleteObject function.
This commit is contained in:
parent
761d25e9c7
commit
73f7ec6a70
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user