FAQ  •  Login

Bullet Ordering

<<

BSme964uw

Newbie
Newbie

Posts: 15

Joined: Mon Aug 18, 2008 9:32 am

Unread post Fri Nov 07, 2008 2:47 pm

Bullet Ordering

My CUDA results are failing the Bullet test because of ordering. I thought that A is always of lower index than B. For Bullet, we sort by A then B. For 30 bodies I fail due to swapping of A and B for bodies 11 and 16. Any ideas?

CUDA:
1 3 485.805 235.005 136.692 433.221 271.585 170.986 -0.723714 0.503453 0.471988
2 20 539.688 228.571 445.208 515.339 249.175 413.366 -0.540262 0.457144 -0.706496
3 5 554.486 258.378 84.7034 533.022 248.472 101.214 -0.744378 -0.343559 0.572598
3 21 556.853 259.798 88.8994 537.011 250.538 102.293 -0.773036 -0.36075 0.521799
5 21 612.984 285.992 51.0079 532.109 247.481 91.4454 -0.822897 -0.391856 0.411448
11 16 141.372 230.652 256.408 142.314 257.674 247.296 0.0330369 0.947058 -0.319357
19 20 519.531 186.124 485.607 484.372 168.828 492.412 -0.88407 -0.434905 0.17111
7

Bullet:
1 3 485.805 235.005 136.692 433.221 271.585 170.986 -0.723714 0.503453 0.471988
2 20 539.688 228.571 445.208 515.339 249.175 413.366 -0.540262 0.457144 -0.706496
3 5 554.486 258.378 84.7034 533.022 248.472 101.214 -0.744378 -0.343559 0.572598
3 21 556.853 259.798 88.8994 537.011 250.538 102.293 -0.773036 -0.36075 0.521799
5 21 612.984 285.992 51.0079 532.109 247.481 91.4454 -0.822897 -0.391856 0.411448
16 11 142.314 257.674 247.296 141.372 230.652 256.408 -0.0330369 -0.947058 0.319357
19 20 519.531 186.124 485.607 484.372 168.828 492.412 -0.88407 -0.434905 0.17111
7
<<

HammadM

Supreme Overlord
Supreme Overlord

Posts: 37

Joined: Wed Sep 03, 2008 12:23 pm

Unread post Fri Nov 07, 2008 3:52 pm

Re: Bullet Ordering

That is messed up.

as a fix change:

temp.a=obA->getCompanionId();
temp.b=obB->getCompanionId();

in the bullet code's main.h (around line 140)

to:


if(obA->getCompanionId()>obB->getCompanionId()){
temp.b=obA->getCompanionId();
temp.a=obB->getCompanionId();
}else{
temp.a=obA->getCompanionId();
temp.b=obB->getCompanionId();
}

This should fix the problem
<<

BSme964uw

Newbie
Newbie

Posts: 15

Joined: Mon Aug 18, 2008 9:32 am

Unread post Fri Nov 07, 2008 4:14 pm

Re: Bullet Ordering

If this is the case I think that we also need to swap the contact locations and the sign of the normal vector:

        if(obA->getCompanionId()>obB->getCompanionId()){
temp.b=obA->getCompanionId();
temp.a=obB->getCompanionId();
temp.x1=pt.m_positionWorldOnB.x();
temp.y1=pt.m_positionWorldOnB.y();
temp.z1=pt.m_positionWorldOnB.z();
temp.x2=pt.m_positionWorldOnA.x();
temp.y2=pt.m_positionWorldOnA.y();
temp.z2=pt.m_positionWorldOnA.z();
temp.nx=-pt.m_normalWorldOnB.x();
temp.ny=-pt.m_normalWorldOnB.y();
temp.nz=-pt.m_normalWorldOnB.z();
}else{
temp.a=obA->getCompanionId();
temp.b=obB->getCompanionId();
temp.x1=pt.m_positionWorldOnA.x();
temp.y1=pt.m_positionWorldOnA.y();
temp.z1=pt.m_positionWorldOnA.z();
temp.x2=pt.m_positionWorldOnB.x();
temp.y2=pt.m_positionWorldOnB.y();
temp.z2=pt.m_positionWorldOnB.z();
temp.nx=pt.m_normalWorldOnB.x();
temp.ny=pt.m_normalWorldOnB.y();
temp.nz=pt.m_normalWorldOnB.z();
}
<<

HammadM

Supreme Overlord
Supreme Overlord

Posts: 37

Joined: Wed Sep 03, 2008 12:23 pm

Unread post Fri Nov 07, 2008 4:20 pm

Re: Bullet Ordering

Ah, Forgot to look at the signs, Thanks for pointing that out.

Return to ME964 Fall 2008: High Performance Computing

Who is online

Users browsing this forum: No registered users and 1 guest

cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software.