MCPcopy Create free account
hub / github.com/axmolengine/axmol / getEdgeDirection

Method getEdgeDirection

core/3d/OBB.cpp:357–382  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

355}
356
357Vec3 OBB::getEdgeDirection(int index) const
358{
359 Vec3 corners[8];
360 getCorners(corners);
361
362 Vec3 tmpLine;
363 switch (index)
364 {
365 case 0: // edge with x axis
366 tmpLine = corners[5] - corners[6];
367 tmpLine.normalize();
368 break;
369 case 1: // edge with y axis
370 tmpLine = corners[7] - corners[6];
371 tmpLine.normalize();
372 break;
373 case 2: // edge with z axis
374 tmpLine = corners[1] - corners[6];
375 tmpLine.normalize();
376 break;
377 default:
378 AXASSERT(0, "Invalid index!");
379 break;
380 }
381 return tmpLine;
382}
383
384Vec3 OBB::getFaceDirection(int index) const
385{

Callers 1

intersectsMethod · 0.80

Calls 1

normalizeMethod · 0.45

Tested by

no test coverage detected