void update_last_hit(SculptCurveTool tool, Ray3f ray)
        {
            SORayHit soHit;

            // stick brush to target if we have one
            if (tool.BrushTarget != null)
            {
                Vector3d hitPos, hitNormal;
                bool     bHit = tool.BrushTarget.RayIntersect(ray, out hitPos, out hitNormal);
                if (bHit)
                {
                    lastHitPosW = (Vector3f)hitPos;
                }
            }
            else if (in_draw)
            {
                lastHitPosW = curDrawFrameW.RayPlaneIntersection(ray.Origin, ray.Direction, 2);
            }
            else if (SceneUtil.FindNearestRayIntersection(tool.Targets, ray, out soHit))
            {
                lastHitPosW = soHit.hitPos;
            }
            else
            {
                Frame3f f = new Frame3f(lastHitPosW, context.ActiveCamera.Forward());
                lastHitPosW = f.RayPlaneIntersection(ray.Origin, ray.Direction, 2);
            }
        }
Beispiel #2
0
        public bool FindRayIntersection(Ray3f ray, out SORayHit hit)
        {
            hit = null;
            if (SelectionMode == SelectionModes.NoSelection)
            {
                return(false);
            }

            bool bHit = SceneUtil.FindNearestRayIntersection(vChildren, ray, out hit);

            if (bHit && SelectionMode == SelectionModes.SelectGroup)
            {
                hit.hitSO = this;
            }
            return(bHit);
        }
Beispiel #3
0
        public bool FindRayIntersection(Ray3f ray, out SORayHit hit)
        {
            hit = null;
            if (EnableSelection == false)
            {
                return(false);
            }

            bool bHit = SceneUtil.FindNearestRayIntersection(vChildren, ray, out hit);

            if (bHit)
            {
                hit.hitSO = this;
            }
            return(bHit);
        }