本文整理汇总了C++中SoCamera::enableNotify方法的典型用法代码示例。如果您正苦于以下问题:C++ SoCamera::enableNotify方法的具体用法?C++ SoCamera::enableNotify怎么用?C++ SoCamera::enableNotify使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SoCamera
的用法示例。
在下文中一共展示了SoCamera::enableNotify方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: apply
virtual void apply(SoNode* node)
{
if (!headlightRot) {
SoSearchAction sa;
sa.setNode(viewer->getHeadlight());
sa.apply(viewer->getSceneRoot());
SoFullPath* fullPath = (SoFullPath*) sa.getPath();
if (fullPath) {
SoGroup *group = (SoGroup*) fullPath->getNodeFromTail(1);
headlightRot = (SoRotation*) group->getChild(0);
if (!headlightRot->isOfType(SoRotation::getClassTypeId()))
headlightRot = 0;
}
}
const SbViewportRegion vpr = getViewportRegion();
const SbVec2s & size = vpr.getViewportSizePixels();
const int width = size[0];
const int height = size[1];
const int vpsize = width / 2;
SoCamera * camera = viewer->getCamera();
const SbVec3f position = camera->position.getValue();
const SbRotation orientation = camera->orientation.getValue();
const float nearplane = camera->nearDistance.getValue();
const float farplane = camera->farDistance.getValue();
camera->enableNotify(false);
// Front View
rotateCamera(SbRotation(SbVec3f(0,0,1), M_PI));
SbViewportRegion vp;
vp.setViewportPixels(SbVec2s(0, height-width/2), SbVec2s(width, width/2) );
setViewportRegion(vp);
SoGLRenderAction::apply(node);
// Left View
SbRotation r1(SbVec3f(0,0,1), -M_PI/2);
rotateCamera(r1*SbRotation(SbVec3f(0,1,0), -M_PI/2));
vp.setViewportPixels(SbVec2s(0, height-width), SbVec2s(width/2, width) );
setViewportRegion(vp);
SoGLRenderAction::apply(node);
// Right View
rotateCamera(SbRotation(SbVec3f(0,1,0), -M_PI));
vp.setViewportPixels(SbVec2s(width/2, height-width), SbVec2s(width/2, width) );
setViewportRegion(vp);
SoGLRenderAction::apply(node);
setViewportRegion(vpr);
camera->position = position;
camera->orientation = orientation;
camera->enableNotify(true);
// Restore original viewport region
setViewportRegion(vpr);
}