Static objects with mass zero should not accumulate any impulse, as c.m_angularComponentA should be the zero vector.
That should be correct. What we observed was that for an identical input, resolveSingleConstraintRowLowerLimit did not yield the same result when going through the SIMD version. When looking over the code the only difference we could notice was that this line of the C++ code
Code: Select all
SIMD_FORCE_INLINE void internalApplyImpulse(const btVector3& linearComponent, const btVector3& angularComponent,const btScalar impulseMagnitude)
{
if (m_inverseMass)
{
m_deltaLinearVelocity += linearComponent * impulseMagnitude;
m_deltaAngularVelocity += angularComponent * impulseMagnitude;
}
}
was not present in the SIMD version. So we assumed the static object in the pair was getting a non-zero deltaAngularVelocity which affected the next iteration's deltaVel1Dotn.
We could very well have been wrong about this deduction, like I said we did not explore the SIMD version much since we found it slower than the C++ one.
I'm surprised you don't see any speedup, but slowdown. Our benchmark shows good speedup for the SIMD version, but it depends on the usage of course.
What compiler/platform are you using?
We are compiling on Dev Studio 2008 and we tested on a WinXP AMD PC. I'm not sure how the SIMD version is expected to yield a speed up since it is used strictly to do scalar math with a single value in the vector. Essentially you get all the overhead of setting up the SIMD computation and none of the benefits of being able to do math on 4 values at a time.
On that topic, it seems that SIMD would be a good candidate to have the solver solve the constraints by block (one block per contact manifold).