Example #1
0
        void HandleTapGesture(UITapGestureRecognizer sender)
        {
            SCNView areaPanned = sender.View as SCNView;
            CGPoint point      = sender.LocationInView(areaPanned);

            SCNHitTestResult[] hitResults = areaPanned.HitTest(point, new SCNHitTestOptions());
            SCNHitTestResult   hit        = hitResults.FirstOrDefault();

            if (hit != null)
            {
                SCNNode node = hit.Node;
                if (node != null)
                {
                    if (!isAnimating)
                    {
                        node.AddRotationAction(SCNActionTimingMode.Linear, 3, true);
                        isAnimating = true;
                    }
                    else
                    {
                        node.RemoveAction("rotation");
                        isAnimating = false;
                    }
                }
            }
        }