removing lights by pointer

This commit is contained in:
devZoGok
2024-09-08 20:33:13 +03:00
parent 93e479662f
commit 059136a688
2 changed files with 13 additions and 0 deletions
+12
View File
@@ -253,6 +253,18 @@ namespace vb01{
}
void Node::removeLight(Light *light){
for(int i = 0; i < lights.size(); i++)
if(lights[i] == light){
lights.erase(lights.begin() + i);
Root::getSingleton()->shiftNumLights(false);
updateShaders();
break;
}
}
void Node::removeLight(int id){
Root::getSingleton()->shiftNumLights(false);
Light *light = lights[id];
+1
View File
@@ -31,6 +31,7 @@ namespace vb01{
void attachChild(Node*);
void dettachChild(Node*);
void addLight(Light*);
void removeLight(Light*);
void removeLight(int);
void addText(Text*);
virtual void lookAt(Vector3, Vector3);