From cb76d630fe1175bf8dfa1b6a16e92f42396f6bf2 Mon Sep 17 00:00:00 2001 From: freezy Date: Wed, 27 Nov 2024 21:23:40 +0100 Subject: [PATCH] chore: Clean up unused collider reference APIs. --- .../Physics/Collider/ColliderReference.cs | 41 +++---------------- 1 file changed, 5 insertions(+), 36 deletions(-) diff --git a/VisualPinball.Unity/VisualPinball.Unity/Physics/Collider/ColliderReference.cs b/VisualPinball.Unity/VisualPinball.Unity/Physics/Collider/ColliderReference.cs index f7ed8b372..5325373ba 100644 --- a/VisualPinball.Unity/VisualPinball.Unity/Physics/Collider/ColliderReference.cs +++ b/VisualPinball.Unity/VisualPinball.Unity/Physics/Collider/ColliderReference.cs @@ -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)) { @@ -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; @@ -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); @@ -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)) { @@ -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); @@ -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));