예제 #1
0
    void Awake()
    {
        leftHand = new HydraHand(SixenseHands.LEFT);
        rightHand = new HydraHand(SixenseHands.RIGHT);

        areHandsCalibrated = false;
    }
예제 #2
0
    // Initialization
    //------------------
    void Awake()
    {
        m_instance = this;

        //Collision lists
        m_leftInstrumentProximity  = new List <GameObject>();
        m_rightInstrumentProximity = new List <GameObject>();
        m_leftInstrumentInterior   = new List <GameObject>();
        m_rightInstrumentInterior  = new List <GameObject>();
        m_leftHandHydra            = m_leftHand.GetComponent <HydraHand>();
        m_rightHandHydra           = m_rightHand.GetComponent <HydraHand>();

        m_leftGlove  = m_leftHand.GetComponent <GloveController>();
        m_rightGlove = m_rightHand.GetComponent <GloveController>();
    }
    /** Updates hand position and rotation */
    void UpdateHand(HydraHand hand)
    {
        bool bControllerActive = IsControllerActive(hand.m_controller);

        if (bControllerActive)
        {
            hand.transform.localPosition = (hand.m_controller.Position - m_baseOffset) * m_sensitivity * (mirror?-1:1);
            hand.transform.localRotation = hand.m_controller.Rotation * hand.InitialRotation;
        }
        else
        {
            // use the inital position and orientation because the controller is not active
            hand.transform.localPosition = hand.InitialPosition;
            hand.transform.localRotation = hand.InitialRotation;
        }
    }