# [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:
http://jasonuniverse.appspot.com/file/ag1qYXNvbnVuaXZlcnNlcgwLEgRQbGlrGImkAQw
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:			contact.setBounce(4.0)			contact.setMu(0)			contact.setMu2(0)			j = ode.ContactJoint(self.odeWorld, self.odeContactGroup,contact=contact)			j.attach(self.odeGeom1.getBody(), self.odeGeom2.getBody())

## Create an account

Register a new account

• ## Partner Spotlight

• ### Forum Statistics

• Total Topics
627674
• Total Posts
2978558

• 11
• 11
• 10
• 12
• 22