Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/Box2D.NET.Samples/Samples/Collisions/Manifold.cs
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,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 = b2CollideCircles(ref circle1, transform1, ref circle2, transform2);
B2Manifold m = b2CollideCircles(circle1, transform1, circle2, transform2);

DrawSolidCircle(m_draw, new B2Transform(circle1.center, transform1.q), circle1.radius, color1);
DrawSolidCircle(m_draw, new B2Transform(circle2.center, transform2.q), circle2.radius, color2);
Expand All @@ -262,7 +262,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 = b2CollideCapsuleAndCircle(capsule, transform1, ref circle, transform2);
B2Manifold m = b2CollideCapsuleAndCircle(capsule, transform1, circle, transform2);

B2Vec2 v1 = b2TransformPoint(transform1, capsule.center1);
B2Vec2 v2 = b2TransformPoint(transform1, capsule.center2);
Expand All @@ -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(segment, transform1, ref circle, transform2);
B2Manifold m = b2CollideSegmentAndCircle(segment, transform1, circle, transform2);

B2Vec2 p1 = b2TransformPoint(transform1, segment.point1);
B2Vec2 p2 = b2TransformPoint(transform1, segment.point2);
Expand All @@ -305,7 +305,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 = b2CollidePolygonAndCircle(ref box, transform1, ref circle, transform2);
B2Manifold m = b2CollidePolygonAndCircle(ref box, transform1, circle, transform2);

DrawSolidPolygon(m_draw, transform1, box.vertices.AsSpan(), box.count, m_round, color1);
DrawSolidCircle(m_draw, new B2Transform(circle.center, transform2.q), circle.radius, color2);
Expand Down Expand Up @@ -569,7 +569,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 = b2CollideChainSegmentAndCircle(segment, transform1, ref circle, transform2);
B2Manifold m = b2CollideChainSegmentAndCircle(segment, transform1, circle, transform2);

B2Vec2 g1 = b2TransformPoint(transform1, segment.ghost1);
B2Vec2 g2 = b2TransformPoint(transform1, segment.ghost2);
Expand Down
2 changes: 1 addition & 1 deletion src/Box2D.NET.Samples/Samples/Collisions/SmoothManifold.cs
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ public override void Draw()
for (int i = 0; i < m_count; ++i)
{
ref readonly B2ChainSegment segment = ref m_segments[i];
B2Manifold m = b2CollideChainSegmentAndCircle(segment, transform1, ref circle, transform2);
B2Manifold m = b2CollideChainSegmentAndCircle(segment, transform1, circle, transform2);
DrawManifold(m);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Box2D.NET.Samples/Samples/Shapes/ModifyGeometry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

private B2ShapeId m_shapeId;
private B2ShapeType m_shapeType;
private object m_shape;

Check warning on line 24 in src/Box2D.NET.Samples/Samples/Shapes/ModifyGeometry.cs

View workflow job for this annotation

GitHub Actions / test-windows-latest-10

The field 'ModifyGeometry.m_shape' is never used
private float m_scale;

private B2ShapeUnion m_us;
Expand Down Expand Up @@ -81,7 +81,7 @@
{
case B2ShapeType.b2_circleShape:
m_us.circle = new B2Circle(new B2Vec2(0.0f, 0.0f), 0.5f * m_scale);
b2Shape_SetCircle(m_shapeId, ref m_us.circle);
b2Shape_SetCircle(m_shapeId, m_us.circle);
break;

case B2ShapeType.b2_capsuleShape:
Expand Down
10 changes: 5 additions & 5 deletions src/Box2D.NET/B2Contacts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ public static class B2Contacts
internal static B2Manifold b2CircleManifold(B2Shape shapeA, in B2Transform xfA, B2Shape shapeB, in B2Transform xfB, ref B2SimplexCache cache)
{
B2_UNUSED(cache);
return b2CollideCircles(ref shapeA.us.circle, xfA, ref shapeB.us.circle, xfB);
return b2CollideCircles(shapeA.us.circle, xfA, shapeB.us.circle, xfB);
}

internal static B2Manifold b2CapsuleAndCircleManifold(B2Shape shapeA, in B2Transform xfA, B2Shape shapeB, in B2Transform xfB, ref B2SimplexCache cache)
{
B2_UNUSED(cache);
return b2CollideCapsuleAndCircle(shapeA.us.capsule, xfA, ref shapeB.us.circle, xfB);
return b2CollideCapsuleAndCircle(shapeA.us.capsule, xfA, shapeB.us.circle, xfB);
}

internal static B2Manifold b2CapsuleManifold(B2Shape shapeA, in B2Transform xfA, B2Shape shapeB, in B2Transform xfB, ref B2SimplexCache cache)
Expand All @@ -63,7 +63,7 @@ internal static B2Manifold b2CapsuleManifold(B2Shape shapeA, in B2Transform xfA,
internal static B2Manifold b2PolygonAndCircleManifold(B2Shape shapeA, in B2Transform xfA, B2Shape shapeB, in B2Transform xfB, ref B2SimplexCache cache)
{
B2_UNUSED(cache);
return b2CollidePolygonAndCircle(ref shapeA.us.polygon, xfA, ref shapeB.us.circle, xfB);
return b2CollidePolygonAndCircle(ref shapeA.us.polygon, xfA, shapeB.us.circle, xfB);
}

internal static B2Manifold b2PolygonAndCapsuleManifold(B2Shape shapeA, in B2Transform xfA, B2Shape shapeB, in B2Transform xfB, ref B2SimplexCache cache)
Expand All @@ -81,7 +81,7 @@ 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(shapeA.us.segment, xfA, ref shapeB.us.circle, xfB);
return b2CollideSegmentAndCircle(shapeA.us.segment, xfA, shapeB.us.circle, xfB);
}

internal static B2Manifold b2SegmentAndCapsuleManifold(B2Shape shapeA, in B2Transform xfA, B2Shape shapeB, in B2Transform xfB, ref B2SimplexCache cache)
Expand All @@ -99,7 +99,7 @@ internal static B2Manifold b2SegmentAndPolygonManifold(B2Shape shapeA, in B2Tran
internal static B2Manifold b2ChainSegmentAndCircleManifold(B2Shape shapeA, in B2Transform xfA, B2Shape shapeB, in B2Transform xfB, ref B2SimplexCache cache)
{
B2_UNUSED(cache);
return b2CollideChainSegmentAndCircle(shapeA.us.chainSegment, xfA, ref shapeB.us.circle, xfB);
return b2CollideChainSegmentAndCircle(shapeA.us.chainSegment, xfA, shapeB.us.circle, xfB);
}

internal static B2Manifold b2ChainSegmentAndCapsuleManifold(B2Shape shapeA, in B2Transform xfA, B2Shape shapeB, in B2Transform xfB, ref B2SimplexCache cache)
Expand Down
12 changes: 6 additions & 6 deletions src/Box2D.NET/B2Manifolds.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public static B2Polygon b2MakeCapsule(B2Vec2 p1, B2Vec2 p2, float radius)
// localAnchorB = qBc * (point - pB)
// anchorB = point - pB = qA * localAnchorA + pA - pB
// = anchorA + (pA - pB)
public static B2Manifold b2CollideCircles(ref B2Circle circleA, in B2Transform xfA, ref B2Circle circleB, in B2Transform xfB)
public static B2Manifold b2CollideCircles(in B2Circle circleA, in B2Transform xfA, in B2Circle circleB, in B2Transform xfB)
{
B2Manifold manifold = new B2Manifold();

Expand Down Expand Up @@ -80,7 +80,7 @@ public static B2Manifold b2CollideCircles(ref B2Circle circleA, in B2Transform x

/// Compute the contact manifold between a capsule and circle
/// Compute the collision manifold between a capsule and circle
public static B2Manifold b2CollideCapsuleAndCircle(in B2Capsule capsuleA, in B2Transform xfA, ref B2Circle circleB, in B2Transform xfB)
public static B2Manifold b2CollideCapsuleAndCircle(in B2Capsule capsuleA, in B2Transform xfA, in B2Circle circleB, in B2Transform xfB)
{
B2Manifold manifold = new B2Manifold();

Expand Down Expand Up @@ -145,7 +145,7 @@ public static B2Manifold b2CollideCapsuleAndCircle(in B2Capsule capsuleA, in B2T
}

/// Compute the contact manifold between a polygon and a circle
public static B2Manifold b2CollidePolygonAndCircle(ref B2Polygon polygonA, in B2Transform xfA, ref B2Circle circleB, in B2Transform xfB)
public static B2Manifold b2CollidePolygonAndCircle(ref B2Polygon polygonA, in B2Transform xfA, in B2Circle circleB, in B2Transform xfB)
{
B2Manifold manifold = new B2Manifold();
float speculativeDistance = B2_SPECULATIVE_DISTANCE;
Expand Down Expand Up @@ -1088,10 +1088,10 @@ public static B2Manifold b2CollidePolygons(ref B2Polygon polygonA, in B2Transfor
}

/// Compute the contact manifold between an segment and a circle
public static B2Manifold b2CollideSegmentAndCircle(in B2Segment segmentA, in B2Transform xfA, ref B2Circle circleB, in B2Transform xfB)
public static B2Manifold b2CollideSegmentAndCircle(in B2Segment segmentA, in B2Transform xfA, in B2Circle circleB, in B2Transform xfB)
{
B2Capsule capsuleA = new B2Capsule(segmentA.point1, segmentA.point2, 0.0f);
return b2CollideCapsuleAndCircle(capsuleA, xfA, ref circleB, xfB);
return b2CollideCapsuleAndCircle(capsuleA, xfA, circleB, xfB);
}

/// Compute the contact manifold between an segment and a polygon
Expand All @@ -1102,7 +1102,7 @@ public static B2Manifold b2CollideSegmentAndPolygon(in B2Segment segmentA, in B2
}

/// Compute the contact manifold between a chain segment and a circle
public static B2Manifold b2CollideChainSegmentAndCircle(in B2ChainSegment segmentA, in B2Transform xfA, ref B2Circle circleB, in B2Transform xfB)
public static B2Manifold b2CollideChainSegmentAndCircle(in B2ChainSegment segmentA, in B2Transform xfA, in B2Circle circleB, in B2Transform xfB)
{
B2Manifold manifold = new B2Manifold();

Expand Down
2 changes: 1 addition & 1 deletion src/Box2D.NET/B2Shapes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1460,7 +1460,7 @@ public static B2Polygon b2Shape_GetPolygon(in B2ShapeId shapeId)
return shape.us.polygon;
}

public static void b2Shape_SetCircle(in B2ShapeId shapeId, ref B2Circle circle)
public static void b2Shape_SetCircle(in B2ShapeId shapeId, in B2Circle circle)
{
B2World world = b2GetWorldLocked(shapeId.world0);
if (world == null)
Expand Down
Loading