Changeset 79 for trunk/VUT/work
- Timestamp:
- 05/03/05 16:59:18 (20 years ago)
- Location:
- trunk/VUT/work/TestCulling
- Files:
-
- 2 added
- 2 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/work/TestCulling/TestCulling.vcproj
r78 r79 122 122 UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"> 123 123 <File 124 RelativePath="..\TestCullingTerrain\SceneContentGenerator.cpp"> 125 </File> 126 <File 124 127 RelativePath=".\TestCullingApplication.cpp"> 125 128 </File> … … 129 132 Filter="h;hpp;hxx;hm;inl;inc;xsd" 130 133 UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"> 134 <File 135 RelativePath="..\TestCullingTerrain\SceneContentGenerator.h"> 136 </File> 131 137 <File 132 138 RelativePath=".\TestCullingApplication.h"> -
trunk/VUT/work/TestCulling/TestCullingApplication.cpp
r74 r79 12 12 #include <../CEGUIRenderer/include/OgreCEGUITexture.h> 13 13 #include <OgreMemoryMacros.h> 14 15 #include "Ogre.h" 14 #include <Ogre.h> 16 15 #include "TestCullingApplication.h" 16 #include "SceneContentGenerator.h" 17 17 18 18 #define WIN32_LEAN_AND_MEAN … … 48 48 //l->setPosition(20,80,50); 49 49 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); 57 52 58 53 // Create a skybox … … 90 85 mSceneMgr = mRoot->getSceneManager(ST_GENERIC); 91 86 } 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 136 89 /***********************************************/ 137 90 /* MouseQueryListener implementation */ -
trunk/VUT/work/TestCulling/TestCullingApplication.h
r74 r79 93 93 @param number of objects to generate 94 94 */ 95 void generateScene(int numObjects);95 void GenerateScene(int numObjects); 96 96 97 97 /** generates a new scene object
Note: See TracChangeset
for help on using the changeset viewer.