Skip to content

DynamicAABBTree::updateObject assert #440

@System-Lord22

Description

@System-Lord22

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;

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions