TotallyNotHuman 546 Posted January 4 Share Posted January 4 (edited) Is it possible to detect whether a ray intersects with Colliders using worldspace coordinates stored in Vector3ds? Both RayCast(All) and SphereCast(All) take Vector3s as their argument(s), and I'd like to avoid the precision loss from switching between double- and single-precision types, since I also intend to convert between orbital elements and worldspace. EDIT: After some testing I noticed that Vector3ds can be casted implicitly to Vector3s, and vice versa. Is this, then, the only way to detect collisions? Edited January 4 by TotallyNotHuman Additional findings Quote Link to post Share on other sites
JPLRepo 4,574 Posted January 12 Share Posted January 12 On 1/4/2021 at 8:46 PM, TotallyNotHuman said: Is it possible to detect whether a ray intersects with Colliders using worldspace coordinates stored in Vector3ds? Both RayCast(All) and SphereCast(All) take Vector3s as their argument(s), and I'd like to avoid the precision loss from switching between double- and single-precision types, since I also intend to convert between orbital elements and worldspace. EDIT: After some testing I noticed that Vector3ds can be casted implicitly to Vector3s, and vice versa. Is this, then, the only way to detect collisions? Correct. Unity only uses Vector3. Vector3d is a construct used in KSP - but is outside of Unity. Raycasts are a functionality of Unity, and as such only work with Vector3. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.