Ejemplo n.º 1
0
    /// <summary>
    /// Update the pointers according to what is available in the PointerManager
    /// </summary>
    private void Update()
    {
        for (int i = 0; i < m_expectedPointerCount; ++i)
        {
            BeckonPointer curPointer = BeckonManager.BeckonInstance.PointerManager.GetPointer((uint)i);
            if (curPointer != m_currentPointers[i].m_pointer)             // If this is a different pointer, update it.
            {
                m_pointerChangedTimes[i] = Time.realtimeSinceStartup;
                if (curPointer != null)
                {
                    Omek.HandType hand = (curPointer.PointerJoint == Omek.JointID.leftFingerTip) ? Omek.HandType.Left : Omek.HandType.Right;

                    m_currentPointers[i] = new PointerData((int)curPointer.TrackedObjectID, hand, ConstrainPosition(curPointer.Position), curPointer);
                }
                else
                {
                    m_currentPointers[i] = UNAVAILABLE_HAND_POINTER;
                }
            }
            else if (curPointer != null)
            {
                m_currentPointers[i].m_position = ConstrainPosition(curPointer.Position);
            }
        }
    }
Ejemplo n.º 2
0
 /// <summary>
 /// Data representing a pointer
 /// </summary>
 /// <param name="personID">The person ID for which this pointer is for</param>
 /// <param name="hand">The hand which this pointer represents</param>
 /// <param name="pos">The position of the pointer</param>
 /// <param name="pointer">A reference to the wrapped BeckonPointer instance</param>
 public PointerData(int personID, Omek.HandType hand, Vector3 pos, BeckonPointer pointer)
 {
     m_personID = personID;
     m_hand     = hand;
     m_position = pos;
     m_pointer  = pointer;
 }