tutorial needs update?

User avatar
ejtttje
Posts: 96
Joined: Mon Nov 03, 2008 9:57 pm

tutorial needs update?

Post by ejtttje »

In the Hello World tutorial:
http://www.continuousphysics.com/mediaw ... ello_World

When creating the ground plane, it says that you must offset the shape so it does not intersect the origin. However, looking at the btStaticPlaneShape implementation as well as running a trial, I don't see any grounds for this claim:
The ground plane normal is upwards, and its distance from the origin is 1 metre. The ground will actually intersect the origin, but Bullet doesn't allow this in the local collision space, so we will offset it by 1 metre and the compensate when we place the rigid body later.
btCollisionShape* groundShape = new btStaticPlaneShape(btVector3(0,1,0),1);
btStaticPlaneShape(btVector3(0,1,0),0) works just fine for me...

Perhaps an old issue which has since been resolved, so the warning can be removed from the wiki?
sparkprime
Posts: 508
Joined: Fri May 30, 2008 2:51 am
Location: Ossining, New York

Re: tutorial needs update?

Post by sparkprime »

I hope so, at least when I wrote that, it didn't work. If things have changed then it's time to update the wiki.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: tutorial needs update?

Post by Erwin Coumans »

sparkprime wrote:I hope so, at least when I wrote that, it didn't work. If things have changed then it's time to update the wiki.
I'm not aware of any issue with the btStaticPlaneShape, and no fixes have been applied. What didn't work exactly, and where is the bugreport ;-)?

Thanks,
Erwin
sparkprime
Posts: 508
Joined: Fri May 30, 2008 2:51 am
Location: Ossining, New York

Re: tutorial needs update?

Post by sparkprime »

I think I mentioned it on the forum but there was no reply or something. I wasn't sure if it was bug/feature as I as a real beginner at the time. When I created a btStaticPlaneShape with a plane equation that intersected (0,0,0), i.e. d==0, something went wrong with the collisions (can't remember the exact symptoms). I looked at demo code and discovered that it was offsetting the plane in model space and compensating this with an offset in its rigid body transform, so I have been doing that ever since. I'll do a quick test with svn bullet and see what happens.
sparkprime
Posts: 508
Joined: Fri May 30, 2008 2:51 am
Location: Ossining, New York

Re: tutorial needs update?

Post by sparkprime »

I can't find any problem now. I'm certain there was a problem in the past, and obviously the demos were doing this offsetting which otherwise wouldn't be worthwhile. I think at some point this was fixed :)
User avatar
ejtttje
Posts: 96
Joined: Mon Nov 03, 2008 9:57 pm

Re: tutorial needs update?

Post by ejtttje »

I updated the wiki page. It keeps the offsets for demonstration purposes, just removes the warning.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: tutorial needs update?

Post by Erwin Coumans »

and obviously the demos were doing this offsetting which otherwise wouldn't be worthwhile
It must be a misunderstanding. The offsetting in the demos was to get the same offset as the previous btBoxShape, not because it was buggy. As far as I know, there hasn't been any bugfix applied to the btStaticPlaneShape related to the offset. If you disagree, please provide a revision number that is buggy ;-)

Thanks for removing this misleading comment.
Erwin
sparkprime
Posts: 508
Joined: Fri May 30, 2008 2:51 am
Location: Ossining, New York

Re: tutorial needs update?

Post by sparkprime »

Yeah... I can't reproduce it. It sounds like I was wrong all along then... Must have been something else that was breaking it all those months ago, but I can't remember in enough detail to know for sure. I don't even know what Bullet version I was using back then :)