diff options
author | prep <prep@lindenlab.com> | 2011-12-01 10:54:21 -0500 |
---|---|---|
committer | prep <prep@lindenlab.com> | 2011-12-01 10:54:21 -0500 |
commit | 0538dcf62e3c13b50fc0828e930fa50e4050302d (patch) | |
tree | 22db10891a271b591766bd048f48dfbef5800f2d /indra/newview | |
parent | 38b7f033b28027711a03e5a28d6ea384be909318 (diff) |
New navmesh viewer options, rendering improvements, etc.
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llnavmeshstation.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llviewermenufile.cpp | 68 | ||||
-rw-r--r-- | indra/newview/pipeline.cpp | 16 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/menu_viewer.xml | 20 |
4 files changed, 46 insertions, 60 deletions
diff --git a/indra/newview/llnavmeshstation.cpp b/indra/newview/llnavmeshstation.cpp index 2f7e62b8ae..9ae8492380 100644 --- a/indra/newview/llnavmeshstation.cpp +++ b/indra/newview/llnavmeshstation.cpp @@ -27,7 +27,7 @@ #include "llviewerprecompiledheaders.h"
#include "llnavmeshstation.h"
#include "llcurl.h"
-#include "LLPathingLib.h"//prep# fixme
+#include "llpathinglib.h"
#include "llagent.h"
#include "llviewerregion.h"
#include "llsdutil.h"
diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index 2c826788a2..91ca4175f4 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -74,13 +74,12 @@ #include "lluuid.h"
#include "llvorbisencode.h"
#include "message.h"
+#include "llpathinglib.h"
+#include "llnavmeshstation.h"
// system libraries
#include <boost/tokenizer.hpp>
-#include "LLPathingLib.h"
-#include "llnavmeshstation.h"
-
class LLBuildNavMesh : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
@@ -89,56 +88,29 @@ class LLBuildNavMesh : public view_listener_t return result;
}
};
-//prep#TODO#remove if not needed for ship
-class LLFileUploadNavMesh : public view_listener_t, LLNavMeshObserver
+class LLNavMeshRenderingToggle : public view_listener_t
{
-
bool handleEvent(const LLSD& userdata)
{
- LLPathingLib::initSystem();
-
- if ( LLPathingLib::getInstance() == NULL )
- {
- llinfos<<"No implementation of pathing library."<<llendl;
+ if ( LLPathingLib::getInstance() )
+ {
+ LLPathingLib::getInstance()->toggleRenderNavMeshState( );
}
- else
- {
- LLPathingLib::getInstance()->testNavMeshGenerationWithLocalAsset();
- LLSD data;
- LLPLResult result = LLPathingLib::getInstance()->getNavMeshAsLLSD( data );
- if ( result == LLPL_OK )
- {
- std::string capability = "NavMeshUpload";
- std::string url = gAgent.getRegion()->getCapability( capability );
- if ( !url.empty() )
- {
- llinfos<< typeid(*this).name() <<"setNavMeshUploadURL "<< url <<llendl;
- //Populate the required paramters that are required to store in the dictionary
- data["agent_id"] = gAgent.getID();
- LLUUID object_id;
- data["object_id"] = object_id; //"prepFIXME#IsThisReallyNeeded?";
- data["region_id"] = gAgent.getRegion()->getRegionID();
- data["sim_host"] = gAgent.getRegion()->getHost().getString();
- data["sim_port"] = (S32)gAgent.getRegion()->getHost().getPort();
- LLNavMeshStation::getInstance()->setNavMeshUploadURL( url );
- LLNavMeshStation::getInstance()->postNavMeshToServer( data, getObserverHandle() );
- }
- else
- {
- llinfos<<"region contained no capability of type ["<<capability<<"]"<<llendl;
- }
- }
- else
- {
- llinfos<<"ok4"<<llendl;
- }
+ return true;
+ }
+};
+class LLNavMeshShapeRenderingToggle : public view_listener_t
+{
+ bool handleEvent(const LLSD& userdata)
+ {
+ if ( LLPathingLib::getInstance() )
+ {
+ LLPathingLib::getInstance()->toggleRenderNavMeshandShapesState( );
}
-
return true;
}
};
-
-
+//prep#
class LLPathingTools : public view_listener_t, LLNavMeshDownloadObserver
{
@@ -173,8 +145,7 @@ class LLPathingTools : public view_listener_t, LLNavMeshDownloadObserver {
llinfos<<"Region has does not required caps of type ["<<capability<<"]"<<llendl;
}
- }
-
+ }
return true;
}
};
@@ -1386,7 +1357,8 @@ void init_menu_file() view_listener_t::addMenu(new LLMeshUploadVisible(), "File.VisibleUploadModel");
//prep#
- //view_listener_t::addCommit(new LLFileUploadNavMesh(), "File.UploadNavMesh");
view_listener_t::addCommit(new LLPathingTools(), "PathingTools.RetrieveSrc");
+ view_listener_t::addCommit(new LLNavMeshRenderingToggle(), "PathingTools.ToggleNavMeshView");
+ view_listener_t::addCommit(new LLNavMeshShapeRenderingToggle(), "PathingTools.ToggleNavMeshShapeView");
// "File.SaveTexture" moved to llpanelmaininventory so that it can be properly handled.
}
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index f797822d41..97b69370c9 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -104,8 +104,7 @@ #include "lltoolpie.h" #include "llcurl.h" #include "llnotifications.h" -//prep# -#include "LLPathingLib.h" +#include "llpathinglib.h" void check_stack_depth(S32 stack_depth) { @@ -3787,9 +3786,16 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate) LLVertexBuffer::unbind(); //prep# - if ( LLPathingLib::getInstance() ) - { - LLPathingLib::getInstance()->renderNavMesh(); + if ( LLPathingLib::getInstance() ) + { + if ( LLPathingLib::getInstance()->getRenderNavMeshState() ) + { + LLPathingLib::getInstance()->renderNavMesh(); + } + if ( LLPathingLib::getInstance()->getRenderNavMeshandShapesState() ) + { + LLPathingLib::getInstance()->renderNavMeshandShapes(); + } } if (!LLPipeline::sReflectionRender && !LLPipeline::sRenderDeferred) diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index e7a0f1b0e0..2f88b6fbf1 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -657,18 +657,26 @@ name="Pathing Tools" tear_off="true" visible="true"> - <menu_item_check - label="Retrieve NavMesh Src" + <menu_item_call + label="Retrieve Navigation Mesh Src" name="Show Pathing Tools"> - <menu_item_check.on_click + <menu_item_call.on_click function="PathingTools.RetrieveSrc" /> - </menu_item_check> + </menu_item_call> + <menu_item_call - label="Toggle NavMesh Display" - name="Toggle NavMesh View"> + label="Toggle Navigation Mesh Display" + name="Toggle Navigation Mesh View"> <menu_item_call.on_click function="PathingTools.ToggleNavMeshView" /> </menu_item_call> + + <menu_item_call + label="Toggle Navigation Mesh Shape Display" + name="Toggle Navigation Mesh Shape View"> + <menu_item_call.on_click + function="PathingTools.ToggleNavMeshShapeView" /> + </menu_item_call> </menu> <menu |