• Create Account

### #ActualMuzzy A

Posted 18 October 2012 - 11:39 PM

i feel like floating point inaccuracy is a part of the problem, but definately not all.

'm' is the mass of everything, including the sun. Gravity from all objects affect all objects.

I have no tangential velocity, i just have normal velocity being affected by gravity.

I'm using the Universal Gravitational Constant.

i scaled all the masses and the Gravitational constant just a bit to try to avoid floating point error.
I imagine that could be a problem as well?

// time step is based off the time between frames
float dt;
const double G_Constant;

Vec3 gravityAccel = (G_Constant*objMass/distSqu) * direction  ;
velocity -= gravityAccel * dt;


### #2Muzzy A

Posted 18 October 2012 - 11:36 PM

i feel like floating point inaccuracy is a part of the problem, but definately not all.

'm' is the mass of everything, including the sun. Gravity from all objects affect all objects.

I have no tangential velocity, i just have normal velocity being affected by gravity.

I'm using the Universal Gravitational Constant.

i scaled all the masses and the Gravitational constant just a bit to try to avoid floating point error.
I imagine that could be a problem as well?

// time step is based off the time between frames
float dt;

const double G_Constant;
Vec3 gravityAccel = (G_Constant*objMass/distSqu) * direction  ;
velocity -= gravityAccel * dt;


### #1Muzzy A

Posted 18 October 2012 - 11:34 PM

i feel like floating point inaccuracy is a part of the problem, but definately not all.

'm' is the mass of everything, including the sun. Gravity from all objects affect all objects.

I have no tangential velocity, i just have normal velocity being affected by gravity.

I'm using the Universal Gravitational Constant.

// time step is based off the time between frames
float dt;

const double G_Constant;
Vec3 gravityAccel = (G_Constant*objMass/distSqu) * direction  ;
velocity -= gravityAccel * dt;


PARTNERS