- Timestamp:
- 05/24/05 07:21:00 (20 years ago)
- Location:
- trunk/VUT
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/Ogre/include/OgreTerrainContentGenerator.h
r107 r110 37 37 const Vector3 &rotation, const String &objName); 38 38 39 /** maximum height where objects can beput into the terrain */40 //void SetMaxHeight(Real maxHeight);39 /** offset which is added to objects when put into the terrain */ 40 void SetOffset(Real offset); 41 41 42 42 RayQueryExecutor *GetRayQueryExecutor(); … … 44 44 protected: 45 45 RayQueryExecutor *mRayQueryExecutor; 46 //Real mMaxHeight;46 Real mOffset; 47 47 }; 48 48 -
trunk/VUT/Ogre/src/OgreSceneContentGenerator.cpp
r107 r110 86 86 { 87 87 Matrix3 mat; 88 mat.FromEulerAngles XYZ(Degree(rotation.x),//.valueRadians(),88 mat.FromEulerAnglesYXZ(Degree(rotation.x),//.valueRadians(), 89 89 Degree(rotation.y),//.valueRadians(), 90 90 Degree(rotation.z));//.valueRadians()); -
trunk/VUT/Ogre/src/OgreTerrainContentGenerator.cpp
r107 r110 51 51 //----------------------------------------------------------------------- 52 52 TerrainContentGenerator::TerrainContentGenerator(SceneManager *sm): 53 SceneContentGenerator(sm) //, mMaxHeight(50)53 SceneContentGenerator(sm), mOffset(0) 54 54 { 55 55 mMinPos = Vector3(0.0f, MAX_HEIGHT, 0.0f); … … 76 76 if (mRayQueryExecutor->executeRayQuery(&queryResult, position, Vector3::NEGATIVE_UNIT_Y)) 77 77 { 78 queryResult.y += mOffset; 78 79 // reject if height is too high 79 80 if (queryResult.y < mMaxPos.y) … … 91 92 } 92 93 //----------------------------------------------------------------------- 93 /*void TerrainContentGenerator::SetMaxHeight(Real maxHeight)94 void TerrainContentGenerator::SetOffset(Real offset) 94 95 { 95 m MaxHeight = maxHeight;96 } */96 mOffset = offset; 97 } 97 98 98 99 } // namespace Ogre -
trunk/VUT/work/TestCullingTerrain/TestCullingTerrainApplication.cpp
r109 r110 93 93 { 94 94 // Set ambient light 95 mSceneMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.5)); 96 97 // Create a light 98 Light* l = mSceneMgr->createLight("MainLight"); 99 // Accept default settings: point light, white diffuse, just set position 100 // NB I could attach the light to a SceneNode if I wanted it to move automatically with 101 // other objects, but I don't 102 l->setPosition(20,80,50); 95 //mSceneMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.5)); 96 mSceneMgr->setAmbientLight(ColourValue(0.0, 0.0, 0.0)); 97 98 //-- create light 99 mSunLight = mSceneMgr->createLight("MainLight"); 100 mSunLight->setType(Light::LT_POINT); 101 mSunLight->setPosition(-707, 4000, -500); 102 //mSunLight->setSpotlightRange(Degree(30), Degree(50)); 103 104 Vector3 dir; 105 dir = -mSunLight->getPosition(); 106 dir.normalise(); 107 mSunLight->setDirection(dir); 108 mSunLight->setDiffuseColour(0.8, 0.8, 0.8); 109 mSunLight->setSpecularColour(0.9, 0.9, 1); 110 111 //mSunLight->setCastShadows(true); 103 112 104 113 // --Fog … … 128 137 129 138 mTerrainContentGenerator = new TerrainContentGenerator(mSceneMgr); 130 139 131 140 // if no objects file generate yourself 132 //if (!mTerrainContentGenerator->LoadObjects("objects.out")) 133 //{ 134 // the objects are generated on the whole terrain 141 if (!mTerrainContentGenerator->LoadObjects("objects.out")) 142 { 135 143 // height is restricted to 50, so no objects appear on peaks 136 144 // => there is much occlusion 137 145 mTerrainContentGenerator->SetMaxPos(Vector3(3000.0f, 50.0f, 3000.0f)); 138 mTerrainContentGenerator->GenerateScene(1500, "robot"); 146 mTerrainContentGenerator->SetOffset(50); 147 148 // the objects are generated on the whole terrain 149 mTerrainContentGenerator->GenerateScene(1500, "athene"); 139 150 // mTerrainContentGenerator->GenerateScene(500, "ninja"); 140 //}151 } 141 152 142 153 // no limitations needed anymore: the user can set 143 154 // objects also on peaks of terrain 144 155 mTerrainContentGenerator->SetMaxPos(Vector3(3000.0f, 5000.0f, 3000.0f)); 145 146 //-- create light147 mSunLight = mSceneMgr->createLight("SunLight");148 mSunLight->setType(Light::LT_SPOTLIGHT);149 mSunLight->setPosition(1000,1250,500);150 mSunLight->setSpotlightRange(Degree(30), Degree(50));151 152 Vector3 dir;153 dir = -mSunLight->getPosition();154 dir.normalise();155 mSunLight->setDirection(dir);156 mSunLight->setDiffuseColour(0.35, 0.35, 0.38);157 mSunLight->setSpecularColour(0.9, 0.9, 1);158 159 mSunLight->setCastShadows(true);160 156 } 161 157 //-----------------------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.