public float GetJointAngle1() { float angle = 0.0f; if (m_joint != null) { dNewtonJointDoubleHingeActuator joint = (dNewtonJointDoubleHingeActuator)m_joint; angle = joint.GetAngle1(); } return(angle); }
public override void Create() { NewtonBody child = GetComponent <NewtonBody>(); dMatrix matrix = Utils.ToMatrix(m_posit, Quaternion.Euler(m_rotation)); IntPtr otherBody = (m_otherBody != null) ? m_otherBody.GetBody().GetBody() : new IntPtr(0); m_joint = new dNewtonJointDoubleHingeActuator(matrix, child.GetBody().GetBody(), otherBody); TargetAngle0 = m_targetAngle0; AngularRate0 = m_angularRate0; MaxTorque0 = m_maxTorque0; TargetAngle1 = m_targetAngle1; AngularRate1 = m_angularRate1; MaxTorque1 = m_maxTorque1; }
public override void InitJoint() { NewtonBody child = GetComponent <NewtonBody>(); dMatrix matrix = Utils.ToMatrix(m_Pivot, m_Pin0, m_Pin1); IntPtr otherBody = (m_OtherBody != null) ? m_OtherBody.GetBody().GetBody() : IntPtr.Zero; m_Joint = new dNewtonJointDoubleHingeActuator(matrix, child.GetBody().GetBody(), otherBody); TargetAngle0 = m_TargetAngle0; AngularRate0 = m_AngularRate0; MaxTorque0 = m_MaxTorque0; TargetAngle1 = m_TargetAngle1; AngularRate1 = m_AngularRate1; MaxTorque1 = m_MaxTorque1; EnableCollision = m_EnableCollision; }