private static void BoxBox(Manifold manifold, PhysShapeAabb a, PhysShapeAabb b, float flip, out CollisionFeatures features) { var aRect = new AlignedRectangle(manifold.A.Entity.Transform.WorldPosition, a.LocalBounds.Size / 2); var bRect = new AlignedRectangle(manifold.B.Entity.Transform.WorldPosition, b.LocalBounds.Size / 2); CalculateCollisionFeatures(in aRect, in bRect, flip, out features); }
private static void CircleBBox(Manifold manifold, PhysShapeCircle a, PhysShapeAabb b, bool flip, out CollisionFeatures features) { var aRad = a.Radius; var aPos = manifold.A.Entity.Transform.WorldPosition; var bBox = b.LocalBounds.Translated(manifold.B.Entity.Transform.WorldPosition); CalculateCollisionFeatures(in bBox, new Circle(aPos, aRad), flip, out features); }
private static void CircleBox(Manifold manifold, PhysShapeCircle a, PhysShapeAabb b, float flip, out CollisionFeatures features) { var aRad = a.Radius; var aPos = manifold.A.Entity.Transform.WorldPosition; var bRect = new AlignedRectangle(manifold.B.Entity.Transform.WorldPosition, b.LocalBounds.Size / 2); CalculateCollisionFeatures(bRect, new Circle(aPos, aRad), (float)flip * -1, out features); }