Esempio n. 1
0
        /// <summary>
        /// Finds the intersection point of the ray with the given plane. Checks
        /// for the ray being parallel with the plane or the ray pointing away
        /// from the plane</summary>
        /// <param name="plane">Must be constructed "by the rules" of Plane3F</param>
        /// <param name="intersectionPoint">The resulting intersection point or
        /// the zero-point if there was no intersection</param>
        /// <returns>True if the ray points towards the plane and intersects it</returns>
        public bool IntersectPlane(Plane3F plane, out Vec3F intersectionPoint)
        {
            // both the normal and direction must be unit vectors.
            float cos = Vec3F.Dot(plane.Normal, Direction);

            if (Math.Abs(cos) > 0.0001f)
            {
                // dist > 0 means "on the same side as the normal", aka, "the front".
                float dist = plane.SignedDistance(Origin);
                // There are two cases for the ray shooting away from the plane:
                // 1. If the ray is in front of the plane and pointing away,
                //  then 'cos' and 'dist' are both > 0.
                // 2. If the ray is in back of the plane and pointing away,
                //  then 'cos' and 'dist' are both < 0.
                // So, if the signs are the same, then there's no intersection.
                // So, if 'cos' * 'dist' is positive, then there's no intersection.
                if (cos * dist < 0.0)
                {
                    // There are two cases for the ray hitting the plane:
                    // 1. Origin is behind the plane, so the ray and normal are aligned
                    //  and 'dist' is < 0. We need to negate 'dist'.
                    // 2. Origin is in front of the plane, so the ray needs to be negated
                    //  so that cos(angle-180) is calculated. 'dist' is > 0.
                    // Either way, we've got a -1 thrown into the mix. Tricky!
                    float t = -dist / cos;
                    intersectionPoint = Origin + (Direction * t);
                    return(true);
                }
            }
            intersectionPoint = new Vec3F(0, 0, 0);
            return(false);
        }
Esempio n. 2
0
 /// <summary>
 /// Finds the intersection point of the ray with the given plane. Checks
 /// for the ray being parallel with the plane or the ray pointing away
 /// from the plane</summary>
 /// <param name="plane">Must be constructed "by the rules" of Plane3F</param>
 /// <param name="intersectionPoint">The resulting intersection point or
 /// the zero-point if there was no intersection</param>
 /// <returns>True if the ray points towards the plane and intersects it</returns>
 public bool IntersectPlane(Plane3F plane, out Vec3F intersectionPoint)
 {
     // both the normal and direction must be unit vectors.
     float cos = Vec3F.Dot(plane.Normal, Direction);
     if (Math.Abs(cos) > 0.0001f)
     {
         // dist > 0 means "on the same side as the normal", aka, "the front".
         float dist = plane.SignedDistance(Origin);
         // There are two cases for the ray shooting away from the plane:
         // 1. If the ray is in front of the plane and pointing away,
         //  then 'cos' and 'dist' are both > 0.
         // 2. If the ray is in back of the plane and pointing away,
         //  then 'cos' and 'dist' are both < 0.
         // So, if the signs are the same, then there's no intersection.
         // So, if 'cos' * 'dist' is positive, then there's no intersection.
         if (cos * dist < 0.0)
         {
             // There are two cases for the ray hitting the plane:
             // 1. Origin is behind the plane, so the ray and normal are aligned
             //  and 'dist' is < 0. We need to negate 'dist'.
             // 2. Origin is in front of the plane, so the ray needs to be negated
             //  so that cos(angle-180) is calculated. 'dist' is > 0.
             // Either way, we've got a -1 thrown into the mix. Tricky!
             float t = -dist / cos;
             intersectionPoint = Origin + (Direction * t);
             return true;
         }
     }
     intersectionPoint = new Vec3F(0, 0, 0);
     return false;
 }
Esempio n. 3
0
        private void TestToStringWithCulture(CultureInfo culture)
        {
            CultureInfo originalCulture = Thread.CurrentThread.CurrentCulture;
            Thread.CurrentThread.CurrentCulture = culture;
            try
            {
                string listSeparator = culture.TextInfo.ListSeparator;
                string decimalSeparator = culture.NumberFormat.NumberDecimalSeparator;
                var normal = new Vec3F(1.1f, 2.2f, 3.3f);
                normal.Normalize();
                var o = new Plane3F(normal, 4.4f);

                string s = o.ToString(null, null);
                TestToStringResults(o, s, listSeparator, decimalSeparator);

                string s2 = o.ToString();
                Assert.AreEqual(s, s2);

                s = o.ToString("G", culture);
                TestToStringResults(o, s, listSeparator, decimalSeparator);

                s = o.ToString("R", culture);
                TestToStringResults(o, s, listSeparator, decimalSeparator);
            }
            finally
            {
                Thread.CurrentThread.CurrentCulture = originalCulture;
            }
        }
Esempio n. 4
0
        /// <summary>
        /// Transforms the given plane by this matrix</summary>
        /// <param name="p">Input plane</param>
        /// <param name="transposeOfInverse">Transpose of the inverse of this matrix, for performance reasons</param>
        /// <param name="result">Output plane</param>
        public void Transform(Plane3F p, Matrix4F transposeOfInverse, out Plane3F result)
        {
            Vec3F normal = p.Normal;
            Vec3F point  = p.PointOnPlane();

            TransformNormal(normal, transposeOfInverse, out normal);
            Transform(point, out point);
            normal.Normalize();
            result = new Plane3F(normal, point);
        }
Esempio n. 5
0
        /// <summary>
        /// Transforms the given plane by this matrix</summary>
        /// <param name="p">Input plane</param>
        /// <param name="result">Output plane</param>
        public void Transform(Plane3F p, out Plane3F result)
        {
            Vec3F normal = p.Normal;
            Vec3F point  = p.PointOnPlane();

            TransformNormal(normal, out normal);
            Transform(point, out point);
            normal.Normalize();
            result = new Plane3F(normal, point);
        }
Esempio n. 6
0
        public override bool Pick(ViewControl vc, Point scrPt)
        {
            m_hitRegion = HitRegion.None;
            if (base.Pick(vc, scrPt) == false)
                return false;

            Camera camera = vc.Camera;
            float rad;
            Util.CalcAxisLengths(camera, HitMatrix.Translation, out rad);
            float tolerance = rad / 10.0f;

            // compute ray in object space  space.
            Matrix4F vp = camera.ViewMatrix * camera.ProjectionMatrix;
            Matrix4F wvp = HitMatrix * vp;            
            Ray3F rayL = vc.GetRay(scrPt, wvp);

            Plane3F xplane = new Plane3F(Vec3F.XAxis, Vec3F.ZeroVector);
            Plane3F yplane = new Plane3F(Vec3F.YAxis,Vec3F.ZeroVector);
            Plane3F zplane = new Plane3F(Vec3F.ZAxis,Vec3F.ZeroVector);

            Vec3F pt;
            float xdelta = float.MaxValue;            
            float ydelta = float.MaxValue;
            float zdelta = float.MaxValue;
            if(rayL.IntersectPlane(xplane,out pt))
            {
                xdelta = Math.Abs(pt.Length - rad); 
            }

            if (rayL.IntersectPlane(yplane, out pt))
            {
                ydelta = Math.Abs(pt.Length - rad);              
            }

            if (rayL.IntersectPlane(zplane, out pt))
            {
                zdelta = Math.Abs(pt.Length - rad);
            }

            if(xdelta < tolerance && xdelta < ydelta && xdelta < zdelta)
            {
                m_hitRegion = HitRegion.XAxis;                
            }
            else if(ydelta < tolerance && ydelta < zdelta)
            {
                m_hitRegion = HitRegion.YAxis;
            }
            else if(zdelta < tolerance)
            {
                m_hitRegion = HitRegion.ZAxis;
            }

            return m_hitRegion != HitRegion.None;
        }
Esempio n. 7
0
 private void TestToStringResults(Plane3F o, string s, string listSeparator, string decimalSeparator)
 {
     string[] results = s.Split(new[] { listSeparator }, StringSplitOptions.RemoveEmptyEntries);
     Assert.AreEqual(results.Length, 4);
     foreach (string oneFloatString in results)
         Assert.True(oneFloatString.Contains(decimalSeparator));
     Assert.AreEqual(float.Parse(results[0]), o.Normal.X);
     Assert.AreEqual(float.Parse(results[1]), o.Normal.Y);
     Assert.AreEqual(float.Parse(results[2]), o.Normal.Z);
     Assert.AreEqual(float.Parse(results[3]), o.Distance);
 }
Esempio n. 8
0
        public override void OnDragging(ViewControl vc, Point scrPt)
        {
            if (m_hitRegion == HitRegion.None || m_activeOp == null || m_activeOp.NodeList.Count == 0)
                return;
            Camera cam = vc.Camera;

            Matrix4F view = cam.ViewMatrix;
            Matrix4F proj = cam.ProjectionMatrix;

            Matrix4F axisMtrx = HitMatrix * view;
            Ray3F hitRay = HitRayV;
            Ray3F dragRay = vc.GetRay(scrPt, proj);
            
            Vec3F xAxis = axisMtrx.XAxis;
            Vec3F yAxis = axisMtrx.YAxis;
            Vec3F zAxis = axisMtrx.ZAxis;
            Vec3F origin = axisMtrx.Translation;
            
            Vec3F rotAxis = new Vec3F();            
            float theta = 0;

            float snapAngle = ((ISnapSettings)DesignView).SnapAngle;
            switch (m_hitRegion)
            {                
                case HitRegion.XAxis:
                    {
                        Plane3F xplane = new Plane3F(xAxis, origin);
                        theta = CalcAngle(origin, xplane, hitRay, dragRay, snapAngle);
                        rotAxis = HitMatrix.XAxis;                        
                    }
                    break;
                case HitRegion.YAxis:
                    {
                        Plane3F yplane = new Plane3F(yAxis, origin);
                        theta = CalcAngle(origin, yplane, hitRay, dragRay, snapAngle);
                        rotAxis = HitMatrix.YAxis;                        
                    }
                    break;
                case HitRegion.ZAxis:
                    {
                        Plane3F zplane = new Plane3F(zAxis, origin);
                        theta = CalcAngle(origin, zplane, hitRay, dragRay, snapAngle);
                        rotAxis = HitMatrix.ZAxis;
                    }
                    break;
                case HitRegion.LookAxis:
                    {                        
                        // for billboard objects the look vector is object's negative position in viewspace.
                        Vec3F lookAxis = Vec3F.Normalize(-origin);
                        Plane3F plane = new Plane3F(lookAxis, origin);
                        theta = CalcAngle(origin, plane, hitRay, dragRay, snapAngle);                        
                        rotAxis = m_lookAxisHitMtrx.ZAxis;
                    }
                    break;
                default:
                    throw new ArgumentOutOfRangeException();
            }

            AngleAxisF axf = new AngleAxisF(-theta, rotAxis);
            Matrix4F deltaMtrx = new Matrix4F(axf);                                   
            Matrix4F rotMtrx = new Matrix4F();

            for (int i = 0; i < m_activeOp.NodeList.Count; i++)
            {
                ITransformable node = m_activeOp.NodeList[i];                              
                rotMtrx.Mul(m_rotations[i], deltaMtrx);                
                float ax, ay, az;
                rotMtrx.GetEulerAngles(out ax, out ay, out az);                                
                node.Rotation = new Vec3F(ax, ay, az);      
            }
        }
Esempio n. 9
0
        public override void OnDragging(ViewControl vc, Point scrPt)
        {
            if (m_hitRegion == HitRegion.None || NodeList.Count == 0)
                return;
            Camera cam = vc.Camera;

            Matrix4F view = cam.ViewMatrix;
            Matrix4F mtrx = cam.ProjectionMatrix;

            Matrix4F axisMtrx = HitMatrix * view;
            Ray3F hitRay = HitRayV;
            Ray3F dragRay = vc.GetRay(scrPt, mtrx);
            
            Vec3F xAxis = axisMtrx.XAxis;
            Vec3F yAxis = axisMtrx.YAxis;
            Vec3F zAxis = axisMtrx.ZAxis;
            Vec3F origin = axisMtrx.Translation;
            
            Vec3F rotAxis = new Vec3F();
            float theta = 0;
            
            switch (m_hitRegion)
            {                
                case HitRegion.XAxis:
                    {
                        Plane3F xplane = new Plane3F(xAxis, origin);
                        theta = CalcAngle(origin, xplane, hitRay, dragRay);
                        rotAxis = HitMatrix.XAxis;                     
                    }
                    break;
                case HitRegion.YAxis:
                    {
                        Plane3F yplane = new Plane3F(yAxis, origin);
                        theta = CalcAngle(origin, yplane, hitRay, dragRay);
                        rotAxis = HitMatrix.YAxis;

                    }
                    break;
                case HitRegion.ZAxis:
                    {
                        Plane3F zplane = new Plane3F(zAxis, origin);
                        theta = CalcAngle(origin, zplane, hitRay, dragRay);
                        rotAxis = HitMatrix.ZAxis;
                    }
                    break;
                default:
                    throw new ArgumentOutOfRangeException();
            }

            AngleAxisF axf = new AngleAxisF(-theta, rotAxis);
            Matrix4F deltaMtrx = new Matrix4F(axf);                                   
            Matrix4F rotMtrx = new Matrix4F();            
            for (int i = 0; i < NodeList.Count; i++)
            {                                
                ITransformable node = NodeList[i];                
                rotMtrx.Set(m_rotations[i]);
                rotMtrx.Mul(rotMtrx, deltaMtrx);                
                float ax, ay, az;
                rotMtrx.GetEulerAngles(out ax, out ay, out az);                
                node.Rotation = new Vec3F(ax,ay,az);
            }

        }
Esempio n. 10
0
 /// <summary>
 /// Constructs a plane from another plane</summary>
 /// <param name="plane">Other plane</param>
 public Plane3F(Plane3F plane)
 {
     Normal = plane.Normal;
     Distance = plane.Distance;
 }
Esempio n. 11
0
        public HitRegion Pick(Matrix4F world, Matrix4F view, Ray3F rayL, Ray3F rayV, float s)
        {
            m_hitRegion = HitRegion.None;
            m_hitRayV = rayV;

            m_hitMatrix.Set(world);
            m_hitWorldView = world * view;
            
            float sl = s * SquareLength;
           

            // test xy square.            
            Vec3F p1 = new Vec3F(0, 0, 0);
            Vec3F p2 = new Vec3F(sl, 0, 0);
            Vec3F p3 = new Vec3F(sl, sl, 0);
            Vec3F p4 = new Vec3F(0, sl, 0);
            Plane3F plane = new Plane3F(p1, p2, p3);
            Vec3F p;
            if (rayL.IntersectPlane(plane, out p))
            {
                // test point in 2d rectangle.
                if (p.X > p1.X && p.X < p2.X
                    && p.Y > p1.Y && p.Y < p4.Y)
                {
                    m_hitRegion = HitRegion.XYSquare;
                    return m_hitRegion;
                }

            }

            // test xz square
            p1 = new Vec3F(0, 0, 0);
            p2 = new Vec3F(sl, 0, 0);
            p3 = new Vec3F(sl, 0, sl);
            p4 = new Vec3F(0, 0, sl);
            plane = new Plane3F(p1, p2, p3);
            if (rayL.IntersectPlane(plane, out p))
            {
                // test point in 2d rectangle.
                if (p.X > p1.X && p.X < p2.X
                    && p.Z > p1.Z && p.Z < p4.Z)
                {
                    m_hitRegion = HitRegion.XZSquare;
                    return m_hitRegion;
                }

            }


            // test yz square
            p1 = new Vec3F(0, 0, 0);
            p2 = new Vec3F(0, 0, sl);
            p3 = new Vec3F(0, sl, sl);
            p4 = new Vec3F(0, sl, 0);
            plane = new Plane3F(p1, p2, p3);
            if (rayL.IntersectPlane(plane, out p))
            {
                // test point in 2d rectangle.
                if (p.Z > p1.Z && p.Z < p2.Z
                    && p.Y > p1.Z && p.Y < p4.Y)
                {
                    m_hitRegion = HitRegion.YZSquare;
                    return m_hitRegion;
                }

            }

            Vec3F min = new Vec3F(-0.5f, -0.5f, -0.5f);
            Vec3F max = new Vec3F(0.5f, 0.5f, 0.5f);
            AABB box = new AABB(min, max);
            Matrix4F boxScale = new Matrix4F();
            Matrix4F boxTrans = new Matrix4F();
            Matrix4F BoxMtrx = new Matrix4F();

            // X axis
            boxScale.Scale(new Vec3F(s, s * br, s * br));
            boxTrans.Translation = new Vec3F(s / 2, 0, 0);
            BoxMtrx = boxScale * boxTrans;

            Ray3F ray = rayL;
            BoxMtrx.Invert(BoxMtrx);
            ray.Transform(BoxMtrx);            
            if (box.Intersect(ray))
            {
                m_hitRegion = HitRegion.XAxis;
                return m_hitRegion;
            }

            // y axis
            boxScale.Scale(new Vec3F(s * br, s, s * br));
            boxTrans.Translation = new Vec3F(0, s / 2, 0);
            BoxMtrx = boxScale * boxTrans;
            ray = rayL;
            BoxMtrx.Invert(BoxMtrx);
            ray.Transform(BoxMtrx);
            if (box.Intersect(ray))
            {
                m_hitRegion = HitRegion.YAxis;
                return m_hitRegion;
            }

            // z axis
            boxScale.Scale(new Vec3F(s * br, s * br, s));
            boxTrans.Translation = new Vec3F(0, 0, s / 2);
            BoxMtrx = boxScale * boxTrans;

            ray = rayL;
            BoxMtrx.Invert(BoxMtrx);
            ray.Transform(BoxMtrx);
            if (box.Intersect(ray))
            {
                m_hitRegion = HitRegion.ZAxis;
            }

            return m_hitRegion;
        }
Esempio n. 12
0
 /// <summary>
 /// Constructor</summary>
 public Frustum()
 {
     m_planes = new Plane3F[6];
 }
Esempio n. 13
0
 /// <summary>
 /// Constructor</summary>
 public Frustum()
 {
     m_planes = new Plane3F[6];
 }
Esempio n. 14
0
        private static float CalcAngle(Vec3F origin, Plane3F plane, Ray3F ray0, Ray3F ray1, float snapAngle)
        {
            float theta = 0;            
            Vec3F p0;
            Vec3F p1;

            if( ray0.IntersectPlane(plane, out p0)
                && ray1.IntersectPlane(plane, out p1))
            {
                Vec3F v0 = Vec3F.Normalize(p0 - origin);
                Vec3F v1 = Vec3F.Normalize(p1 - origin);
                theta = CalcAngle(v0, v1, plane.Normal, snapAngle);
            }
            return theta;
        }
Esempio n. 15
0
        public override bool Pick(ViewControl vc, Point scrPt)
        {            
            m_hitRegion = HitRegion.None;           
            if (base.Pick(vc, scrPt) == false) 
                return false;
                                   
            Camera camera = vc.Camera;
            float s;
            Util.CalcAxisLengths(camera, HitMatrix.Translation, out s);
                        
            Matrix4F vp = camera.ViewMatrix * camera.ProjectionMatrix;
            Matrix4F wvp = HitMatrix * vp;
            
            // get ray in object space  space.
            Ray3F rayL = vc.GetRay(scrPt, wvp);
            
            m_scale = new Vec3F(1, 1, 1);            
            m_hitScale = s;
                                               
            float rectScale = s*FreeRectRatio;                                               
            Vec3F topRight    = rectScale * (new Vec3F(1, 1, 0));
            Vec3F topLeft     = rectScale * (new Vec3F(-1, 1, 0));
            Vec3F bottomLeft  = rectScale * (new Vec3F(-1, -1, 0));
            Vec3F bottomRight = rectScale * (new Vec3F(1, -1, 0));
            Matrix4F planeXform = Util.CreateBillboard(HitMatrix.Translation, camera.WorldEye, camera.Up, camera.LookAt);
            Matrix4F wvpPlane = planeXform * vp;

            // create ray in plane's local space.
            Ray3F rayP = vc.GetRay(scrPt, wvpPlane);

            Plane3F plane = new Plane3F(topRight,topLeft,bottomLeft);
            Vec3F p;

            bool intersect = rayP.IntersectPlane(plane, out p);            
            if(intersect)
            {                
                bool inside = p.X > topLeft.X
                              && p.X < topRight.X
                              && p.Y > bottomLeft.Y
                              && p.Y < topLeft.Y;
                if (inside)
                {
                    m_hitRegion = HitRegion.FreeRect;
                    return true;
                }                    
            }

            Vec3F min = new Vec3F(-0.5f, -0.5f, -0.5f);
            Vec3F max = new Vec3F(0.5f, 0.5f, 0.5f);
            AABB box = new AABB(min, max);
            Matrix4F boxScale = new Matrix4F();
            Matrix4F boxTrans = new Matrix4F();
            Matrix4F BoxMtrx = new Matrix4F();

            float handleScale = s * HandleRatio;
            // X axis

            boxScale.Scale(new Vec3F(s, handleScale, handleScale));
            boxTrans.Translation = new Vec3F(s / 2, 0, 0);
            BoxMtrx = boxScale * boxTrans;            
            Ray3F ray = rayL;
            BoxMtrx.Invert(BoxMtrx);
            ray.Transform(BoxMtrx);

            if (box.Intersect(ray))
            {
                m_hitRegion = HitRegion.XAxis;
                return true;
            }

            // y axis
            boxScale.Scale(new Vec3F(handleScale, s, handleScale));
            boxTrans.Translation = new Vec3F(0, s / 2, 0);
            BoxMtrx = boxScale * boxTrans;
            ray = rayL;
            BoxMtrx.Invert(BoxMtrx);
            ray.Transform(BoxMtrx);
            if (box.Intersect(ray))
            {
                m_hitRegion = HitRegion.YAxis;
                return true;
            }

            // z axis
            boxScale.Scale(new Vec3F(handleScale, handleScale, s));
            boxTrans.Translation = new Vec3F(0, 0, s / 2);
            BoxMtrx = boxScale * boxTrans;

            ray = rayL;
            BoxMtrx.Invert(BoxMtrx);
            ray.Transform(BoxMtrx);
            if (box.Intersect(ray))
            {
                m_hitRegion = HitRegion.ZAxis;
                return true;
            }

            return false;
        }
Esempio n. 16
0
        public override bool Pick(ViewControl vc, Point scrPt)
        {
            m_hitRegion = HitRegion.None;
            if (base.Pick(vc, scrPt) == false)
                return false;

            Camera camera = vc.Camera;
            float RingDiameter = 2 * AxisLength;
            float s = Util.CalcAxisScale(vc.Camera, HitMatrix.Translation, RingDiameter, vc.Height);

            float rad = s * Util3D.RingCenterRadias;
            float lrad = rad * LookRingScale;
            float tolerance = s * Util3D.RingThickness;
            
            Matrix4F billboard
                = Util.CreateBillboard(HitMatrix.Translation, vc.Camera.WorldEye, vc.Camera.Up, vc.Camera.LookAt);
            m_lookAxisHitMtrx = billboard;
            // compute ray in object space  space.
            Matrix4F vp = camera.ViewMatrix * camera.ProjectionMatrix;
            Matrix4F wvp = HitMatrix * vp;            
            Ray3F rayL = vc.GetRay(scrPt, wvp);

            Matrix4F wvp2 = billboard * vp;
            Ray3F rayL2 = vc.GetRay(scrPt, wvp2);

            Plane3F xplane = new Plane3F(Vec3F.XAxis, Vec3F.ZeroVector);
            Plane3F yplane = new Plane3F(Vec3F.YAxis,Vec3F.ZeroVector);
            Plane3F zplane = new Plane3F(Vec3F.ZAxis, Vec3F.ZeroVector);
            

            Vec3F pt;
            float xdelta    = float.MaxValue;            
            float ydelta    = float.MaxValue;
            float zdelta    = float.MaxValue;
            float lookdelta = float.MaxValue;
            if(rayL.IntersectPlane(xplane,out pt))
            {
                xdelta = Math.Abs(pt.Length - rad); 
            }

            if (rayL.IntersectPlane(yplane, out pt))
            {
                ydelta = Math.Abs(pt.Length - rad);              
            }

            if (rayL.IntersectPlane(zplane, out pt))
            {
                zdelta = Math.Abs(pt.Length - rad);
            }

            if (rayL2.IntersectPlane(zplane, out pt))
            {
                lookdelta = Math.Abs(pt.Length - lrad);
            }

            if(xdelta < tolerance && xdelta < ydelta && xdelta < zdelta
                && xdelta < lookdelta)
            {
                m_hitRegion = HitRegion.XAxis;                
            }
            else if(ydelta < tolerance && ydelta < zdelta
                && ydelta < lookdelta)
            {
                m_hitRegion = HitRegion.YAxis;
            }
            else if(zdelta < tolerance && zdelta < lookdelta)
            {
                m_hitRegion = HitRegion.ZAxis;
            }
            else if (lookdelta < tolerance)
            {
                m_hitRegion = HitRegion.LookAxis;
            }

            return m_hitRegion != HitRegion.None;
        }
Esempio n. 17
0
 /// <summary>
 /// Constructs a plane from another plane</summary>
 /// <param name="plane">Other plane</param>
 public Plane3F(Plane3F plane)
 {
     Normal   = plane.Normal;
     Distance = plane.Distance;
 }