SuperDex Physics C++ API
Loading...
Searching...
No Matches
box.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#pragma once
18
22
23namespace superdex {
24
25/**
26 * @brief Data for an implicit box within a model file.
27 *
28 * @note Similar to @ref Obb (oriented bounding box), but with a serialization-friendly data
29 * representation. Used in @ref ModelData.
30 */
31struct Box {
32 Box() = default;
35
36 Real3 center{}; ///< Center of the box [m]
37 Real3 halfExtents{1_r, 1_r, 1_r}; ///< Half extents of the box [m]
38 Quaternion rotation; ///< Rotation about the center of the box
39
40#if MOCHI_LANGUAGE_CPP20
41 bool operator==(Box const& other) const = default;
42 bool operator!=(Box const& other) const = default;
43#endif
44
50};
51
52} // namespace superdex
NdArray< real, 3 > Real3
Definition nd_array.h:106
#define MOCHI_STRUCT_END()
Definition reflection.h:279
#define MOCHI_FIELD(name)
Definition reflection.h:293
#define MOCHI_STRUCT_BEGIN(name)
Definition reflection.h:278
#define MOCHI_ATTRIBUTE(...)
Definition reflection.h:298
Data for an implicit box within a model file.
Definition box.h:31
Quaternion rotation
Rotation about the center of the box.
Definition box.h:38
bool operator!=(Box const &other) const =default
Box()=default
Real3 halfExtents
Half extents of the box [m].
Definition box.h:37
Real3 center
Center of the box [m].
Definition box.h:36
bool operator==(Box const &other) const =default
Box(Real3 const &center, Real3 const &halfExtents, Quaternion const &rotation={})
Definition box.h:33