本文整理汇总了C++中ModelLoader::removeAsset方法的典型用法代码示例。如果您正苦于以下问题:C++ ModelLoader::removeAsset方法的具体用法?C++ ModelLoader::removeAsset怎么用?C++ ModelLoader::removeAsset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ModelLoader
的用法示例。
在下文中一共展示了ModelLoader::removeAsset方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
float second = t->getMilli();
float lastTime = second;
while (win->isOpen())
{
second = t->getMilli();
deltaTime = second - lastTime;
lastTime = second;
if (glfwGetKey(GLFW_KEY_ESC))
break;
if (glfwGetKey(GLFW_KEY_SPACE))
mdlanictrl2.setActiveAnimation("jump");
if (glfwGetKey('W'))
mdlanictrl2.setActiveAnimation("begin_walk");
if (glfwGetKey('S'))
mdlanictrl2.setActiveAnimation("idle");
if (glfwGetKey('F'))
mdlanictrl.setActiveAnimation("die");
if (glfwGetKey('G'))
mdlanictrl2.setActiveAnimation("die");
if (glfwGetKey('A'))
mdlm2 = glm::rotate(mdlm2, -0.3f, glm::vec3(0.0f, 1.0f, 0.0f));
if (glfwGetKey('D'))
mdlm2 = glm::rotate(mdlm2, 0.3f, glm::vec3(0.0f, 1.0f, 0.0f));
if( glfwGetKey(GLFW_KEY_LSHIFT) || glfwGetKey(GLFW_KEY_RSHIFT))
speed = 1.0f;
else speed = 0.1f;
if (glfwGetKey('I'))
cam_pos += glm::cross(cam->getUpVector(),cam->getRightVector()) * speed * deltaTime;
if (glfwGetKey('K'))
cam_pos -= glm::cross(cam->getUpVector(),cam->getRightVector()) * speed * deltaTime;
if (glfwGetKey('J'))
cam_pos -= cam->getRightVector() * speed * deltaTime;
if (glfwGetKey('L'))
cam_pos += cam->getRightVector() * speed * deltaTime;
if (glfwGetKey('O'))
cam_pos += cam->getUpVector() * speed * deltaTime;
if (glfwGetKey('P'))
cam_pos -= cam->getUpVector() * speed * deltaTime;
if(glfwGetKey(GLFW_KEY_LEFT))
cam_orient = glm::rotate(cam_orient,speed * deltaTime,glm::vec3(0.0f,1.0f,0.0f));
if(glfwGetKey(GLFW_KEY_RIGHT))
cam_orient =glm::rotate(cam_orient,-speed * deltaTime,glm::vec3(0.0f,1.0f,0.0f));
if(glfwGetKey(GLFW_KEY_UP))
cam_orient = glm::rotate(cam_orient,speed * deltaTime,glm::vec3(1.0f,0.0f,0.0f));
if(glfwGetKey(GLFW_KEY_DOWN))
cam_orient = glm::rotate(cam_orient,-speed * deltaTime,glm::vec3(1.0f,0.0f,0.0f));
cam_pos.y = terr->getHeightAt(cam_pos.x,cam_pos.z) + 5;
cam->setPosition(cam_pos);
cam->setOrientation(cam_orient);
mdlanictrl.update(deltaTime);
mdlanictrl2.update(deltaTime);
grctx->clearDisplay();
grctx->setShader(sh);
grctx->setProjectionMatrix(cam->getLens());
grctx->setViewMatrix(cam->getView());
grctx->setModelMatrix(&mdlm);
for (int i = 0; i < mdl->getNumMeshes(); i++)
{
grctx->setMesh(mdl->getMesh(i));
grctx->setMaterial(mdl->getMaterial(mdl->getMesh(i)->getMaterialId()));
grctx->setBoneTransformation(mdlanictrl.getBoneTransformation(), mdlanictrl.getNumBones());
grctx->draw();
}
grctx->setModelMatrix(&mdlm2);
for (int i = 0; i < mdl2->getNumMeshes(); i++)
{
grctx->setMesh(mdl2->getMesh(i));
grctx->setMaterial(mdl2->getMaterial(mdl2->getMesh(i)->getMaterialId()));
grctx->setBoneTransformation(mdlanictrl2.getBoneTransformation(), mdlanictrl2.getNumBones());
grctx->draw();
}
grctx->setShader(tsh);
grctx->setProjectionMatrix(cam->getLens());
grctx->setViewMatrix(cam->getView());
terr->selectNodes(cam);
grctx->swapBuffers();
frames++;
}
t->end();
delete sh;
mmgr->removeAsset("Resources/Models/dwarf1.ms3d");
mmgr->removeAsset("Resources/Models/ant01.ms3d");
std::cout << "TpF: " << t->getLastMilli() / frames << " mspf was " << frames
<< " Frames in " << t->getLastMilli() << "ms or "
<< frames / t->getLastSecond() << "fps" << std::endl;
delete mmgr;
delete tmgr;
delete t;
delete GSystem;
return 0;
}