Unified static + dynamic obstacle distance field. 更多...
#include <ObstacleField.h>
Public 成员函数 | |
| bool | hasStaticGrid () const |
| True when a static grid is allocated. | |
| void | clear () |
| Clear static grid and dynamic sources. | |
| void | bakeEmpty (const glm::vec3 &originMin, const glm::ivec3 &dims, float cellSize, float fillDistance=10.f) |
| Bake an empty (all free) box field. | |
| void | carveSphere (const glm::vec3 ¢er, float radius) |
| Carve a solid sphere into the static grid (min with existing). | |
| void | carveBox (const glm::vec3 &minCorner, const glm::vec3 &maxCorner) |
| Carve a solid axis-aligned box (min with existing). | |
| void | setDynamicSources (std::vector< DynamicObstacleSource > sources) |
| Replace the dynamic obstacle list. | |
| ObstacleSample | sample (const glm::vec3 &p) const |
| Sample combined static+dynamic distance and gradient at p. | |
| void | resolve (glm::vec3 &position, glm::vec3 &velocity, float agentRadius, float predictTime) const |
| Push an agent out of obstacles and keep feasible tangential velocity. | |
Public 属性 | |
| glm::vec3 | origin {0.f} |
| float | cellSize = 1.f |
| glm::ivec3 | dims {0} |
| std::vector< float > | distances |
| std::vector< DynamicObstacleSource > | dynamicSources |
详细描述
Unified static + dynamic obstacle distance field.
Static samples live on a regular voxel grid (positive = free space). Dynamic sources are analytic spheres combined with min.
在文件 ObstacleField.h 第 28 行定义.
成员函数说明
◆ bakeEmpty()
| void eve::gpuagents::ObstacleField::bakeEmpty | ( | const glm::vec3 & | originMin, |
| const glm::ivec3 & | dims, | ||
| float | cellSize, | ||
| float | fillDistance = 10.f |
||
| ) |
Bake an empty (all free) box field.
- 参数
-
originMin World corner of voxel (0,0,0). dims Voxel counts. cellSize Voxel edge length. fillDistance Initial free-space distance written to every voxel.
在文件 ObstacleField.cpp 第 29 行定义.
引用了 cellSize, d, dims, distances, EV_PARAM_CHECK , 以及 origin.
◆ carveBox()
| void eve::gpuagents::ObstacleField::carveBox | ( | const glm::vec3 & | minCorner, |
| const glm::vec3 & | maxCorner | ||
| ) |
Carve a solid axis-aligned box (min with existing).
- 参数
-
minCorner Inclusive AABB min. maxCorner Inclusive AABB max.
在文件 ObstacleField.cpp 第 55 行定义.
引用了 cellSize, d, dims, distances, EV_PARAM_CHECK, hasStaticGrid(), origin, p, q, x, y , 以及 z.
◆ carveSphere()
| void eve::gpuagents::ObstacleField::carveSphere | ( | const glm::vec3 & | center, |
| float | radius | ||
| ) |
Carve a solid sphere into the static grid (min with existing).
- 参数
-
center Sphere center. radius Sphere radius.
在文件 ObstacleField.cpp 第 40 行定义.
引用了 cellSize, center, d, dims, distances, EV_PARAM_CHECK, hasStaticGrid(), origin, p, radius, x, y , 以及 z.
◆ clear()
| void eve::gpuagents::ObstacleField::clear | ( | ) |
Clear static grid and dynamic sources.
在文件 ObstacleField.cpp 第 23 行定义.
引用了 dims, distances , 以及 dynamicSources.
◆ hasStaticGrid()
|
inline |
True when a static grid is allocated.
在文件 ObstacleField.h 第 37 行定义.
被这些函数引用 carveBox() , 以及 carveSphere().
◆ resolve()
| void eve::gpuagents::ObstacleField::resolve | ( | glm::vec3 & | position, |
| glm::vec3 & | velocity, | ||
| float | agentRadius, | ||
| float | predictTime | ||
| ) | const |
Push an agent out of obstacles and keep feasible tangential velocity.
- 参数
-
position In/out world position. velocity In/out world velocity. agentRadius Collision radius. predictTime Velocity extrapolation horizon for predictive sample.
在文件 ObstacleField.cpp 第 140 行定义.
引用了 eve::gpuagents::ObstacleSample::distance, hit, n, position , 以及 sample().
被这些函数引用 eve::gpuagents::BirdSolver::step(), eve::gpuagents::FishSolver::step() , 以及 eve::gpuagents::PetalSolver::step().
◆ sample()
| ObstacleSample eve::gpuagents::ObstacleField::sample | ( | const glm::vec3 & | p | ) | const |
Sample combined static+dynamic distance and gradient at p.
在文件 ObstacleField.cpp 第 129 行定义.
引用了 eve::gpuagents::ObstacleSample::distance, eve::gpuagents::ObstacleSample::gradient , 以及 p.
被这些函数引用 resolve().
◆ setDynamicSources()
| void eve::gpuagents::ObstacleField::setDynamicSources | ( | std::vector< DynamicObstacleSource > | sources | ) |
类成员变量说明
◆ cellSize
| float eve::gpuagents::ObstacleField::cellSize = 1.f |
在文件 ObstacleField.h 第 31 行定义.
被这些函数引用 bakeEmpty(), carveBox() , 以及 carveSphere().
◆ dims
| glm::ivec3 eve::gpuagents::ObstacleField::dims {0} |
在文件 ObstacleField.h 第 32 行定义.
被这些函数引用 bakeEmpty(), carveBox(), carveSphere() , 以及 clear().
◆ distances
| std::vector<float> eve::gpuagents::ObstacleField::distances |
在文件 ObstacleField.h 第 33 行定义.
被这些函数引用 bakeEmpty(), carveBox(), carveSphere() , 以及 clear().
◆ dynamicSources
| std::vector<DynamicObstacleSource> eve::gpuagents::ObstacleField::dynamicSources |
在文件 ObstacleField.h 第 34 行定义.
被这些函数引用 clear(), setDynamicSources() , 以及 eve::gpuagents::PetalSolver::step().
◆ origin
| glm::vec3 eve::gpuagents::ObstacleField::origin {0.f} |
在文件 ObstacleField.h 第 30 行定义.
被这些函数引用 bakeEmpty(), carveBox() , 以及 carveSphere().
该类的文档由以下文件生成:
- src/modules/gpuagents/ObstacleField.h
- src/modules/gpuagents/ObstacleField.cpp