Jump to content
  • Advertisement
Sign in to follow this  

Euler method for unconstrained Rigid Body Dynamics

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

Well, I wrote my rigid body class and a class to implement the euler method. I've chosen for my rigid body class the following state variables: position, orientation, linear and angular velocities( more intuitive ). So the state derivate is given by: dx(t)/dt = v(t) dR(t)/dt = w(t) * R(t) dv(t)/dt = F(t)/M dw(t)/dt = invI(t) * ( T(t) - w(t) x ( I(t) * w(t) ) ) x:position v:linear velocity R:orientation w:angular velocity F(t): force applied to the body at time t T(t): torque applied to the rigid body at time t invI: inverse of the world inertia tensor I: world inertia tensor *: product x: cross product I update the rigid body state like this: x(t+dt) = x(t) + v(t)dt; R(t+dt) = R(t) + w(t)*R(t)dt v(t+dt) = v(t) + F(t)dt/M w(t+dt) = w(t) + invI(t) * ( T(t) - w(t) x ( I(t) * w(t) ) )dt I was wondering if theoretically, updating the state that way v(t+dt) = v(t) + F(t)dt/M x(t+dt) = x(t) + v(t+dt)dt; w(t+dt) = w(t) + invI(t) * ( T(t) - w(t) x ( I(t) * w(t) ) )dt R(t+dt) = R(t) + w(t+dt) * R(t)dt was better. I had another idea: actually, we obtain by integrating the motion of a particle( a point mass ), when all quantities( functions ) are continuous: x(t) = xo + vo.dt + a.t.t/2 v(t) = vo + a.t xo and vo being respectively the initial position and speed, and a, a constant acceleration. and hence, x(t+dt) = x(t) + v(t)dt + a(t).t.t/2 v(t+dt) = v(t) + a(t)t could be an integration method. I then wondered if actually such a method is used in games: v(t+dt) = v(t) + F(t)dt/M x(t+dt) = x(t) + v(t)dt + F(t)dtdt/(2M); w(t+dt) = w(t) + invI(t) * ( T(t) - w(t) x ( I(t) * w(t) ) )dt R(t+dt) = R(t) + w(t)*R(t)dtdt/2 This would simply be analoguous to the precedent integration method( x(t+dt) = x(t) + v(t)dt + a(t).t.t/2 ... ) Is such a "method" used in games( or are there similar methods? ) , and if so, is it really better? Thanks for the replies.

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!