Skip to main content
GameDev.net gamedev.net
🔒 Locked

Mouse-Driven Spaceflight

Started by CadetUmfer Oct 24, 2011 at 11:53 PM 0 replies 1k views
Original Post
CadetUmfer
CadetUmfer
I'm making a 3D space combat demo, and I want to mimic Freelancer's mouse-driven control scheme. If you aren't familiar with it: you hold down a mouse button while your cursor moves freely around the screen, and the nose of your ship "follows" it. A spring camera keeps the ship within the boundaries of the screen.

To do this, I use the normalized X/Y mouse controls to scale rotations around the ship's X/Y axes. This more or less works, but I get unintended rolling that makes the controls unintuitive.

The part I'm having trouble with is managing the ship's roll. While I have explicit roll controls, I'd like for beginners to not have to use them, and have the ship's roll managed for them. When the player moves their mouse to the right edge of the screen, the ship should roll say 30 degrees and then rotate around its starting Up vector. Also, when a player shops steering (lets go of the mouse button), the ship should roll back to it's starting Up vector.

Does anyone have any info on this?
Anthony Umfer
chaosavy
chaosavy
I grab my ship's roll and then tell the AI to roll in the opposite direction to get back to "0" roll - I don't auto roll when the player is in control - but the AI auto rolls after all the other turns are completed to face a target. Sounds like you just need to grab the ship's roll and use your existing controls to do the opposite to 0 it out.

Visit http://www.VoidDestroyer.com to check out my space sim project - Void Destroyer

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.