Jump to content
  • Advertisement
Sign in to follow this  
Sketchys

Steering Problem

This topic is 3608 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 trying to work out a system to let me move an object towards a destination, using a constant rate of change in speed and angle (in 2D). I have a moving object. It has an initial location (x,y), heading and speed. I also have a destination point (x,y). What I would like, is some way to calculate the constant acceleration and rate of turning (ie. degrees per frame) required to get the object to the destination point. I am not interested in the object's speed or heading when it reaches the final destination. I'm not using a "proper" programming language, so code examples won't be a lot of use me, but if anyone can help with the maths, then that would be amazing. I realize it's a pretty big ask, but if anyone could help me, or perhaps point me in the direction of some relevant articles then I'd really appreciate it. Thanks :)

Share this post


Link to post
Share on other sites
Advertisement
Using your initial position, heading, speed, and the target point, just solve for a spiral which has both points on it, and which has your initial heading tangential to it; to keep delta-theta constant, you'll need to include your initial velocity to calculate a constant delta-speed. This assumes that rotation of your vehicle causes no loss in velocity, and no slippage.

Share this post


Link to post
Share on other sites
Quote:
Original post by Sketchys
I'm trying to work out a system to let me move an object towards a destination, using a constant rate of change in speed and angle (in 2D).

I have a moving object. It has an initial location (x,y), heading and speed.
I also have a destination point (x,y).

What I would like, is some way to calculate the constant acceleration and rate of turning (ie. degrees per frame) required to get the object to the destination point.

I am not interested in the object's speed or heading when it reaches the final destination.

I'm not using a "proper" programming language, so code examples won't be a lot of use me, but if anyone can help with the maths, then that would be amazing.

I realize it's a pretty big ask, but if anyone could help me, or perhaps point me in the direction of some relevant articles then I'd really appreciate it.

Thanks :)
Are you familiar with Craig Reynolds' articles on steering behaviors? If not, you might check them out - I believe that 'arriving at a target location' is one of the behaviors discussed.

Share this post


Link to post
Share on other sites
Thanks a lot for your reply :)
Wyrframe:
You are right to assume there will be no loss of velocity and no slippage when turning, so hopefully that will be ok.

To be honest though, a lot of what you said went over my head.

Having looked into spirals a little, there appear to be several different kinds, with completely different formulae - eg. "equiangular", "archimedean" etc. How do I know which kind to use? Could you tell me how to calculate the equation of a spiral?

The main problem though, is that I don't understand how any of the parameters in the spiral equations, relate to the variables in my game - speed, heading, turning rate etc.

Could you please possibly go into a little more detail?



Jyk: Thanks for the suggestion. I will check out that article.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!