Jump to content
  • Advertisement
Sign in to follow this  

[PyODE] Rotation of the box always corresponds motion direction

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

Hello. Im using PyODE to do 2D physics in my game. I'm just learning to use ODE at the moment, so I've got one problem I can't solve. How to make the rotation of the box body to be always corresponding to the direction of it? For example take a look at this picture:
When blaster shot reach the lightsaber, it's obvious that it's rotation around it's axis will be corresponding to the direction (after reflection/bounce). Where should I make changes? Apply any methods to ode.Body or ode.GeomBox? Or some changes in collision handling?

contacts = ode.collide(self.odeGeom1, self.odeGeom2)
for contact in contacts:
j = ode.ContactJoint(self.odeWorld, self.odeContactGroup,contact=contact)
j.attach(self.odeGeom1.getBody(), self.odeGeom2.getBody())

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!