diff options
author | chai <215380520@qq.com> | 2023-05-10 18:09:12 +0800 |
---|---|---|
committer | chai <215380520@qq.com> | 2023-05-10 18:09:12 +0800 |
commit | 530881df3968089a8b07e0f9b79185b844d0cdd0 (patch) | |
tree | 6f61565923012e7e8e0c610a10928a5d39230201 /marching/Assets/Scripts/TestAABB.cs | |
parent | caeba98e0385edebb344e6dbd024c01801a75fc4 (diff) |
* raycast
Diffstat (limited to 'marching/Assets/Scripts/TestAABB.cs')
-rw-r--r-- | marching/Assets/Scripts/TestAABB.cs | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/marching/Assets/Scripts/TestAABB.cs b/marching/Assets/Scripts/TestAABB.cs new file mode 100644 index 0000000..ed33ab3 --- /dev/null +++ b/marching/Assets/Scripts/TestAABB.cs @@ -0,0 +1,32 @@ +using System.Collections; +using System.Collections.Generic; +using Unity.VisualScripting; +using UnityEngine; + +public class TestAABB : MonoBehaviour +{ + + public Vector4 ray; + + public Vector2 size; + + private void Awake() + { + + } + + private void OnDrawGizmos() + { + if(PhysicsManager.RayVsBox(ray, new Vector4(transform.position.x, transform.position.y, size.x, size.y))) + { + Gizmos.color = Color.red; + } + else + { + Gizmos.color = Color.white; + } + Gizmos.DrawLine(ray.xy().ToVector3(), ray.xy().ToVector3() + ray.zw().ToVector3()); + Gizmos.DrawCube(transform.position, size.ToVector3()); + } + +} |