Moderators: Sascha Willems, walaber
dFloat lastAngle = m_curJointAngle.GetAngle();
dFloat sinAngle;
dFloat cosAngle;
CalculateAngle(matrix1.m_up, matrix0.m_up, matrix1.m_front, sinAngle, cosAngle);
m_curJointAngle.Update(cosAngle, sinAngle);
dFloat curAngle = m_curJointAngle.GetAngle();
dFloat curOmega = (curAngle - lastAngle) / timestep;
dFloat desiredAccel = NewtonCalculateSpringDamperAcceleration(timestep, m_accel, curAngle, m_damp, curOmega);
NewtonUserJointAddAngularRow(joint, curAngle, &matrix1.m_front[0]);
NewtonUserJointSetRowAcceleration(m_joint, desiredAccel);
NewtonUserJointSetRowStiffness(m_joint, m_stiffness * 0.4f);
Users browsing this forum: No registered users and 29 guests