Commit c52eed06 authored by Pavel Rojtberg's avatar Pavel Rojtberg

ovis: implement removeEntity method

parent faf82d88
...@@ -70,6 +70,12 @@ public: ...@@ -70,6 +70,12 @@ public:
CV_WRAP virtual void createEntity(const String& name, const String& meshname, CV_WRAP virtual void createEntity(const String& name, const String& meshname,
InputArray tvec = noArray(), InputArray rot = noArray()) = 0; InputArray tvec = noArray(), InputArray rot = noArray()) = 0;
/**
* remove an entity from the scene
* @param name entity name
*/
CV_WRAP virtual void removeEntity(const String& name) = 0;
/** /**
* convenience method to visualize a camera position * convenience method to visualize a camera position
* *
......
...@@ -342,6 +342,13 @@ public: ...@@ -342,6 +342,13 @@ public:
node->attachObject(ent); node->attachObject(ent);
} }
void removeEntity(const String& name) {
SceneNode* node = _getSceneNode(sceneMgr, name);
node->getAttachedObject(name)->detachFromParent();
sceneMgr->destroyEntity(name);
sceneMgr->destroySceneNode(node);
}
Rect2d createCameraEntity(const String& name, InputArray K, const Size& imsize, float zFar, Rect2d createCameraEntity(const String& name, InputArray K, const Size& imsize, float zFar,
InputArray tvec, InputArray rot) InputArray tvec, InputArray rot)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment