yan007
23-08-2010 12:08:11
Hi all,
I have a weird problem, i have 2 hinge joints that I want to power separately, simplified code:
The strange part is togheter they don't work, but if I comment one out (for instance //leftJoint.WorldUpdated += new EventHandler(leftJoint_WorldUpdated);) it works,
It also works if I use constants instead of forceLeft and forceRight, but I need those variables to give different values depending on the user input.
Anyone has an idea of the cause?
I have a weird problem, i have 2 hinge joints that I want to power separately, simplified code:
leftJoint.WorldUpdated += new EventHandler(leftJoint_WorldUpdated);
rightJoint.WorldUpdated += new EventHandler(rightJoint_WorldUpdated);
void leftJoint_WorldUpdated(object sender, EventArgs e)
{
MogreNewt.BasicJoints.Hinge hinge = (MogreNewt.BasicJoints.Hinge)sender;
hinge.SetCallbackAccel(forceLeft);
}
void rightJoint_WorldUpdated(object sender, EventArgs e)
{
MogreNewt.BasicJoints.Hinge hinge2 = (MogreNewt.BasicJoints.Hinge)sender;
hinge2.SetCallbackAccel(forceRight);
}
The strange part is togheter they don't work, but if I comment one out (for instance //leftJoint.WorldUpdated += new EventHandler(leftJoint_WorldUpdated);) it works,
It also works if I use constants instead of forceLeft and forceRight, but I need those variables to give different values depending on the user input.
Anyone has an idea of the cause?