GPU Agents module — extensible fixed-step agent FX simulation. 更多...
#include <GpuAgents.h>
Public 成员函数 | |
| Module_REG (GpuAgents) | |
| GpuAgentWorld * | newWorld () |
| Create an empty World. @ownership Caller / script VM owns the returned world; delete or let the VM free it. @lifetime Valid until the owner destroys it; not retained by the module. @nullable No on success; factory failure is an invariant. @thread Main/composition thread only. | |
| EffectBackend * | newBackend (int kind, int maxAgents) |
| Create a configured EffectBackend. | |
| EffectProfile | makeProfile (int kind, int maxAgents) const |
| Build a default EffectProfile value for script helpers. | |
| Result< void > | spawnCloud (EffectBackend *backend, int count, float centerX, float centerY, float centerZ, float spread) const |
| Spawn a simple school / flock / petal cloud into a backend. | |
| Result< void > | captureSurface (GpuAgentWorld *world, const std::vector< float > &positions, const std::vector< std::uint32_t > &indices, float originX, float originY, float originZ, float worldSize, int resolution) const |
| Orthographic triangle bake into a world's surface field. | |
| Result< void > | syncLifeFieldBinding (GpuAgentWorld *world, LifeFieldMaterialBinding *binding) const |
| Pack a world's surface into CPU LifeField / SurfaceData RGBA buffers. | |
Public 成员函数 继承自 eve::Module | |
| virtual | ~Module () |
| Module. | |
| virtual std::string | getName () const =0 |
| Returns the name. | |
详细描述
GPU Agents module — extensible fixed-step agent FX simulation.
Script: gpuAgents <- eve.GpuAgents();
Four-layer architecture: EffectProfile → EffectBackend → Solver → Renderer, orchestrated by GpuAgentWorld for environment registration and by GpuAgentSimulation for fixed-step double buffers.
在文件 GpuAgents.h 第 29 行定义.
成员函数说明
◆ captureSurface()
| Result< void > eve::gpuagents::GpuAgents::captureSurface | ( | GpuAgentWorld * | world, |
| const std::vector< float > & | positions, | ||
| const std::vector< std::uint32_t > & | indices, | ||
| float | originX, | ||
| float | originY, | ||
| float | originZ, | ||
| float | worldSize, | ||
| int | resolution | ||
| ) | const |
Orthographic triangle bake into a world's surface field.
- 参数
-
world Borrowed world whose surface is rewritten. positions Interleaved xyz floats. indices Triangle indices. originX Domain origin X. originY Domain origin Y (also base height). originZ Domain origin Z. worldSize Domain side length. resolution Field resolution. @ownership Borrowed world; positions/indices copied for the call only. @lifetime world must outlive the call.
在文件 GpuAgents.cpp 第 90 行定义.
引用了 eve::gpuagents::SurfaceCapture::captureFromTriangles(), eve::Diagnostic::error(), eve::Result< T >::failure(), indices, eve::InvalidArgument, positions, verts , 以及 world.
◆ makeProfile()
| EffectProfile eve::gpuagents::GpuAgents::makeProfile | ( | int | kind, |
| int | maxAgents | ||
| ) | const |
Build a default EffectProfile value for script helpers.
- 参数
-
kind Effect kind integer. maxAgents Capacity.
在文件 GpuAgents.cpp 第 33 行定义.
引用了 eve::gpuagents::Bird, eve::gpuagents::Fish, kind, eve::gpuagents::LifeNetwork, eve::gpuagents::EffectProfile::makeBird(), eve::gpuagents::EffectProfile::makeFish(), eve::gpuagents::EffectProfile::makeLife(), eve::gpuagents::EffectProfile::makePetal() , 以及 eve::gpuagents::Petal.
被这些函数引用 newBackend().
◆ Module_REG()
| eve::gpuagents::GpuAgents::Module_REG | ( | GpuAgents | ) |
◆ newBackend()
| EffectBackend * eve::gpuagents::GpuAgents::newBackend | ( | int | kind, |
| int | maxAgents | ||
| ) |
Create a configured EffectBackend.
- 参数
-
kind 0=Fish, 1=LifeNetwork, 2=Bird, 3=Petal. maxAgents Capacity. @ownership Caller / script VM owns the returned backend. @lifetime Valid until the owner destroys it; register with World only as borrowed. @nullable Yes when configure fails; caller must check for nullptr. @thread Main/composition thread only.
在文件 GpuAgents.cpp 第 43 行定义.
引用了 kind , 以及 makeProfile().
◆ newWorld()
| GpuAgentWorld * eve::gpuagents::GpuAgents::newWorld | ( | ) |
Create an empty World. @ownership Caller / script VM owns the returned world; delete or let the VM free it. @lifetime Valid until the owner destroys it; not retained by the module. @nullable No on success; factory failure is an invariant. @thread Main/composition thread only.
在文件 GpuAgents.cpp 第 29 行定义.
◆ spawnCloud()
| Result< void > eve::gpuagents::GpuAgents::spawnCloud | ( | EffectBackend * | backend, |
| int | count, | ||
| float | centerX, | ||
| float | centerY, | ||
| float | centerZ, | ||
| float | spread | ||
| ) | const |
Spawn a simple school / flock / petal cloud into a backend.
- 参数
-
backend Target backend; borrowed, must already be configured. count Alive agent count. centerX Spawn center X. centerY Spawn center Y. centerZ Spawn center Z. spread Spawn radius. @ownership Borrowed backend; this call does not take ownership. @lifetime backendmust remain valid for the duration of the call.
在文件 GpuAgents.cpp 第 51 行定义.
引用了 eve::gpuagents::EffectProfile::base(), eve::gpuagents::Bird, center, count, dir, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::gpuagents::Fish, eve::gpuagents::GpuAgentSimulation::initialize(), eve::InvalidArgument, eve::gpuagents::GpuAgentSimulation::isConfigured(), kind, eve::gpuagents::EffectBackend::kind(), eve::gpuagents::LifeNetwork, eve::gpuagents::lookRotation(), eve::gpuagents::Petal, eve::PreconditionViolation, eve::gpuagents::GpuAgentSimulation::profile(), s , 以及 eve::gpuagents::EffectBackend::simulation().
◆ syncLifeFieldBinding()
| Result< void > eve::gpuagents::GpuAgents::syncLifeFieldBinding | ( | GpuAgentWorld * | world, |
| LifeFieldMaterialBinding * | binding | ||
| ) | const |
Pack a world's surface into CPU LifeField / SurfaceData RGBA buffers.
- 参数
-
world Borrowed world with an initialized surface. binding Destination binding (caller-owned). @ownership Borrowed; does not take ownership of world or binding. @lifetime Both arguments must outlive the call.
在文件 GpuAgents.cpp 第 110 行定义.
引用了 binding, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument , 以及 world.
该类的文档由以下文件生成:
- src/modules/gpuagents/GpuAgents.h
- src/modules/gpuagents/GpuAgents.cpp
Public 成员函数 继承自