Changeset 1117 for GTP/trunk/App/Demos/Illum
- Timestamp:
- 07/11/06 15:47:39 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Illum/Ogre/src/PRMDemo/include/PRMDemo.h
r1086 r1117 122 122 123 123 Root::getSingleton()._setCurrentSceneManager(mSceneMgr); 124 mCamera->setPosition(0, 100,240);124 mCamera->setPosition(0,20,40); 125 125 mCamera->setFOVy(Radian(Degree(80))); 126 126 //mCamera->setFarClipDistance(1000); … … 130 130 131 131 SceneNode* rootNode = mSceneMgr->getRootSceneNode(); 132 132 /* 133 133 SceneSerializer s(mSceneMgr); 134 134 DataStreamPtr inputStream; 135 135 inputStream = ResourceGroupManager::getSingleton().openResource("level.txt"); 136 136 s.parseScript(inputStream, ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME); 137 */ 138 Entity* lepcso = mSceneMgr->createEntity("lepcso","stairs.mesh"); 139 SceneNode* lNode = rootNode->createChildSceneNode("l"); 140 lNode->attachObject(lepcso); 141 142 createPlane("p","lambert1",Vector3(0,0,0),Vector2(100,100)); 137 143 138 144 Light* mainLight = mSceneMgr->createLight("MainLight"); … … 144 150 mainLightNode->setPosition(0,0,0); 145 151 mainLight->setPosition(mainLightNode->getWorldPosition()); 146 mainLight->setDirection(-1,-1, -1);152 mainLight->setDirection(-1,-1, -1); 147 153 mainLightNode->attachObject(mainLight); 148 154 149 155 OgreIlluminationManager::getSingleton().initTechniques(); 150 156 } 157 158 void createPlane(Ogre::String _name, Ogre::String _material, Ogre::Vector3 _pos, Ogre::Vector2 _size, Ogre::Vector2 _subdivisions = Ogre::Vector2(1,1)) { 159 Plane _plane; 160 _plane.normal = Vector3::UNIT_Y; 161 _plane.d = 0; 162 163 164 MeshManager::getSingleton().createPlane(_name + ".plane", 165 ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, 166 _plane,_size.x,_size.y,1,1,true,1,_subdivisions.x,_subdivisions.y,Vector3::UNIT_Z); 167 168 Entity *_entity = mSceneMgr->createEntity(_name + ".entity", _name + ".plane"); 169 _entity->setMaterialName(_material); 170 171 SceneNode* _node = mSceneMgr->getRootSceneNode()->createChildSceneNode(_name + ".node"); 172 _node->attachObject(_entity); 173 _node->setPosition(_pos); 174 175 } 151 176 152 177 void createFrameListener(void)
Note: See TracChangeset
for help on using the changeset viewer.