Advertisement Jump to content

Archived

This topic is now archived and is closed to further replies.

Guest

Simple 2d Physics

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

Guest
ok I'm trying to make a bullet move throught the air.
basicly I've got the following data to start with

SX = Starting X
SY = Starting Y
DX = Destination X sorta
DY = Destination Y sorta
V = Vilocity Along Line

and what I need is

XV = X vilocity
YV = Y vilocity

any Ideas?

------------------
Great Milenko

Words Of Wisdom:
"Never Stick A Pretzel In Your Butt It Might Break Off In There."


http://www.crosswinds.net/~milenko
http://www.crosswinds.net/~pirotech

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
Vx = Xd - Xs / t
Vy = Yd - Ys / t

t is total time. If t is not known, normalize the vector V, i.e.,

Vx = Xd - Xs
Vy = Yd - Ys
|V| = sqrt((Vx ** 2) + (Vy ** 2))
Vx /= |V|
Vy /= |V

Share this post


Link to post
Share on other sites

  • 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!