CameraGroup::buildCamera(): Return CameraInfo*
Make CameraGroup::buildCamera() return the new CameraInfo* so the caller can make adjustments.
This commit is contained in:
parent
45d969f319
commit
7a096d9835
2 changed files with 6 additions and 4 deletions
|
@ -477,7 +477,7 @@ void CameraGroup::buildDistortionCamera(const SGPropertyNode* psNode,
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void CameraGroup::buildCamera(SGPropertyNode* cameraNode)
|
CameraInfo* CameraGroup::buildCamera(SGPropertyNode* cameraNode)
|
||||||
{
|
{
|
||||||
WindowBuilder *wBuild = WindowBuilder::getWindowBuilder();
|
WindowBuilder *wBuild = WindowBuilder::getWindowBuilder();
|
||||||
const SGPropertyNode* windowNode = cameraNode->getNode("window");
|
const SGPropertyNode* windowNode = cameraNode->getNode("window");
|
||||||
|
@ -491,7 +491,7 @@ void CameraGroup::buildCamera(SGPropertyNode* cameraNode)
|
||||||
window = wBuild->buildWindow(cameraNode);
|
window = wBuild->buildWindow(cameraNode);
|
||||||
}
|
}
|
||||||
if (!window) {
|
if (!window) {
|
||||||
return;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
osg::Matrix vOff;
|
osg::Matrix vOff;
|
||||||
|
@ -599,7 +599,7 @@ void CameraGroup::buildCamera(SGPropertyNode* cameraNode)
|
||||||
if (it == _cameras.end()) {
|
if (it == _cameras.end()) {
|
||||||
SG_LOG(SG_VIEW, SG_ALERT, "CameraGroup::buildCamera: "
|
SG_LOG(SG_VIEW, SG_ALERT, "CameraGroup::buildCamera: "
|
||||||
"failed to find parent camera for relative camera!");
|
"failed to find parent camera for relative camera!");
|
||||||
return;
|
return nullptr;
|
||||||
}
|
}
|
||||||
parentInfo = (*it);
|
parentInfo = (*it);
|
||||||
if (projectionNode->getNameString() == "right-of-perspective") {
|
if (projectionNode->getNameString() == "right-of-perspective") {
|
||||||
|
@ -717,6 +717,8 @@ void CameraGroup::buildCamera(SGPropertyNode* cameraNode)
|
||||||
info->flags = info->flags | CameraInfo::VIEW_ABSOLUTE;
|
info->flags = info->flags | CameraInfo::VIEW_ABSOLUTE;
|
||||||
//buildDistortionCamera(psNode, camera);
|
//buildDistortionCamera(psNode, camera);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return info;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CameraGroup::buildGUICamera(SGPropertyNode* cameraNode,
|
void CameraGroup::buildGUICamera(SGPropertyNode* cameraNode,
|
||||||
|
|
|
@ -150,7 +150,7 @@ public:
|
||||||
* @param cameraNode the property node.
|
* @param cameraNode the property node.
|
||||||
* @return a CameraInfo object for the camera.
|
* @return a CameraInfo object for the camera.
|
||||||
*/
|
*/
|
||||||
void buildCamera(SGPropertyNode* cameraNode);
|
CameraInfo* buildCamera(SGPropertyNode* cameraNode);
|
||||||
/** Create a camera from properties that will draw the GUI and add
|
/** Create a camera from properties that will draw the GUI and add
|
||||||
* it to the camera group.
|
* it to the camera group.
|
||||||
* @param cameraNode the property node. This can be 0, in which
|
* @param cameraNode the property node. This can be 0, in which
|
||||||
|
|
Loading…
Add table
Reference in a new issue