本文整理汇总了C++中ogre::SceneNode::setScale方法的典型用法代码示例。如果您正苦于以下问题:C++ SceneNode::setScale方法的具体用法?C++ SceneNode::setScale怎么用?C++ SceneNode::setScale使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::SceneNode
的用法示例。
在下文中一共展示了SceneNode::setScale方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: testModelMountScaling
void ModelMountTestCase::testModelMountScaling()
{
Ogre::Root root;
Ogre::SceneManager* sceneManager = root.createSceneManager(Ogre::ST_GENERIC);
TestModel model(*sceneManager);
//First test with a straight forward case.
Ogre::SceneNode* node = sceneManager->getRootSceneNode()->createChildSceneNode();
//We get an error when it's destroyed. So we don't destroy it.
SceneNodeProvider* nodeProvider = new SceneNodeProvider(node, nullptr);
Model::ModelMount mount(model, nodeProvider);
scaleAndTestMount(model, mount, nodeProvider->getNode());
//Test with the parent node being scaled
node->setScale(Ogre::Vector3(3.0f, 0.2f, 200.0f));
Ogre::SceneNode* subNode = node->createChildSceneNode();
nodeProvider = new SceneNodeProvider(subNode, nullptr);
Model::ModelMount mount2(model, nodeProvider);
scaleAndTestMount(model, mount2, nodeProvider->getNode());
//Test with the parent node being scaled and rotated
node->setScale(Ogre::Vector3(3.0f, 0.2f, 200.0f));
node->yaw(Ogre::Degree(42));
node->pitch(Ogre::Degree(76));
node->roll(Ogre::Degree(98));
subNode = node->createChildSceneNode();
nodeProvider = new SceneNodeProvider(subNode, nullptr);
Model::ModelMount mount3(model, nodeProvider);
scaleAndTestMount(model, mount3, nodeProvider->getNode());
}
示例2: setupContent
void StencilShadowTest::setupContent()
{
// turn ambient light off
mSceneMgr->setAmbientLight(ColourValue(0.0, 0.0, 0.0));
// turn on stencil shadows
mSceneMgr->setShadowTechnique(SHADOWTYPE_STENCIL_ADDITIVE);
// add a couple lights
Ogre::Light* light = mSceneMgr->createLight("Light1");
light->setDiffuseColour(0.5f,0.4f,0.35f);
light->setSpecularColour(0, 0, 0);
light->setAttenuation(8000,1,0.0005,0);
light->setPosition(220,100,0);
light->setCastShadows(true);
light->setType(Light::LT_POINT);
light = mSceneMgr->createLight("Light2");
light->setDiffuseColour(0.5f,0.4f,0.35f);
light->setSpecularColour(0, 0, 0);
light->setAttenuation(8000,1,0.0005,0);
light->setPosition(220,100,-200);
light->setCastShadows(true);
light->setType(Light::LT_POINT);
// create a ground plane to receive some shadows
Plane pln = MovablePlane("plane");
pln.normal = Vector3::UNIT_Y;
pln.d = 107;
MeshManager::getSingleton().createPlane("ground_plane",
ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, pln,
1500,1500,50,50,true,1,5,5,Vector3::UNIT_Z);
Ogre::Entity* groundPlane = mSceneMgr->createEntity( "plane", "ground_plane" );
groundPlane->setMaterialName("Examples/Rocky");
groundPlane->setCastShadows(false);
mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(groundPlane);
// and a couple objects to cast the shadows
Ogre::Entity* bar = mSceneMgr->createEntity( "barrel", "Barrel.mesh" );
bar->setCastShadows(true);
Ogre::SceneNode* barNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
barNode->attachObject(bar);
barNode->setScale(7,7,7);
barNode->setPosition(Ogre::Vector3(0,-85,-320));
Ogre::Entity* head = mSceneMgr->createEntity( "ogrehead", "ogrehead.mesh" );
head->setCastShadows(true);
Ogre::SceneNode* headNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
headNode->attachObject(head);
headNode->setPosition(Ogre::Vector3(-100,-80,-320));
Ogre::Entity* torus = mSceneMgr->createEntity( "torus", "knot.mesh" );
torus->setCastShadows(true);
torus->setMaterialName("Examples/RustySteel");
Ogre::SceneNode* torusNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
torusNode->setScale(0.5,0.5,0.5);
torusNode->attachObject(torus);
torusNode->setPosition(Ogre::Vector3(100,-60,-320));
// point the camera down a bit
mCamera->pitch(Ogre::Degree(-20.f));
}
示例3:
Banderin::Banderin( Ogre::String nombre , Ogre::SceneManager* sm , float _x , float _y , float _z){
x = _x;
y = _y;
z = _z;
_sceneManager = sm;
nodoBanderin = _sceneManager->createSceneNode("Banderin"+nombre);
Ogre::SceneNode* nodoSuperiorIzq = _sceneManager->createSceneNode(nombre+"superiorIzq");
Ogre::SceneNode* nodoBandera = _sceneManager->createSceneNode(nombre+"bandera");
Ogre::SceneNode* nodoSuperiorDer = _sceneManager->createSceneNode(nombre+"superiorDer");
Ogre::SceneNode* nodoBaseDer = _sceneManager->createSceneNode(nombre+"baseDer");
Ogre::Entity* entBanderin = _sceneManager->createEntity("usb_cilindro.mesh");
Ogre::Entity* entSuperiorIzq = _sceneManager->createEntity("poly10.mesh");
Ogre::Entity* entBandera = _sceneManager->createEntity("usb_planocurvo.mesh");
Ogre::Entity* entSuperiorDer = _sceneManager->createEntity("poly10.mesh");
Ogre::Entity* entBaseDer = _sceneManager->createEntity("usb_cilindro.mesh");
entBanderin->setMaterialName("banderin");
entSuperiorIzq->setMaterialName("superior");
entBandera->setMaterialName("bandera");
entSuperiorDer->setMaterialName("superior");
entBaseDer->setMaterialName("banderin");
nodoSuperiorIzq->attachObject(entSuperiorIzq);
nodoSuperiorIzq->setScale(0.03,0.008,0.06);
nodoSuperiorIzq->translate(2.2,7.2,0.0);
nodoSuperiorIzq->rotate(Ogre::Vector3(0.0,0.0,1.0),Ogre::Radian(Ogre::Degree(180.0)));
nodoBandera->attachObject(entBandera);
nodoBandera->setScale(1.2,3.85,1.0);
nodoBandera->translate(-2.2,7.2,0.0);
nodoBandera->rotate(Ogre::Vector3(0.0,0.0,1.0),Ogre::Radian(Ogre::Degree(90.0)));
nodoSuperiorDer->attachObject(entSuperiorDer);
nodoSuperiorDer->setScale(0.03,0.008,0.06);
nodoSuperiorDer->translate(-152.2,7.2,0.0);
nodoBaseDer->attachObject(entBaseDer);
nodoBaseDer->translate(-150.0,0.0,0.0);
nodoBanderin->attachObject(entBanderin);
nodoBanderin->addChild(nodoSuperiorIzq);
nodoBanderin->addChild(nodoBandera);
nodoBanderin->addChild(nodoSuperiorDer);
nodoBanderin->addChild(nodoBaseDer);
nodoBanderin->setPosition(x,y,z);
nodoBanderin->setScale(60.0,600.0,60.0);
}
示例4: createScene
void GameState::createScene()
{
// --- Objects
m_pNpc01 = new BaseNpc("Blacksmith", m_pSceneMgr, Ogre::Vector3(50.0f, 0.0f, 50.0f));
m_pNpc01->ChangeState(Work::Instance());
//m_pNpc02 = new BaseNpc("Woman", m_pSceneMgr, Ogre::Vector3(-50.0f, 0.0f, -50.0f));
//m_pNpc01->addLocation(Ogre::Vector3(-100.0f,0.0f,-100.0f));
// --- World
// Light
m_pSceneMgr->setAmbientLight(Ogre::ColourValue(0.7, 0.7, 0.7));
// Objects
// Home
Ogre::Entity* home = m_pSceneMgr->createEntity("Home", "tudorhouse.mesh");
//home->setCastShadows(true);
Ogre::SceneNode* homeNode = m_pSceneMgr->getRootSceneNode()->createChildSceneNode("HomeNode");
homeNode->attachObject(home);
homeNode->setPosition(Ogre::Vector3(-400.0f,220.0f,-400.0f));
homeNode->setScale(0.4f, 0.4f, 0.4f);
// Work
Ogre::Entity* work = m_pSceneMgr->createEntity("Work", "tudorhouse.mesh");
//work->setCastShadows(true);
Ogre::SceneNode* workNode = m_pSceneMgr->getRootSceneNode()->createChildSceneNode("WorkNode");
workNode->attachObject(work);
workNode->setPosition(Ogre::Vector3(400.0f,220.0f,400.0f));
workNode->setScale(0.4f, 0.4f, 0.4f);
workNode->yaw(Ogre::Degree(180));
// Tavern
Ogre::Entity* tavern = m_pSceneMgr->createEntity("Tavern", "tudorhouse.mesh");
//tavern->setCastShadows(true);
Ogre::SceneNode* tavernNode = m_pSceneMgr->getRootSceneNode()->createChildSceneNode("TavernNode");
tavernNode->attachObject(tavern);
tavernNode->setPosition(Ogre::Vector3(-400.0f,220.0f,400.0f));
tavernNode->setScale(0.4f, 0.4f, 0.4f);
tavernNode->yaw(Ogre::Degree(180));
// Ground
Ogre::Plane plane(Ogre::Vector3::UNIT_Y, 0);
Ogre::MeshManager::getSingleton().createPlane("ground", Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
plane, 1500, 1500, 20, 20, true, 1, 5, 5, Ogre::Vector3::UNIT_Z);
Ogre::Entity* entGround = m_pSceneMgr->createEntity("GroundEntity", "ground");
m_pSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(entGround);
entGround->setMaterialName("Examples/Rockwall");
entGround->setCastShadows(false);
}
示例5: createScene
void Hundir::createScene() {
Ogre::Entity* inicio = _sceneManager->createEntity("Inicio.mesh");
Ogre::SceneNode* ninicio = _sceneManager->createSceneNode("ninicio");
_sceneManager->getRootSceneNode()->addChild(ninicio);
ninicio->attachObject(inicio);
ninicio->yaw(Ogre::Degree(-15));
ninicio->pitch(Ogre::Degree(50));
ninicio->roll(Ogre::Degree(90));
ninicio->setScale(1,1.5,1.2);
ninicio->setPosition(0,0,-2);
/* Sombras */
_sceneManager->setShadowTechnique(Ogre::SHADOWTYPE_STENCIL_MODULATIVE);
_sceneManager->setShadowColour(Ogre::ColourValue(0.5, 0.5, 0.5) );
_sceneManager->setAmbientLight(Ogre::ColourValue(0.9, 0.9, 0.9));
_sceneManager->setShadowTextureCount(2);
_sceneManager->setShadowTextureSize(512);
/* Iluminacion */
Ogre::Light *light = _sceneManager->createLight("Light");
light->setType(Ogre::Light::LT_SPOTLIGHT);
light->setDirection(Ogre::Vector3(0,-1,0));
light->setSpotlightInnerAngle(Ogre::Degree(25.0f));
light->setSpotlightOuterAngle(Ogre::Degree(200.0f));
light->setPosition(0, 150, 0);
light->setSpecularColour(1, 1, 1);
light->setDiffuseColour(1, 1, 1);
light->setSpotlightFalloff(5.0f);
light->setCastShadows(true);
}
示例6: rotation
void np::ConnectionDisplaySystem::onAddedEntity( ac::es::EntityPtr e)
{
np::ConnectionComponent* connection = e->getComponent<np::ConnectionComponent>();
np::GraphicComponent* graphics = e->getComponent<np::GraphicComponent>();
//OgreFramework::getSingletonPtr()->m_pLog->logMessage( "Connection to be displayed!");
double mx = ( connection->target1->position.x + connection->target2->position.x) * 0.5;
//OgreFramework::getSingletonPtr()->m_pLog->logMessage( Ogre::StringConverter::toString( (Ogre::Real)mx));
double mz = ( connection->target1->position.z + connection->target2->position.z) * 0.5;
//OgreFramework::getSingletonPtr()->m_pLog->logMessage( Ogre::StringConverter::toString( (Ogre::Real)mz));
double dx = connection->target2->position.x - connection->target1->position.x;
double dz = connection->target2->position.z - connection->target1->position.z;
double d = std::sqrt( dx * dx + dz * dz) / 100.0;
Ogre::Vector3 position( mx, 0.0, mz);
double rads = std::atan2( dx, dz);
Ogre::Quaternion rotation( Ogre::Radian( rads), Ogre::Vector3::UNIT_Y);
Ogre::SceneNode* newNode = mSceneMgr->getRootSceneNode()->createChildSceneNode( position, rotation);
newNode->setScale( 1.0, 1.0, d);
for (std::list<Ogre::Entity*>::iterator it = graphics->entities.begin(); it != graphics->entities.end(); it++)
newNode->attachObject( (*it));
graphics->node = newNode;
}
示例7: insertBegin
void Actors::insertBegin(const MWWorld::Ptr &ptr)
{
Ogre::SceneNode* cellnode;
CellSceneNodeMap::const_iterator celliter = mCellSceneNodes.find(ptr.getCell());
if(celliter != mCellSceneNodes.end())
cellnode = celliter->second;
else
{
//Create the scenenode and put it in the map
cellnode = mRootNode->createChildSceneNode();
mCellSceneNodes[ptr.getCell()] = cellnode;
}
Ogre::SceneNode* insert = cellnode->createChildSceneNode();
const float *f = ptr.getRefData().getPosition().pos;
insert->setPosition(f[0], f[1], f[2]);
insert->setScale(ptr.getCellRef().mScale, ptr.getCellRef().mScale, ptr.getCellRef().mScale);
// Convert MW rotation to a quaternion:
f = ptr.getCellRef().mPos.rot;
// Rotate around X axis
Ogre::Quaternion xr(Ogre::Radian(-f[0]), Ogre::Vector3::UNIT_X);
// Rotate around Y axis
Ogre::Quaternion yr(Ogre::Radian(-f[1]), Ogre::Vector3::UNIT_Y);
// Rotate around Z axis
Ogre::Quaternion zr(Ogre::Radian(-f[2]), Ogre::Vector3::UNIT_Z);
// Rotates first around z, then y, then x
insert->setOrientation(xr*yr*zr);
ptr.getRefData().setBaseNode(insert);
}
示例8: createOgreVehicle
OgreVehicle* OgreVehicle::createOgreVehicle(Ogre::SceneNode* parNode, std::string name, Ogre::Vector3 pos)
{
if (parNode)
{
OgreVehicle* vehicle = new OgreVehicle();
vehicle->mName = name;
vehicle->mParNode = parNode;
Ogre::SceneManager* sceneMgr = vehicle->mParNode->getCreator();
Ogre::String nodeName = "User_" + name;
vehicle->mNode = vehicle->mParNode->createChildSceneNode(nodeName);
Ogre::SceneNode* pNodeBody = vehicle->mNode->createChildSceneNode("Body" + nodeName);
Ogre::SceneNode* pNodeCam = vehicle->mNode->createChildSceneNode("Cam" + nodeName);
Ogre::Entity* eBody = sceneMgr->createEntity("eBody"+nodeName, OGRE_VEHICLE_FILE);
pNodeBody->attachObject(eBody);
pNodeBody->setScale(0.0002*SCALE_TERRAIN, 0.0002*SCALE_TERRAIN, 0.0002*SCALE_TERRAIN);
vehicle->mNode->setPosition(pos);
vehicle->mWheels[0] = OgreWheel::createOgreWheel(pNodeBody, Ogre::Vector3(1.02f, -0.3622f, 1.26));
vehicle->mWheels[1] = OgreWheel::createOgreWheel(pNodeBody, Ogre::Vector3(1.12f, -0.3622f,-1.54));
vehicle->mWheels[2] = OgreWheel::createOgreWheel(pNodeBody, Ogre::Vector3(-1.02f, -0.3622f, 1.26));
vehicle->mWheels[3] = OgreWheel::createOgreWheel(pNodeBody, Ogre::Vector3(-1.12f, -0.3622f,-1.54));
return vehicle;
}
return NULL;
}
示例9: throwSphere
void DPSHelper::throwSphere(void)
{
Ogre::Vector3 pos = mCamera->getDerivedPosition() + mCamera->getDerivedDirection().normalisedCopy() * 10;
Ogre::Quaternion rot = Ogre::Quaternion::IDENTITY;
Ogre::Entity *ent = mSceneMgr->createEntity("sphere.mesh");
//Ogre::Entity *ent = mSceneMgr->createEntity("cube.mesh");
ent->setCastShadows(true);
//ent->setMaterialName("Examples/BumpyMetal");
Ogre::SceneNode* sphereNode = mSceneMgr->getRootSceneNode()->createChildSceneNode(pos,rot);
setColor(ent, Ogre::Vector3(0.3021f,0.3308f,0.3671f));
sphereNode->attachObject(ent);
sphereNode->setScale(Ogre::Vector3(0.1f,0.1f,0.1f));
BtOgre::StaticMeshToShapeConverter converter(ent);
btCollisionShape* entShape = converter.createSphere();
//btCollisionShape* entShape = converter.createTrimesh();
//Calculate inertia.
btScalar mass = 1;
btVector3 inertia(0,0,0);
entShape->calculateLocalInertia(mass, inertia);
//Create BtOgre MotionState (connects Ogre and Bullet).
BtOgre::RigidBodyState* entState = new BtOgre::RigidBodyState(sphereNode);
//Create the Body.
btRigidBody* entBody = new btRigidBody(mass, entState, entShape, inertia);
Ogre::Vector3 thro = mCamera->getRealDirection() * 800;
entBody->applyCentralForce(btVector3(pos.x,pos.y,pos.z) * 50000);
entBody->setLinearVelocity(btVector3(thro.x,thro.y,thro.z));
phyWorld->addRigidBody(entBody);
}
示例10: createOgreHead
void DPSHelper::createOgreHead(void)
{
Ogre::Vector3 pos = Ogre::Vector3(0,100,0);
Ogre::Quaternion rot = Ogre::Quaternion::IDENTITY;
//Create Ogre stuff.
Ogre::Entity* ogreHeadEntity = mSceneMgr->createEntity("ogrehead.mesh");
Ogre::SceneNode* ogreHeadNode = mSceneMgr->getRootSceneNode()->createChildSceneNode(pos, rot);
ogreHeadNode->attachObject(ogreHeadEntity);
ogreHeadNode->setScale(Ogre::Vector3(1,1,1));
ogreHeadEntity->setCastShadows(true);
//setColor(mNinjaEntity, Ogre::Vector3(0.3021,0.3308,0.3671));
//mNinjaEntity->setMaterialName("Examples/Rockwall");
//Create shape.
BtOgre::StaticMeshToShapeConverter converter(ogreHeadEntity);
//BtOgre::AnimatedMeshToShapeConverter converter(mNinjaEntity);
//mNinjaShape = converter.createTrimesh();
btCollisionShape* ogreHeadShape = converter.createConvex();
//mNinjaShape = converter.createConvex();
//Calculate inertia.
btScalar mass = 1;
btVector3 inertia;
ogreHeadShape->calculateLocalInertia(mass, inertia);
//Create BtOgre MotionState (connects Ogre and Bullet).
BtOgre::RigidBodyState *ogreheadState = new BtOgre::RigidBodyState(ogreHeadNode);
//Create the Body.
btRigidBody* ogreHeadBody = new btRigidBody(mass, ogreheadState, ogreHeadShape, inertia);
phyWorld->addRigidBody(ogreHeadBody);
}
示例11: setupScene
void Sample::setupScene()
{
mSceneMgr->setSkyBox(true, "spaceSkyBox");
// Set the scene's ambient light
mSceneMgr->setAmbientLight(Ogre::ColourValue(0.5f, 0.5f, 0.5f));
Ogre::Entity* pEntity = mSceneMgr->createEntity("SinbadInstance", "Sinbad.mesh");
Ogre::SceneNode* pNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
pNode->attachObject(pEntity);
pNode->setScale(Ogre::Vector3(3.0f));
mDance = pEntity->getAnimationState("Dance");
mDance->setEnabled(true);
mDance->setLoop(true);
mDance->setTimePosition(0);
Ogre::Light* pDirLight = mSceneMgr->createLight();
pDirLight->setDirection(Ogre::Vector3(0,-1,0));
pDirLight->setType(Ogre::Light::LT_DIRECTIONAL);
pNode->attachObject(pDirLight);
mCamera->setNearClipDistance(1.0f);
mCamera->setFarClipDistance(100000.0f);
mCamera->setPosition(0,0,30.0f);
mCamera->lookAt(0,0,0);
mCamera->setAutoAspectRatio(true);
Ogre::Viewport* vp = mWindow->addViewport(mCamera);
vp->setBackgroundColour(Ogre::ColourValue(1,0,0));
}
示例12: update
void Replicator::update(float value)
{
//logFile << getFrequentcyRange() << " :\t " << value << "\n";
Ogre::Vector3 currentScale = getScale();
this->setThreshold(0.7*this->getThreshold() + 0.4*value);
float result = value / this->getThreshold();
int numOfChildrenToGenerate = result > 1.0 ? (result - value) * 2 : 0;
//logFile << value / this->getThreashold() << "\t" << (result - value) * 10 << "\t" << numOfChildrenToGenerate << "\n";
for ( int i = 0; i < numOfChildrenToGenerate; i++ ) {
createChildren(numOfChildrenToGenerate);
}
for(std::vector<Ogre::Entity*>::size_type i = 0; i < children.size(); ) {
Ogre::SceneNode* childNode = children[i]->getParentSceneNode();
Ogre::Real res = childNode->getScale().length();
if ( res < 0.1 ) {
children[i]->setVisible(false);
childNode->setVisible(false);
childNode->detachObject(children[i]->getName());
_sceneManager->destroyEntity(children[i]->getName());
// entity is now destroyed, don't try to use the pointer anymore!
// optionally destroy node
_sceneManager->destroySceneNode(childNode->getName());
children.erase( children.begin() + i );
} else {
Ogre::Vector3 currScale = childNode->getScale();
childNode->setScale(Ogre::Vector3(currScale.x - currScale.x/3, currScale.y - currScale.y/3, currScale.z - currScale.z/3));
i++;
}
}
}
示例13: name
void
OgreModel::attachTo(Ogre::SceneNode* node) const
{
std::string name(original->getName());
OgreRenderer* renderer(OgreRenderer::getInstance());
Ogre::SceneManager* sceneManager(renderer->getOgreSceneManager());
Ogre::Entity* ogreEntity;
if (0 == name.compare("cube"))
{
ogreEntity = sceneManager->createEntity(renderer->createUniqueString("cube-Entity"), "cube");
}
else
{
ogreEntity = sceneManager->createEntity(renderer->createUniqueString(name + "-Entity"), name + ".mesh");
}
if (!PURGE::CoordinateSystem::get().isLeftHanded())
{
node->attachObject(ogreEntity);
}
else
{
Ogre::SceneNode* modelNode = node->createChildSceneNode(name + "-Node");
modelNode->setScale(1, 1, -1);
modelNode->attachObject(ogreEntity);
}
}
示例14: getBase
Ogre::SceneNode * WheelAnimalSceneObj::getBaseCenter()
{
if(_sn == NULL)
{
_sn = Orz::OgreGraphicsManager::getSingleton().getSceneManager()->getRootSceneNode()->createChildSceneNode(getCenterPoint());
//_sn->yaw(Ogre::Radian(Ogre::Math::PI));
for(int i=0 ; i<(BASE_ALL-BASE_0); ++i)
{
Ogre::SceneNode * base = getBase(i);
Ogre::Node * parent = base->getParent();
Ogre::Vector3 p = base->getPosition();
if(parent)
{
parent->removeChild(base);
}
base->translate(-getCenterPoint());
_sn->addChild(base);
Ogre::SceneManager * sm = OgreGraphicsManager::getSingleton().getSceneManager();
Ogre::Entity * ent = sm->createEntity("ring"+Ogre::StringConverter::toString(i), "zp_dwdzgh.mesh");
Ogre::SceneNode * node = base->createChildSceneNode("ring"+Ogre::StringConverter::toString(i),Ogre::Vector3(0.f, 10.f, 0.f));
node->setScale(0.6f,0.6f,0.6f);
node->attachObject(ent);
Orz::OgreGraphicsManager::getSingleton().getSceneManager()->getSceneNode("ring"+Ogre::StringConverter::toString(i))->setVisible(false);
}
}
return _sn;
}
示例15:
void Application::createSceneSet3()
{
int sNumber = 2;
Ogre::Entity* groundEntity = m_sceneManager->createEntity( "Ground3", "ground.mesh" );
Ogre::SceneNode* groundSceneNode = m_sceneManager->getRootSceneNode()->createChildSceneNode();
groundSceneNode->attachObject( groundEntity );
groundSceneNode->setPosition(Ogre::Vector3(0, 0, DISTANCE_TO_ANOTHER * sNumber * -1));
groundSceneNode->setScale( ROW_WIDTH, 1, ROW_HEIGHT );
Ogre::ParticleSystem* pTest1 = m_sceneManager->createParticleSystem("pBlast", "PEExamples/blast");
Ogre::SceneNode* pTest1SceneNode = m_sceneManager->getRootSceneNode()->createChildSceneNode();
pTest1SceneNode->attachObject(pTest1);
pTest1SceneNode->setPosition(Ogre::Vector3(150, DISTANCE_TO_FLOOR, DISTANCE_TO_ANOTHER * sNumber * -1));
Ogre::ParticleSystem* pTest2 = m_sceneManager->createParticleSystem("pBlast2", "PEExamples/blast2");
Ogre::SceneNode* pTest2SceneNode = m_sceneManager->getRootSceneNode()->createChildSceneNode();
pTest2SceneNode->attachObject(pTest2);
pTest2SceneNode->setPosition(Ogre::Vector3(-100, DISTANCE_TO_FLOOR, DISTANCE_TO_ANOTHER * sNumber * -1));
Ogre::ParticleSystem* pTest3 = m_sceneManager->createParticleSystem("pFloaty", "PEExamples/floatyGreeny");
Ogre::SceneNode* pTest3SceneNode = m_sceneManager->getRootSceneNode()->createChildSceneNode();
pTest3SceneNode->attachObject(pTest3);
pTest3SceneNode->setPosition(Ogre::Vector3(-350, DISTANCE_TO_FLOOR, DISTANCE_TO_ANOTHER * sNumber * -1));
}