WIP: navmesh station posts to a url, responder receives llsd and then has the llpathing library extract and render the navmesh (if desired).
parent
9f996fdc56
commit
378c076d1d
|
|
@ -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];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
#ifndef LL_M3MATH_H
|
||||
#define LL_M3MATH_H
|
||||
|
||||
#include "llerror.h"
|
||||
//#include "llerror.h"
|
||||
#include "stdtypes.h"
|
||||
|
||||
class LLVector4;
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@
|
|||
class LLColor4;
|
||||
class LLVector4;
|
||||
|
||||
#include "llerror.h"
|
||||
//#include "llerror.h"
|
||||
#include "llmath.h"
|
||||
#include "llsd.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
#ifndef LL_V3DMATH_H
|
||||
#define LL_V3DMATH_H
|
||||
|
||||
#include "llerror.h"
|
||||
//#include "llerror.h"
|
||||
#include "v3math.h"
|
||||
|
||||
class LLVector3d
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
#ifndef LL_V3MATH_H
|
||||
#define LL_V3MATH_H
|
||||
|
||||
#include "llerror.h"
|
||||
//#include "llerror.h"
|
||||
#include "llmath.h"
|
||||
|
||||
#include "llsd.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"
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
#ifndef LL_V4MATH_H
|
||||
#define LL_V4MATH_H
|
||||
|
||||
#include "llerror.h"
|
||||
//#include "llerror.h"
|
||||
#include "llmath.h"
|
||||
#include "v3math.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
#include <boost/unordered_map.hpp>
|
||||
#include <list>
|
||||
|
||||
#include "llerror.h"
|
||||
//#include "llerror.h"
|
||||
#include "v4color.h"
|
||||
#include "llstring.h"
|
||||
#include "stdtypes.h"
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
||||
}
|
||||
//=============================================================================
|
||||
|
|
@ -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
|
||||
|
|
@ -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;
|
||||
}
|
||||
//===============================================================================
|
||||
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Reference in New Issue