Ejemplo n.º 1
0
        /// <summary>
        /// called on click-down
        /// </summary>
        override public void Begin(SceneObject so, Vector2d downPos, Ray3f downRayWorld)
        {
            SORayHit hit;

            if (TargetSO.FindRayIntersection(downRayWorld, out hit) == false)
            {
                return;
            }

            Vector3d scenePos = SceneTransforms.WorldToSceneP(this.Scene, hit.hitPos);

            if (have_source == false)
            {
                CurrentSourceHitPosS = new Frame3f(scenePos);

                sourceIndicator = new SphereIndicator()
                {
                    SceneFrameF = () => { return(CurrentSourceHitPosS); },
                    Radius      = fDimension.Scene(SourceIndicatorSizeScene * 0.5),
                    ColorF      = () => { return(Colorf.Orange); }
                };
                indicators.AddIndicator(sourceIndicator);

                have_source     = true;
                source_modified = true;
            }
            else if (have_extent == false)
            {
                CurrentExtentHitPosS = new Frame3f(scenePos);

                extentIndicator = new SphereIndicator()
                {
                    SceneFrameF = () => { return(CurrentExtentHitPosS); },
                    Radius      = fDimension.Scene(ExtentIndicatorSizeScene * 0.5),
                    ColorF      = () => { return(Colorf.CornflowerBlue); }
                };
                indicators.AddIndicator(extentIndicator);

                have_extent     = true;
                extent_modified = true;
            }
        }