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

Method updateBounds

Engine/source/ts/tsPartInstance.cpp:76–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74}
75
76void TSPartInstance::updateBounds()
77{
78 // run through meshes and brute force it?
79 Box3F bounds;
80 mBounds.minExtents.set( 10E30f, 10E30f, 10E30f);
81 mBounds.maxExtents.set(-10E30f,-10E30f,-10E30f);
82 for (S32 i=0; i<mMeshObjects.size(); i++)
83 {
84 if (mMeshObjects[i]->getMesh(0))
85 mMeshObjects[i]->getMesh(0)->computeBounds(mMeshObjects[i]->getTransform(),bounds,mMeshObjects[i]->frame);
86 mBounds.minExtents.setMin(bounds.minExtents);
87 mBounds.maxExtents.setMax(bounds.maxExtents);
88 }
89 mCenter = mBounds.minExtents + mBounds.maxExtents;
90 mCenter *= 0.5f;
91 Point3F r = mBounds.maxExtents-mCenter;
92 mRadius = mSqrt(mDot(r,r));
93}
94
95//-------------------------------------------------------------------------------------
96// Methods for breaking shapes into pieces

Callers 1

breakShapeMethod · 0.45

Calls 9

mSqrtFunction · 0.85
mDotFunction · 0.50
setMethod · 0.45
sizeMethod · 0.45
getMeshMethod · 0.45
computeBoundsMethod · 0.45
getTransformMethod · 0.45
setMinMethod · 0.45
setMaxMethod · 0.45

Tested by

no test coverage detected