void SceneGraph::zoomAllViewpoint() { float bboxCenter[3]; float bboxSize[3]; getBoundingBoxCenter(bboxCenter); getBoundingBoxSize(bboxSize); ViewpointNode *view = getViewpointNode(); if (view == NULL) view = getDefaultViewpointNode(); float fov = view->getFieldOfView(); float zoffset = bboxSize[0] / (float)tan(fov); view->setPosition(bboxCenter[0], bboxCenter[1], bboxCenter[2] + zoffset*5.0f); view->setOrientation(0.0f, 0.0f, 1.0f, 0.0f); }
XnBoundingBox3D Cylinder::getBoundingBox() { return calcBoundingBox(getCenter(), getBoundingBoxSize()); }
XnBoundingBox3D RectPrism::getBoundingBox() { return calcBoundingBox(getCenter(), getBoundingBoxSize()); }