Terrain and objects collision with IrrNewt...

Post your questions, suggestions and experiences regarding game design, integration of external libraries here. For irrEdit, irrXML and irrKlang, see the
ambiera forums
Post Reply
Mushketer888
Posts: 12
Joined: Sun Feb 25, 2007 6:08 pm

Terrain and objects collision with IrrNewt...

Post 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?
roxaz
Posts: 575
Joined: Tue Jan 23, 2007 8:35 pm
Location: LT

Post by roxaz »

buhatkj
Posts: 444
Joined: Fri Dec 12, 2003 4:53 am
Contact:

terrain collision in irrnewt 0.4 is probably broken

Post 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.
My irrlicht-based projects have gone underground for now, but if you want, check out my webcomic instead! http://brokenboomerang.net
Mushketer888
Posts: 12
Joined: Sun Feb 25, 2007 6:08 pm

Post 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) :-(
Jacky_J
Posts: 55
Joined: Fri Apr 27, 2007 5:01 am

Post 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.
white tiger
Posts: 269
Joined: Tue Oct 31, 2006 3:24 pm
Contact:

Post 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
Kim2
Posts: 14
Joined: Thu May 31, 2007 12:40 am

Post 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.
Post Reply