Ignore:
Timestamp:
07/13/05 18:28:40 (19 years ago)
Author:
mattausch
Message:

did some code cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/VUT/work/TestCullingTerrain/TestCullingTerrainApplication.cpp

    r164 r173  
    1111//#include "OgreRefAppWorld.h" 
    1212#include "TestCullingTerrainApplication.h" 
    13  
     13#include "TerrainFrameListener.h" 
    1414 
    1515#define WIN32_LEAN_AND_MEAN 
    1616#include <windows.h> 
    1717 
    18 String currentObjectCaptions[] = 
    19 { 
    20         "robot", 
    21         "athene", 
    22         "ninja" 
    23         //"ogrehead" 
    24 }; 
    25  
    26 const float walk_duration = 10.0f; 
    27 const float wait_duration = 2.0f; 
    28 const float rotate_factor = 0.7f; 
    29 const float move_factor = 0.03; 
    30  
    31 /***************************************/ 
    32 /*      EntityState implementation     */ 
    33 /***************************************/ 
     18 
     19/**********************************************/ 
     20/*             EntityState implementation     */ 
     21/**********************************************/ 
     22 
     23 
    3424Vector3 EntityState::msMinPos = Vector3::ZERO; 
    3525Vector3 EntityState::msMaxPos = Vector3::ZERO; 
     
    250240        mSunLight->setCastShadows(true); 
    251241 
    252         // set light angle not too sharp, otherwise shadows textures will be broken 
     242        // set light angle not too small over the surface, otherwise shadows textures will be broken 
    253243        Vector3 dir(0.5, 1, 0.5); 
    254244        dir.normalise(); 
     
    288278        mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(pPlaneEnt); */ 
    289279 
    290         mSceneMgr->setShadowTextureSettings(1024, 2); 
     280        // Use 512x512 texture in GL since we can't go higher than the window res 
     281        mSceneMgr->setShadowTextureSettings(512, 2); 
     282 
    291283        mSceneMgr->setShadowColour(ColourValue(0.5, 0.5, 0.5)); 
    292284    
     
    326318void  TestCullingTerrainApplication::generateScene(int num, int objectType) 
    327319{ 
    328         mTerrainContentGenerator->GenerateScene(num, currentObjectCaptions[objectType]); 
     320        Vector3 scale(TerrainFrameListener::msObjectScales[objectType],  
     321                                  TerrainFrameListener::msObjectScales[objectType], 
     322                                  TerrainFrameListener::msObjectScales[objectType]); 
     323 
     324        mTerrainContentGenerator->SetScale(scale); 
     325        mTerrainContentGenerator->SetOffset(TerrainFrameListener::msObjectTerrainOffsets[objectType]); 
     326        mTerrainContentGenerator->GenerateScene(num, TerrainFrameListener::msObjectCaptions[objectType]); 
    329327 
    330328        if (objectType != 0) // from our objects, only robot has animation phases 
     
    384382} 
    385383//----------------------------------------------------------------------- 
    386 String TestCullingTerrainApplication::getCurrentObjectCaption(int id) 
    387 { 
    388         return currentObjectCaptions[id]; 
    389 } 
    390 //----------------------------------------------------------------------- 
    391384void TestCullingTerrainApplication::chooseSceneManager() 
    392385{ 
Note: See TracChangeset for help on using the changeset viewer.