diff --git a/src/Box2D.NET.Samples/Samples/Collisions/Manifold.cs b/src/Box2D.NET.Samples/Samples/Collisions/Manifold.cs index ab34d32..8e97ebb 100644 --- a/src/Box2D.NET.Samples/Samples/Collisions/Manifold.cs +++ b/src/Box2D.NET.Samples/Samples/Collisions/Manifold.cs @@ -283,7 +283,7 @@ public override void Step() B2Transform transform1 = new B2Transform(offset, b2Rot_identity); B2Transform transform2 = new B2Transform(b2Add(m_transform.p, offset), m_transform.q); - B2Manifold m = b2CollideSegmentAndCircle(ref segment, transform1, ref circle, transform2); + B2Manifold m = b2CollideSegmentAndCircle(segment, transform1, ref circle, transform2); B2Vec2 p1 = b2TransformPoint(transform1, segment.point1); B2Vec2 p2 = b2TransformPoint(transform1, segment.point2); @@ -367,7 +367,7 @@ public override void Step() B2Transform transform1 = new B2Transform(offset, b2Rot_identity); B2Transform transform2 = new B2Transform(b2Add(m_transform.p, offset), m_transform.q); - B2Manifold m = b2CollideSegmentAndCapsule(ref segment, transform1, capsule, transform2); + B2Manifold m = b2CollideSegmentAndCapsule(segment, transform1, capsule, transform2); B2Vec2 p1 = b2TransformPoint(transform1, segment.point1); B2Vec2 p2 = b2TransformPoint(transform1, segment.point2); @@ -473,7 +473,7 @@ public override void Step() B2Transform transform2 = new B2Transform(b2Add(m_transform.p, offset), m_transform.q); // b2Transform transform2 = {b2Add({-1.44583416f, 0.397352695f}, offset), m_transform.q}; - B2Manifold m = b2CollideSegmentAndPolygon(ref segment, transform1, ref rox, transform2); + B2Manifold m = b2CollideSegmentAndPolygon(segment, transform1, ref rox, transform2); B2Vec2 p1 = b2TransformPoint(transform1, segment.point1); B2Vec2 p2 = b2TransformPoint(transform1, segment.point2); diff --git a/src/Box2D.NET.Samples/Samples/Shapes/ModifyGeometry.cs b/src/Box2D.NET.Samples/Samples/Shapes/ModifyGeometry.cs index 5a9a22a..3128436 100644 --- a/src/Box2D.NET.Samples/Samples/Shapes/ModifyGeometry.cs +++ b/src/Box2D.NET.Samples/Samples/Shapes/ModifyGeometry.cs @@ -91,7 +91,7 @@ void UpdateShape() case B2ShapeType.b2_segmentShape: m_us.segment = new B2Segment(new B2Vec2(-0.5f * m_scale, 0.0f), new B2Vec2(0.75f * m_scale, 0.0f)); - b2Shape_SetSegment(m_shapeId, ref m_us.segment); + b2Shape_SetSegment(m_shapeId, m_us.segment); break; case B2ShapeType.b2_polygonShape: diff --git a/src/Box2D.NET/B2Contacts.cs b/src/Box2D.NET/B2Contacts.cs index 84d8e6d..43af49b 100644 --- a/src/Box2D.NET/B2Contacts.cs +++ b/src/Box2D.NET/B2Contacts.cs @@ -81,19 +81,19 @@ internal static B2Manifold b2PolygonManifold(B2Shape shapeA, in B2Transform xfA, internal static B2Manifold b2SegmentAndCircleManifold(B2Shape shapeA, in B2Transform xfA, B2Shape shapeB, in B2Transform xfB, ref B2SimplexCache cache) { B2_UNUSED(cache); - return b2CollideSegmentAndCircle(ref shapeA.us.segment, xfA, ref shapeB.us.circle, xfB); + return b2CollideSegmentAndCircle(shapeA.us.segment, xfA, ref shapeB.us.circle, xfB); } internal static B2Manifold b2SegmentAndCapsuleManifold(B2Shape shapeA, in B2Transform xfA, B2Shape shapeB, in B2Transform xfB, ref B2SimplexCache cache) { B2_UNUSED(cache); - return b2CollideSegmentAndCapsule(ref shapeA.us.segment, xfA, shapeB.us.capsule, xfB); + return b2CollideSegmentAndCapsule(shapeA.us.segment, xfA, shapeB.us.capsule, xfB); } internal static B2Manifold b2SegmentAndPolygonManifold(B2Shape shapeA, in B2Transform xfA, B2Shape shapeB, in B2Transform xfB, ref B2SimplexCache cache) { B2_UNUSED(cache); - return b2CollideSegmentAndPolygon(ref shapeA.us.segment, xfA, ref shapeB.us.polygon, xfB); + return b2CollideSegmentAndPolygon(shapeA.us.segment, xfA, ref shapeB.us.polygon, xfB); } internal static B2Manifold b2ChainSegmentAndCircleManifold(B2Shape shapeA, in B2Transform xfA, B2Shape shapeB, in B2Transform xfB, ref B2SimplexCache cache) diff --git a/src/Box2D.NET/B2Manifolds.cs b/src/Box2D.NET/B2Manifolds.cs index 9c83aba..5babbdb 100644 --- a/src/Box2D.NET/B2Manifolds.cs +++ b/src/Box2D.NET/B2Manifolds.cs @@ -537,7 +537,7 @@ public static B2Manifold b2CollideCapsules(in B2Capsule capsuleA, in B2Transform } /// Compute the contact manifold between an segment and a capsule - public static B2Manifold b2CollideSegmentAndCapsule(ref B2Segment segmentA, in B2Transform xfA, in B2Capsule capsuleB, in B2Transform xfB) + public static B2Manifold b2CollideSegmentAndCapsule(in B2Segment segmentA, in B2Transform xfA, in B2Capsule capsuleB, in B2Transform xfB) { B2Capsule capsuleA = new B2Capsule(segmentA.point1, segmentA.point2, 0.0f); return b2CollideCapsules(capsuleA, xfA, capsuleB, xfB); @@ -1088,14 +1088,14 @@ public static B2Manifold b2CollidePolygons(ref B2Polygon polygonA, in B2Transfor } /// Compute the contact manifold between an segment and a circle - public static B2Manifold b2CollideSegmentAndCircle(ref B2Segment segmentA, in B2Transform xfA, ref B2Circle circleB, in B2Transform xfB) + public static B2Manifold b2CollideSegmentAndCircle(in B2Segment segmentA, in B2Transform xfA, ref B2Circle circleB, in B2Transform xfB) { B2Capsule capsuleA = new B2Capsule(segmentA.point1, segmentA.point2, 0.0f); return b2CollideCapsuleAndCircle(capsuleA, xfA, ref circleB, xfB); } /// Compute the contact manifold between an segment and a polygon - public static B2Manifold b2CollideSegmentAndPolygon(ref B2Segment segmentA, in B2Transform xfA, ref B2Polygon polygonB, in B2Transform xfB) + public static B2Manifold b2CollideSegmentAndPolygon(in B2Segment segmentA, in B2Transform xfA, ref B2Polygon polygonB, in B2Transform xfB) { B2Polygon polygonA = b2MakeCapsule(segmentA.point1, segmentA.point2, 0.0f); return b2CollidePolygons(ref polygonA, xfA, ref polygonB, xfB); diff --git a/src/Box2D.NET/B2Shapes.cs b/src/Box2D.NET/B2Shapes.cs index 6a13693..0a26cba 100644 --- a/src/Box2D.NET/B2Shapes.cs +++ b/src/Box2D.NET/B2Shapes.cs @@ -1502,7 +1502,7 @@ public static void b2Shape_SetCapsule(in B2ShapeId shapeId, in B2Capsule capsule b2ResetProxy(world, shape, wakeBodies, destroyProxy); } - public static void b2Shape_SetSegment(in B2ShapeId shapeId, ref B2Segment segment) + public static void b2Shape_SetSegment(in B2ShapeId shapeId, in B2Segment segment) { B2World world = b2GetWorldLocked(shapeId.world0); if (world == null)