CameraGroup: Add removeCamera()
Add removeCamera() method to CameraGroup to find and remove a single CameraInfo. This will allow cameras created for VR to be dynamically reconfigured.
This commit is contained in:
parent
7a096d9835
commit
9e430b3fc2
2 changed files with 14 additions and 0 deletions
|
@ -721,6 +721,16 @@ CameraInfo* CameraGroup::buildCamera(SGPropertyNode* cameraNode)
|
|||
return info;
|
||||
}
|
||||
|
||||
void CameraGroup::removeCamera(CameraInfo *info)
|
||||
{
|
||||
for (auto it = _cameras.begin(); it != _cameras.end(); ++it) {
|
||||
if (*it == info) {
|
||||
_cameras.erase(it);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CameraGroup::buildGUICamera(SGPropertyNode* cameraNode,
|
||||
GraphicsWindow* window)
|
||||
{
|
||||
|
|
|
@ -151,6 +151,10 @@ public:
|
|||
* @return a CameraInfo object for the camera.
|
||||
*/
|
||||
CameraInfo* buildCamera(SGPropertyNode* cameraNode);
|
||||
/** Remove a camera from the camera group.
|
||||
* @param info the camera info to remove.
|
||||
*/
|
||||
void removeCamera(CameraInfo *info);
|
||||
/** Create a camera from properties that will draw the GUI and add
|
||||
* it to the camera group.
|
||||
* @param cameraNode the property node. This can be 0, in which
|
||||
|
|
Loading…
Reference in a new issue