Gravity and Meshes

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
isiahil

Gravity and Meshes

Post by isiahil »

How do you make it so that if i load in a mesh it is affected by gravity and touchs the ground like the camera? Code please
yin nadie
Posts: 43
Joined: Wed Mar 31, 2004 1:03 pm
Location: Seville, Spain
Contact:

Post by yin nadie »

This does work. (at least it does for me ^__^) In order to achievethies effect you use the collisionersponse aniamtor, that implements also gravity

Code: Select all

	core::aabbox3d<f32> box = object->getBoundingBox();
	scene::ISceneNodeAnimatorCollisionResponse* collider;
	collider = device->getSceneManager()->createCollisionResponseAnimator(
		metaSelector, objeto, box.MaxEdge - box.getCenter(),
		core::vector3df( 0,-100.0,0), 100.0, core::vector3df(0,0,0), 0.0005f);
	object->addAnimator( collider );
Tyn
Posts: 932
Joined: Thu Nov 20, 2003 7:53 pm
Location: England
Contact:

Post by Tyn »

Better ( in my view, I haven't seen that code in action yet ) to use a physics engine as it includes everything you could need to build a realistic world. Gravity, friction etc. I like the look of Newton, that's the one I am going to use but there are others. They are on the front page of this site and implementation in Irrlicht is in the external tutorials ( forgot who wrote it, sorry :oops: )
Acki

Post by Acki »

Yes, an dynamics engine is the best choise !!!
I'm using the "Open Dynamics Engine", it's a free engine, like Irrlicht !!!
U can find it here: http://q12.org/ode/


Cu, Acki[/url]
Post Reply