Page 1 of 1

Can it be done with irrlicht?

Posted: Thu Apr 13, 2006 6:23 pm
by Blitz
Hey,

Normally i would ask this kind of question. However, i'm getting a bit short on time and don't have enough time to learn something then to find out i can't do what i want with it. So here's the deal. We're doing a univ project. And what i need is to be able tilt the world in different ways so that a ball in that world starts to roll and pick up speed only through gravity. I've seen the animator examples with collision detection. It's a start, but i need it to start rolling on any surface that's not completly flat becuase of gravity. Is this possible in a simple and quick way? Or can irrlicht only do FPS kind of collision response were you only slide against walls and not any non flat surface ?

Posted: Thu Apr 13, 2006 6:27 pm
by magicat
I'm not sure if Irrlicht alone can accomplish gravity, I don't think so. But, it is very easy to integrate Irrlicht with a nice phsysics engine. I recommended Newton, heres a tutorial on it if you're interested: http://irrlicht.sourceforge.net/tut_newton.html.

Posted: Thu Apr 13, 2006 7:32 pm
by hybrid
You might also take the normal vector of the triangle your ball is lying on and offset it into the direction it would be rolling to. Additionally use a rotation animation which rotates the ball depending on its offset. Could be possible, though this is completely faking the laws of physic.

Posted: Thu Apr 13, 2006 8:10 pm
by Guest
What i had in mind was adding the colliding surfaces normals scaled to the velocity vector of the ball. The way I see it this is what happens in reality. The surface applies as large force in it's normal direction as the body is pressing on it.

And as for gravity, is just an acceleration in the negative y direction. So those parts aren't a problem.

What is, is if i can get the normals of the surfaces which the sphere collides. Maybe a code snippet?

Posted: Sun Apr 23, 2006 1:23 am
by Melancor
There is a game called NEVERBALL
This game is pretty much the kind of what you want to make I believe. It also comes with a mini-golf based on the same engine (don't know which though).
The developer seems to provide support, maybe you can get additional help there regarding your project :)

Image