Internal edges for btBoxShape

Post Reply
MaxDZ8
Posts: 149
Joined: Fri Jun 24, 2011 8:53 am

Internal edges for btBoxShape

Post by MaxDZ8 » Wed Feb 22, 2012 5:12 pm

I'm not entirely sure what's going on so I'm going to ask for some help.
I have a world which is - for the most part - made by boxes. When seen top-down, it's like

Code: Select all

+---+---+---+
|   |   |   |
+-------+---+---+
|       |   |   |
|       |---+---+
|       |   |   |
+-------+---+---+
Please note some quads might be merged in a bigger one.
I switched from previous kinematic-oriented modelling to a fully dynamic-based player actor. This means I move the player by applying forces (most of the time, I set its velocity) and then allow Bullet update its position for me.
The player will sometimes get stuck in between two adjacent box-shaped rigidbodies. To be honest, I'm not really sure what's really going on, but it appears this is the case.
I am looking for suggestions to either investigate this in more detail or get the rid of the problem.
I must admit I'm currently incredibly low on performance. Is there a possibility the problem will just go away with a smaller time tick? The problem seems to be much less pronounced on release builds (I'm using VC++2010).

Would it be the case to drop boxes completely and go with trimeshes?
Should I use "real" triangular meshes or simplify them as individual polygons?

kloplop321
Posts: 55
Joined: Sun Jan 01, 2012 7:37 pm

Re: Internal edges for btBoxShape

Post by kloplop321 » Wed Feb 22, 2012 7:20 pm

I've tried to use a fully dynamic character model and I usually end up getting stuck or lodged into things too because I'm using forces but limiting the angular movement.

Boxes should be more stable than trimeshes (currently, since over trimeshes, you can get a weird issue when going across edges.)

MaxDZ8
Posts: 149
Joined: Fri Jun 24, 2011 8:53 am

Re: Internal edges for btBoxShape

Post by MaxDZ8 » Thu Feb 23, 2012 9:11 am

Yes, that's sure. But trimeshes do have a way to deal with the problem which is internal edge marks AFAIK.
There's no such thing with boxes. Everything is fine when dealing with the inner portion of the box but when crossing the boundaries between two boxes this problem becomes fairly common.
I am limiting angular movement as well.

MaxDZ8
Posts: 149
Joined: Fri Jun 24, 2011 8:53 am

Re: Internal edges for btBoxShape

Post by MaxDZ8 » Tue Feb 28, 2012 8:58 am

Replying to my own question for future reference.
The player was getting stuck because dynamic objects are subject to sleeping. Disabling deactivation made the problem go away.
This happens because Bullet clearly does not know a thing about the impulses I am sending and therefore will decide to put the object to sleep after a while, which is very reasonable.

Post Reply