This project is read-only.

Moving a cube with the keyboard...

Apr 21, 2008 at 10:12 AM
Hello guys,
I wonder if someone knows how to make a cube moveable for a player : I mean I don't want to add forces each time the player press a Key :
I want to make a MoveTo and still have collisions with the others entities ( others entities get pushed if their mass is inferior or the player can't move if superior..)

Any ideas ?

Thank you in advance
Coordinator
Apr 23, 2008 at 10:38 AM
mhh.. this is an physic engine... and in a 'physics world' forces makes objects move... (okay, in JigLibX impulses...)
If you move you object directly you can't expect the engine to work correctly.

You should write a player controller which adds forces... See the hover controller code in the jiglibx-wiki-forum by jwatte!
Apr 23, 2008 at 7:05 PM
What I want is to simulate the player which is moving as a cube.
Here you can see in the first video http://bepu-games.com/BEPUphysics/mediasection.htm when the player move to the cube they fall : I don't think they use forces to move the camera.

I don't think it's really possible to manage the movements of a living entity by playing with forces :/
Apr 25, 2008 at 12:47 AM
Edited Apr 25, 2008 at 12:48 AM
For BEPUphysics, I actually do use impulses to control the dynamic character controller. These range from the ones pushing the character off the ground, to the friction forces, to movement forces, to jumping. In many games, non-dynamic character controllers are used- technically, these do not operate strictly on impulses. Instead, they essentially 'fake it' to have greater control over the feel, with the world responding almost indirectly (in terms of the physics engine) to the character's movement.

You can look at the source for the dynamic controller in the demos source in the downloads section of the bepuphysics website.