//private Vector3 currentPosition;

    // Use this for initialization
    void Start()
    {
        // disable the whole task initially to give time for the experimenter to use the UI
        // gameObject.SetActive(false);

        movementType = new AlignedHandCursor();

        //determine the offset (from the controller) for the hand cursor
        handPosOffset = realHand.transform.localPosition;
    }
Beispiel #2
0
        public static AbstractCursorMovement Movement(this CursorMovementType type)
        {
            switch (type)
            {
            case CursorMovementType.PositionControl:
                return(new PositionCursorMovement());

            case CursorMovementType.VelocityControl:
                return(new VelocityCursorMovement());

            case CursorMovementType.AccelerationControl:
                return(new AccelerationCursorMovement());
            }
            throw new System.Exception(type.ToString());
        }
    public void SetMovementType(Trial trial)
    {
        string type = trial.settings.GetString("type");

        rotation        = trial.settings.GetFloat("cursor_rotation");
        experiment_mode = trial.settings.GetString("experiment_mode");
        // set the rotation for the trial


        if (type.Equals("clamped"))
        {
            movementType = new ClampedHandCursor();
            //Debug.Log("MovementType set to : Clamped");
        }
        else if (type.Equals("rotated"))
        {
            movementType = new RotatedHandCursor(rotation);
        }
        else
        {
            movementType = new AlignedHandCursor();
            //Debug.Log("MovementType set to : Aligned");
        }
    }