コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }