ah nice, the optimization goes to the scene management, the solver will still take the same time for complex stacks.Basically its meant to help on scene with lot of objects that are not stack.
we test with stacks but that just for fun, I do no know of any app where stack are part of the design.
You can see that the slow down happens when the large stack is touch but as soon as if start to go down then the fps goes up.
Sometime the collision seen to don't work, I have get a dContact solver error with the ide.
I have seen some capsules not colliding with other, Or the box not colliding when I try to broke down the stack.
- Code: Select all
void dgBroadPhase::UpdateBody(dgBody* const body, dgInt32 threadIndex)
{
if (m_rootNode && !m_rootNode->IsLeafNode() && body->m_masterNode) {
dgBroadPhaseBodyNode* const node = body->GetBroadPhase();
dgBody* const body1 = node->GetBody();
dgAssert(body1 == body);
dgAssert(!body1->m_equilibrium);
dgAssert(!node->GetLeft());
dgAssert(!node->GetRight());
dgAssert(!body1->GetCollision()->IsType(dgCollision::dgCollisionNull_RTTI));
const dgBroadPhaseNode* const root = (m_rootNode->GetLeft() && m_rootNode->GetRight()) ? NULL : m_rootNode;
for (dgBroadPhaseNode* parent = node; parent && parent->m_isSleeping; parent = parent->m_parent) {
[color=#FF4000]// this should be an atomic write, or else [/color]
parent->m_isSleeping = 0;
}
I will fix it tonight, I was hopping that all write where guarantee, but that is not the case if
there is also another place where I nee to make sure the value is change as intended.
I let like that to see how severe it is, because if it is rare then is can be doen incrementally, but if is happen a lot the it nee a brute force pass. It seems to be mild so I will try an incremental updated