From 378c076d1df5d911e07959638fbd61a9094384d2 Mon Sep 17 00:00:00 2001 From: prep Date: Thu, 17 Nov 2011 13:32:04 -0500 Subject: WIP: navmesh station posts to a url, responder receives llsd and then has the llpathing library extract and render the navmesh (if desired). --- indra/llmath/llmatrix3a.inl | 1 - indra/llmath/m3math.h | 2 +- indra/llmath/v3color.h | 2 +- indra/llmath/v3dmath.h | 2 +- indra/llmath/v3math.h | 2 +- indra/llmath/v4color.h | 2 +- indra/llmath/v4math.h | 2 +- indra/llrender/llgl.h | 2 +- indra/llrender/llrendersegment.cpp | 54 ++++++++++++++++++++++++++++++++++++ indra/llrender/llrendersegment.h | 49 ++++++++++++++++++++++++++++++++ indra/newview/llnavmeshstation.cpp | 31 ++++++++++----------- indra/newview/llspatialpartition.cpp | 8 ++++++ indra/newview/llviewermenufile.cpp | 11 ++++++-- indra/newview/pipeline.cpp | 9 +++++- 14 files changed, 149 insertions(+), 28 deletions(-) create mode 100644 indra/llrender/llrendersegment.cpp create mode 100644 indra/llrender/llrendersegment.h diff --git a/indra/llmath/llmatrix3a.inl b/indra/llmath/llmatrix3a.inl index 37819fea3c..270f1e905b 100644 --- a/indra/llmath/llmatrix3a.inl +++ b/indra/llmath/llmatrix3a.inl @@ -66,7 +66,6 @@ inline void LLMatrix3a::setTranspose(const LLMatrix3a& src) inline const LLVector4a& LLMatrix3a::getColumn(const U32 column) const { - llassert( column < 3 ); return mColumns[column]; } diff --git a/indra/llmath/m3math.h b/indra/llmath/m3math.h index 2be5452f8d..3970a5de31 100644 --- a/indra/llmath/m3math.h +++ b/indra/llmath/m3math.h @@ -27,7 +27,7 @@ #ifndef LL_M3MATH_H #define LL_M3MATH_H -#include "llerror.h" +//#include "llerror.h" #include "stdtypes.h" class LLVector4; diff --git a/indra/llmath/v3color.h b/indra/llmath/v3color.h index 56cb2ae73e..4e77d9e5ff 100644 --- a/indra/llmath/v3color.h +++ b/indra/llmath/v3color.h @@ -30,7 +30,7 @@ class LLColor4; class LLVector4; -#include "llerror.h" +//#include "llerror.h" #include "llmath.h" #include "llsd.h" diff --git a/indra/llmath/v3dmath.h b/indra/llmath/v3dmath.h index 578dcdc8ea..fba549a3b7 100644 --- a/indra/llmath/v3dmath.h +++ b/indra/llmath/v3dmath.h @@ -27,7 +27,7 @@ #ifndef LL_V3DMATH_H #define LL_V3DMATH_H -#include "llerror.h" +//#include "llerror.h" #include "v3math.h" class LLVector3d diff --git a/indra/llmath/v3math.h b/indra/llmath/v3math.h index 0432aeba4c..206a99b567 100644 --- a/indra/llmath/v3math.h +++ b/indra/llmath/v3math.h @@ -27,7 +27,7 @@ #ifndef LL_V3MATH_H #define LL_V3MATH_H -#include "llerror.h" +//#include "llerror.h" #include "llmath.h" #include "llsd.h" diff --git a/indra/llmath/v4color.h b/indra/llmath/v4color.h index b047f86e6e..6946b570ab 100644 --- a/indra/llmath/v4color.h +++ b/indra/llmath/v4color.h @@ -27,7 +27,7 @@ #ifndef LL_V4COLOR_H #define LL_V4COLOR_H -#include "llerror.h" +//#include "llerror.h" //#include "vmath.h" #include "llmath.h" #include "llsd.h" diff --git a/indra/llmath/v4math.h b/indra/llmath/v4math.h index 623c8b2003..f999e0533e 100644 --- a/indra/llmath/v4math.h +++ b/indra/llmath/v4math.h @@ -27,7 +27,7 @@ #ifndef LL_V4MATH_H #define LL_V4MATH_H -#include "llerror.h" +//#include "llerror.h" #include "llmath.h" #include "v3math.h" diff --git a/indra/llrender/llgl.h b/indra/llrender/llgl.h index d736133f3f..5b2fcf422c 100644 --- a/indra/llrender/llgl.h +++ b/indra/llrender/llgl.h @@ -33,7 +33,7 @@ #include #include -#include "llerror.h" +//#include "llerror.h" #include "v4color.h" #include "llstring.h" #include "stdtypes.h" diff --git a/indra/llrender/llrendersegment.cpp b/indra/llrender/llrendersegment.cpp new file mode 100644 index 0000000000..8f856f62f3 --- /dev/null +++ b/indra/llrender/llrendersegment.cpp @@ -0,0 +1,54 @@ +/** + * @file llrendersegment.cpp + * @brief + * + * $LicenseInfo:firstyear=2001&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +// Sphere creates a set of display lists that can then be called to create +// a lit sphere at different LOD levels. You only need one instance of sphere +// per viewer - then call the appropriate list. + +#include "linden_common.h" +#include "llrendersegment.h" +#include "llerror.h" +#include "llglheaders.h" + +LLRenderSegment gSegment; +//============================================================================= +void LLRenderSegment::renderSegment( const LLVector3& start, const LLVector3& end, int color ) +{ + LLColor4 colorA = LLColor4::yellow; + + gGL.color4fv( colorA.mV ); + + gGL.begin(LLRender::LINES); + { + gGL.vertex3fv( start.mV ); + + gGL.vertex3fv( end.mV ); + } + + gGL.end(); + +} +//============================================================================= \ No newline at end of file diff --git a/indra/llrender/llrendersegment.h b/indra/llrender/llrendersegment.h new file mode 100644 index 0000000000..d929d6f628 --- /dev/null +++ b/indra/llrender/llrendersegment.h @@ -0,0 +1,49 @@ +/** + * @file llrendersegment.h + * @brief + * + * $LicenseInfo:firstyear=2001&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLRENDERSEGMENT_H +#define LL_LLRENDERSEGMENT_H + +#include "llmath.h" +#include "v3math.h" +#include "v4math.h" +#include "m3math.h" +#include "m4math.h" +#include "v4color.h" +#include "llgl.h" + + +class LLRenderSegment +{ +public: + void renderSegment( const LLVector3& start, const LLVector3& end, int color ); + +private: +}; + +extern LLRenderSegment gSegment; + +#endif 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"<extractNavMeshSrcFromLLSD( content ); + llinfos<<"LLsd buffer"<extractNavMeshSrcFromLLSD( stuff ); + } + else + { + llwarns<<"no mesh data "<& 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."<renderNavMesh(); + } + if (!LLPipeline::sReflectionRender && !LLPipeline::sRenderDeferred) { if (gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI)) -- cgit v1.2.3