This is part of Math for Game Devs by Freya Holmér
Interactive Demo
Coverted to Three.js & R3F
- Create a component you can put on objects, to detect whether or not another transform is inside of its radius
- Draw debug gizmos to indicate inside/outside status
- Make the radius configurable
- Do not use colliders - this is a math exercise using vectors!