1
0
Fork 0

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:
James Hogan 2021-08-02 23:36:04 +01:00
parent 7a096d9835
commit 9e430b3fc2
No known key found for this signature in database
GPG key ID: 35CEE4862B1023F2
2 changed files with 14 additions and 0 deletions

View file

@ -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)
{

View file

@ -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