Unusual "jitter" while hit

AxeD
Posts: 36
Joined: Tue Jun 17, 2008 8:28 pm

Re: Unusual "jitter" while hit

Post by AxeD »

Hi,
i have found that issue. It is not a angular velocity. It looks like getRotation().getX(), getRotation().getY(), getRotation().getZ() returns wrong sign sometimes. I don't know how to fix it.

EDIT:

I think i've got it.
Original code

Code: Select all

btScalar trace = m_el[0].x() + m_el[1].y() + m_el[2].z();
       btScalar temp[4];
         
       if (trace > btScalar(0.0)) 
       {
                    btScalar s = btSqrt(trace + btScalar(1.0));
As far as i know acoording to a theory it should be:

Code: Select all

btScalar trace = m_el[0].x() + m_el[1].y() + m_el[2].z();
       btScalar temp[4];  
       btScalar s = btSqrt(trace + btScalar(1.0));

       if (s > btScalar(0.0)) 
       {
        

Am I right?
AxeD
Posts: 36
Joined: Tue Jun 17, 2008 8:28 pm

Re: Unusual "jitter" while hit

Post by AxeD »

And.... jitter is back. I'm using glmatrix directly and jitter still exists. It seems to be something wrong with rotation. When i used a cylinder instead of pin shape, jitter was even higher. So I still need some help :/
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Unusual "jitter" while hit

Post by Erwin Coumans »

Most likely the jitter is because your objects are too small, Bullet currently has limitations on the sizes.

Assuming units in meters and seconds, bowling pins are just too small. There have been some games shipped, using Bullet, but this required some additional tweaking to make it stable. We can't help users with this tweaking, so it is currently unsupported. You could try to upscale collision shapes, and work around this issue.

This known issue is reported here: http://code.google.com/p/bullet/issues/detail?id=45
Thanks,
Erwin
AxeD
Posts: 36
Joined: Tue Jun 17, 2008 8:28 pm

Re: Unusual "jitter" while hit

Post by AxeD »

Hi Erwin,
thank You for a hint. All my objects are in CM not in meters :| In Meters i have just this same behaviour and i have to add that on PC all is OK :| Maybe there is some platform dependent calculation ?
AxeD
Posts: 36
Joined: Tue Jun 17, 2008 8:28 pm

Re: Unusual "jitter" while hit

Post by AxeD »

I have found solution/reason of that issue and :
1. Avoid multiple rotation conversions, in both ways (matrix <-> quaternion) - lost of precission.
2. Do not operate on pointers not taken from phx world.