A world-space area constraint. 更多...
#include <Targeting.h>
Public 类型 | |
| enum class | Shape : std::uint8_t { Circle2D , Box2D , Sphere3D , Box3D , Cone2D } |
| Shape public API. 更多... | |
Public 成员函数 | |
| WorldArea ()=default | |
| Constructs an invalid default area. | |
| Shape | shape () const noexcept |
| Returns the area shape. | |
| CoordinateSpace | space () const noexcept |
| Returns the area coordinate space. | |
| bool | isValid () const noexcept |
| Returns whether this area is valid. | |
| WorldPoint | first () const noexcept |
| Return the center for circle/sphere, or minimum corner for boxes. | |
| WorldPoint | second () const noexcept |
| Return the maximum corner for boxes; invalid/default for circle and sphere. | |
| float | radius () const noexcept |
| Return circle/sphere radius; zero for boxes. | |
| bool | contains (WorldPoint point) const noexcept |
| Tests a world point without converting coordinate spaces. | |
静态 Public 成员函数 | |
| static Result< WorldArea > | circle2D (WorldPoint center, float radius) |
| Creates a finite non-negative 2D world circle. | |
| static Result< WorldArea > | box2D (WorldPoint minimum, WorldPoint maximum) |
| Creates an axis-aligned 2D world box from inclusive corners. | |
| static Result< WorldArea > | sphere3D (WorldPoint center, float radius) |
| Creates a finite non-negative 3D world sphere. | |
| static Result< WorldArea > | box3D (WorldPoint minimum, WorldPoint maximum) |
| Creates an axis-aligned 3D world box from inclusive corners. | |
| static Result< WorldArea > | cone2D (WorldPoint apex, float dirX, float dirY, float halfAngleRadians, float range) |
| Creates a 2D world cone/sector. | |
详细描述
A world-space area constraint.
Circle/box are 2D and sphere/box3D are 3D. Factory methods reject a point from the wrong coordinate space, so a 2D area cannot accidentally consume a 3D point or a grid point.
在文件 Targeting.h 第 207 行定义.
成员枚举类型说明
◆ Shape
|
strong |
构造及析构函数说明
◆ WorldArea()
|
default |
Constructs an invalid default area.
被这些函数引用 box2D(), box3D(), circle2D(), cone2D() , 以及 sphere3D().
成员函数说明
◆ box2D()
|
static |
Creates an axis-aligned 2D world box from inclusive corners.
在文件 Targeting.cpp 第 158 行定义.
引用了 Box2D, eve::Result< T >::failure(), maximum, minimum, eve::Result< T >::success(), valid, eve::sensing::World2D , 以及 WorldArea().
◆ box3D()
|
static |
Creates an axis-aligned 3D world box from inclusive corners.
在文件 Targeting.cpp 第 172 行定义.
引用了 Box3D, eve::Result< T >::failure(), maximum, minimum, eve::Result< T >::success(), valid, eve::sensing::World3D , 以及 WorldArea().
◆ circle2D()
|
static |
Creates a finite non-negative 2D world circle.
在文件 Targeting.cpp 第 150 行定义.
引用了 center, Circle2D, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, radius(), eve::Result< T >::success(), eve::sensing::World2D , 以及 WorldArea().
◆ cone2D()
|
static |
Creates a 2D world cone/sector.
- 参数
-
apex Cone apex in World2D. dirX Forward X (normalized on use). dirY Forward Y (normalized on use). halfAngleRadians Half-angle in radians, in [0, pi].range Non-negative distance from the apex.
在文件 Targeting.cpp 第 178 行定义.
引用了 Cone2D, direction, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, eve::sensing::WorldPoint::isValid(), range, eve::sensing::WorldPoint::space(), eve::Result< T >::success(), eve::sensing::World2D, eve::sensing::WorldPoint::world2D() , 以及 WorldArea().
◆ contains()
|
noexcept |
◆ first()
|
inlinenoexcept |
Return the center for circle/sphere, or minimum corner for boxes.
在文件 Targeting.h 第 240 行定义.
◆ isValid()
|
inlinenoexcept |
Returns whether this area is valid.
在文件 Targeting.h 第 238 行定义.
◆ radius()
|
inlinenoexcept |
Return circle/sphere radius; zero for boxes.
在文件 Targeting.h 第 244 行定义.
被这些函数引用 circle2D() , 以及 sphere3D().
◆ second()
|
inlinenoexcept |
Return the maximum corner for boxes; invalid/default for circle and sphere.
在文件 Targeting.h 第 242 行定义.
◆ shape()
|
inlinenoexcept |
Returns the area shape.
在文件 Targeting.h 第 234 行定义.
◆ space()
|
inlinenoexcept |
Returns the area coordinate space.
在文件 Targeting.h 第 236 行定义.
◆ sphere3D()
|
static |
Creates a finite non-negative 3D world sphere.
在文件 Targeting.cpp 第 164 行定义.
引用了 center, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, radius(), Sphere3D, eve::Result< T >::success(), eve::sensing::World3D , 以及 WorldArea().
该类的文档由以下文件生成:
- src/modules/sensing/Targeting.h
- src/modules/sensing/Targeting.cpp