mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-27 10:33:50 +00:00
Added PLC_Navigation hint for gathering navmesh polygon data.
This commit is contained in:
parent
95ef5ec226
commit
d9c731b73f
4 changed files with 77 additions and 2 deletions
|
|
@ -653,6 +653,29 @@ bool ConvexShape::buildPolyList( PolyListContext context, AbstractPolyList *plis
|
|||
|
||||
const Vector< ConvexShape::Face > faceList = mGeometry.faces;
|
||||
|
||||
if(context == PLC_Navigation)
|
||||
{
|
||||
for(S32 i = 0; i < faceList.size(); i++)
|
||||
{
|
||||
const ConvexShape::Face &face = faceList[i];
|
||||
|
||||
S32 s = face.triangles.size();
|
||||
for(S32 j = 0; j < s; j++)
|
||||
{
|
||||
plist->begin(0, s*i + j);
|
||||
|
||||
plist->plane(PlaneF(face.centroid, face.normal));
|
||||
|
||||
plist->vertex(base + face.points[face.triangles[j].p0]);
|
||||
plist->vertex(base + face.points[face.triangles[j].p1]);
|
||||
plist->vertex(base + face.points[face.triangles[j].p2]);
|
||||
|
||||
plist->end();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
for ( S32 i = 0; i < faceList.size(); i++ )
|
||||
{
|
||||
const ConvexShape::Face &face = faceList[i];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue