Don't clone far camera; create a new one and initialize it from the near camera
The clone operation may be sharing things that shouldn't be shared.
This commit is contained in:
parent
d43e0b83f7
commit
60e8f14d5b
1 changed files with 4 additions and 1 deletions
|
@ -134,8 +134,11 @@ CameraInfo* CameraGroup::addCamera(unsigned flags, Camera* camera,
|
|||
|
||||
Camera* farCamera = 0;
|
||||
if ((flags & (GUI | ORTHO)) == 0) {
|
||||
farCamera = simgear::clone(camera);
|
||||
farCamera = new Camera;
|
||||
farCamera->setAllowEventFocus(camera->getAllowEventFocus());
|
||||
farCamera->setGraphicsContext(camera->getGraphicsContext());
|
||||
farCamera->setCullingMode(camera->getCullingMode());
|
||||
farCamera->setInheritanceMask(camera->getInheritanceMask());
|
||||
// Each camera's viewport is written when the window is
|
||||
// resized; if the the viewport isn't copied here, it gets updated
|
||||
// twice and ends up with the wrong value.
|
||||
|
|
Loading…
Add table
Reference in a new issue