Ejemplo n.º 1
0
    // Note: this method is somewhat expensive, and called fairly often.  A better
    // approach to region/region hit testing could be implemented, to improve
    // performance and return more useful info (such as a collision-normal vector).
    internal static Region GetOverlap(RigidBodyBase body1, RigidBodyBase body2)
    {
        body1.UpdateGP(); body1.UpdateRgn();
        body2.UpdateGP(); body2.UpdateRgn();

        Region overlap = body1.rgncache.Clone();

        overlap.Intersect(body2.rgncache);
        return(overlap);
    }
Ejemplo n.º 2
0
    // Note: this method is somewhat expensive, and called fairly often.  A better
    // approach to region/region hit testing could be implemented, to improve
    // performance and return more useful info (such as a collision-normal vector).
    internal static Region GetOverlap(RigidBodyBase body1, RigidBodyBase body2)
    {
        body1.UpdateGP(); body1.UpdateRgn();
        body2.UpdateGP(); body2.UpdateRgn();

        Region overlap = body1.rgncache.Clone();
        overlap.Intersect(body2.rgncache);
        return overlap;
    }