Jump to content
  • Advertisement
Sign in to follow this  
CadetUmfer

Mouse-Driven Spaceflight

This topic is 2607 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!