Last visit was: It is currently Thu Dec 05, 2024 11:00 am


All times are UTC-05:00




Post new topic Reply to topic  [18 posts ] 
Author Message
 Post subject:Re: Physics (Gravity)
PostPosted:Wed Sep 30, 2009 3:00 pm 
User avatar
 

Joined:Sun Feb 12, 2006 8:56 pm
Posts:1019
Website:http://eddieringle.com
Location:Detroit, MI
Quote:
If your player is at an angle, you would break the force into x and y components using sin and cos.
What?
EDIT: You mean xVel = cos(acceleration) and yVel = sin(acceleration)?

Also, what does fps stand for? Feet per second?
I understood pretty much everything else of that. :)

_________________
-- Eddie Ringle

Check out Elysian Shadows and consider backing us on Kickstarter!

====================================

Image


Top
Offline  
 Post subject:Re: Physics (Gravity)
PostPosted:Wed Sep 30, 2009 3:18 pm 
User avatar
 

Joined:Sat Jun 03, 2006 3:51 am
Posts:1186
Website:http://griffinhart.livejournal.com/
Yahoo Messenger:Squall591
AOL:FinalWarrior591
Location:Look at my horse, my horse is amazing!
Should be calculating and/or accelerating every frame, no?

-- Griffinhart

_________________
"My word is my honor. My honor is my life."
-- Demonchild, Angelkin, the Blackest Seraph, the Final Warrior

Image


Top
Offline  
 Post subject:Re: Physics (Gravity)
PostPosted:Wed Sep 30, 2009 9:26 pm 
 

Joined:Thu Apr 28, 2005 3:57 pm
Posts:175
AOL:DKWiz214
FPS stands for frames per second. This is how fast your game runs. Usually to convert acceleration into velocity you need to multiply acceleration * time (since accel is m/s^2 and vel is just m/s). So we have frames/s, but we need s. So 1/fps is s/frame, which is perfect since all these calculations have just taken place in 1 frame. So therefore, 1/fps is just s, so doing accel/fps gives you velocity.

And yes, xaccel = accel*cos(angle) and yaccel = accel*sin(angle).

And yes, you are doing this calculation every frame, which is why you use the fps in converting accel to vel and vel to pos.

_________________
The light shall be your demise.


Top
Offline  
Display posts from previous: Sort by 
Post new topic Reply to topic

All times are UTC-05:00


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Theme created by Miah with assistance from hyprnova