i have a small problem and could use some help please.
i have this set up when moving forwards: walkingDirection.addLocal(modelForwardDir.mult(vspd * tpf * thrust));
vspd is a constant speed, and thrust is 0f to 5.0f increments of 0.2f when hitting the ‘forward’ key
when i hit a wall, i want to bounce off and i try this: walkingDirection.addLocal(modelForwardDir.negate().multLocal(vspd * tpf * thrust));
it tends to stick to the wall for a second and then bounce back, or gets stuck to the wall if I’m going to fast. The thrust reduces down to 0f when the up key isn’t pressed.
Thanks. (NOTE: I already tried the hovertank example, but when i hit a wall the tank turns sideways, upside down, etc.) I keep hitting a metaphor for a wall myself with this.
I think your issue may be that you are using walking direction to simulate physics restitution.
…thus when you ‘change direction’ you have to overcome forward momentum before you see reverse movement. It’s just a guess, though.
If that’s the case then I’m not entirely sure why you are using a physics engine if you don’t really want physics collision and restitution. 50% of a physics engine is collision detection and 50% of a physics engine is contact resolution. The “movement” part is immeasurably small in comparison and can be written in three or four lines of code in the simple case.