Changeset 79


Ignore:
Timestamp:
05/03/05 16:59:18 (19 years ago)
Author:
mattausch
Message:
 
Location:
trunk/VUT/work/TestCulling
Files:
2 added
2 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/VUT/work/TestCulling/TestCulling.vcproj

    r78 r79  
    122122                        UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"> 
    123123                        <File 
     124                                RelativePath="..\TestCullingTerrain\SceneContentGenerator.cpp"> 
     125                        </File> 
     126                        <File 
    124127                                RelativePath=".\TestCullingApplication.cpp"> 
    125128                        </File> 
     
    129132                        Filter="h;hpp;hxx;hm;inl;inc;xsd" 
    130133                        UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"> 
     134                        <File 
     135                                RelativePath="..\TestCullingTerrain\SceneContentGenerator.h"> 
     136                        </File> 
    131137                        <File 
    132138                                RelativePath=".\TestCullingApplication.h"> 
  • trunk/VUT/work/TestCulling/TestCullingApplication.cpp

    r74 r79  
    1212#include <../CEGUIRenderer/include/OgreCEGUITexture.h> 
    1313#include <OgreMemoryMacros.h> 
    14  
    15 #include "Ogre.h" 
     14#include <Ogre.h> 
    1615#include "TestCullingApplication.h" 
     16#include "SceneContentGenerator.h" 
    1717 
    1818#define WIN32_LEAN_AND_MEAN 
     
    4848        //l->setPosition(20,80,50); 
    4949 
    50         mMinTranslation = Vector3(-70.0f, -70.0f, 0.0f); 
    51         mMaxTranslation = Vector3(70.0f, 70.0f, 600.0f); 
    52  
    53         mMinAngle = Vector3(0, 0, 0); 
    54         mMaxAngle = Vector3(360, 360, 360); 
    55  
    56         generateScene(330); 
     50        SceneContentGenerator contentGenerator(); 
     51        contentGenerator.GenerateScene(330); 
    5752 
    5853        // Create a skybox 
     
    9085    mSceneMgr = mRoot->getSceneManager(ST_GENERIC); 
    9186} 
    92 //----------------------------------------------------------------------- 
    93 void TestCullingApplication::generateSceneObject(const Vector3 &translationRatio,  
    94                                                                                                  const Vector3 &rotationRatio,  
    95                                                                                                  const int idx,  
    96                                                                                                  const String& entName) 
    97 { 
    98         Vector3 rotation = mMinAngle + rotationRatio * (mMaxAngle - mMinAngle); 
    99         Vector3 translation = mMinTranslation +  
    100                 translationRatio * (mMaxTranslation - mMinTranslation); 
    101  
    102         char name[16]; 
    103     sprintf( name, "object%d", idx ); 
    104  
    105     Entity *ent = mSceneMgr->createEntity(name, entName); 
    106         SceneNode *node = mSceneMgr->getRootSceneNode()-> 
    107                 createChildSceneNode(String(name) + "Node", translation); 
    108         node->attachObject(ent); 
    109         node->scale(0.1,0.1,0.1); 
    110  
    111         node->yaw(Degree(rotation.x)); 
    112     node->pitch(Degree(rotation.y)); 
    113         node->roll(Degree(rotation.z)); 
    114 } 
    115 //----------------------------------------------------------------------- 
    116 void TestCullingApplication::generateScene( int numObjects ) 
    117 { 
    118         srand (time (0)); 
    119          
    120         Vector3 rotationRatio; 
    121         Vector3 translationRatio; 
    122  
    123         for(int i=0; i < numObjects; i++) 
    124         { 
    125                 rotationRatio.x = rand() / (float) RAND_MAX; 
    126                 rotationRatio.y = rand() / (float) RAND_MAX; 
    127                 rotationRatio.z = rand() / (float) RAND_MAX; 
    128  
    129                 translationRatio.x = rand() / (float) RAND_MAX; 
    130                 translationRatio.y = rand() / (float) RAND_MAX; 
    131                 translationRatio.z = rand() / (float) RAND_MAX; 
    132  
    133                 generateSceneObject(translationRatio, rotationRatio, i, "sphere.mesh"); 
    134         } 
    135 } 
     87 
     88 
    13689/***********************************************/ 
    13790/* MouseQueryListener implementation           */ 
  • trunk/VUT/work/TestCulling/TestCullingApplication.h

    r74 r79  
    9393        @param number of objects to generate 
    9494        */ 
    95         void generateScene(int numObjects); 
     95        void GenerateScene(int numObjects); 
    9696 
    9797        /** generates a new scene object  
Note: See TracChangeset for help on using the changeset viewer.