Original Post
i''m building a game, where I want a spaceship whose motion is contorlled by the mouse, at the moment, i simply have its position be your mouse position, but this is not correct, because it is possible to whip the mouse around nearly instantaneously, and the ship''s should only be allowed to move as quickly as its thrusters and the game physics allow.
so I''m thinking that i need to have a fly-by-wire system like on modern aircraft; where the user input does not directly affect the vechicle, but instead sets a goal position, which the vehcle then needs to get to by itself.
I''m not quite sure how to do this though.
to keep things simple, my thruster is always either on or off, and a constant force - no variable throttle or anything like that
at first glance, i was thinking that i can simply aim the thruster in the direction of the goal position at all times, and have it fire constantly; but thinking this over, it would just result in orbiting or occilating around the goal position - you accelerate towards the goal, pass it, the thruster flips around, and deccelerates, but you''d end up swinging back and fourth between your origional position and one opposite the goal position
so i think i need to have the thruster begin decceleration before i even reach the goal position, but I dont know how to calculate where and when this point is
keep in mind that at any given point, the user might move the mouse and reset the goal position, also that the ship is not necessarially at rest initially
anyone have any ideas?
Thanks