Jump to content
  • Advertisement
Sign in to follow this  
c0der_

Springs and cameras

This topic is 2712 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

Using hooke's law, I have some code from the game physics engine development book but this code doesn't return the object to the spring's equilibrium position,but rather the spring's actual position, so it seems wrong. My implementation however, makes the spring end at its equilibrium position.

To make the camera lag behind the character, is the spring supposed to always oscillate in a straight line?

Share this post


Link to post
Share on other sites
Advertisement

Using hooke's law, I have some code from the game physics engine development book but this code doesn't return the object to the spring's equilibrium position,but rather the spring's actual position, so it seems wrong. My implementation however, makes the spring end at its equilibrium position.


I cant really give any feedback without seeing your implementation. If you want to post up some code then I (or someone else) could have a look at it.


To make the camera lag behind the character, is the spring supposed to always oscillate in a straight line?


Yes, using just Hookes law will result in your camera continually oscillating. To get a stable camera which comes to rest you'll have to introduce spring damping (that is a force which is applied opposite to the cameras velocity direction and is proportional to the cameras speed).

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!