Lagrange
Loading...
Searching...
No Matches
RayCasterOBBAccess.h
1/*
2 * Copyright 2026 Adobe. All rights reserved.
3 * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License. You may obtain a copy
5 * of the License at http://www.apache.org/licenses/LICENSE-2.0
6 *
7 * Unless required by applicable law or agreed to in writing, software distributed under
8 * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9 * OF ANY KIND, either express or implied. See the License for the specific language
10 * governing permissions and limitations under the License.
11 */
12#pragma once
13
14#include <lagrange/raycasting/RayCaster.h>
15#include <lagrange/utils/function_ref.h>
16#include <lagrange/utils/span.h>
17
18#include <variant>
19
20namespace lagrange::raycasting::internal {
21
25{
26 using OrientedBox = RayCaster::OrientedBox;
27
28 static void overlap_obb(
29 const RayCaster& rc,
30 const OrientedBox& obb,
31 lagrange::function_ref<bool(uint32_t, uint32_t, uint32_t)> callback)
32 {
33 rc.overlap_obb_internal(obb, callback);
34 }
35
38 static void overlap_obb16(
39 const RayCaster& rc,
41 std::variant<RayCaster::Mask16, size_t> active,
43 bool(uint32_t lane, uint32_t mesh_index, uint32_t instance_index, uint32_t facet_index)>
44 callback)
45 {
46 rc.overlap_obb16_internal(obbs, active, callback);
47 }
48};
49
50} // namespace lagrange::raycasting::internal
A lightweight non-owning reference to a callable.
Definition function_ref.h:47
A ray caster built on top of Embree that operates directly on SurfaceMesh and SimpleScene objects.
Definition RayCaster.h:196
::nonstd::span< T, Extent > span
A bounds-safe view for sequences of objects.
Definition span.h:27
Friend accessor to RayCaster's OBB overlap queries.
Definition RayCasterOBBAccess.h:25
static void overlap_obb16(const RayCaster &rc, span< const OrientedBox > obbs, std::variant< RayCaster::Mask16, size_t > active, lagrange::function_ref< bool(uint32_t lane, uint32_t mesh_index, uint32_t instance_index, uint32_t facet_index)> callback)
Packet-of-16 OBB overlap query.
Definition RayCasterOBBAccess.h:38