Stoo
11-09-2007 18:03:09
I'm still new to Ogre, so I may be missing something obvious -
I've got the following callback defined (Python, sorry guys!):
So the boxes start moving along the x-axis until they reach the point where they're as far along the x-axis as they are on the y-axis, and then should start trying to reverse direction.
This callback is used for a series of boxes set vertically at 0,0,0; 0,1,0; ... 0,7,0. The bottom box moves very little, and the box above it moves out a bit, then bounces back - as expected. But the boxes above move, start to slow down, and continuously print 'left' ... but never reverse direction.
Am I bumping into a damping mechanism of some sort? Or misusing a command? Or did I perhaps just misunderstand a function?
I've got the following callback defined (Python, sorry guys!):
def thrustCallback( self, body ):
body.addForce(body.getVelocity())
bodpos, bodorient = body.getPositionOrientation()
print bodpos, 'vel = ', body.getVelocity(),
if bodpos[0] > bodpos[1]:
body.addForce(bodorient * Ogre.Vector3(-2,0,0))
print ', left'
elif bodpos[0] <= bodpos[1]:
body.addForce(bodorient * Ogre.Vector3(2,0,0))
print ', right'
So the boxes start moving along the x-axis until they reach the point where they're as far along the x-axis as they are on the y-axis, and then should start trying to reverse direction.
This callback is used for a series of boxes set vertically at 0,0,0; 0,1,0; ... 0,7,0. The bottom box moves very little, and the box above it moves out a bit, then bounces back - as expected. But the boxes above move, start to slow down, and continuously print 'left' ... but never reverse direction.
Am I bumping into a damping mechanism of some sort? Or misusing a command? Or did I perhaps just misunderstand a function?