From d2a574ba76c56c340d8ac0ad841344664bc2cc59 Mon Sep 17 00:00:00 2001 From: chai <215380520@qq.com> Date: Mon, 8 May 2023 18:40:58 +0800 Subject: + misc --- marching/Assets/Scripts/Physics/PhysicsManager.cs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'marching/Assets/Scripts/Physics/PhysicsManager.cs') diff --git a/marching/Assets/Scripts/Physics/PhysicsManager.cs b/marching/Assets/Scripts/Physics/PhysicsManager.cs index 5dff7d4..0577aa9 100644 --- a/marching/Assets/Scripts/Physics/PhysicsManager.cs +++ b/marching/Assets/Scripts/Physics/PhysicsManager.cs @@ -9,10 +9,26 @@ public static class PhysicsManager public static List quadTreeObjects = new List(); + private static List m_SharedCastResult = new List(); + public static bool CircleVsCircle(Vector2 pos1, float r1, Vector2 pos2, float r2) { - return false; + return (pos1 - pos2).magnitude < r1+r2; } + /// + /// box, pos+size + /// + /// + /// + public static List BoxCast(Vector4 box) + { + m_SharedCastResult.Clear(); + + if (TestQuadtree.quadtree.Retrieve(ref m_SharedCastResult, box)) + { + } + return m_SharedCastResult; + } } \ No newline at end of file -- cgit v1.1-26-g67d0