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

Method end

Engine/source/collision/extrudedPolyList.cpp:221–331  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

219}
220
221void ExtrudedPolyList::end()
222{
223 // Anything facing away from the mVelocity is rejected (and also
224 // cap to max collisions)
225 if (mDot(mPoly.plane, mNormalVelocity) > 0.f ||
226 mCollisionList->getCount() >= CollisionList::MaxCollisions)
227 return;
228
229 // Test the built up poly (stored in mPoly) against all our extruded
230 // faces.
231 U32 cFaceCount = 0;
232 ExtrudedFace* cFace[30];
233 bool cEdgeColl[30];
234 ExtrudedFace* face = mExtrudedList.begin();
235 ExtrudedFace* end = mExtrudedList.end();
236
237 for (; face != end; face++)
238 {
239 // Skip inactive..
240 if (!face->active)
241 continue;
242
243 // Update the dot product.
244 face->faceDot = -mDot(face->plane,mPoly.plane);
245
246 // Skip it if we're facing towards...
247 if(face->faceDot <= 0.f)
248 continue;
249
250 // Test, and skip if colliding.
251 if (!testPoly(*face))
252 continue;
253
254 // Note collision.
255 cFace[cFaceCount] = face;
256 cEdgeColl[cFaceCount++] = false;
257 }
258
259 if (!cFaceCount)
260 {
261 face = mExtrudedList.begin();
262 end = mExtrudedList.end();
263 for (; face != end; face++)
264 {
265 // Don't need to do dot product second time, so just check if it's
266 // active (we already did the dot product in the previous loop).
267 if (!face->active)
268 continue;
269
270 // Skip it if we're facing away...
271 if(face->faceDot > 0.f)
272 continue;
273
274 // Do collision as above.
275 if (!testPoly(*face))
276 continue;
277
278 // Note the collision.

Callers 1

extrudeMethod · 0.45

Calls 9

setMaxHeightMethod · 0.80
incrementMethod · 0.80
mDotFunction · 0.50
getCountMethod · 0.45
beginMethod · 0.45
getTimeMethod · 0.45
clearMethod · 0.45
setTimeMethod · 0.45
getMaxHeightMethod · 0.45

Tested by

no test coverage detected