-
-
Notifications
You must be signed in to change notification settings - Fork 252
Open
Description
In here I am occasionally getting this asserted:
assert(mNodes[nodeID].aabb.contains(newAABB));
Anything I can do? I dont mind an occasional glitch, can I safely disable the assert or if the condition fires do something (rather than crash)?
Thanks,
bool DynamicAABBTree::updateObject(int32 nodeID, const AABB& newAABB, bool forceReinsert) {
RP3D_PROFILE("DynamicAABBTree::updateObject()", mProfiler);
assert(nodeID >= 0 && nodeID < mNbAllocatedNodes);
assert(mNodes[nodeID].isLeaf());
assert(mNodes[nodeID].height >= 0);
// If the new AABB is still inside the fat AABB of the node
if (!forceReinsert && mNodes[nodeID].aabb.contains(newAABB)) {
return false;
}
// If the new AABB is outside the fat AABB, we remove the corresponding node
removeLeafNode(nodeID);
// Compute the fat AABB by inflating the AABB with by a constant percentage of the size of the AABB
mNodes[nodeID].aabb = newAABB;
const Vector3 gap(newAABB.getExtent() * mFatAABBInflatePercentage * decimal(0.5f));
mNodes[nodeID].aabb.mMinCoordinates -= gap;
mNodes[nodeID].aabb.mMaxCoordinates += gap;
assert(mNodes[nodeID].aabb.contains(newAABB));
// Reinsert the node into the tree
insertLeafNode(nodeID);
return true;
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels