diff options
author | prep <prep@lindenlab.com> | 2011-11-17 13:32:04 -0500 |
---|---|---|
committer | prep <prep@lindenlab.com> | 2011-11-17 13:32:04 -0500 |
commit | 378c076d1df5d911e07959638fbd61a9094384d2 (patch) | |
tree | d0e6f8868cc78539b05847d089200c2da68d4746 /indra/newview | |
parent | 9f996fdc5684a3e55c9f86508979ad943e2eaded (diff) |
WIP: navmesh station posts to a url, responder receives llsd and then has the llpathing library extract and render the navmesh (if desired).
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llnavmeshstation.cpp | 31 | ||||
-rw-r--r-- | indra/newview/llspatialpartition.cpp | 8 | ||||
-rw-r--r-- | indra/newview/llviewermenufile.cpp | 11 | ||||
-rw-r--r-- | indra/newview/pipeline.cpp | 9 |
4 files changed, 39 insertions, 20 deletions
diff --git a/indra/newview/llnavmeshstation.cpp b/indra/newview/llnavmeshstation.cpp index 3a29730328..6f491c34c9 100644 --- a/indra/newview/llnavmeshstation.cpp +++ b/indra/newview/llnavmeshstation.cpp @@ -30,6 +30,7 @@ #include "LLPathingLib.h"//prep# fixme
#include "llagent.h"
#include "llviewerregion.h"
+#include "llsdutil.h"
//===============================================================================
LLNavMeshStation::LLNavMeshStation()
{
@@ -111,7 +112,17 @@ public: if ( pObserver )
{
llinfos<<"Do something immensely important w/content"<<llendl;
- LLPathingLib::getInstance()->extractNavMeshSrcFromLLSD( content );
+ llinfos<<"LLsd buffer"<<ll_pretty_print_sd(content)<<llendl;
+
+ if ( content.has("navmesh_data") )
+ {
+ LLSD::Binary& stuff = content["navmesh_data"].asBinary();
+ LLPathingLib::getInstance()->extractNavMeshSrcFromLLSD( stuff );
+ }
+ else
+ {
+ llwarns<<"no mesh data "<<llendl;
+ }
}
}
}
@@ -152,30 +163,16 @@ bool LLNavMeshStation::postNavMeshToServer( LLSD& data, const LLHandle<LLNavMesh //===============================================================================
void LLNavMeshStation::downloadNavMeshSrc( const LLHandle<LLNavMeshDownloadObserver>& observerHandle )
{
- mCurlRequest = new LLCurlRequest();
-
if ( mNavMeshDownloadURL.empty() )
{
llinfos << "Unable to upload navmesh because of missing URL" << llendl;
}
else
- {
- LLCurlRequest::headers_t headers;
+ {
LLSD data;
data["agent_id"] = gAgent.getID();
data["region_id"] = gAgent.getRegion()->getRegionID();
- mCurlRequest->post( mNavMeshDownloadURL, headers, data,
- new LLNavMeshDownloadResponder( observerHandle ) );
- do
- {
- mCurlRequest->process();
- //sleep for 10ms to prevent eating a whole core
- apr_sleep(10000);
- } while ( mCurlRequest->getQueued() > 0 );
+ LLHTTPClient::post(mNavMeshDownloadURL, data, new LLNavMeshDownloadResponder( observerHandle ) );
}
-
- delete mCurlRequest;
-
- mCurlRequest = NULL;
}
//===============================================================================
\ No newline at end of file diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index 6c2b71dd0a..529ca9f022 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -48,6 +48,8 @@ #include "llvolumemgr.h" #include "lltextureatlas.h" #include "llglslshader.h" +#include "llrendersegment.h" +#include "llagent.h" static LLFastTimer::DeclareTimer FTM_FRUSTUM_CULL("Frustum Culling"); static LLFastTimer::DeclareTimer FTM_CULL_REBOUND("Cull Rebound"); @@ -3992,6 +3994,12 @@ public: { renderAgentTarget(avatar); } + + //prep# + //LLVector3 pos = gAgent.getPositionGlobal(); + //LLVector3d vel = gAgent.getVelocity(); + //gSegment.renderSegment( pos, pos+vel, 0 ); + if (gDebugGL) { diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index 5a496c76f0..2c826788a2 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -145,8 +145,15 @@ class LLPathingTools : public view_listener_t, LLNavMeshDownloadObserver bool handleEvent(const LLSD& userdata)
{
//make sure we have a pathing system
- LLPathingLib::initSystem();
-
+ if ( !LLPathingLib::getInstance() )
+ {
+ LLPathingLib::initSystem();
+ }
+ //prep# test remove
+ //LLSD content;
+ //LLPathingLib::getInstance()->extractNavMeshSrcFromLLSD( content );
+ //return true;
+ //prep# end test
if ( LLPathingLib::getInstance() == NULL )
{
llinfos<<"No implementation of pathing library."<<llendl;
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index a50f66f282..f797822d41 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -104,7 +104,8 @@ #include "lltoolpie.h" #include "llcurl.h" #include "llnotifications.h" - +//prep# +#include "LLPathingLib.h" void check_stack_depth(S32 stack_depth) { @@ -3785,6 +3786,12 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate) LLVertexBuffer::unbind(); + //prep# + if ( LLPathingLib::getInstance() ) + { + LLPathingLib::getInstance()->renderNavMesh(); + } + if (!LLPipeline::sReflectionRender && !LLPipeline::sRenderDeferred) { if (gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI)) |