hey there,
I'm having some issues with using limits of revolute joints
the set-up is basically my swingarm is connected to the chassis with a revolute joint and a limit at -30 and 20 degrees. The rearwheel then is connected to the swingarm via a revolute joint to act as the motor that powers my motorbike
my problem is that the limits don't seem to do anything.
References:
SWF
pressing control (reverse) will swing the swing arm around so you'll see how its not working
my code for the swingarm (simplified):
thanks for the read.
I'm having some issues with using limits of revolute joints
the set-up is basically my swingarm is connected to the chassis with a revolute joint and a limit at -30 and 20 degrees. The rearwheel then is connected to the swingarm via a revolute joint to act as the motor that powers my motorbike
my problem is that the limits don't seem to do anything.
References:
SWF
pressing control (reverse) will swing the swing arm around so you'll see how its not working
my code for the swingarm (simplified):
Code:
var rearMotorDef:b2RevoluteJointDef = new b2RevoluteJointDef ()
rearMotorDef.Initialize (chassis, swingArm, new b2Vec2 (20 / Vals.RATIO, 6/ Vals.RATIO))
rearMotorDef.enableMotor = true
rearMotorDef.maxMotorTorque = 20
rearMotorDef.enableLimit = true
rearMotorDef.lowerAngle = -30 / (Math.PI/180)
rearMotorDef.upperAngle = 20 / (Math.PI/180)
var motor:b2RevoluteJoint = Vals._world.CreateJoint (rearMotorDef) as b2RevoluteJoint
rearMotorDef.Initialize (chassis, swingArm, new b2Vec2 (20 / Vals.RATIO, 6/ Vals.RATIO))
rearMotorDef.enableMotor = true
rearMotorDef.maxMotorTorque = 20
rearMotorDef.enableLimit = true
rearMotorDef.lowerAngle = -30 / (Math.PI/180)
rearMotorDef.upperAngle = 20 / (Math.PI/180)
var motor:b2RevoluteJoint = Vals._world.CreateJoint (rearMotorDef) as b2RevoluteJoint
thanks for the read.