* Fixes description for a few Scene methods

* Adds method to Scene to delete dynamic objects in the scene
* Add getNodeTransform to ShapeBase
* Add sanity check to AFX ea_update function to avoid divide by zero
* Adds ability to set color mul on GuiBitmapBorderCtrl like bitmapCtrl
* MatrixF utilty functions/operators
* Add ability to ignore an object in the containerBoxEmpty method call
* Adds some better initialization/sanity handling for resetWorldBox and resetRenderWorldBox for SceneObject
This commit is contained in:
Areloch 2024-02-03 23:42:26 -06:00
parent e630ab859a
commit da06fc1d96
10 changed files with 98 additions and 15 deletions

View file

@ -1485,7 +1485,7 @@ ConsoleFunctionGroupBegin( Containers, "Functions for ray casting and spatial q
//-----------------------------------------------------------------------------
DefineEngineFunction( containerBoxEmpty, bool,
( U32 mask, Point3F center, F32 xRadius, F32 yRadius, F32 zRadius, bool useClientContainer ), ( -1, -1, false ),
( U32 mask, Point3F center, F32 xRadius, F32 yRadius, F32 zRadius, bool useClientContainer, SceneObject* ignoreObj), ( -1, -1, false, nullAsType<SceneObject*>()),
"@brief See if any objects of the given types are present in box of given extent.\n\n"
"@note Extent parameter is last since only one radius is often needed. If "
"one radius is provided, the yRadius and zRadius are assumed to be the same. Unfortunately, "
@ -1519,8 +1519,12 @@ DefineEngineFunction( containerBoxEmpty, bool,
polyList.mPlaneList[5].set(B.maxExtents, VectorF(0,0,1));
SceneContainer* pContainer = useClientContainer ? &gClientContainer : &gServerContainer;
return ! pContainer->buildPolyList(PLC_Collision, B, mask, &polyList);
if (ignoreObj)
ignoreObj->disableCollision();
bool ret = !pContainer->buildPolyList(PLC_Collision, B, mask, &polyList);
if (ignoreObj)
ignoreObj->enableCollision();
return ret;
}
//-----------------------------------------------------------------------------

View file

@ -521,8 +521,14 @@ void SceneObject::resetWorldBox()
AssertFatal(mObjBox.isValidBox(), "SceneObject::resetWorldBox - Bad object box!");
mWorldBox = mObjBox;
mWorldBox.minExtents.convolve(mObjScale);
mWorldBox.maxExtents.convolve(mObjScale);
Point3F scale = Point3F(mFabs(mObjScale.x), mFabs(mObjScale.y), mFabs(mObjScale.z));
mWorldBox.minExtents.convolve(scale);
mWorldBox.maxExtents.convolve(scale);
if (mObjToWorld.isNaN())
mObjToWorld.identity();
mObjToWorld.mul(mWorldBox);
AssertFatal(mWorldBox.isValidBox(), "SceneObject::resetWorldBox - Bad world box!");
@ -585,11 +591,16 @@ void SceneObject::resetRenderWorldBox()
AssertFatal( mObjBox.isValidBox(), "Bad object box!" );
mRenderWorldBox = mObjBox;
mRenderWorldBox.minExtents.convolve( mObjScale );
mRenderWorldBox.maxExtents.convolve( mObjScale );
Point3F scale = Point3F(mFabs(mObjScale.x), mFabs(mObjScale.y), mFabs(mObjScale.z));
mRenderWorldBox.minExtents.convolve(scale);
mRenderWorldBox.maxExtents.convolve(scale);
if (mRenderObjToWorld.isNaN())
mRenderObjToWorld.identity();
mRenderObjToWorld.mul( mRenderWorldBox );
AssertFatal( mRenderWorldBox.isValidBox(), "Bad world box!" );
AssertFatal( mRenderWorldBox.isValidBox(), "Bad Render world box!" );
// Create mRenderWorldSphere from mRenderWorldBox.