Is Newton what I need for my project?

cyberjunk

06-02-2012 15:22:56

Dear community,

first I'd like to thank all you great devs out there working on Ogre!
As a skilled programmer with the mathematical background knowledge of linear algebra,
I was able to get pretty far within just a single week of prototyping (thanks to your robust and easy to use framework!).

However currently I'm wondering, wether I should be using newton for collisions in my project or not.

So far I've done the following:
1) I've implemented basic collisions based on the "Minimal Ogre Collision Toolkit" (http://code.google.com/p/minimal-ogre-c ... n-toolkit/)
This is working great on a simple PLANE (y=0). In fact I got a "Ninja Avatar" (the scene node I'm moving around by keys) and a bunch of giant ogre heads.
I cannot walk through the heads anymore thanks to the collision lib.

2) I've also followed the "Terrain Collision Detection" in the Intermediate Tutorial 2 (http://www.ogre3d.org/tikiwiki/Intermediate+Tutorial+2)
As long as I don't combine it with the collisiontoolkit from 1 it's also working nicely, my Ninja Avatar (=AvatarNode) is staying on the Terrain ground while moving.
(I think it's well known, that MOC is not working with terrain, in my case it just gives me an application freeze/crash if I use it on terrain scenes.)

What I now need to find out is, wether my following requirements can be easily "selfcoded" (ray queries) or if I do myself a favour and pick newton for these jobs.
(However I feel like newton may be a little overpowered for my requirements).

1) I need a collision detection and avoidance for (AvatarNode<-->SceneNode and AvatarNode<-->Terrain).
I don't need anything like "simulating" the collision. Just detecting it and preventing (resetting/adjusting the movement) it would be fine.
Also I don't need any collision detections for other situations like (SceneNode<-->SceneNode, SceneNode<-->Terrain), just the Node I'm controlling.
However what I do want is "walking up hills that are smooth" and "collide with hills that are to "steep").

2) I want my objects to be able to "stay on top" of each other by default. Let's say my "Avatar Ninja" jumps down a hill and lands on a house (SceneNode), I want my AvatarNinja stay on the roof top.

3) I want my objects to follow gravity in a minimal manner. (A SceneNode without a ground below it's feet should start falling).
However I do not need it to be physically correct, for example a constant "fall velocity" / "linear falling" would be just fine.
But what I need to know is, wether my AvatarNode for example "successfully jumped across a canyon" or wether it failed and did not reach the other end of the jump before losing too much height and finally collide with the wall instead of landing on it.

In fact that is all I need.
So would YOU be using Newton in this case?
Or would you just stay with selfcoded "ray queries"?
I already have some of the "manual ray-queries" in mind...
however may be Newton will handle all this for me more easily?

Thanks for all your answers.

kind regards,
cyberjunk