MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / renderFaceEdges

Method renderFaceEdges

Engine/source/T3D/convexShape.cpp:1743–1792  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1741}
1742
1743void ConvexShape::renderFaceEdges( S32 faceid, const ColorI &color /*= ColorI::WHITE*/, F32 lineWidth /*= 1.0f */ )
1744{
1745 const Vector< ConvexShape::Face > &faceList = mGeometry.faces;
1746
1747 if ( faceid >= faceList.size() )
1748 return;
1749
1750 GFXTransformSaver saver;
1751 MatrixF xfm( mObjToWorld );
1752 xfm.scale( mObjScale );
1753 GFX->multWorld( xfm );
1754
1755 GFXStateBlockDesc desc;
1756 desc.setBlend( true );
1757 GFX->setStateBlockByDesc( desc );
1758
1759 MatrixF projBias(true);
1760 const Frustum& frustum = GFX->getFrustum();
1761 MathUtils::getZBiasProjectionMatrix( 0.001f, frustum, &projBias );
1762 GFX->setProjectionMatrix( projBias );
1763
1764 S32 s = faceid;
1765 S32 e = faceid + 1;
1766
1767 if ( faceid == -1 )
1768 {
1769 s = 0;
1770 e = faceList.size();
1771 }
1772
1773 for ( S32 i = s; i < e; i++ )
1774 {
1775 const ConvexShape::Face &face = faceList[i];
1776 const Vector< ConvexShape::Edge > &edgeList = face.edges;
1777 const Vector< U32 > &facePntList = face.points;
1778 const Vector< Point3F > &pointList = mGeometry.points;
1779
1780 PrimBuild::begin( GFXLineList, edgeList.size() * 2 );
1781
1782 PrimBuild::color( color );
1783
1784 for ( S32 j = 0; j < edgeList.size(); j++ )
1785 {
1786 PrimBuild::vertex3fv( pointList[ facePntList[ edgeList[j].p0 ] ] );
1787 PrimBuild::vertex3fv( pointList[ facePntList[ edgeList[j].p1 ] ] );
1788 }
1789
1790 PrimBuild::end();
1791 }
1792}
1793
1794void ConvexShape::getSurfaceTriangles( S32 surfId, Vector< Point3F > *outPoints, Vector< Point2F > *outCoords, bool worldSpace )
1795{

Callers 1

renderSceneMethod · 0.80

Calls 12

getZBiasProjectionMatrixFunction · 0.85
beginFunction · 0.85
endFunction · 0.85
multWorldMethod · 0.80
setBlendMethod · 0.80
setStateBlockByDescMethod · 0.80
getFrustumMethod · 0.80
setProjectionMatrixMethod · 0.80
colorFunction · 0.50
vertex3fvFunction · 0.50
sizeMethod · 0.45
scaleMethod · 0.45

Tested by

no test coverage detected