From: <cn...@us...> - 2009-10-26 02:00:45
|
Revision: 584 http://hgengine.svn.sourceforge.net/hgengine/?rev=584&view=rev Author: cnlohr Date: 2009-10-26 02:00:33 +0000 (Mon, 26 Oct 2009) Log Message: ----------- make camera go to right place in first frame Modified Paths: -------------- Mercury2/modules/Terrain.cpp Mercury2/src/Camera.cpp Mercury2/src/MercuryAsset.h Modified: Mercury2/modules/Terrain.cpp =================================================================== --- Mercury2/modules/Terrain.cpp 2009-10-26 01:49:06 UTC (rev 583) +++ Mercury2/modules/Terrain.cpp 2009-10-26 02:00:33 UTC (rev 584) @@ -57,8 +57,6 @@ yMax = MAX<float>(v.GetY(),yMax); zMax = MAX<float>(v.GetZ(),zMax); } - - printf("%f %f %f\n", xMax, yMax, zMax); m_hash.Allocate(10, 1); for(uint16_t i = 0; i < length; i+=3) @@ -163,6 +161,11 @@ { if (message == "QueryTerrainPoint") { + if( Asset().GetLoadState() == LOADING ) + { + POST_MESSAGE( "QueryTerrainPoint", new VertexDataMessage( dynamic_cast<const VertexDataMessage&>(data) ), 0.0001 ); + return; + } const VertexDataMessage& v( dynamic_cast<const VertexDataMessage&>(data) ); //compute local space position Modified: Mercury2/src/Camera.cpp =================================================================== --- Mercury2/src/Camera.cpp 2009-10-26 01:49:06 UTC (rev 583) +++ Mercury2/src/Camera.cpp 2009-10-26 02:00:33 UTC (rev 584) @@ -13,6 +13,7 @@ m_lookAt = MercuryVector(0,0,-1); REGISTER_FOR_MESSAGE( INPUTEVENT_MOUSE ); REGISTER_FOR_MESSAGE( "SetCameraPosition" ); + POST_MESSAGE("QueryTerrainPoint", new VertexDataMessage(m_origionalPosition), 0.00001); } void CameraNode::PreRender(const MercuryMatrix& matrix) Modified: Mercury2/src/MercuryAsset.h =================================================================== --- Mercury2/src/MercuryAsset.h 2009-10-26 01:49:06 UTC (rev 583) +++ Mercury2/src/MercuryAsset.h 2009-10-26 02:00:33 UTC (rev 584) @@ -64,9 +64,10 @@ inline void SetPasses( unsigned short p ) { m_iPasses = p; } virtual MercuryAssetInstance* GenerateInstanceData(MercuryNode* parentNode); + + LoadState GetLoadState(); //thread safe protected: void SetLoadState(LoadState ls); //thread safe - LoadState GetLoadState(); //thread safe bool m_isInstanced; BoundingVolume* m_boundingVolume; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |