载入中...
搜索中...
未找到
eve::gpuagents::GpuAgents类 参考

GPU Agents module — extensible fixed-step agent FX simulation. 更多...

#include <GpuAgents.h>

类 eve::gpuagents::GpuAgents 继承关系图:
eve::Module

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.

参数
worldBorrowed world whose surface is rewritten.
positionsInterleaved xyz floats.
indicesTriangle indices.
originXDomain origin X.
originYDomain origin Y (also base height).
originZDomain origin Z.
worldSizeDomain side length.
resolutionField 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

◆ Module_REG()

eve::gpuagents::GpuAgents::Module_REG ( GpuAgents  )

◆ newBackend()

EffectBackend * eve::gpuagents::GpuAgents::newBackend ( int  kind,
int  maxAgents 
)

Create a configured EffectBackend.

参数
kind0=Fish, 1=LifeNetwork, 2=Bird, 3=Petal.
maxAgentsCapacity. @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.

参数
backendTarget backend; borrowed, must already be configured.
countAlive agent count.
centerXSpawn center X.
centerYSpawn center Y.
centerZSpawn center Z.
spreadSpawn radius. @ownership Borrowed backend; this call does not take ownership. @lifetime backend must 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.

参数
worldBorrowed world with an initialized surface.
bindingDestination 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.


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