22#ifdef LIBCARLA_INCLUDED_FROM_UE4
75 auto point_in_bbox_space = in_world_point;
80 return point_in_bbox_space.
x >= -
extent.
x && point_in_bbox_space.x <=
extent.
x &&
81 point_in_bbox_space.y >= -
extent.
y && point_in_bbox_space.y <=
extent.
y &&
82 point_in_bbox_space.z >= -
extent.
z && point_in_bbox_space.z <=
extent.
z;
129 std::for_each(world_vertices.begin(), world_vertices.end(), [&in_bbox_to_world_tr](
auto &world_vertex) {
130 in_bbox_to_world_tr.TransformPoint(world_vertex);
132 return world_vertices;
154 return !(*
this == rhs);
161#ifdef LIBCARLA_INCLUDED_FROM_UE4
169 extent(1e-2f * Box.Extent.X, 1e-2f * Box.Extent.Y, 1e-2f * Box.Extent.Z),
BoundingBox(const Vector3D &in_extent)
bool operator!=(const BoundingBox &rhs) const
比较两个边界框是否不相等。
Location location
边界框的中心位置(本地坐标系下)
std::array< Location, 8 > GetLocalVertices() const
返回边界框在本地空间中的8个顶点的位置。
std::array< Location, 8 > GetLocalVerticesNoRotation() const
返回边界框在本地空间中的8个顶点的位置,但不考虑旋转。
MSGPACK_DEFINE_ARRAY(location, extent, rotation)
BoundingBox(const Location &in_location, const Vector3D &in_extent)
bool Contains(const Location &in_world_point, const Transform &in_bbox_to_world_transform) const
检查给定的世界空间中的点是否在边界框内。
Vector3D extent
边界框的半尺寸(本地坐标系下,表示在每个轴方向上的半宽、半高和半深)
BoundingBox(const FBoundingBox &Box)
从UE4的边界框类型(FBoundingBox)构造一个carla::geom::BoundingBox对象。
std::array< Location, 8 > GetWorldVertices(const Transform &in_bbox_to_world_tr) const
返回边界框在世界空间中的8个顶点的位置。
BoundingBox(const Location &in_location, const Vector3D &in_extent, const Rotation &in_rotation)
bool operator==(const BoundingBox &rhs) const
比较两个边界框是否相等。
Rotation rotation
边界框的旋转(本地坐标系下)
void RotateVector(Vector3D &in_point) const