Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / 3D Physics and passing through the static plane

Author
Message
nz0
AGK Developer
17
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 3rd Apr 2017 21:51
I noticed that under some conditions, 3D physics objects can be squeezed through other objects (like the floor) if there's a disproportionate mass landing on them.
I can't set mass on a static object (the floor) - perhaps to counter it - as it seems to lose it's ability to collide if you do that, so I placed an additional static plane where the floor should be and although it helps a little, objects can still be pushed through it if there's more mass (e.g. mass 10 object pressing down on a mass 1 object).

The object rarely (if ever) gets pushed right through, but may become somewhat embedded in it. Disturbing the embedded object sometimes allows it to correct itself, but it's not ideal. It's nothing to do with the complexity of the shape - it's just cubes.

I tried making the floor "thicker" but no different. I also tried different collision shapes on the floor and this doesn't improve the chances.
Perhaps more static "floors" on top of each other to create more "barrier" checks ?

Also, I noted that there seems to be a "minimum working" unit size for the 3D physics of 3.5 units or something. Does this apply to mass as well?
My smallest object unit size is 10x10x10 with mass of 1.




Stab in the Dark software
Valued Member
22
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 4th Apr 2017 01:29 Edited at: 4th Apr 2017 23:14
The problem you are describing is called tunneling and is an issue in all physics engines.
AGK by default applies Constant Collision Detection(CCD) to all rigid bodies to limit tunneling.
FYI you can not set a mass for a STATIC PLANE. All static objects have a mass of 0.
Adding more Static planes in the location is not recommended which you discovered by getting embedded objects.
There are a few things that you can do to limit tunneling.

Try not having a object with a very large mass land on another object.
By default objects have a max linear velocity of 30, If you increase it this will cause more tunneling.
The minimum size of an object is important to prevent tunneling. At the default scale factor 3.5 units is the recommended minimum.

The Bullet Physics Engine that AppGameKit uses was designed for use with video games to simulate physics fast and limit processing.
Please do not expect it to simulate physics at a higher resolution as this would not be practical for mobile platforms.
The coffee is lovely dark and deep,and I have code to write before I sleep.
nz0
AGK Developer
17
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 4th Apr 2017 22:34
Thanks for that.
I'm happy to work within the limitations now that I know what they are.

Login to post a reply

Server time is: 2025-06-06 16:39:40
Your offset time is: 2025-06-06 16:39:40