World-level registry for GPU agent simulations and environment semantics. 更多...
#include <GpuAgentWorld.h>
Public 成员函数 | |
| GpuAgentWorld ()=default | |
| Gpu agent world. | |
| ObstacleField & | obstacles () |
| Access the shared obstacle field (mutable for baking). | |
| const ObstacleField & | obstacles () const |
| Const obstacle field. | |
| SurfaceField & | surface () |
| Shared surface field for Life Network effects. | |
| const SurfaceField & | surface () const |
| Const surface field. | |
| void | setWaterCurrent (float x, float y, float z) |
| Set uniform water current. | |
| void | setWind (float x, float y, float z) |
| Set uniform wind. | |
| void | setVerticalBounds (float groundY, float ceilingY) |
| Set ground / ceiling heights for bird clearance. | |
| void | setGoals (std::vector< EnvironmentMarker > goals) |
| Replace goal markers. | |
| void | setDangers (std::vector< EnvironmentMarker > dangers) |
| Replace danger markers. | |
| void | setNutrients (std::vector< EnvironmentMarker > nutrients) |
| Replace nutrient markers. | |
| Result< void > | registerBackend (std::string name, EffectBackend *backend) |
| Register a borrowed backend under a unique name. | |
| Result< void > | unregisterBackend (const std::string &name) |
| Remove a named backend registration without destroying the backend. @ownership Does not take or release ownership of the backend instance. | |
| EffectBackend * | find (const std::string &name) const |
| Look up a registered backend by name. @ownership Borrowed; World does not own the returned pointer. @lifetime Valid until unregisterBackend or World destruction; nullptr when missing. @nullable Yes when the name is not registered. | |
| int | backendCount () const |
| Number of registered backends. | |
| EnvironmentSnapshot | makeSnapshot (bool includeSurface) const |
| Build an environment snapshot for the current World state. | |
| Result< void > | stepAll (float dt) |
| Step every registered backend with a shared environment snapshot. | |
详细描述
World-level registry for GPU agent simulations and environment semantics.
Analogous to a World Subsystem: owns obstacle/surface fields, registers named EffectBackends that stay caller-owned, and prepares per-tick EnvironmentSnapshot values for every registered simulation.
@ownership Backends are borrowed; the caller / script VM retains ownership for the full World registration lifetime. @lifetime World must not outlive registered backends; unregister before destroy.
在文件 GpuAgentWorld.h 第 27 行定义.
构造及析构函数说明
◆ GpuAgentWorld()
|
default |
Gpu agent world.
成员函数说明
◆ backendCount()
|
inline |
Number of registered backends.
在文件 GpuAgentWorld.h 第 83 行定义.
◆ find()
| EffectBackend * eve::gpuagents::GpuAgentWorld::find | ( | const std::string & | name | ) | const |
Look up a registered backend by name. @ownership Borrowed; World does not own the returned pointer. @lifetime Valid until unregisterBackend or World destruction; nullptr when missing. @nullable Yes when the name is not registered.
在文件 GpuAgentWorld.cpp 第 32 行定义.
引用了 name.
◆ makeSnapshot()
| EnvironmentSnapshot eve::gpuagents::GpuAgentWorld::makeSnapshot | ( | bool | includeSurface | ) | const |
Build an environment snapshot for the current World state.
- 参数
-
includeSurface When true, attaches the mutable surface pointer. @ownership Snapshot borrows obstacle/surface pointers owned by this World. @lifetime Valid only while this World and its fields remain alive for the step.
在文件 GpuAgentWorld.cpp 第 37 行定义.
引用了 eve::gpuagents::EnvironmentSnapshot::ceilingY, eve::gpuagents::EnvironmentSnapshot::dangers, eve::gpuagents::EnvironmentSnapshot::goals, eve::gpuagents::EnvironmentSnapshot::groundY, eve::gpuagents::EnvironmentSnapshot::nutrients, eve::gpuagents::EnvironmentSnapshot::obstacles, eve::gpuagents::EnvironmentSnapshot::surface, eve::gpuagents::EnvironmentSnapshot::waterCurrent , 以及 eve::gpuagents::EnvironmentSnapshot::windVelocity.
被这些函数引用 stepAll().
◆ obstacles() [1/2]
|
inline |
Access the shared obstacle field (mutable for baking).
在文件 GpuAgentWorld.h 第 33 行定义.
◆ obstacles() [2/2]
|
inline |
Const obstacle field.
在文件 GpuAgentWorld.h 第 35 行定义.
◆ registerBackend()
| Result< void > eve::gpuagents::GpuAgentWorld::registerBackend | ( | std::string | name, |
| EffectBackend * | backend | ||
| ) |
Register a borrowed backend under a unique name.
- 参数
-
name Non-empty unique key. backend Borrowed backend; must outlive the World registration. @ownership Borrowed; caller retains ownership. @lifetime backendmust remain valid until unregisterBackend or World destruction.
在文件 GpuAgentWorld.cpp 第 7 行定义.
引用了 eve::AlreadyExists, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, name , 以及 eve::Result< T >::success().
◆ setDangers()
|
inline |
Replace danger markers.
在文件 GpuAgentWorld.h 第 55 行定义.
◆ setGoals()
|
inline |
Replace goal markers.
在文件 GpuAgentWorld.h 第 53 行定义.
◆ setNutrients()
|
inline |
Replace nutrient markers.
在文件 GpuAgentWorld.h 第 57 行定义.
◆ setVerticalBounds()
|
inline |
Set ground / ceiling heights for bird clearance.
在文件 GpuAgentWorld.h 第 47 行定义.
◆ setWaterCurrent()
|
inline |
◆ setWind()
|
inline |
◆ stepAll()
| Result< void > eve::gpuagents::GpuAgentWorld::stepAll | ( | float | dt | ) |
Step every registered backend with a shared environment snapshot.
- 参数
-
dt Frame delta seconds.
在文件 GpuAgentWorld.cpp 第 51 行定义.
引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), eve::gpuagents::LifeNetwork, makeSnapshot(), name, eve::PreconditionViolation , 以及 eve::Result< T >::success().
◆ surface() [1/2]
|
inline |
Shared surface field for Life Network effects.
在文件 GpuAgentWorld.h 第 38 行定义.
◆ surface() [2/2]
|
inline |
Const surface field.
在文件 GpuAgentWorld.h 第 40 行定义.
◆ unregisterBackend()
| Result< void > eve::gpuagents::GpuAgentWorld::unregisterBackend | ( | const std::string & | name | ) |
Remove a named backend registration without destroying the backend. @ownership Does not take or release ownership of the backend instance.
在文件 GpuAgentWorld.cpp 第 24 行定义.
引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), name, eve::NotFound , 以及 eve::Result< T >::success().
该类的文档由以下文件生成:
- src/modules/gpuagents/GpuAgentWorld.h
- src/modules/gpuagents/GpuAgentWorld.cpp