载入中...
搜索中...
未找到

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

enum class eve::sensing::WorldArea::Shape : std::uint8_t
strong

Shape public API.

枚举值
Circle2D 
Box2D 
Sphere3D 
Box3D 
Cone2D 

在文件 Targeting.h 第 210 行定义.

构造及析构函数说明

◆ WorldArea()

eve::sensing::WorldArea::WorldArea ( )
default

Constructs an invalid default area.

被这些函数引用 box2D(), box3D(), circle2D(), cone2D() , 以及 sphere3D().

成员函数说明

◆ box2D()

Result< WorldArea > eve::sensing::WorldArea::box2D ( WorldPoint  minimum,
WorldPoint  maximum 
)
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()

Result< WorldArea > eve::sensing::WorldArea::box3D ( WorldPoint  minimum,
WorldPoint  maximum 
)
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()

Result< WorldArea > eve::sensing::WorldArea::circle2D ( WorldPoint  center,
float  radius 
)
static

◆ cone2D()

Result< WorldArea > eve::sensing::WorldArea::cone2D ( WorldPoint  apex,
float  dirX,
float  dirY,
float  halfAngleRadians,
float  range 
)
static

Creates a 2D world cone/sector.

参数
apexCone apex in World2D.
dirXForward X (normalized on use).
dirYForward Y (normalized on use).
halfAngleRadiansHalf-angle in radians, in [0, pi].
rangeNon-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()

bool eve::sensing::WorldArea::contains ( WorldPoint  point) const
noexcept

Tests a world point without converting coordinate spaces.

在文件 Targeting.cpp 第 192 行定义.

引用了 distance, distSq, dx, dy, dz, nx, ny , 以及 point.

◆ first()

WorldPoint eve::sensing::WorldArea::first ( ) const
inlinenoexcept

Return the center for circle/sphere, or minimum corner for boxes.

在文件 Targeting.h 第 240 行定义.

◆ isValid()

bool eve::sensing::WorldArea::isValid ( ) const
inlinenoexcept

Returns whether this area is valid.

在文件 Targeting.h 第 238 行定义.

◆ radius()

float eve::sensing::WorldArea::radius ( ) const
inlinenoexcept

Return circle/sphere radius; zero for boxes.

在文件 Targeting.h 第 244 行定义.

被这些函数引用 circle2D() , 以及 sphere3D().

◆ second()

WorldPoint eve::sensing::WorldArea::second ( ) const
inlinenoexcept

Return the maximum corner for boxes; invalid/default for circle and sphere.

在文件 Targeting.h 第 242 行定义.

◆ shape()

Shape eve::sensing::WorldArea::shape ( ) const
inlinenoexcept

Returns the area shape.

在文件 Targeting.h 第 234 行定义.

◆ space()

CoordinateSpace eve::sensing::WorldArea::space ( ) const
inlinenoexcept

Returns the area coordinate space.

在文件 Targeting.h 第 236 行定义.

◆ sphere3D()

Result< WorldArea > eve::sensing::WorldArea::sphere3D ( WorldPoint  center,
float  radius 
)
static

该类的文档由以下文件生成: