public static bool Fire(Vector3 origin, Vector3 direction, float distance, PhysXCollider.CollisionLayer layers, uint ignoredVehicleId = 0) { physXOrigin.FromVector(origin); physXDirection.FromVector(direction); if (defaultPhysXRaycastHit == IntPtr.Zero) { defaultPhysXRaycastHit = PhysXLib.CreateRaycastHit(); } return(PhysXSceneManager.FireRaycastFiltered(physXOrigin, physXDirection, distance, defaultPhysXRaycastHit, (uint)layers, 0, 0, ignoredVehicleId)); }
public static bool Fire(Vector3 origin, Vector3 direction, PhysXCollider.CollisionLayer layers, uint ignoredVehicleId = 0) { return(Fire(direction, origin, float.MaxValue, layers, ignoredVehicleId)); }
public static bool Fire(Vector3 origin, Vector3 direction, PhysXRaycastHit raycastHit, float distance, PhysXCollider.CollisionLayer layers, uint ignoredVehicleId = 0) { physXOrigin.FromVector(origin); physXDirection.FromVector(direction); bool hit = PhysXSceneManager.FireRaycastFiltered(physXOrigin, physXDirection, distance, raycastHit.physXRaycastHit, (uint)layers, 0, 0, ignoredVehicleId); if (hit) { raycastHit.PopulateFields(); } return(hit); }