mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 15:44:36 +00:00
backup
backup commit
This commit is contained in:
parent
2d2d3c7560
commit
25d6ee5372
2 changed files with 30 additions and 7 deletions
|
|
@ -299,10 +299,8 @@ void GroundPlane::buildConvex( const Box3F& box, Convex* convex )
|
||||||
{
|
{
|
||||||
Point3F queryCenter = box.getCenter();
|
Point3F queryCenter = box.getCenter();
|
||||||
|
|
||||||
planeConvex->mCenter = Point3F( queryCenter.x, queryCenter.y, 0 );
|
planeConvex->mCenter = Point3F( queryCenter.x, queryCenter.y, 0 );
|
||||||
planeConvex->mSize = Point3F( box.getExtents().x,
|
planeConvex->mSize = Point3F( box.getExtents().x, box.getExtents().y, 0 );
|
||||||
box.getExtents().y,
|
|
||||||
0 );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -150,13 +150,13 @@ void ConcretePolyList::render()
|
||||||
GFXStateBlockRef sb = GFX->createStateBlock( solidZDisable );
|
GFXStateBlockRef sb = GFX->createStateBlock( solidZDisable );
|
||||||
GFX->setStateBlock( sb );
|
GFX->setStateBlock( sb );
|
||||||
|
|
||||||
PrimBuild::color3i( 255, 0, 255 );
|
|
||||||
|
|
||||||
Poly *p;
|
Poly *p;
|
||||||
Point3F *pnt;
|
Point3F *pnt;
|
||||||
|
|
||||||
for ( p = mPolyList.begin(); p < mPolyList.end(); p++ )
|
for ( p = mPolyList.begin(); p < mPolyList.end(); p++ )
|
||||||
{
|
{
|
||||||
|
PrimBuild::color3i(255, 0, 255);
|
||||||
|
|
||||||
PrimBuild::begin( GFXLineStrip, p->vertexCount + 1 );
|
PrimBuild::begin( GFXLineStrip, p->vertexCount + 1 );
|
||||||
|
|
||||||
for ( U32 i = 0; i < p->vertexCount; i++ )
|
for ( U32 i = 0; i < p->vertexCount; i++ )
|
||||||
|
|
@ -169,6 +169,31 @@ void ConcretePolyList::render()
|
||||||
PrimBuild::vertex3fv( pnt );
|
PrimBuild::vertex3fv( pnt );
|
||||||
|
|
||||||
PrimBuild::end();
|
PrimBuild::end();
|
||||||
|
|
||||||
|
// Calculate the center of the polygon
|
||||||
|
Point3F centroid(0, 0, 0);
|
||||||
|
for (U32 i = 0; i < p->vertexCount; i++)
|
||||||
|
{
|
||||||
|
pnt = &mVertexList[mIndexList[p->vertexStart + i]];
|
||||||
|
centroid += *pnt;
|
||||||
|
}
|
||||||
|
centroid /= p->vertexCount;
|
||||||
|
|
||||||
|
// Calculate the end point of the normal line
|
||||||
|
Point3F norm = p->plane.getNormal();
|
||||||
|
|
||||||
|
U8 red = static_cast<U8>((norm.x + 1.0f) * 0.5f * 255);
|
||||||
|
U8 green = static_cast<U8>((norm.y + 1.0f) * 0.5f * 255);
|
||||||
|
U8 blue = static_cast<U8>((norm.z + 1.0f) * 0.5f * 255);
|
||||||
|
|
||||||
|
PrimBuild::color3i(red, green, blue);
|
||||||
|
Point3F normalEnd = centroid + norm;
|
||||||
|
|
||||||
|
// Draw the normal line
|
||||||
|
PrimBuild::begin(GFXLineList, 2);
|
||||||
|
PrimBuild::vertex3fv(centroid);
|
||||||
|
PrimBuild::vertex3fv(normalEnd);
|
||||||
|
PrimBuild::end();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -220,4 +245,4 @@ void ConcretePolyList::triangulate()
|
||||||
|
|
||||||
mPolyList = polyList;
|
mPolyList = polyList;
|
||||||
mIndexList = indexList;
|
mIndexList = indexList;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue