mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 03:33:48 +00:00
recast update
Added chunkytrimesh - this class splits up the geometry the navmesh is interested in into kdtree for fast traversal, makes the actual navmesh generation work with smaller chunks. Now only 1 RecastPolylist per navmesh this can be saved out in a future commit. This is a history commit, all functionality works same as it did before but it matches recasts recommended setup more closely. Future additions may break backwards compatibility.
This commit is contained in:
parent
26ebdd093b
commit
d4d552e8e0
8 changed files with 800 additions and 215 deletions
|
|
@ -27,7 +27,7 @@
|
|||
#include "gfx/primBuilder.h"
|
||||
#include "gfx/gfxStateBlock.h"
|
||||
|
||||
RecastPolyList::RecastPolyList()
|
||||
RecastPolyList::RecastPolyList() : mChunkyMesh(0)
|
||||
{
|
||||
nverts = 0;
|
||||
verts = NULL;
|
||||
|
|
@ -44,6 +44,28 @@ RecastPolyList::~RecastPolyList()
|
|||
clear();
|
||||
}
|
||||
|
||||
rcChunkyTriMesh* RecastPolyList::getChunkyMesh()
|
||||
{
|
||||
if (!mChunkyMesh)
|
||||
{
|
||||
mChunkyMesh = new rcChunkyTriMesh;
|
||||
if (!mChunkyMesh)
|
||||
{
|
||||
Con::errorf("Build tile navigation: out of memory");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!rcCreateChunkyTriMesh(getVerts(), getTris(), getTriCount(), 256, mChunkyMesh))
|
||||
{
|
||||
Con::errorf("Build tile navigation: out of memory");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return mChunkyMesh;
|
||||
}
|
||||
|
||||
void RecastPolyList::clear()
|
||||
{
|
||||
nverts = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue