本文整理汇总了C++中ISceneNode::clone方法的典型用法代码示例。如果您正苦于以下问题:C++ ISceneNode::clone方法的具体用法?C++ ISceneNode::clone怎么用?C++ ISceneNode::clone使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISceneNode
的用法示例。
在下文中一共展示了ISceneNode::clone方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addRunWaySceneNode
ISceneNode* MySceneManager::addRunWaySceneNode( const core::vector3df& position /*= core::vector3df( 0 )*/,
f32 interval /*= 200*/, f32 width /*= 300*/,
const core::vector3df& colorFrom /*= core::vector3df( 0, 63, 255 )*/, const core::vector3df& colorTo /*= core::vector3df( 255, 255, 0 )*/,
s32 numOfArrows /*= 15 */ )
{
MyIrrlichtEngine* pEngine = MyIrrlichtEngine::GetEngine();
ISceneManager* smgr = pEngine->GetSceneManager();
IVideoDriver* driver = pEngine->GetVideoDriver();
u32 TimeMs = pEngine->GetDevice()->getTimer()->getTime();
f32 delay = 100;
// 跑道根节点
ISceneNode* runWay = smgr->addEmptySceneNode();
runWay->setPosition( position );
// 供复制的节点
ISceneNode* node = smgr->addMeshSceneNode( smgr->getMesh( "../media/UnitModel/UnitPlane.obj" ), runWay );
node->setScale( vector3df( 90, 176, 1 ) );
node->setRotation( vector3df( 0, 45, 0 ) );
node->setMaterialTexture( 0, driver->getTexture( "../media/UIResource/Game/arrow.png" ) );
node->setMaterialFlag( EMF_BACK_FACE_CULLING, false );
// 节点临时变量
ISceneNode* copy;
// Shader
SceneNodeShader shader;
// 色彩偏移量
vector3df colorOffset = ( colorTo - colorFrom ) / (f32)numOfArrows;
// 右跑道
for( int i=0; i<numOfArrows; i++ )
{
copy = node->clone();
copy->setPosition( vector3df( width / 2.f, 0, interval * i ) );
RunWayBlink* ani = new RunWayBlink( (u32)(delay * i), (f32)i, colorFrom, colorOffset );
copy->addAnimator( ani );
ani->drop();
}
node->setRotation( vector3df( 0, 45, 180 ) );
// 左跑道
for( int i=0; i<numOfArrows; i++ )
{
copy = node->clone();
copy->setPosition( vector3df( -width / 2.f, 0, interval * i ) );
RunWayBlink* ani = new RunWayBlink( (u32)(delay * i), (f32)i, colorFrom, colorOffset );
copy->addAnimator( ani );
ani->drop();
}
node->setVisible( false );
return runWay;
//return CreateRunWay( position, interval, width, colorFrom, colorTo, numOfArrows );
}
示例2: Java_zte_irrlib_scene_SceneNode_nativeCloneNode
int Java_zte_irrlib_scene_SceneNode_nativeCloneNode(
JNIEnv* env, jobject defaultObj, jint res, jint des)
{
ISceneNode* node = smgr->getSceneNodeFromId(res);
if (!node)
{
WARN_NODE_NOT_FOUND(res, nativeCloneNode);
return -1;
}
ISceneNode *copy = node->clone();
copy->setID(des);
return 0;
}