Game Development Community

Inconstant orbit

by Blake Horton · in Torque Game Builder · 02/16/2010 (6:54 pm) · 4 replies

First, I am reletively new to torque. What I am attempting to accomplish is a realistic orbit based on a gravity constant and the mass / distance between two objects. The code should account for multiple instances of the satellites. If you can provide code examples please use the names Planet and Satellite, thanks for any and all help.

About the author

Student, majoring in game and simulation programming. Have any entry level / internship opportunities available? Contact me at sup3rscript3d@gmail.com.

Recent Threads


#1
02/16/2010 (8:22 pm)
torque isn't built to provide "realistic" gravitational forces, basically you can mount a satellite to a planet with a mount offset and have it rotate at a predefined velocity, would that be what you're looking for
#2
02/16/2010 (8:40 pm)
No, but I am not really looking for a realistic gravity in that actual sense of the word...here's my thinking. I would set up a collision circle...or test for the nearest instance of type satellite and then apply my gravity equation to that object. I was thinking. Gravity = (G*M*m)/(R*R) where G is a gravity constant, M is mass 1, m is mass2 and R is the distance between the objects... the result of this equation would be the amount of motion for the satellite instance to move toward the Planets center. I just don't know how "code wise" to accomplish this goal.
#4
02/17/2010 (2:05 am)
HA! just what I needed, much thanks.