本文整理汇总了C++中ogre::SceneNode::pitch方法的典型用法代码示例。如果您正苦于以下问题:C++ SceneNode::pitch方法的具体用法?C++ SceneNode::pitch怎么用?C++ SceneNode::pitch使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::SceneNode
的用法示例。
在下文中一共展示了SceneNode::pitch方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: initOgreEntity
void Room::initOgreEntity(Ogre::SceneManager* mSceneMgr){
Ogre::Plane plane(Ogre::Vector3::UNIT_Y, 0);
Ogre::MeshManager::getSingleton().createPlane(
"wall",
Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
plane,
WALL_SIZE, WALL_SIZE, 20, 20,
true,
1, 5, 5,
Ogre::Vector3::UNIT_Z);
Ogre::Entity* walls[NUM_WALLS];
for(int i = 0; i < NUM_WALLS; i++){
walls[i] = mSceneMgr->createEntity("wall");
walls[i]->setMaterialName("Examples/Rockwall");
walls[i]->setCastShadows(true);
}
//FLOOR
mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(walls[0]);
//CEILING
Ogre::SceneNode* sceneForManip = mSceneMgr->getRootSceneNode()->createChildSceneNode(Ogre::Vector3(0, WALL_SIZE, 0));
sceneForManip->attachObject(walls[1]);
sceneForManip->roll(Ogre::Degree(180));
//LEFT WALL
sceneForManip = mSceneMgr->getRootSceneNode()->createChildSceneNode(Ogre::Vector3(-WALL_SIZE/2, WALL_SIZE/2, 0));
sceneForManip->attachObject(walls[2]);
sceneForManip->roll(Ogre::Degree(-90));
//RIGHT WALL
sceneForManip = mSceneMgr->getRootSceneNode()->createChildSceneNode(Ogre::Vector3(WALL_SIZE/2, WALL_SIZE/2, 0));
sceneForManip->attachObject(walls[3]);
sceneForManip->roll(Ogre::Degree(90));
//BACK WALL
sceneForManip = mSceneMgr->getRootSceneNode()->createChildSceneNode(Ogre::Vector3(0, WALL_SIZE/2, -WALL_SIZE/2));
sceneForManip->attachObject(walls[4]);
sceneForManip->pitch(Ogre::Degree(90));
//FRONT WALL
sceneForManip = mSceneMgr->getRootSceneNode()->createChildSceneNode(Ogre::Vector3(0, WALL_SIZE/2, WALL_SIZE/2));
sceneForManip->attachObject(walls[5]);
sceneForManip->pitch(Ogre::Degree(-90));
targetWall = sceneForManip;
}
示例2: DrawNewCore
void TestGame::DrawNewCore(Logic::CoreBuiltEvnt *evnt){
Ogre::Entity* drop= mSceneMgr->createEntity("Mesh"+evnt->building->mSysName, "BaseDropNew.mesh");
drop->setCastShadows(true);
const Ogre::AxisAlignedBox test =drop->getBoundingBox();
Control::ClickHelper* helpr = new Control::ClickHelper(Logic::CHT_BUILDING);
helpr->target = evnt->building;
drop->setUserAny(Ogre::Any(helpr));
Ogre::SceneNode *coreNode = evnt->country->mNode->createChildSceneNode();
Ogre::Vector3 tempvect = calculateActualPointFromCenter(evnt->country->mCapital.mPosition,evnt->tile->mPosition);
tempvect= tempvect*TILESIZE;
coreNode->attachObject(drop);
coreNode->translate(tempvect);
coreNode->pitch(Ogre::Degree(90));
coreNode->scale(0.5,0.5,0.5);
Ogre::AnimationState* temp= drop->getAnimationState("drop");
temp->setLoop(false);
temp->setEnabled(true);
mAllAnimation .insert(temp);
Ogre::Entity* basePlane= mSceneMgr->createEntity("MeshBaseFloor"+evnt->building->mSysName, "BaseCloseLook.mesh");
basePlane->setMaterialName("BaseCloseLook/Rockwall");
Ogre::SceneNode *BaseDraw = evnt->country->mNode->createChildSceneNode(),*camspot;
BaseDraw->attachObject(basePlane);
BaseDraw->translate(2000*evnt->building->mSlot,0,0);
camspot = BaseDraw->createChildSceneNode("CamPoint_"+evnt->building->mSysName);
camspot->setPosition(0,45,45);
camspot->lookAt(Ogre::Vector3(0,0,0), Ogre::Node::TS_PARENT);
helpr = new Control::ClickHelper(Logic::CHT_EMPTYSPACE);
helpr->target = evnt->building;
basePlane->setUserAny(Ogre::Any(helpr));
}
示例3: 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);
}
示例4: _buildRoom
//-----------------------------------------------------------------------------
void SSAOApp::_buildRoom()
{
Ogre::Plane plane(Ogre::Vector3::UNIT_Y, 0.0f);
Ogre::MeshPtr planeMesh =
Ogre::MeshManager::getSingleton().createPlane("Plane.mesh"
,Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME
,plane
, 1000, 1000
, 1, 1, true
, 1, 5, 5
, Ogre::Vector3::UNIT_Z );
Ogre::SceneNode *wallNode;
wallNode = _makeWall("Plane.mesh", "ground");
wallNode = _makeWall("Plane.mesh", "left wall");
wallNode->translate(-500, 500, 0);
wallNode->roll(Ogre::Radian(-Ogre::Math::PI / 2));
wallNode = _makeWall("Plane.mesh", "back wall");
wallNode->translate(0, 500, -500);
wallNode->pitch(Ogre::Radian(Ogre::Math::PI / 2));
wallNode = _makeWall("Plane.mesh", "right wall");
wallNode->translate(500, 500, 0);
wallNode->roll(Ogre::Radian(Ogre::Math::PI / 2));
}
示例5: 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());
}
示例6: setup
void CharacterPreview::setup ()
{
mSceneMgr = Ogre::Root::getSingleton().createSceneManager(Ogre::ST_GENERIC);
// This is a dummy light to turn off shadows without having to use a separate set of shaders
Ogre::Light* l = mSceneMgr->createLight();
l->setType (Ogre::Light::LT_DIRECTIONAL);
l->setDiffuseColour (Ogre::ColourValue(0,0,0));
/// \todo Read the fallback values from INIImporter (Inventory:Directional*)
l = mSceneMgr->createLight();
l->setType (Ogre::Light::LT_DIRECTIONAL);
l->setDirection (Ogre::Vector3(0.3, -0.7, 0.3));
l->setDiffuseColour (Ogre::ColourValue(1,1,1));
mSceneMgr->setAmbientLight (Ogre::ColourValue(0.5, 0.5, 0.5));
mCamera = mSceneMgr->createCamera (mName);
mCamera->setAspectRatio (float(mSizeX) / float(mSizeY));
Ogre::SceneNode* renderRoot = mSceneMgr->getRootSceneNode()->createChildSceneNode("renderRoot");
//we do this with mwRoot in renderingManager, do it here too.
renderRoot->pitch(Ogre::Degree(-90));
mNode = renderRoot->createChildSceneNode();
mAnimation = new NpcAnimation(mCharacter, mNode,
0, true, (renderHeadOnly() ? NpcAnimation::VM_HeadOnly : NpcAnimation::VM_Normal));
Ogre::Vector3 scale = mNode->getScale();
mCamera->setPosition(mPosition * scale);
mCamera->lookAt(mLookAt * scale);
mCamera->setNearClipDistance (0.01);
mCamera->setFarClipDistance (1000);
mTexture = Ogre::TextureManager::getSingleton().getByName (mName);
if (mTexture.isNull ())
mTexture = Ogre::TextureManager::getSingleton().createManual(mName,
Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, Ogre::TEX_TYPE_2D, mSizeX, mSizeY, 0, Ogre::PF_A8R8G8B8, Ogre::TU_RENDERTARGET);
mRenderTarget = mTexture->getBuffer()->getRenderTarget();
mRenderTarget->removeAllViewports ();
mViewport = mRenderTarget->addViewport(mCamera);
mViewport->setOverlaysEnabled(false);
mViewport->setBackgroundColour(Ogre::ColourValue(0, 0, 0, 0));
mViewport->setShadowsEnabled(false);
mRenderTarget->setActive(true);
mRenderTarget->setAutoUpdated (false);
onSetup ();
}
示例7: objects
void // Load other propers or objects (e.g. furniture)
GameApplication::loadObjects()
{
using namespace Ogre;
Ogre::Entity *ent;
Ogre::SceneNode *node;
/////////////////////////////////////////////////////////////////////////////////////////////////////
// Lecture 7
ent = mSceneMgr->createEntity("Gun", "38pistol.mesh");
node = mSceneMgr->getRootSceneNode()->createChildSceneNode("GunNode", Ogre::Vector3(5.0f, 1.4f, 5.0f));
node->attachObject(ent);
node->pitch(Degree(90));
node->setScale(0.1f, 0.1f, 0.1);
ent = mSceneMgr->createEntity("Gun2", "9mm.mesh");
node = mSceneMgr->getRootSceneNode()->createChildSceneNode("GunNode2", Ogre::Vector3(5.0f, 1.4f, 5.0f));
node->attachObject(ent);
node->pitch(Degree(90));
node->setScale(0.1f, 0.1f, 0.1);
///////////////////////////////////////////////////////////////////////////////////////////////////
}
示例8: createDebugRendering
void PhysicEngine::createDebugRendering()
{
if(!isDebugCreated)
{
Ogre::SceneManagerEnumerator::SceneManagerIterator iter = Ogre::Root::getSingleton().getSceneManagerIterator();
iter.begin();
Ogre::SceneManager* scn = iter.getNext();
Ogre::SceneNode* node = scn->getRootSceneNode()->createChildSceneNode();
node->pitch(Ogre::Degree(-90));
mDebugDrawer = new BtOgre::DebugDrawer(node, dynamicsWorld);
dynamicsWorld->setDebugDrawer(mDebugDrawer);
isDebugCreated = true;
dynamicsWorld->debugDrawWorld();
}
}
示例9: createWall
Wall* Application::createWall(Ogre::String nme, GameObject::objectType tp, Ogre::String meshName, int x, int y, int z, Ogre::Vector3 scale, Ogre::Degree pitch, Ogre::Degree yaw, Ogre::Degree roll, 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.x, scale.y, scale.z);
sn->pitch(pitch);
sn->yaw(yaw);
sn->roll(roll);
Wall* obj = new Wall(nme, tp, mSceneManager, ssm, sn, ent, ms, mySim, mss, rest, frict, scale, kinematic);
obj->addToSimulator();
return obj;
}
示例10: Initialize
void Laser::Initialize(Ogre::SceneManager *sceneManager, Ogre::SceneNode* parentNode, PhysicsEngine &physicsEngine, unsigned int parentID)
{
PhysicsEntity::Initialize(sceneManager, parentNode, physicsEngine, parentID);
//setting our mass to 0
bodyType = ENTITY_BODY_METAPHYSICAL;
dynamic = false;
mass = 0.0f;
Ogre::Entity *laserEntity = sceneManager->createEntity("Cylinder");
laserEntity->setMaterialName("LaserMaterial");
Ogre::SceneNode *laserSceneNode = sceneNode->createChildSceneNode("Laser" + Ogre::StringConverter::toString(entityCount));
laserSceneNode->attachObject(laserEntity);
laserSceneNode->scale(0.3f, 1000.0f, 0.3f);
laserSceneNode->pitch(Ogre::Radian(-Ogre::Math::HALF_PI));
laserSceneNode->translate(0,0,-500.0f);
sceneNode->setVisible(false);
}
示例11: setup
void CharacterPreview::setup ()
{
mSceneMgr = Ogre::Root::getSingleton().createSceneManager(Ogre::ST_GENERIC);
mCamera = mSceneMgr->createCamera (mName);
mCamera->setAspectRatio (float(mSizeX) / float(mSizeY));
Ogre::SceneNode* renderRoot = mSceneMgr->getRootSceneNode()->createChildSceneNode("renderRoot");
//we do this with mwRoot in renderingManager, do it here too.
renderRoot->pitch(Ogre::Degree(-90));
mNode = renderRoot->createChildSceneNode();
mAnimation = new NpcAnimation(mCharacter, mNode,
MWWorld::Class::get(mCharacter).getInventoryStore (mCharacter), RV_PlayerPreview);
mNode->setVisible (false);
Ogre::Vector3 scale = mNode->getScale();
mCamera->setPosition(mPosition * scale);
mCamera->lookAt(mLookAt * scale);
mCamera->setNearClipDistance (0.01);
mCamera->setFarClipDistance (1000);
mTexture = Ogre::TextureManager::getSingleton().getByName (mName);
if (mTexture.isNull ())
mTexture = Ogre::TextureManager::getSingleton().createManual(mName,
Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, Ogre::TEX_TYPE_2D, mSizeX, mSizeY, 0, Ogre::PF_A8R8G8B8, Ogre::TU_RENDERTARGET);
mRenderTarget = mTexture->getBuffer()->getRenderTarget();
mRenderTarget->removeAllViewports ();
mViewport = mRenderTarget->addViewport(mCamera);
mViewport->setOverlaysEnabled(false);
mViewport->setBackgroundColour(Ogre::ColourValue(0, 0, 0, 0));
mViewport->setShadowsEnabled(false);
mViewport->setMaterialScheme("local_map");
mViewport->setVisibilityMask (RV_PlayerPreview);
mRenderTarget->setActive(true);
mRenderTarget->setAutoUpdated (false);
onSetup ();
}
示例12: createScene
void createScene()
{
// Create the Entity
Ogre::Entity* robot = mSceneMgr->createEntity("Robot", "robot.mesh");
// Attach robot to scene graph
Ogre::SceneNode* RobotNode = mSceneMgr->getRootSceneNode()->createChildSceneNode("Robot");
//RobotNode->setPosition((Ogre::Real)-0.3, (Ogre::Real)0.2, (Ogre::Real)0);
RobotNode->attachObject(robot);
RobotNode->scale((Ogre::Real)0.001,(Ogre::Real)0.001,(Ogre::Real)0.001);
RobotNode->pitch(Ogre::Degree(180));
RobotNode->yaw(Ogre::Degree(-90));
// The animation
// Set the good animation
mAnimationState = robot->getAnimationState( "Idle" );
// Start over when finished
mAnimationState->setLoop( true );
// Animation enabled
mAnimationState->setEnabled( true );
}
示例13: mObjects
RenderingManager::RenderingManager (OEngine::Render::OgreRenderer& _rend, const boost::filesystem::path& resDir, OEngine::Physic::PhysicEngine* engine, MWWorld::Environment& environment)
:mRendering(_rend), mObjects(mRendering), mActors(mRendering, environment), mAmbientMode(0), mDebugging(engine)
{
mRendering.createScene("PlayerCam", 55, 5);
// Set default mipmap level (NB some APIs ignore this)
TextureManager::getSingleton().setDefaultNumMipmaps(5);
// Load resources
ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
// Turn the entire scene (represented by the 'root' node) -90
// degrees around the x axis. This makes Z go upwards, and Y go into
// the screen (when x is to the right.) This is the orientation that
// Morrowind uses, and it automagically makes everything work as it
// should.
SceneNode *rt = mRendering.getScene()->getRootSceneNode();
mMwRoot = rt->createChildSceneNode();
mMwRoot->pitch(Degree(-90));
mObjects.setMwRoot(mMwRoot);
mActors.setMwRoot(mMwRoot);
//used to obtain ingame information of ogre objects (which are faced or selected)
mRaySceneQuery = mRendering.getScene()->createRayQuery(Ray());
Ogre::SceneNode *playerNode = mMwRoot->createChildSceneNode ("player");
playerNode->pitch(Degree(90));
Ogre::SceneNode *cameraYawNode = playerNode->createChildSceneNode();
Ogre::SceneNode *cameraPitchNode = cameraYawNode->createChildSceneNode();
cameraPitchNode->attachObject(mRendering.getCamera());
//mSkyManager = 0;
mSkyManager = new SkyManager(mMwRoot, mRendering.getCamera());
mPlayer = new MWRender::Player (mRendering.getCamera(), playerNode);
mSun = 0;
}
示例14: iniciarCenario
//-------------------------------------------------------------------------------------
void Cenario::iniciarCenario(){
// Crio um nó filho do nó raiz na hierarquia de cena
Cenario::cenarioNode = Bomberman::getInstance()->mSceneMgr->getRootSceneNode()->createChildSceneNode("cenarioNode");
//Posiciona o Nó
Cenario::cenarioNode->setPosition( Ogre::Vector3(0,0,0) );
Ogre::Entity* campoEntity = Bomberman::getInstance()->mSceneMgr->createEntity("cenario", "scenario_green.mesh");
Ogre::SceneNode * campo = Bomberman::getInstance()->mSceneMgr->getRootSceneNode()->createChildSceneNode( "campo" );
campo->attachObject(campoEntity);
campo->setPosition(6,-0.5f,-7);
campo->setScale( 10.0f, 10.0f, 10.0f );
campo->pitch( Ogre::Degree( -90 ) );
Ogre::SceneNode* elementoNode;
Ogre::Entity* elementoEntidade;
for( int i = 0; i < LINHAS; i++ ){
for( int j = 0; j < COLUNAS; j++){
Ogre::String nomeEntidade, nomeCenarioNode;
Square square = Cenario::criarSquare( i, j, &nomeCenarioNode, &nomeEntidade );
switch( Cenario::cenario[i][j] ){
case 'X':
elementoNode = Cenario::cenarioNode->createChildSceneNode( nomeCenarioNode );
elementoEntidade = Bomberman::getInstance()->mSceneMgr->createEntity( nomeEntidade, "block_hard.mesh" );
elementoEntidade->setCastShadows(true);
elementoNode->setPosition( Ogre::Vector3( i, 0, j * - 1 ) );
elementoNode->attachObject( elementoEntidade );
elementoNode->setScale( 0.5f, 0.5f, 0.5f );
break;
case 'B':
elementoNode = Cenario::cenarioNode->createChildSceneNode( nomeCenarioNode );
elementoEntidade = Bomberman::getInstance()->mSceneMgr->createEntity( nomeEntidade, "block_normal.mesh" );
elementoEntidade->setCastShadows(true);
elementoNode->setPosition( Ogre::Vector3( i, 0, j * - 1 ) );
elementoNode->attachObject( elementoEntidade );
elementoNode->setScale( 0.5f, 0.5f, 0.5f );
break;
case 'H':
elementoNode = Cenario::cenarioNode->createChildSceneNode( "bomberman_node" );
elementoEntidade = Bomberman::getInstance()->mSceneMgr->createEntity( "bomberman", "bomberman.mesh" );
elementoEntidade->setCastShadows(true);
elementoNode->setPosition( Ogre::Vector3( i, 0.5f, j * - 1 ) );
elementoNode->attachObject( elementoEntidade );
elementoNode->setScale( 0.3f, 0.3f, 0.3f );
elementoNode->yaw( Ogre::Degree( 180 ) );
break;
}
Cenario::cenarioSquare[i][j] = square;
}
}
}
示例15: AddCollisionEntity
ObjectEditHandler::ObjectEditHandler(SceneDoc *Owner)
{
mOwner = Owner;
mMode = OEM_NONE;
mAxisMode = AM_NONE;
mTarget = NULL;
mObjectEditNode = mOwner->getSceneManager()->getRootSceneNode()->createChildSceneNode();
mRayQuery = mOwner->getSceneManager()->createRayQuery(Ogre::Ray());
mMaterials[0] = Ogre::MaterialManager::getSingletonPtr()->getByName("Editor/RedMat");
mMaterials[1] = Ogre::MaterialManager::getSingletonPtr()->getByName("Editor/GreenMat");
mMaterials[2] = Ogre::MaterialManager::getSingletonPtr()->getByName("Editor/BlueMat");
mMaterials[3] = Ogre::MaterialManager::getSingletonPtr()->getByName("Editor/ObjectIndicatorWhiteMat");
mMaterials[4] = Ogre::MaterialManager::getSingletonPtr()->getByName("Editor/ObjectIndicatorYellowMat");
//////////////////////////////////////////////////
// 碰撞检测
//////////////////////////////////////////////////
mCollisionManager = new OgreOpcode::CollisionManager(Owner->getSceneManager());
mCollisionManager->addCollClass("Object");
mCollisionManager->addCollType("Object", "Object", OgreOpcode::COLLTYPE_IGNORE);
mCollisionContext = mCollisionManager->createContext("SceneObject");
Ogre::MovableObjectFactory* Factory =
Ogre::Root::getSingleton().getMovableObjectFactory(Ogre::EntityFactory::FACTORY_TYPE_NAME);
Ogre::NameValuePairList Params;
//////////////////////////////////////////////////
// 平移放缩指示器
//////////////////////////////////////////////////
mIndicatorContext = mCollisionManager->createContext("TransScale");
mTransScaleNode = mObjectEditNode->createChildSceneNode("TransScaleIndicator");
mTransScaleNode->setScale(200.0f, 200.0f, 200.0f);
// x
Ogre::SceneNode *SubNode = mTransScaleNode->createChildSceneNode();
SubNode->roll(Ogre::Degree(-90.0f));
Ogre::Entity *Entity = Owner->getSceneManager()->createEntity("TransScaleXLine", "MoveArrowLineVisible.mesh");
//Entity->setQueryFlags(0); // 参与查询
Entity->setCastShadows(false);
Entity->setMaterial(mMaterials[0]);
Entity->setRenderQueueGroup(Ogre::RENDER_QUEUE_8);
SubNode->attachObject(Entity);
mTransformEntities[AM_TRANS_SCALE_X] = Entity;
Entity = Owner->getSceneManager()->createEntity("TransScaleXCone", "MoveArrowConeVisible.mesh");
Entity->setQueryFlags(0);
Entity->setCastShadows(false);
Entity->setMaterial(mMaterials[0]);
Entity->setRenderQueueGroup(Ogre::RENDER_QUEUE_8);
SubNode->attachObject(Entity);
Params["mesh"] = "MoveArrowCollision.mesh";
Entity = (Ogre::Entity*)Factory->createInstance("TransScaleXCol", Owner->getSceneManager(), &Params);
Entity->setQueryFlags(0);
Entity->setCastShadows(false);
Entity->setVisible(false);
SubNode->attachObject(Entity);
OgreOpcode::CollisionObject *CollisionObject =
AddCollisionEntity(mIndicatorContext, Entity);
mCollisionObjectToAxisMode[CollisionObject] = AM_TRANS_SCALE_X;
// y
SubNode = mTransScaleNode;
Entity = Owner->getSceneManager()->createEntity("TransScaleYLine", "MoveArrowLineVisible.mesh");
//Entity->setQueryFlags(0);
Entity->setCastShadows(false);
Entity->setMaterial(mMaterials[1]);
Entity->setRenderQueueGroup(Ogre::RENDER_QUEUE_8);
SubNode->attachObject(Entity);
mTransformEntities[AM_TRANS_SCALE_Y] = Entity;
Entity = Owner->getSceneManager()->createEntity("TransScaleYCone", "MoveArrowConeVisible.mesh");
Entity->setQueryFlags(0);
Entity->setCastShadows(false);
Entity->setMaterial(mMaterials[1]);
Entity->setRenderQueueGroup(Ogre::RENDER_QUEUE_8);
SubNode->attachObject(Entity);
Params["mesh"] = "MoveArrowCollision.mesh";
Entity = (Ogre::Entity*)Factory->createInstance("TransScaleYCol", Owner->getSceneManager(), &Params);
Entity->setQueryFlags(0);
Entity->setCastShadows(false);
Entity->setVisible(false);
SubNode->attachObject(Entity);
CollisionObject = AddCollisionEntity(mIndicatorContext, Entity);
mCollisionObjectToAxisMode[CollisionObject] = AM_TRANS_SCALE_Y;
// z
SubNode = mTransScaleNode->createChildSceneNode();
SubNode->pitch(Ogre::Degree(90));
//.........这里部分代码省略.........