User controlled movement
Posted: Tue May 18, 2010 7:40 pm
I'm trying to make a clone of SkyRoads (http://www.youtube.com/watch?v=F6Rovi9QSDk) and need some help imitating the behavior of the ship. The steering behaves as if there's infinite friction in right and left, x-axis (velocity changes are instant and movement stops when you let go of the right or left arrow) and zero in forward, z-axis (there's no deacceleration).
I've tried using this for the left/right steering:
But for some reason this hinders the movement in the z-axis. And since I don't want the ship to deaccelerate, I've set the static and dynamicfriction to 0 but it still speeds down.
The gravity also seems to be veeeeery low... The ship is roughly 5x3x2 units and gravity is set to -10. When I press the jump key I use ship.Entity.linearVelocity += Vector3.UnitY * 15.0f; It's as if everything is in slow-motion.
I've also experimented with bounciness but I only want the ship to bounce off the ground, not walls/obstacles.
I don't know if there's actually a need for an advanced physics engine as bepu, if anyone has another idéa of how to do this, please say so I didn't want to waste 90% of the time on collision detection/response as this is a school assignment mainly focused on the rendering.
Thanks!
I've tried using this for the left/right steering:
Code: Select all
if(ship.TouchesGround)
ship.Entity.linearVelocity *= new Vector(0, 1.0f, 1.0f); // Sets the x-axis velocity to 0
The gravity also seems to be veeeeery low... The ship is roughly 5x3x2 units and gravity is set to -10. When I press the jump key I use ship.Entity.linearVelocity += Vector3.UnitY * 15.0f; It's as if everything is in slow-motion.
I've also experimented with bounciness but I only want the ship to bounce off the ground, not walls/obstacles.
I don't know if there's actually a need for an advanced physics engine as bepu, if anyone has another idéa of how to do this, please say so I didn't want to waste 90% of the time on collision detection/response as this is a school assignment mainly focused on the rendering.
Thanks!