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
6 changes: 3 additions & 3 deletions src/Box2D.NET.Samples/Samples/Collisions/Manifold.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
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-macos-latest-9

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

private B2ShapeUnion m_us;
Expand Down Expand Up @@ -91,7 +91,7 @@

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:
Expand Down
6 changes: 3 additions & 3 deletions src/Box2D.NET/B2Contacts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions src/Box2D.NET/B2Manifolds.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
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 @@ -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)
Expand Down
Loading