本文整理汇总了C++中ogre::Entity类的典型用法代码示例。如果您正苦于以下问题:C++ Entity类的具体用法?C++ Entity怎么用?C++ Entity使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Entity类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: createBall
Ball* Application::createBall(Ogre::String nme, GameObject::objectType tp, Ogre::String meshName, int x, int y, int z, Ogre::Real scale, Ogre::SceneManager* scnMgr, GameManager* ssm, Ogre::Real mss, Ogre::Real rest, Ogre::Real frict, bool kinematic, Simulator* mySim) {
createRootEntity(nme, meshName, x, y, z);
Ogre::SceneNode* sn = mSceneManager->getSceneNode(nme);
Ogre::Entity* ent = SceneHelper::getEntity(mSceneManager, nme, 0);
const btTransform pos;
OgreMotionState* ms = new OgreMotionState(pos, sn);
sn->setScale(scale,scale,scale);
ent->setMaterialName("ball");
Ball* obj = new Ball(nme, tp, mSceneManager, ssm, sn, ent, ms, mySim, mss, rest, frict, scale, kinematic);
obj->addToSimulator();
return obj;
}
开发者ID:David-Parker,项目名称:Paddle-Game,代码行数:15,代码来源:Application.cpp
示例2: createBox
Ogre::SceneNode* createBox(Ogre::SceneManager* sceneMgr, Ogre::String name)
{
// create an ordinary Ogre mesh with texture
Ogre::Entity* boxEnt = sceneMgr->createEntity(name , "cube.mesh");
// we need the bounding box of the cube.mesh to set the size of the Bullet box
Ogre::AxisAlignedBox boxBb = boxEnt->getBoundingBox();
//Ogre::Vector3 size = boxBb.getSize();
boxEnt->setMaterialName("Examples/BumpyMetal");
// create the node
Ogre::SceneNode* boxNode = sceneMgr->getRootSceneNode()->createChildSceneNode();
boxNode->attachObject( boxEnt );
return boxNode;
}
开发者ID:damiannz,项目名称:Loco,代码行数:15,代码来源:TutorialApplication.cpp
示例3: setNode
Penguin::Penguin(Ogre::SceneManager* sceneMgr, std::string name) {
Ogre::Entity* entPenguin = sceneMgr->createEntity(name, "penguin.mesh");
mAnimationState = entPenguin->getAnimationState("amuse");
mAnimationState->setLoop(true);
mAnimationState->setEnabled(true);
entPenguin->setCastShadows(true);
Ogre::SceneNode* penguinNode = sceneMgr->getRootSceneNode()->createChildSceneNode(name, Ogre::Vector3(0,30,0));
penguinNode->attachObject(entPenguin);
penguinNode->scale(60 / 63.0057, 50 / 47.99059, 50 / 49.27139);
Ogre::Camera* cam = sceneMgr->getCamera("GameCam");
cameraNode = penguinNode->createChildSceneNode("CameraNode");
cameraNode->attachObject(cam);
setNode(penguinNode);
}
开发者ID:klt592,项目名称:GTFinal,代码行数:15,代码来源:Penguin.cpp
示例4:
void
RenderEntityComp::_create(const ZEntityResource* res, Ogre::SceneManager* scnMgr, Ogre::SceneNode* node)
{
Ogre::Entity* ent = scnMgr->createEntity(res->getKey(), res->getResourceName());
ent->setMaterialName("PRJZ/MinecraftCharacter");
auto scale = World::WorldScale::computeAWorldScale();
if(!ent)
OGRE_EXCEPT(Ogre::Exception::ERR_INVALIDPARAMS, "Failed to create Entity", "RenderEntityComp::_create");
//Assume the center is is at units / 2.0
_node = node->createChildSceneNode();
_node->attachObject(ent);
_node->setScale(scale.metersPerUnit, scale.metersPerUnit, scale.metersPerUnit);
// childNode->translate(0.0f, -scale.unitsPerMeter / 2.0, 0.0f);
_node->setVisible(false);
}
开发者ID:ColinGilbert,项目名称:projectzombie,代码行数:15,代码来源:RenderEntityComp.cpp
示例5: performSelection
void SelectionBox::performSelection(std::list<AgentId> &selection, Ogre::Camera *mCamera)
{
if((mRight - mLeft) * (mBottom - mTop) < 0.0001)
return;
float left = (mLeft + 1.f) / 2.f;
float right = (mRight + 1.f) / 2.f;
float top = (1.f - mBottom) / 2.f;
float bottom = (1.f - mTop) / 2.f;
Ogre::Ray topLeft = mCamera->getCameraToViewportRay(left, top);
Ogre::Ray topRight = mCamera->getCameraToViewportRay(right, top);
Ogre::Ray bottomLeft = mCamera->getCameraToViewportRay(left, bottom);
Ogre::Ray bottomRight = mCamera->getCameraToViewportRay(right, bottom);
// These planes have now defined an "open box" which extends to infinity in front of the camera. You can think of
// the rectangle we drew with the mouse as being the termination point of the box just in front of the camera.
Ogre::PlaneBoundedVolume vol;
const Ogre::Real min = .1, max = 500;
vol.planes.push_back(Ogre::Plane(topLeft.getPoint(min), topRight.getPoint(min), bottomRight.getPoint(min))); // front plane
vol.planes.push_back(Ogre::Plane(topLeft.getOrigin(), topLeft.getPoint(max), topRight.getPoint(max))); // top plane
vol.planes.push_back(Ogre::Plane(topLeft.getOrigin(), bottomLeft.getPoint(max), topLeft.getPoint(max))); // left plane
vol.planes.push_back(Ogre::Plane(bottomLeft.getOrigin(), bottomRight.getPoint(max), bottomLeft.getPoint(max))); // bottom plane
vol.planes.push_back(Ogre::Plane(topRight.getOrigin(), topRight.getPoint(max), bottomRight.getPoint(max))); // right plane
Ogre::PlaneBoundedVolumeList volList;
volList.push_back(vol);
mVolQuery->setVolumes(volList);
Ogre::SceneQueryResult result = mVolQuery->execute();
// Finally we need to handle the results of the query. First we will deselect all previously selected objects,
// then we will select all objects which were found by the query.
std::list<Ogre::SceneNode *> nodes;
Ogre::SceneQueryResultMovableList::iterator iter;
for(iter = result.movables.begin(); iter != result.movables.end(); ++iter)
{
Ogre::MovableObject *movable = *iter;
if(movable->getMovableType().compare("Entity") == 0)
{
Ogre::Entity *pentity = static_cast<Ogre::Entity *>(movable);
nodes.push_back(pentity->getParentSceneNode());
}
}
mEngine->level()->getAgentsIdsFromSceneNodes(nodes, selection);
}
开发者ID:onze,项目名称:Steel,代码行数:48,代码来源:SelectionBox.cpp
示例6: while
void RttManager::CDepthReflectionListener::preRenderTargetUpdate(const Ogre::RenderTargetEvent& evt)
{
Hydrax *mHydrax = mRttManager->mHydrax;
mHydrax->getMesh()->getEntity()->setVisible(false);
Ogre::SceneManager::MovableObjectIterator EntityIterator =
mHydrax->getSceneManager()->getMovableObjectIterator("Entity");
Ogre::Entity* CurrentEntity;
unsigned int k;
mMaterials.empty();
while (EntityIterator.hasMoreElements())
{
CurrentEntity = static_cast<Ogre::Entity*>(EntityIterator.peekNextValue());
for(k = 0; k < CurrentEntity->getNumSubEntities(); k++)
{
mMaterials.push(CurrentEntity->getSubEntity(k)->getMaterialName());
CurrentEntity->getSubEntity(k)->setMaterialName(mHydrax->getMaterialManager()->getMaterial(MaterialManager::MAT_DEPTH)->getName());
}
EntityIterator.moveNext();
}
mRttManager->mPlanes[RTT_DEPTH_REFLECTION]->getParentNode()->translate(0,-mHydrax->getPlanesError(),0);
bool IsInUnderwaterError = false;
if (mHydrax->getCamera()->getDerivedPosition().y > mRttManager->mPlanes[RTT_DEPTH_REFLECTION]->getParentNode()->getPosition().y)
{
mCameraPlaneDiff = 0;
IsInUnderwaterError = true;
}
else
{
mCameraPlaneDiff = 0;
}
mHydrax->getCamera()->enableReflection(mRttManager->mPlanes[RTT_DEPTH_REFLECTION]);
if (!IsInUnderwaterError)
{
mHydrax->getCamera()->enableCustomNearClipPlane(mRttManager->mPlanes[RTT_DEPTH_REFLECTION]);
}
}
开发者ID:Aperion,项目名称:rigsofrods-next-stable,代码行数:48,代码来源:RttManager.cpp
示例7: updateOGRE
void MainWindow::updateOGRE()
{
QMutexLocker locker(&mutex);
static bool updateGUI=true;
Ogre::Root* mRoot = Ogre::Root::getSingletonPtr();
mRoot->_fireFrameStarted();
// loop through ogre widgets and update animation
QList<OgreWidget*> rendlist = this->findChildren<OgreWidget*>();
foreach (OgreWidget* w, rendlist)
{
// update animation for OgreWidget's sceneManager
if (w->mRenderWindow && w->updatesEnabled())
{
// update OgreWidget
w->update();
//emit w->paintEvent(new QPaintEvent(w->rect()));
for (Ogre::SceneManager::MovableObjectIterator mit = w->getSceneManager()->getMovableObjectIterator("Entity");
mit.hasMoreElements(); mit.moveNext() )
{
Ogre::Entity *entity = static_cast<Ogre::Entity*>(mit.peekNextValue());
if (updateGUI) {
updateGUI = false;
}
// check has skeleton to avoid crash for non animable entities
if (entity->hasSkeleton())
{
for (Ogre::AnimationStateIterator animIt = entity->getAllAnimationStates()->getAnimationStateIterator();
animIt.hasMoreElements(); animIt.moveNext() )
{
Ogre::AnimationState *animState = animIt.peekNextValue();
if ( animState->getEnabled() )
{
//std::cout << entity->getName() << " ZZZZZZZZZZZ " << animState->getAnimationName();
animState->addTime(w->getRenderWindow()->getBestFPS()/10000);
}
}
}
}
}
}
mRoot->_fireFrameRenderingQueued();
mRoot->_fireFrameEnded();
}
开发者ID:toglia3d,项目名称:OgreSpriteEditor,代码行数:48,代码来源:MainWindow.cpp
示例8: _loadMesh
//-----------------------------------------------------------------------------
Ogre::SceneNode* SSAOApp::_loadMesh(const Ogre::String &_name, const Ogre::Vector3 &_pos)
{
std::string entityName = _name+Ogre::StringConverter::toString(mScenePairs.size());
Ogre::Entity *ent = mSceneMgr->createEntity(entityName, _name+".mesh");
Ogre::SceneNode *node = mSceneMgr->getRootSceneNode()->createChildSceneNode(ent->getName()+"Node", _pos);
ent->setMaterialName("SSAO/DiffuseLight_GBuffer");
node->attachObject(ent);
mScenePairs.push_back(SSAOApp::ScenePair(ent, node));
return node;
}
开发者ID:sevas,项目名称:ogre-ssao,代码行数:17,代码来源:SSAOApp.cpp
示例9: CharacterController
OgreCharacterController::OgreCharacterController(Ogre::Camera * Camera, const Ogre::String& name, const Ogre::Vector3& position)
: CharacterController(Camera, position, name, "Sinbad.mesh", Ogre::Vector3(3, 3, 3)), lastTop(0), lastBase(0),
mSword1(0), mSword2(0), swordsOut(false), sliceDir(false), animTimer(0)
{
Ogre::SceneManager * smgr = Camera->getSceneManager();
Ogre::Entity * ent = getEntity();
ent->getSkeleton()->setBlendMode(Ogre::ANIMBLEND_CUMULATIVE);
mSword1 = smgr->createEntity("Sword1", "Sword.mesh");
mSword2 = smgr->createEntity("Sword2", "Sword.mesh");
ent->attachObjectToBone("Sheath.L", mSword1);
ent->attachObjectToBone("Sheath.R", mSword2);
getTargetNode()->setFixedYawAxis(true);
}
开发者ID:DeathByTape,项目名称:OldWork,代码行数:16,代码来源:OgreCharacterController.cpp
示例10: createBackGround
/*
* Create a fake Plane for Drag and Drop
*/
void MyFrameListener::createBackGround() {
Ogre::SceneManager* mSceneMgr = Ogre::Root::getSingleton().
getSceneManager("mainSM");
Ogre::Plane *mPlane = new Ogre::Plane(Ogre::Vector3::UNIT_Z, -2);
Ogre::MeshManager::getSingleton().createPlane("backPlane",
Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
*mPlane,800, 800, 20, 20, true, 1, 5, 5
, Ogre::Vector3::UNIT_Y);
Ogre::Entity* plane = mSceneMgr->createEntity("backPlane");
plane->setQueryFlags(PLANE_DRAG_DROP);
plane->setMaterialName("sheet");
Ogre::Root::getSingleton().
getSceneManager("mainSM")->getRootSceneNode()->
attachObject(plane);
}
开发者ID:flush,项目名称:CEDV-2015,代码行数:19,代码来源:MyFrameListener.cpp
示例11: placeObjectOnTerrain
void OgreWidget::placeObjectOnTerrain(const QString meshName, const Ogre::Vector3 position, const float rotationY, const Ogre::Vector3 scale)
{
Ogre::Quaternion rotation;
QString name(meshName);
name.replace(".mesh", "");
Ogre::Entity* entity = mSceneManager->createEntity(name.toStdString(), meshName.toStdString());
entity->setQueryFlags(0xFFFFFFFF);
rotation.FromAngleAxis(Ogre::Degree(rotationY), Ogre::Vector3::UNIT_Y);
Ogre::SceneNode* sceneNode = mSceneManager->getRootSceneNode()->createChildSceneNode(
position + Ogre::Vector3(0, mTerrainGroup->getHeightAtWorldPosition(position) + mTerrainPos.y - 0.2, 0),
rotation);
sceneNode->setScale(scale);
sceneNode->attachObject(entity);
addMeshInformation(entity, sceneNode);
}
开发者ID:wpfhtl,项目名称:octocopter,代码行数:16,代码来源:ogrewidget.cpp
示例12: createMesh
Mesh* OgreSubsystem::createMesh(String mesh,String name)
{
String nombre = name;
if(name=="AUTO_NAME_ME")
{
nombre = "OryxSceneNodeAutoNamed"+StringUtils::toString(mAutoNameIndex);
++mAutoNameIndex;
}
Ogre::Entity* ent = mSceneManager->createEntity(nombre,mesh);
Ogre::SceneNode* node = mSceneManager->createSceneNode(nombre);
node->attachObject(ent);
ent->setCastShadows(false);
Mesh* m = new Mesh(nombre,node,ent);
mSceneNodes.push_back(m);
return m;
}
开发者ID:67-6f-64,项目名称:OryxEngine,代码行数:16,代码来源:OgreSubsystem.cpp
示例13: SceneManager
void
Player::stopAnimation(std::string anim)
{
Ogre::SceneManager::MovableObjectIterator iterator = SceneManager()->getMovableObjectIterator("Entity");
while(iterator.hasMoreElements())
{
Ogre::Entity* e = static_cast<Ogre::Entity*>(iterator.getNext());
if (e->hasSkeleton())
{
Ogre::AnimationState *animation = e->getAnimationState(anim);
animation->setEnabled(false);
animation->setTimePosition(0);
}
}
}
开发者ID:simonkwong,项目名称:Shamoov,代码行数:16,代码来源:Player.cpp
示例14: createWall
void SceneLoader::createWall( Ogre::Vector3 pos, Ogre::Real scale )
{
Ogre::Entity* ent = mSceneMgr->createEntity("atd_cube.mesh");
// Ogre::MeshPtr mesh = ent->getMesh();
// mesh->freeEdgeList();
// mesh->buildEdgeList();
ent->setCastShadows(true);
ent->setQueryFlags(AugmentedTowerDefense::MASK_WALLS);
Ogre::SceneNode* node = mSceneRootNode->createChildSceneNode("Wall_" + AugmentedTowerDefense::HelperClass::ToString(mWallCount));
node->setPosition(pos);
node->setScale(Ogre::Vector3::UNIT_SCALE*scale);
node->attachObject(ent);
mWallCount++;
}
开发者ID:abmantis,项目名称:AugmentedTowerDefense,代码行数:16,代码来源:SceneLoader.cpp
示例15: createScene
//-------------------------------------------------------------------------------------
void GameMain::createScene(void)
{
createCamera(); // Camera
createViewports(); // Viewport
createEnvir(); // Environment: Light, Sky, etc.
//-------------------------
// 地平面
Ogre::MeshManager::getSingleton().createPlane("floor", Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
Ogre::Plane(Ogre::Vector3::UNIT_Y, 0), 100, 100, 10, 10, true, 1, 10, 10, Ogre::Vector3::UNIT_Z);
// create a floor entity, give it a material, and place it at the origin
Ogre::Entity* floor = mSceneMgr->createEntity("Floor", "floor");
floor->setMaterialName("Examples/Rockwall");
floor->setCastShadows(false);
mSceneMgr->getRootSceneNode()->attachObject(floor);
//-------------------------
// 创建障碍物分布地图
//-------------------------
// 创建障碍物
/*Ogre::SceneNode * boxNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
Entity * boxEntity = mSceneMgr->createEntity("Box","cube.mesh");
boxEntity->setMaterialName("Examples/BumpyMetal");
boxNode->attachObject( boxEntity );
boxNode->scale( 0.01f, 0.01f, 0.01f );
boxNode->setPosition( 0,0.5,0 );
boxNodes.push_back( boxNode );
boxEntitys.push_back( boxEntity );*/
Ogre::SceneNode * ogreHeadNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
Entity * ogreHeadEntity = mSceneMgr->createEntity("OgreHead","ogrehead.mesh");
ogreHeadNode->attachObject( ogreHeadEntity );
ogreHeadNode->scale( 0.02f, 0.02f, 0.02f );
//ogreHeadNode->setPosition( 1, 0, 1 );
ogreHeadNode->setPosition( 15, 0.5, -20 );
boxNodes.push_back( ogreHeadNode );
boxEntitys.push_back( ogreHeadEntity );
//-------------------------
// 创建角色
mPlayer = new GamePlayer( mCamera, ogreHeadNode );
}
开发者ID:Kjuly,项目名称:3d-path-search,代码行数:48,代码来源:GameMain.cpp
示例16: AddBoneVisualizer
void Actor::AddBoneVisualizer()
{
SkeletonInstance* pSkeletonInstance = _pBodyEntity->getSkeleton();
if (!pSkeletonInstance)
{
return;
}
Skeleton::BoneIterator it = pSkeletonInstance->getBoneIterator();
while (it.hasMoreElements())
{
Bone* pBone = it.getNext();
Bone::ChildNodeIterator cit = pBone->getChildIterator();
int iCount = 0;
while (cit.hasMoreElements())
{
Node* pChild = cit.getNext();
iCount++;
String strName = pBone->getName() + "_" + pChild->getName();
Ogre::Entity* ent = OgreFramework::getSingletonPtr()->m_pSceneMgr->createEntity(strName, "bone.mesh");
TagPoint* pTag = _pBodyEntity->attachObjectToBone(pBone->getName(), ent);
ent->setVisible(_bShowBone);
_Entitys.push_back(ent);
_BoneVisuals[pTag] = pChild;
}
if (iCount == 0)
{
Ogre::Entity* ent = OgreFramework::getSingletonPtr()->m_pSceneMgr->createEntity(pBone->getName(), "bone.mesh");
TagPoint* pTag = _pBodyEntity->attachObjectToBone(pBone->getName(), ent);
ent->setVisible(_bShowBone);
_Entitys.push_back(ent);
_BoneVisuals[pTag] = 0;
}
}
_UpdateBoneVisualizer();
}
开发者ID:windrobin,项目名称:ogremeshviewer,代码行数:47,代码来源:Actor.cpp
示例17: save
void Cube::save(Ogre::String file)
{
if (rndCounter == 0)
{
std::ofstream output(file.c_str());
// Write cube size
output << size << std::endl;
for (int i = 0; i < size; ++i)
for (int j = 0; j < size; ++j)
for (int k = 0; k < size; ++k)
{
CubeElement *e = data[i][j][k];
Ogre::Entity *ent = static_cast<Ogre::Entity*>(e->node->getAttachedObject(0));
Ogre::SceneNode *node = e->node;
// Write name, indexes and position
output << node->getName() << "\n"
<< "\t" << i << " " << j << " " << k << "\n" // index in data array
<< "\t" << node->getPosition().x << " " << node->getPosition().y << " " << node->getPosition().z << "\n"; // position
// Write orientation
Ogre::Vector3 orient_axis;
Ogre::Degree orient_angle;
node->getOrientation().ToAngleAxis(orient_angle, orient_axis);
output << "\t" << orient_axis.x << " " << orient_axis.y << " " << orient_axis.z << " " // orientation axis
<< orient_angle.valueDegrees() << "\n"; // orientation angle
output << "\t" << ent->getSubEntity(0)->getMaterialName() << "\n"
<< "\t" << ent->getSubEntity(1)->getMaterialName() << "\n"
<< "\t" << ent->getSubEntity(2)->getMaterialName() << "\n"
<< "\t" << ent->getSubEntity(3)->getMaterialName() << "\n"
<< "\t" << ent->getSubEntity(4)->getMaterialName() << "\n"
<< "\t" << ent->getSubEntity(5)->getMaterialName() << "\n";
// Write pivot info
output << "\t" << e->isPivot << "\n";
if (e->isPivot)
{
// pivot indexes
output << "\t" << e->pivotArrays[0] << " " << e->pivotArrayIndexes[0] << "\n"
<< "\t" << e->pivotArrays[1] << " " << e->pivotArrayIndexes[1] << "\n";
}
// flush
output << std::endl;
}
output.close();
}
}
开发者ID:0xc0dec,项目名称:yarc,代码行数:47,代码来源:Cube.cpp
示例18: while
const char *mesh_anim_name ( void *mesh, int index ) {
Ogre::Entity *e = static_cast<Ogre::Entity *> ( mesh );
auto iter = e->getAllAnimationStates()->getAnimationStateIterator();
int c = 0;
while ( iter.hasMoreElements() ) {
auto s = iter.getNext();
if ( c == index ) {
return s->getAnimationName().c_str();
}
c++;
}
return "";
}
开发者ID:OndraVoves,项目名称:CyberEgo3D,代码行数:17,代码来源:meshapi.cpp
示例19: create
void Player::create(Ogre::Degree p, Ogre::Degree r, Ogre::Degree y)
{
Ogre::MeshManager::getSingleton().create("cube.mesh", Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
Ogre::Entity* entity = sceneMgr->createEntity(Ogre::MeshManager::getSingleton().getByName(
"cube.mesh",
Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME));
Ogre::Vector3 newPos(position.x, position.y, position.z);
endPos = newPos;
rootNode = sceneMgr->getRootSceneNode()->createChildSceneNode(name, newPos);
rootNode->setScale(length()/100.0, length()/100.0, length()/100.0);
rootNode->attachObject(entity);
// rootNode->setScale(.6, .6, .6);
entity->setMaterialName("Cube/Blend");
rootNode->pitch(Ogre::Degree(p));
rootNode->roll(Ogre::Degree(r));
startPosition = position;
}
开发者ID:chjk122,项目名称:finalGame,代码行数:17,代码来源:GameObject.cpp
示例20: deleteBoard
bool MyFrameListener::deleteBoard()
{
for (int i=0; i<_XMAX; i++)
{
for (int j=0; j<_YMAX; j++)
{
myBoard[i][j]=0;
}
}
for (int i=0; i<_XMAX; i++)
{
for (int j=0; j<_YMAX; j++)
{
myBoardPlayer[i][j]=0;
}
}
_maxFires=0;
_sceneManager->getRootSceneNode()->removeAndDestroyAllChildren();
_sceneManager->clearScene();
// Añadir el plano a la escena
// Creacion del plano
Ogre::Plane pl1(Ogre::Vector3::UNIT_Y,-5);
Ogre::MeshManager::getSingleton().createPlane("pl1",
Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
pl1,200,200,1,1,true,1,20,20,Ogre::Vector3::UNIT_Z);
// Añadir el plano a la escena
Ogre::SceneNode* nodeG = _sceneManager->createSceneNode("nodeG");
Ogre::Entity* grEnt = _sceneManager->createEntity("pEnt", "pl1");
grEnt->setMaterialName("Ground");
nodeG->attachObject(grEnt);
// Sombras
_sceneManager->setShadowTechnique(Ogre::SHADOWTYPE_STENCIL_ADDITIVE);
Ogre::Light* light = _sceneManager->createLight("light1");
light->setType(Ogre::Light::LT_DIRECTIONAL);
light->setDirection(Ogre::Vector3(1,-1,0));
nodeG->attachObject(light);
_sceneManager->getRootSceneNode()->addChild(nodeG);
return true;
}
开发者ID:jayped,项目名称:victomic,代码行数:46,代码来源:MyFrameListener.cpp
注:本文中的ogre::Entity类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论