Ejemplo n.º 1
0
        public virtual void OnEvent(Event ev)
        {
            if (ev.Code != Event.TRACK)
            {
                return;
            }
            try
            {
                Hand       hand = Hand.NONE;
                TrackEvent tev  = ev as TrackEvent;
                Vec3       p    = WorldFromTrack2D(tev.Position);

                if (tev.PartIndex == Skeleton.LEFT_HAND)
                {
                    hand        = Hand.LEFT;
                    LeftHandPos = p;
                }
                else if (tev.PartIndex == Skeleton.RIGHT_HAND)
                {
                    hand         = Hand.RIGHT;
                    RightHandPos = p;
                }
                else if (tev.Type == TrackEvent.USER_MOVE)
                {
                    if (InActiveArea(p))
                    {
                        OnMove(hand, p, null);
                    }
                    else
                    {
                        OnStop(hand);
                    }
                }
            }
            catch (Exception) { }
            foreach (HandTracker child in children)
            {
                child.OnEvent(ev);
            }
        }
Ejemplo n.º 2
0
 internal static HandleRef getCPtr(TrackEvent obj)
 {
     return((obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr);
 }