示例#1
0
        public AaRect GetBodyFitRect(Rigidbody body)
        {
            var c = body.fixtureCache.capsule;
            var r = new Vec2(c.radius, c.radius);

            return(new AaRect(
                       Vec2.Min(c.p0, c.p1) - r,
                       Vec2.Max(c.p0, c.p1) + r
                       ));
        }
示例#2
0
 public static AaRect Merge(AaRect a, AaRect b)
 {
     return(new AaRect(Vec2.Min(a.min, b.min), Vec2.Max(a.max, b.max)));
 }