예제 #1
0
    public float GetJointAngle()
    {
        float angle = 0.0f;

        if (m_joint != null)
        {
            dNewtonJointHingeActuator joint = (dNewtonJointHingeActuator)m_joint;
            angle = joint.GetAngle();
        }
        return(angle);
    }
예제 #2
0
    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 dNewtonJointHingeActuator(matrix, child.GetBody().GetBody(), otherBody);

        TargetAngle = m_targetAngle;
        AngularRate = m_angularRate;
        MaxTorque   = m_maxTorque;
    }
        public override void InitJoint()
        {
            NewtonBody child     = GetComponent <NewtonBody>();
            dMatrix    matrix    = Utils.ToMatrix(m_Pivot, m_Pin);
            IntPtr     otherBody = (m_OtherBody != null) ? m_OtherBody.GetBody().GetBody() : IntPtr.Zero;

            m_Joint = new dNewtonJointHingeActuator(matrix, child.GetBody().GetBody(), otherBody);

            TargetAngle     = m_TargetAngle;
            AngularRate     = m_AngularRate;
            MaxTorque       = m_MaxTorque;
            EnableCollision = m_EnableCollision;
        }