| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | // Copyright (c) 2017 CNRS | ||
| 2 | // Copyright (c) 2022 INRIA | ||
| 3 | // Authors: Joseph Mirabel (joseph.mirabel@laas.fr) | ||
| 4 | // | ||
| 5 | // This file is part of Coal. | ||
| 6 | // Coal is free software: you can redistribute it | ||
| 7 | // and/or modify it under the terms of the GNU Lesser General Public | ||
| 8 | // License as published by the Free Software Foundation, either version | ||
| 9 | // 3 of the License, or (at your option) any later version. | ||
| 10 | // | ||
| 11 | // Coal is distributed in the hope that it will be | ||
| 12 | // useful, but WITHOUT ANY WARRANTY; without even the implied warranty | ||
| 13 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 14 | // General Lesser Public License for more details. You should have | ||
| 15 | // received a copy of the GNU Lesser General Public License along with | ||
| 16 | // Coal. If not, see <http://www.gnu.org/licenses/>. | ||
| 17 | |||
| 18 | #ifndef COAL_COLLISION_UTILITY_H | ||
| 19 | #define COAL_COLLISION_UTILITY_H | ||
| 20 | |||
| 21 | #include "coal/collision_object.h" | ||
| 22 | |||
| 23 | namespace coal { | ||
| 24 | |||
| 25 | COAL_DLLAPI CollisionGeometry* extract(const CollisionGeometry* model, | ||
| 26 | const Transform3s& pose, | ||
| 27 | const AABB& aabb); | ||
| 28 | |||
| 29 | /** | ||
| 30 | * \brief Returns the name associated to a NODE_TYPE | ||
| 31 | */ | ||
| 32 | 28474 | inline const char* get_node_type_name(NODE_TYPE node_type) { | |
| 33 | static const char* node_type_name_all[] = { | ||
| 34 | "BV_UNKNOWN", "BV_AABB", "BV_OBB", "BV_RSS", | ||
| 35 | "BV_kIOS", "BV_OBBRSS", "BV_KDOP16", "BV_KDOP18", | ||
| 36 | "BV_KDOP24", "GEOM_BOX", "GEOM_SPHERE", "GEOM_CAPSULE", | ||
| 37 | "GEOM_CONE", "GEOM_CYLINDER", "GEOM_CONVEX", "GEOM_PLANE", | ||
| 38 | "GEOM_HALFSPACE", "GEOM_TRIANGLE", "GEOM_OCTREE", "GEOM_ELLIPSOID", | ||
| 39 | "HF_AABB", "HF_OBBRSS", "NODE_COUNT"}; | ||
| 40 | |||
| 41 | 28474 | return node_type_name_all[node_type]; | |
| 42 | } | ||
| 43 | |||
| 44 | /** | ||
| 45 | * \brief Returns the name associated to a OBJECT_TYPE | ||
| 46 | */ | ||
| 47 | inline const char* get_object_type_name(OBJECT_TYPE object_type) { | ||
| 48 | static const char* object_type_name_all[] = { | ||
| 49 | "OT_UNKNOWN", "OT_BVH", "OT_GEOM", "OT_OCTREE", "OT_HFIELD", "OT_COUNT"}; | ||
| 50 | |||
| 51 | return object_type_name_all[object_type]; | ||
| 52 | } | ||
| 53 | |||
| 54 | } // namespace coal | ||
| 55 | |||
| 56 | #endif // COAL_COLLISION_UTILITY_H | ||
| 57 |