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

Method insertPoly

Engine/source/lighting/common/shadowVolumeBSP.cpp:183–227  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

181}
182
183void ShadowVolumeBSP::insertPoly(SVNode ** root, SVPoly * poly)
184{
185 if(!(*root))
186 {
187 insertShadowVolume(root, poly->mShadowVolume);
188
189 if(poly->mSurfaceInfo && !mFirstInteriorNode)
190 mFirstInteriorNode = mShadowVolumes[poly->mShadowVolume];
191
192 if(poly->mTarget)
193 addUniqueVolume(poly->mTarget->mSurfaceInfo, poly->mShadowVolume);
194
195 recyclePoly(poly);
196 return;
197 }
198
199 const PlaneF & plane = getPlane((*root)->mPlaneIndex);
200
201 //
202 switch(whichSide(poly, plane))
203 {
204 case SVNode::On:
205 case SVNode::Front:
206 insertPolyFront(root, poly);
207 break;
208
209 case SVNode::Back:
210 insertPolyBack(root, poly);
211 break;
212
213 case SVNode::Split:
214 {
215 SVPoly * front;
216 SVPoly * back;
217
218 splitPoly(poly, plane, &front, &back);
219 recyclePoly(poly);
220
221 insertPolyFront(root, front);
222 insertPolyBack(root, back);
223
224 break;
225 }
226 }
227}
228
229void ShadowVolumeBSP::insertPolyFront(SVNode ** root, SVPoly * poly)
230{

Callers 1

addStaticMethod · 0.45

Calls 1

getPlaneFunction · 0.50

Tested by

no test coverage detected