Ignore:
Timestamp:
11/03/06 09:52:40 (18 years ago)
Author:
szirmay
Message:
 
Location:
GTP/trunk/App/Demos/Illum/Ogre/src/GameToolsRaytraceDemo
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Illum/Ogre/src/GameToolsRaytraceDemo/include/GameToolsRaytraceDemo.h

    r1691 r1712  
    4040        SceneNode* copperSphereNode; 
    4141        SceneNode* aluSphereNode; 
     42        SceneNode* centerSphereNode; 
    4243        SceneNode* lightNode; 
    4344        Light* light; 
     
    5051                                                                                                                                SceneNode* copperSphereNode, 
    5152                                                                                                                                SceneNode* aluSphereNode, 
     53                                                                                                                                SceneNode* centerSphereNode, 
    5254                                                                                                                                Light* light) 
    5355        :ExampleFrameListener(window, maincam)  
     
    5961                this->copperSphereNode = copperSphereNode; 
    6062                this->aluSphereNode = aluSphereNode; 
     63                this->centerSphereNode = centerSphereNode; 
    6164                this->lightNode = lightNode; 
    6265                this->light = light; 
     
    9396                } 
    9497        */ 
     98                if (mInputDevice->isKeyDown(KC_SPACE)) 
     99        { 
     100                        mTimeUntilNextToggle = 2; 
     101                        static bool first = true; 
     102                        first = !first; 
     103                        goldSphereNode->setVisible(first,true); 
     104                        goldSphereNode->setVisible(!first,false); 
     105                        aluSphereNode->setVisible(first,true); 
     106                        aluSphereNode->setVisible(!first,false); 
     107                        silverSphereNode->setVisible(first,true); 
     108                        silverSphereNode->setVisible(!first,false); 
     109                        copperSphereNode->setVisible(first,true); 
     110                        copperSphereNode->setVisible(!first,false); 
     111                        centerSphereNode->setVisible(first,true); 
     112                        centerSphereNode->setVisible(!first,false); 
     113                         
     114                 
     115                } 
    95116 
    96117                return ExampleFrameListener::processUnbufferedKeyInput(evt); 
     
    157178        SceneNode* copperSphereNode; 
    158179        SceneNode* aluSphereNode; 
     180        SceneNode* centerSphereNode; 
    159181        Light* mainLight; 
    160182 
     
    200222                //init objects 
    201223                Entity* kupola = mSceneMgr->createEntity("kupola", "kupola.mesh"); 
    202                 Entity* athene = mSceneMgr->createEntity("athene", "head.mesh"); 
    203                 Entity* goldSphere = mSceneMgr->createEntity("goldSphere", "head.mesh"); 
    204                 Entity* silverSphere = mSceneMgr->createEntity("silverSphere", "head.mesh"); 
    205                 Entity* copperSphere = mSceneMgr->createEntity("copperSphere", "head.mesh"); 
    206                 Entity* aluSphere = mSceneMgr->createEntity("aluSphere", "head.mesh"); 
     224         
     225                Entity* centerHead = mSceneMgr->createEntity("centerHead", "head.mesh"); 
     226                Entity* goldHead = mSceneMgr->createEntity("goldHead", "head.mesh"); 
     227                Entity* silverHead = mSceneMgr->createEntity("silverHeade", "head.mesh"); 
     228                Entity* copperHead = mSceneMgr->createEntity("copperHead", "head.mesh"); 
     229                Entity* aluHead = mSceneMgr->createEntity("aluHead", "head.mesh"); 
     230 
     231                Entity* centerSphere = mSceneMgr->createEntity("centerSphere", "sphere.mesh"); 
     232                Entity* goldSphere = mSceneMgr->createEntity("goldSphere", "sphere.mesh"); 
     233                Entity* silverSphere = mSceneMgr->createEntity("silverSphere", "sphere.mesh"); 
     234                Entity* copperSphere = mSceneMgr->createEntity("copperSphere", "sphere.mesh"); 
     235                Entity* aluSphere = mSceneMgr->createEntity("aluSphere", "sphere.mesh"); 
     236 
     237 
    207238 
    208239                kupola->setCastShadows(false); 
     
    229260                //kupolaNode->scale(2,2,2);              
    230261                //kupolaNode->setPosition(0,100,0); 
    231                 SceneNode* atheneNode = rootNode->createChildSceneNode("athene"); 
    232                 atheneNode->attachObject(athene); 
    233                 //atheneNode->setScale(3.5,5.5,5.5); 
    234                 atheneNode->setScale(4,4,4); 
    235                 //atheneNode->setScale(0.5,0.5,0.5); 
    236                 AxisAlignedBox bbox = athene->getBoundingBox(); 
    237                 atheneNode->setPosition(0, 100,0); 
     262 
     263                centerSphereNode = rootNode->createChildSceneNode("centerSphere"); 
     264                SceneNode* centerHeadNode = centerSphereNode->createChildSceneNode("centerHead"); 
     265                centerSphereNode->setPosition(0, 100,0); 
     266                centerHeadNode->attachObject(centerHead); 
     267                centerSphereNode->attachObject(centerSphere); 
     268                centerSphereNode->setScale(0.4,0.4,0.4); 
     269                centerHeadNode->setScale(8,8,8);                 
     270                centerHeadNode->setVisible(false, false); 
    238271                 
    239272 
    240273                goldSphereNode = rootNode->createChildSceneNode( "goldSphere" ); 
    241                 //goldSphereNode->scale(0.3,0.3,0.3); 
    242                 goldSphereNode->scale(2,2,2); 
     274                SceneNode* goldHeadNode = goldSphereNode->createChildSceneNode( "goldHead" ); 
     275                goldSphereNode->scale(0.3,0.3,0.3); 
     276                goldHeadNode->setScale(8,8,8); 
     277                goldHeadNode->setVisible(false, false); 
     278 
    243279                silverSphereNode = rootNode->createChildSceneNode( "silverSphere" ); 
    244                 //silverSphereNode->scale(0.3,0.3,0.3); 
    245                 silverSphereNode->scale(2,2,2); 
     280                SceneNode* silverHeadNode = silverSphereNode->createChildSceneNode( "silverHead" ); 
     281                silverSphereNode->scale(0.3,0.3,0.3); 
     282                silverHeadNode->setScale(8,8,8); 
     283                silverHeadNode->setVisible(false, false); 
     284 
     285                aluSphereNode = rootNode->createChildSceneNode( "aluSphere" ); 
     286                SceneNode* aluHeadNode = aluSphereNode->createChildSceneNode( "aluHead" ); 
     287                aluSphereNode->scale(0.3,0.3,0.3); 
     288                aluHeadNode->setScale(8,8,8); 
     289                aluHeadNode->setVisible(false, false); 
     290 
    246291                copperSphereNode = rootNode->createChildSceneNode( "copperSphere" ); 
    247                 //copperSphereNode->scale(0.3,0.3,0.3); 
    248                 copperSphereNode->scale(2,2,2); 
    249                 aluSphereNode = rootNode->createChildSceneNode( "aluSphere" ); 
    250                 //aluSphereNode->scale(0.3,0.3,0.3); 
    251                 aluSphereNode->scale(2,2,2); 
     292                SceneNode* copperHeadNode = copperSphereNode->createChildSceneNode( "copperHead" ); 
     293                copperSphereNode->scale(0.3,0.3,0.3); 
     294                copperHeadNode->setScale(8,8,8); 
     295                copperHeadNode->setVisible(false, false); 
     296                 
    252297 
    253298                goldSphereNode->attachObject(goldSphere); 
     
    255300                aluSphereNode->attachObject(aluSphere); 
    256301                copperSphereNode->attachObject(copperSphere); 
     302                 
     303                goldHeadNode->attachObject(goldHead); 
     304                silverHeadNode->attachObject(silverHead); 
     305                aluHeadNode->attachObject(aluHead); 
     306                copperHeadNode->attachObject(copperHead); 
     307         
    257308 
    258309                goldSphereNode->_updateBounds(); 
     
    261312                copperSphereNode->_updateBounds(); 
    262313 
     314                goldHeadNode->_updateBounds(); 
     315                silverHeadNode->_updateBounds(); 
     316                aluHeadNode->_updateBounds(); 
     317                copperHeadNode->_updateBounds(); 
     318 
    263319                kupolaNode->_updateBounds(); 
    264                 atheneNode->_updateBounds(); 
     320                centerSphereNode->_updateBounds(); 
     321                centerHeadNode->_updateBounds(); 
    265322 
    266323                //Init lights 
     
    279336                bbs->setMaterialName("Flare"); 
    280337                mainLightNode->attachObject(bbs); 
     338                 
     339                silverSphere->setMaterialName("EnvMetals/Silver"); 
     340                copperSphere->setMaterialName("EnvMetals/Copper"); 
     341                goldSphere->setMaterialName("EnvMetals/Gold"); 
    281342                aluSphere->setMaterialName("EnvMetals/Alu"); 
    282                 copperSphere->setMaterialName("EnvMetals/Copper"); 
    283                  
    284                 { 
    285                         Material* oldmat = (Material*) MaterialManager::getSingleton().getByName("EnvMetals/Gold").getPointer(); 
    286                         Material* newmat = oldmat->clone("gold1").getPointer(); 
    287                         Material* newmat2 = oldmat->clone("gold2").getPointer(); 
    288  
    289                         goldSphere->setMaterialName(newmat->getName()); 
    290                         silverSphere->setMaterialName(newmat2->getName()); 
    291                 } 
    292  
    293                 athene->setMaterialName("GameTools/CausticGlass"); 
    294                 //athene->setMaterialName("GameTools/CubeMap/Diffuse"); 
     343 
     344                aluHead->setMaterialName("EnvMetals/Alu"); 
     345                copperHead->setMaterialName("EnvMetals/Copper"); 
     346                goldHead->setMaterialName("EnvMetals/Gold"); 
     347                silverHead->setMaterialName("EnvMetals/Silver"); 
     348                         
     349 
     350                centerSphere->setMaterialName("GameTools/CausticGlass"); 
     351                centerHead->setMaterialName("GameTools/CausticGlass"); 
    295352                 
    296353                OgreIlluminationManager::getSingleton().initTechniques(); 
     
    309366                                                                                        copperSphereNode, 
    310367                                                                                        aluSphereNode, 
     368                                                                                        centerSphereNode, 
    311369                                                                                        mainLight); 
    312370                mFrameListener->setPriority(1); 
  • GTP/trunk/App/Demos/Illum/Ogre/src/GameToolsRaytraceDemo/scripts/GameToolsRaytraceDemo.vcproj

    r1691 r1712  
    4343                                Optimization="0" 
    4444                                AdditionalIncludeDirectories="..\include;"$(OGRE_PATH)\Samples\Common\include";"$(OGRE_PATH)\OgreMain\include";..\..\..\..\..\..\..\Lib\Illum\IllumModule\OgreIllumModule\include;..\..\..\..\..\..\..\Lib\Illum\IllumModule\OgreIllumModule\include\RenderTechniques;..\..\..\..\..\..\..\Lib\Illum\IllumModule\OgreIllumModule\include\RenderingRuns;..\..\..\..\..\..\..\Lib\Illum\IllumModule\IllumModule\include\RenderTechniques;..\..\..\..\..\..\..\Lib\Illum\IllumModule\IllumModule\include;..\..\..\..\..\..\..\Lib\Illum\IllumModule\IllumModule\include\RenderingRuns" 
    45                                 PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;GAMETOOLS_ILLUMINATION_MODULE;GTP_VISIBILITY_MODIFIED_OGRE" 
     45                                PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;GAMETOOLS_ILLUMINATION_MODULE" 
    4646                                MinimalRebuild="true" 
    4747                                BasicRuntimeChecks="3" 
     
    134134                                EnableFiberSafeOptimizations="false" 
    135135                                AdditionalIncludeDirectories="..\include;"$(OGRE_PATH)\Samples\Common\include";"$(OGRE_PATH)\OgreMain\include";..\..\..\..\..\..\..\Lib\Illum\IllumModule\OgreIllumModule\include;..\..\..\..\..\..\..\Lib\Illum\IllumModule\OgreIllumModule\include\RenderTechniques;..\..\..\..\..\..\..\Lib\Illum\IllumModule\OgreIllumModule\include\RenderingRuns;..\..\..\..\..\..\..\Lib\Illum\IllumModule\IllumModule\include\RenderTechniques;..\..\..\..\..\..\..\Lib\Illum\IllumModule\IllumModule\include;..\..\..\..\..\..\..\Lib\Illum\IllumModule\IllumModule\include\RenderingRuns" 
    136                                 PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;GAMETOOLS_ILLUMINATION_MODULE;GTP_VISIBILITY_MODIFIED_OGRE" 
     136                                PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;GAMETOOLS_ILLUMINATION_MODULE" 
    137137                                StringPooling="true" 
    138138                                MinimalRebuild="true" 
Note: See TracChangeset for help on using the changeset viewer.