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

Method findNodeTransform

Engine/source/T3D/shapeBase.cpp:3471–3496  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3469//--------------------------------------------------------------------------
3470
3471void ShapeBaseConvex::findNodeTransform()
3472{
3473 S32 dl = pShapeBase->mDataBlock->collisionDetails[hullId];
3474
3475 TSShapeInstance* si = pShapeBase->getShapeInstance();
3476 TSShape* shape = si->getShape();
3477
3478 const TSShape::Detail* detail = &shape->details[dl];
3479 const S32 subs = detail->subShapeNum;
3480 const S32 start = shape->subShapeFirstObject[subs];
3481 const S32 end = start + shape->subShapeNumObjects[subs];
3482
3483 // Find the first object that contains a mesh for this
3484 // detail level. There should only be one mesh per
3485 // collision detail level.
3486 for (S32 i = start; i < end; i++)
3487 {
3488 const TSShape::Object* obj = &shape->objects[i];
3489 if (obj->numMeshes && detail->objectDetailNum < obj->numMeshes)
3490 {
3491 nodeTransform = &si->mNodeTransforms[obj->nodeIndex];
3492 return;
3493 }
3494 }
3495 return;
3496}
3497
3498const MatrixF& ShapeBaseConvex::getTransform() const
3499{

Callers 3

buildConvexMethod · 0.80
onAddMethod · 0.80
onAddMethod · 0.80

Calls 2

getShapeInstanceMethod · 0.45
getShapeMethod · 0.45

Tested by

no test coverage detected