Skip to content

Commit

Permalink
chore: Clean up unused collider reference APIs.
Browse files Browse the repository at this point in the history
  • Loading branch information
freezy committed Nov 27, 2024
1 parent 5963c0f commit cb76d63
Showing 1 changed file with 5 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -254,16 +254,6 @@ internal int Add(Line3DCollider collider, float4x4 matrix)
return collider.Id;
}

[Obsolete("Add with matrix only.")]
internal int Add(Line3DCollider collider)
{
collider.Id = Lookups.Length;
TrackReference(collider.Header.ItemId, collider.Header.Id);
Lookups.Add(new ColliderLookup(ColliderType.Line3D, Line3DColliders.Length));
Line3DColliders.Add(collider);
return collider.Id;
}

internal int Add(LineSlingshotCollider collider, float4x4 matrix)
{
if (LineSlingshotCollider.IsTransformable(matrix)) {
Expand All @@ -286,9 +276,8 @@ internal int Add(LineSlingshotCollider collider, float4x4 matrix)
return collider.Id;
}

internal int Add(LineCollider collider) => Add(collider, float4x4.identity);

internal int Add(LineCollider collider, float4x4 matrix)
internal int Add(LineCollider collider) => Add(collider, float4x4.identity); // used for the playfield only
private int Add(LineCollider collider, float4x4 matrix)
{
if (LineCollider.IsTransformable(matrix)) {
collider.Header.IsTransformed = true;
Expand All @@ -310,7 +299,7 @@ internal int Add(LineCollider collider, float4x4 matrix)
return collider.Id;
}

internal int Add(LineZCollider collider)
private int Add(LineZCollider collider)
{
collider.Id = Lookups.Length;
TrackReference(collider.Header.ItemId, collider.Header.Id);
Expand Down Expand Up @@ -354,16 +343,6 @@ internal int Add(PointCollider collider, float4x4 matrix)
return collider.Id;
}

[Obsolete("Add with matrix only.")]
internal int Add(PointCollider collider)
{
collider.Id = Lookups.Length;
TrackReference(collider.Header.ItemId, collider.Header.Id);
Lookups.Add(new ColliderLookup(ColliderType.Point, PointColliders.Length));
PointColliders.Add(collider);
return collider.Id;
}

internal int Add(SpinnerCollider collider, float4x4 matrix)
{
if (SpinnerCollider.IsTransformable(matrix)) {
Expand Down Expand Up @@ -399,17 +378,7 @@ internal int Add(TriangleCollider collider, float4x4 matrix)
return collider.Id;
}

[Obsolete("Add with matrix only.")]
internal int Add(TriangleCollider collider)
{
collider.Id = Lookups.Length;
TrackReference(collider.Header.ItemId, collider.Header.Id);
Lookups.Add(new ColliderLookup(ColliderType.Triangle, TriangleColliders.Length));
TriangleColliders.Add(collider);
return collider.Id;
}

internal int Add(PlaneCollider collider)
internal int Add(PlaneCollider collider) // used for the playfield only
{
collider.Id = Lookups.Length;
TrackReference(collider.Header.ItemId, collider.Header.Id);
Expand Down Expand Up @@ -446,7 +415,7 @@ internal void AddLine(float2 v1, float2 v2, float zLow, float zHigh, ColliderInf

internal void AddLineZ(float2 xy, float zLow, float zHigh, ColliderInfo info, float4x4 matrix)
{
if (KinematicColliders || !matrix.IsPureTranslationMatrix()) {
if (KinematicColliders || !matrix.IsPureTranslationMatrix()) { // todo support scale and z-rotation
Add(new Line3DCollider(new float3(xy.xy, zLow), new float3(xy.xy, zHigh), info), matrix);
} else {
Add(new LineZCollider(xy, zLow, zHigh, info).Transform(matrix));
Expand Down

0 comments on commit cb76d63

Please sign in to comment.