예제 #1
0
    // HELPERS

    static void UpdateRotationState(RotationDirection direction, GameObject robotPart)
    {
        ArticulationJointController jointController = robotPart.GetComponent <ArticulationJointController>();

        if (jointController != null)
        {
            jointController.rotationState = direction;
        }
    }
예제 #2
0
 public void ForceJointsToRotations(float[] rotations)
 {
     for (int i = 0; i < rotations.Length; i++)
     {
         Joint joint = joints[i];
         ArticulationJointController jointController = joint.robotPart.GetComponent <ArticulationJointController>();
         jointController.ForceToRotation(0.0f);
         //jointController.ForceToRotation(rotations[i]);
     }
 }
예제 #3
0
    // READ

    public float[] GetCurrentJointRotations()
    {
        float[] list = new float[joints.Length];
        for (int i = 0; i < joints.Length; i++)
        {
            Joint joint = joints[i];
            ArticulationJointController jointController = joint.robotPart.GetComponent <ArticulationJointController>();
            float currentRotation = jointController.CurrentPrimaryAxisRotation();
            list[i] = currentRotation;
        }
        return(list);
    }