本文整理汇总了C++中ObjectManager::setWireframeMode方法的典型用法代码示例。如果您正苦于以下问题:C++ ObjectManager::setWireframeMode方法的具体用法?C++ ObjectManager::setWireframeMode怎么用?C++ ObjectManager::setWireframeMode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObjectManager
的用法示例。
在下文中一共展示了ObjectManager::setWireframeMode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Keyboard
void Keyboard(unsigned char key, int mx, int my)
{
float LO;
float HI;
float x;
float z;
float y;
float r, g, b;
Generic_Object* frag;
vec3 oldPos;
float dirX;
float dirY;
float dirZ;
float moveSpeed = 10.0f;
switch(key)
{
case 'z':
camera.position += camera.target * moveSpeed;
break;
case 's':
camera.position -= camera.target * moveSpeed;
break;
case 'q':
camera.position += camera.orientation.Cross(camera.target).Normalized() * moveSpeed;
break;
case 'd':
camera.position -= camera.orientation.Cross(camera.target).Normalized() * moveSpeed;
break;
case 'w':
clearScene = true;
break;
case 'x':
wireframeMode = (wireframeMode?false:true);
objectManager.setWireframeMode(wireframeMode);
break;
case 'y':
makeExplosion(vec3(0.0f, 0.0f, 0.0f));
break;
case 'u':
makeExplosion(vec3(750.0f, 0.0f, 750.0f));
break;
case 'i':
makeExplosion(vec3(-750.0f, 0.0f, 750.0f));
break;
case 'o':
makeExplosion(vec3(-750.0f, 0.0f, -750.0f));
break;
case 'p':
makeExplosion(vec3(750.0f, 0.0f, -750.0f));
break;
case 'v':
dirX = -2;
dirY = 4;
dirZ = -2;
for(int i = 0; i < 4; ++i)
{
for(int j= 0; j < 4; ++j)
{
for(int k =0; k < 4; ++k)
{
frag = CreateFragments(vec3((float)k * 10.0f-10.f, (float)i * 10.0f + 5.0f + 20.0f, (float)j * 10.0f-10.0f), 10.0f);
++nbObjects;
//cout << ++countSphere << " - x: " << k* 5.0f << " y: " << i* 5.0f + 5.0f<< " z: " << j* 5.0f << endl;
LO = -3.0f;
HI = 3.0f;
r = LO + static_cast <float> (rand()) /( static_cast <float> (RAND_MAX/(HI-LO)));
g = LO + static_cast <float> (rand()) /( static_cast <float> (RAND_MAX/(HI-LO)));
b = LO + static_cast <float> (rand()) /( static_cast <float> (RAND_MAX/(HI-LO)));
frag->setWireframeMode(false);
frag->getComponents()->getGravity()->setUseGravity(true);
frag->getComponents()->getRigidBody()->addRigidBody(RIGID_GENERIC, *frag->getListOfVertices(), *frag->getListOfIndexes(), frag->getCenterOfObject(), true);
frag->getComponents()->getRigidBody()->setDisplayRigidBody(true);
frag->getComponents()->getRigidBody()->activateRigidBody(true);
frag->getComponents()->getGravity()->setBounciness(frag->getMass(), frag->getMass()/5550);
frag->getComponents()->getGravity()->setResistance(frag->getMass(), frag->getMass() / 1.01f);
frag->setAlternateFacesAndNormals(true);
frag->getComponents()->getGravity()->setGravity(9.8f);
switch(j)
{
case 0:
frag->setColor(0.61f, 0.44f, 0.13f, 1.0f);
break;
case 1:
frag->setColor(0.77f, 0.56f, 0.16f, 1.0f);
break;
case 2:
//.........这里部分代码省略.........