Fix for custom actuator joints

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Fix for custom actuator joints

Postby Leadwerks » Sat Apr 29, 2017 11:11 am

If limits are disabled, the motor should be able to move to any angle. Here's the fix.

In dCustomHingeActuator.cpp change this:
Code: Select all
void dCustomHingeActuator::SetTargetAngle(dFloat angle)
{
   m_angle = dClamp (angle, m_minAngle, m_maxAngle);
}


To this:
Code: Select all
void dCustomHingeActuator::SetTargetAngle(dFloat angle)
{
   if (m_limitsOn) {
      m_angle = dClamp(angle, m_minAngle, m_maxAngle);
   }
   else {
      m_angle = angle;
   }
}


In dCustomSliderActuator.cpp change this:
Code: Select all
void dCustomSliderActuator::SetTargetPosit(dFloat posit)
{
   m_posit = dClamp (posit, m_minPosit, m_maxPosit);
}


To this:
Code: Select all
void dCustomSliderActuator::SetTargetPosit(dFloat posit)
{
   if (m_limitsOn) {
      m_posit = dClamp(posit, m_minPosit, m_maxPosit);
   }
   else {
      m_posit = posit;
   }
}
User avatar
Leadwerks
 
Posts: 569
Joined: Fri Oct 27, 2006 2:54 pm

Re: Fix for custom actuator joints

Postby Julio Jerez » Sat Apr 29, 2017 12:29 pm

is it not support to have a switch to disable limits, you can just set the limit to a large number.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 20 guests