本文整理汇总了C++中IAnimatedMeshSceneNode::setTriangleSelector方法的典型用法代码示例。如果您正苦于以下问题:C++ IAnimatedMeshSceneNode::setTriangleSelector方法的具体用法?C++ IAnimatedMeshSceneNode::setTriangleSelector怎么用?C++ IAnimatedMeshSceneNode::setTriangleSelector使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IAnimatedMeshSceneNode
的用法示例。
在下文中一共展示了IAnimatedMeshSceneNode::setTriangleSelector方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createNode
ISceneNode* Render::createNode(bool isMD2, IAnimatedMesh* mesh, ITexture* texture, bool light,core::vector3df scale, core::vector3df pos, core::vector3df rotation)
{
IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode(mesh, NULL, IDFlag_IsPickable);
if(node)
{
pos.Y += -node->getBoundingBox().MinEdge.Y * scale.Y;
node->setPosition(pos);
node->setRotation(rotation);
node->setScale(scale);
node->setAnimationSpeed(20.f);
scene::ITriangleSelector* selector = 0;
selector = smgr->createTriangleSelector(node);
node->setTriangleSelector(selector);
selector->drop();
//Autoscale
//f32 scale = 0.25f;
node->setScale(scale);
if (texture)
{
//node->setMaterialFlag(EMF_LIGHTING, false);
node->setMaterialTexture(0, texture);
}
node->setMD2Animation(EMAT_STAND);
}
return node;
}
示例2: LoadModels
///////////////////////////////////////////函数实现////////////////////////////////////////////////
bool LoadModels(ISceneNode* m_ICamera,std::map<std::string,IAnimatedMeshSceneNode*>& myNode)
{
_finddata_t file;
long longf;
//读取文件夹下文件名字
if((longf = _findfirst("..\\model\\*.3ds", &file))==-1l)
{
std::cout<<"没有找到模型!\n";
}
else
{
std::cout<<"\n加载模型\n";
std::string tempName;
tempName = "";
tempName = file.name;
m_vecStrModelName.push_back(tempName);//加载第一个模型名字
while( _findnext( longf, &file ) == 0 )
{
tempName = "";
tempName = file.name;
if (tempName == "..")
{
continue;
}
m_vecStrModelName.push_back(tempName);
}
}
_findclose(longf);
//模型库模型节点的ID(从1000开始)
int storeModelID=1000;
//加载模型创建场景节点
auto iter(m_vecStrModelName.begin());
while(iter!=m_vecStrModelName.end())
{
std::string myPath=*iter;
myPath="..\\model\\"+myPath;
scene::IAnimatedMesh* mesh = m_IrrSmgr->getMesh((char*)myPath.c_str());
//模型设为摄像头的子节点
IAnimatedMeshSceneNode* modelNode = m_IrrSmgr->addAnimatedMeshSceneNode(mesh,m_ICamera);
// 设置自发光强度大小(即镜面渲染中的亮度大小)
modelNode->getMaterial(0).Shininess = 20.0f;
modelNode->setMaterialFlag(EMF_LIGHTING, true);
modelNode->setRotation(vector3df(90, 0, 0));
modelNode->setPosition(vector3df(90, 0, 0));
//创建三角选择器
m_ItriElector = m_IrrSmgr->createTriangleSelector(modelNode);
modelNode->setTriangleSelector(m_ItriElector);
m_ItriElector->drop(); // We're done with this m_ItriElector, so drop it now.
myNode[(*iter)]=modelNode;//插入模型名字和模型库结点对
iter++;
//设置模型为不可见
modelNode->setVisible(false);
//设置模型库模型ID
modelNode->setID(storeModelID);
++storeModelID;
}
//计算模型库的页数(三个模型一页)
m_iTotalPageNumber=m_vecStrModelName.size()/m_iPageModelCount;
if(m_vecStrModelName.size()%m_iPageModelCount!=0)
{
m_iTotalPageNumber+=1;
}
//添加翻页标志模型
for(int i=0;i<2;i++)
{
scene::IAnimatedMesh* mesh;
if(0==i)
{
mesh = m_IrrSmgr->getMesh("left.3ds");
}
else
{
mesh = m_IrrSmgr->getMesh("right.3ds");
}
//模型设为摄像头的子节点
IAnimatedMeshSceneNode* modelNode = m_IrrSmgr->addAnimatedMeshSceneNode(mesh,m_ICamera);
// 设置自发光强度大小(即镜面渲染中的亮度大小)
modelNode->getMaterial(0).Shininess = 20.0f;
modelNode->setMaterialFlag(EMF_LIGHTING, true);
modelNode->setRotation(vector3df(90, 0, 0));
//创建三角选择器
m_ItriElector = m_IrrSmgr->createTriangleSelector(modelNode);
modelNode->setTriangleSelector(m_ItriElector);
//.........这里部分代码省略.........
开发者ID:xueyedamo,项目名称:Workshop-layout-design-system-based-on-augmented-reality,代码行数:101,代码来源:MainRenderLoop.cpp