예제 #1
0
        public bool Intersects(ref Std.Engine.Core.Utilities.BoundingBox box, ref Std.Engine.Core.Utilities.Ray ray)
        {
            float distance;
            var   sbox = new BoundingBox(box.Minimum.ToSDXVector3(), box.Maximum.ToSDXVector3());
            var   sray = new Ray(ray.Origin.ToSDXVector3(), ray.Direction.ToSDXVector3());

            return(Collision.RayIntersectsBox(ref sray, ref sbox, out distance));
        }
예제 #2
0
        public bool Intersects(ref Std.Engine.Core.Utilities.BoundingBox box, ref Std.Engine.Core.Utilities.Ray ray, out System.Numerics.Vector3 point)
        {
            var sbox = new BoundingBox(box.Minimum.ToSDXVector3(), box.Maximum.ToSDXVector3());
            var sray = new Ray(ray.Origin.ToSDXVector3(), ray.Direction.ToSDXVector3());
            var res  = Collision.RayIntersectsBox(ref sray, ref sbox, out SharpDX.Vector3 p);

            point = p.ToNVector3();

            return(res);
        }