Page 1 of 1

Terrain and objects collision with IrrNewt...

Posted: Fri Sep 07, 2007 12:15 pm
by Mushketer888
Hi all!
I am newbie in programming with newton Physics Engine and i have a question:
How can i make collision (with help of IrrNewt...or any else?) with my terrain and object/s?

Posted: Fri Sep 07, 2007 7:44 pm
by roxaz

terrain collision in irrnewt 0.4 is probably broken

Posted: Tue Sep 11, 2007 4:30 am
by buhatkj
well this is the external stuff forum, so i don't think it's the wrong place for this, since it's not a newton-internal specific question, but one about using irrnewt to do this according to the subject line.

that said, the only news i have for you is not good. in irrnewt 0.4 which i'm using there is supposed to be a collision type you can use called EBT_TREE_TERRAIN, but in trying to use this I continually have been getting a runtime access violation which i have so far been unable to solve. I have tried using the normal EBT_TREE collision type with a terrain scene node as well, but it fails to respond correctly to collisions, it simply acts like it's not even there. EBT_TREE works great for BSP type level geometry but not terrain, which is why I guess EBT_TREE_TERRAIN is there, but as far as I can tell it is broken, at least in irrnewt 0.4 which is what I'm using and I think is the most recent version.

Posted: Wed Sep 12, 2007 9:18 am
by Mushketer888
Well...big thanks for your reply...can you tell me which physics engine is better(and simplier) to use(not IrrNewt)...because i tried to do something with: Newton,Bullet,ODE...but i can't understand a lot...if there would be an example like terrain collision with Newton,it would be great!
...i'm too stupid... :-( ...i want to make my strategy game...but i can't understand Newton collisions (almost) :-(

Posted: Fri Sep 14, 2007 6:17 pm
by Jacky_J
You could try bullet. Here's a demo that might help
http://www.bulletphysics.com/Bullet/php ... f=17&t=830

Or you can look at some of my source code:
http://irrlamb.googlecode.com/svn/trunk ... errain.cpp
http://irrlamb.googlecode.com/svn/trunk ... hysics.cpp

The hardest part is converting an irrlicht mesh into a bullet mesh. Once you have that, it's pretty easy.

Posted: Fri Sep 14, 2007 6:29 pm
by white tiger
Since the collisions between any body and the terrain in the irrnewt's terrain demo (terrain_and_cameraFPS.exe, included in the SDK) works well, and the terrain body is an EBT_TREE_TERRAIN, and also the debug informations are right, EBT_TREE_TERRAIN is not broken

Posted: Sat Sep 15, 2007 4:23 am
by Kim2
This might help you Mushketer, it's a small project I made that uses convex hulls, static meshes, materials and a few other functions of newton with 3ds files. You control a space ship that moves with the application of forces and torque, and if you uncomment a few things you can shoot projectiles. Turn left when the program first starts and you will see a cube you can push around.

It's pretty sketchy and the code for Newton is all lumped into one class file (this was the first time I had used Newton) but you will be able to work out how to use Newton if you study it for a while.

http://rapidshare.com/files/55824563/31 ... t.rar.html

In the case of your terrain you would want to model it physically using a static mesh. Any objects that need to move around (and have mass etc.) will be modeled using convex hulls.