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.

DarkBASIC Professional Discussion / Newton Physics on Complex Objects

Author
Message
Gil Galvanti
21
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 16th Jan 2011 04:48 Edited at: 16th Jan 2011 06:46
Hey,

Does anyone have an idea of how I could use Newton physics on a complex, not completely convex object? Using the convex hull rigid bodies is pretty good, but it cuts corners (since it's convex). For example, if I have a humvee model and the hood and windshield is shaped like this:
___
----|_
-------|
Newton convex hull does the collision like this:
___
-----\
-------|

Any ideas how to work around this, or is there a command I'm not seeing that would create collision on a more advanced object?


Dar13
18
Years of Service
User Offline
Joined: 12th May 2008
Location: Microsoft VisualStudio 2010 Professional
Posted: 16th Jan 2011 06:37
Seems like the NDB_NewtonCreateCompoundCollision command is the one that'll do what you want. You'll have to generalize the shape of the humvee though.

Note: The above is assuming you want the windshield and hood to be like this:
_
|_| <-would be a box rigid body approximating the hood shape
| | <-would be the windshield and cab of humvee


Gil Galvanti
21
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 16th Jan 2011 06:46
Ah, yeah, just saw that, thanks. It seems you have to just make a compound object out of primitive shapes.


tiresius
23
Years of Service
User Offline
Joined: 13th Nov 2002
Location: MA USA
Posted: 16th Jan 2011 07:04
You can make a compound collision out of non-primitive shapes. The source collisions for the compound can be convex hulls.

Look at the last demo for time slicing, I have a catapult there which is a compound collision for the stem. It has a couple odd shapes to make the cup.

Good luck.


A 3D marble platformer using Newton physics.

Login to post a reply

Server time is: 2026-07-18 02:08:59
Your offset time is: 2026-07-18 02:08:59