Sign in to follow this  

[PyODE] Rotation of the box always corresponds motion direction

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this