本文整理汇总了C++中PhysicalObject::drawPhysics方法的典型用法代码示例。如果您正苦于以下问题:C++ PhysicalObject::drawPhysics方法的具体用法?C++ PhysicalObject::drawPhysics怎么用?C++ PhysicalObject::drawPhysics使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PhysicalObject
的用法示例。
在下文中一共展示了PhysicalObject::drawPhysics方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: draw
//.........这里部分代码省略.........
ASSERT(stackDepth == 1);
#endif
}
// draw object / scene physics
if(physicalObject && (physicsShadeMode != noShading || renderFlags & showSensors))
{
Simulation::simulation->scene->defaultSurface->set();
unsigned int renderFlags = (this->renderFlags | showPhysics) & ~showControllerDrawings;
switch(physicsShadeMode)
{
case noShading:
glPolygonMode(GL_FRONT, GL_LINE);
glShadeModel(GL_FLAT);
renderFlags &= ~showPhysics;
break;
case flatShading:
glPolygonMode(GL_FRONT, GL_FILL);
glShadeModel(GL_FLAT);
break;
case wireframeShading:
glPolygonMode(GL_FRONT, GL_LINE);
glShadeModel(GL_FLAT);
break;
case smoothShading:
glPolygonMode(GL_FRONT, GL_FILL);
glShadeModel(GL_SMOOTH);
break;
default:
ASSERT(false);
break;
}
physicalObject->drawPhysics(renderFlags);
Simulation::simulation->scene->defaultSurface->unset();
// check matrix stack size
#ifdef _DEBUG
int stackDepth;
glGetIntegerv(GL_MODELVIEW_STACK_DEPTH, &stackDepth);
ASSERT(stackDepth == 1);
#endif
}
// draw drag plane
if(dragging && dragSelection)
{
Simulation::simulation->scene->defaultSurface->set();
glPolygonMode(GL_FRONT, GL_FILL);
glShadeModel(GL_FLAT);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_SRC_ALPHA);
glPushMatrix();
if(dragType == dragRotate || dragType == dragNormalObject)
glMultMatrixf(dragSelection->transformation);
else
glTranslatef(dragSelection->pose.translation.x, dragSelection->pose.translation.y, dragSelection->pose.translation.z);
switch(dragPlane)
{
case xyPlane:
break; // do nothing