Jump to content
  • Advertisement
Sign in to follow this  
  • entries
  • comments
  • views

Preserving velocity on a path???

Sign in to follow this  


Ok. So I've got the basic framework for how the pathing is going to work. Various nodes and control-points in the scene. Each path starts with a "path manager" node and attaches more nodes from there. Then you attach your object to the manager node and it tells the object its new position on every call to "update".

Fine and dandy. Then I had a look around and realised one of the problems people are running into with these curved paths is that if you just use "take x seconds to move through this curve", then you will sometimes get jerky changes in velocity between curve intervals. Ideally what I would like is to be able to preserve the velocity from the previous interval and smoothly transition to the new velocity at the end of the current interval. However, as the engine needs to be able to correctly position objects based on the current time (not a time delta), the interval needs to know how long it should take to complete.

So after thinking long and hard about this and drawing lots of graphs, etc, I've come to the conclusion that such an algorithm (if it exists) would be too costly and complicated to bother implementing. The nodes can move in world-space, so the velocity-smoothing algorithm would have to be re-run to allow for the changing length of the curve. The length of the curve would have to be re-calculated (by using a suitable number of sub-intervals on the curve for approximation). Bah. I've been writting this engine with a focus on speedy rendering of dynamic objects. This seems like it'll bog the system down too much.

So anyway, back to the old "traverse the curve in x seconds" method. However, in the editor I will allow the user to pick froma few "preserve previous velocity" and "smoothly come to rest" style options. Hopefully it won't be that hard to keep the movement looking nice and smooth.
Sign in to follow this  


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 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!