Esempio n. 1
0
        public static RayCollisionPoint GetCollision(Ray ray, BoundPlaneCollision plane)
        {
            RayCollisionPoint rcp = RayOnPlaneCollision.GetCollision(ray, plane, out float s1, out float s2);

            if (!rcp.DidCollide)
            {
                return(rcp);
            }

            rcp.SetCollide(plane.Restriction(s1, s2));

            return(rcp);
        }
Esempio n. 2
0
        public static Boolean GetCollision(SphereCollision collidableA, BoundPlaneCollision collidableB, out Vector3 position,
                                           out Vector3 normal, out float scale1, out float scale2)
        {
            if (SphereOnPlaneCollision.GetCollision(collidableA, collidableB, out position, out normal, out scale1, out scale2))
            {
                //Console.WriteLine($"SOBPC @{collidableB.Position + collidableB.Origin} + {scale1} * {collidableB.SpanVector1} + {scale2} * {collidableB.SpanVector2} = {position}");


                return(collidableB.Restriction(scale1, scale2));
            }

            return(false);
        }