public static bool Raycast(Vector3 origin, Vector3 direction, out RaycastHit_SU hitInfo, SurfaceMask surfaceMask, float maxDistance) { SpatialUnderstandingDll.Imports.RaycastResult rayCastResult; if (SpatialUnderstanding.Instance.AllowSpatialUnderstanding && SpatialUnderstanding.Instance.ScanState == SpatialUnderstanding.ScanStates.Done) { // Set result pointer IntPtr raycastResultPtr = SpatialUnderstanding.Instance.UnderstandingDLL.GetStaticRaycastResultPtr(); // Shoot Raycast SpatialUnderstandingDll.Imports.PlayspaceRaycast(origin.x, origin.y, origin.z, direction.x, direction.y, direction.z, raycastResultPtr); // Assign temp result rayCastResult = SpatialUnderstanding.Instance.UnderstandingDLL.GetStaticRaycastResult(); hitInfo = new RaycastHit_SU(Vector3.Distance(origin, rayCastResult.IntersectPoint), rayCastResult.IntersectPoint, rayCastResult.SurfaceType); // Check Surface Mask return(CheckSurfaceAgainstMask(rayCastResult.SurfaceType, surfaceMask)); } hitInfo = new RaycastHit_SU(0, Vector3.zero, SpatialUnderstandingDll.Imports.RaycastResult.SurfaceTypes.Invalid); return(false); }
public static bool Raycast(Ray ray, out RaycastHit_SU hitInfo, SurfaceMask surfaceMask, float maxDistance) { return(Raycast(ray.origin, ray.direction, out hitInfo, surfaceMask, maxDistance)); }
public static bool Raycast(Ray ray, out RaycastHit_SU hitInfo) { return(Raycast(ray.origin, ray.direction, out hitInfo)); }
public static bool Raycast(Vector3 origin, Vector3 direction, out RaycastHit_SU hitInfo, float maxDistance) { return(Raycast(origin, direction, out hitInfo, SurfaceMask.Default, maxDistance)); }
public static bool Raycast(Vector3 origin, Vector3 direction, out RaycastHit_SU hitInfo, SurfaceMask surfaceMask) { return(Raycast(origin, direction, out hitInfo, surfaceMask, Mathf.Infinity)); }