Gravity and Meshes
-
isiahil
Gravity and Meshes
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
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 );
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
)
-
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]
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]