University of Southern CaliforniaUSC
USC ICT TwitterUSC ICT FacebookUSC ICT YouTube

Navigation Mesh Question | General SmartBody Discussion | Forum

Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
Navigation Mesh Question
May 3, 2013
3:11 pm
Avatar
Member
Members
Forum Posts: 7
Member Since:
February 6, 2013
sp_UserOfflineSmall Offline

Hello,

Is there any way to save and load navigation mesh data after computing it, instead of recomputing it for the same mesh each time a simulation is run?

 

Thanks,

TB

May 3, 2013
5:56 pm
Avatar
Admin
Forum Posts: 52
Member Since:
August 8, 2012
sp_UserOfflineSmall Offline

Hi,

Currently saving out the navigation is not supported. Though it should be straightforward to save the nav-mesh out as seen in the recast-detour sample codes ( in sample_TileMesh.cpp : saveAll() function ).

 

Andrew

May 28, 2013
7:14 pm
Avatar
Member
Members
Forum Posts: 7
Member Since:
February 6, 2013
sp_UserOfflineSmall Offline

Thanks. Is there a python function to query the navigation mesh, or use the mesh when giving BML commands to the agent?

 

Tim

May 28, 2013
9:20 pm
Avatar
Admin
Forum Posts: 52
Member Since:
August 8, 2012
sp_UserOfflineSmall Offline

Hi Tim,

Currently, there are API functions that can be used to query a path from the navigation mesh.

For example :

"SBNavigationMesh.findPath(SrVec& spos, SrVec& epos, std::vector<SrVec>& pathList)" will find a valid path via navigation mesh.

,where spos and epos means the start and end points. The resulting way points will be stored at pathList.

These C++ API functions are not in Python binding yet, but they can be added quickly if needed.

 

Andrew

 

 

 

 

 

May 29, 2013
5:50 pm
Avatar
Member
Members
Forum Posts: 7
Member Since:
February 6, 2013
sp_UserOfflineSmall Offline

Hi Andrew,

Yeah, that function was the one I was looking for.  If it could be added to the python bindings, that would be great.

 

Tim

May 30, 2013
12:08 am
Avatar
Admin
Forum Posts: 52
Member Since:
August 8, 2012
sp_UserOfflineSmall Offline

Hi Tim,

The new python bindings have been added in the latest revision. Example usage is like :

navi = scene.getNavigationMesh()
sp = SrVec(0.64,-2.75,18.83)
ep = SrVec(6.24,-6.0,34.97)
path = navi.findPath(sp,ep)

 

The resulting path will be stored in 'path' as a array of SrVec.

Let me know if there are any questions.

Thanks,

Andrew