载入中...
搜索中...
未找到
eve::crowd::Crowd::Impl结构体 参考

Private crowd runtime storage. @cost Linear in agent count for SOA vectors and transient broadphase/avoidance work buffers; capacity is bounded by maxAgents. 更多...

#include <CrowdInternal.h>

类

struct  AvoidanceNeighbor
 

Public 成员函数

bool validId (int id) const
 
bool canInteract (size_t a, size_t b) const
 
void rebuildGrid ()
 
template<typename Fn >
void forEachNeighbor (float qx, float qy, float radius, Fn &&fn) const
 
void stepAgents (float dt)
 
void selectAvoidanceVelocity (size_t index, float dt, float &vx, float &vy)
 
float resolveOverlapsPass ()
 
void resolveWalls ()
 

Public 属性

CrowdField field
 
float defaultSpeed = 120.f
 
float defaultRadius = 6.f
 
float defaultTurnRate = 6.f
 
float arriveRadius = 64.f
 
float sepRadius = 28.f
 
float perceiveRadius = 64.f
 
float sepWeight = 1.f
 
float alignWeight = 0.f
 
float cohesionWeight = 0.f
 
float wanderWeight = 0.f
 
float goalWeight = 1.f
 
bool resolveOverlaps = true
 
bool clampToField = true
 
int maxAgents = 100000
 
float simTime = 0.f
 
AvoidanceSettings avoidance
 
std::int64_t avoidanceChecks = 0
 
int avoidanceTruncations = 0
 
float avoidanceMaxSpeed = 0.f
 
float avoidanceMaxRadius = 0.f
 
std::vector< AvoidanceNeighbor > avoidanceNeighbors
 Per-step avoidance neighbor scratch space. @cost Linear in checked neighbors and bounded by avoidance work limits.
 
std::vector< float > xs
 SOA agent storage, indexed by compact slot id. @cost Linear in agent count; mutation keeps all owned vectors aligned.
 
std::vector< float > ys
 
std::vector< float > headings
 
std::vector< float > vxs
 
std::vector< float > vys
 
std::vector< float > speeds
 
std::vector< float > nextVxs
 
std::vector< float > nextVys
 
std::vector< float > correctionXs
 
std::vector< float > correctionYs
 
std::vector< float > preferredVxs
 
std::vector< float > preferredVys
 
std::vector< float > arriveFactors
 
std::vector< float > radii
 
std::vector< float > maxSpeeds
 
std::vector< float > maxAccels
 
std::vector< float > turnRates
 
std::vector< int32_t > actions
 
std::vector< int32_t > datas
 
std::vector< int32_t > avoidancePriorities
 
std::vector< uint8_t > hasTargets
 
std::vector< AgentInteraction > interactions
 
std::vector< float > targetXs
 
std::vector< float > targetYs
 
std::vector< float > wanderPhases
 
std::vector< std::string > stableIds
 
std::unordered_map< std::string, int > namedAgents
 
std::vector< int32_t > cellCount
 Per-frame counting-sort broadphase workspace. @cost Linear in grid cells plus agent count when rebuilt.
 
std::vector< int32_t > cellStart
 
std::vector< int32_t > cursor
 
std::vector< int32_t > sorted
 
int gridW = 0
 
int gridH = 0
 
float gridOriginX = 0.f
 
float gridOriginY = 0.f
 
float gridCell = 1.f
 

详细描述

Private crowd runtime storage. @cost Linear in agent count for SOA vectors and transient broadphase/avoidance work buffers; capacity is bounded by maxAgents.

在文件 CrowdInternal.h 第 17 行定义.

成员函数说明

◆ canInteract()

bool eve::crowd::Crowd::Impl::canInteract ( size_t  a,
size_t  b 
) const
inline

在文件 CrowdInternal.h 第 80 行定义.

引用了 a, b, interactions, layer , 以及 mask.

被这些函数引用 selectAvoidanceVelocity().

◆ forEachNeighbor()

template<typename Fn >
void eve::crowd::Crowd::Impl::forEachNeighbor ( float  qx,
float  qy,
float  radius,
Fn &&  fn 
) const
inline

在文件 CrowdInternal.h 第 88 行定义.

引用了 begin, c, cell, cellCount, cellStart, cx, cy, dx, dy, end, fn, gridCell, gridH, gridOriginX, gridOriginY, gridW, origin, qx, qy, radius, sorted, xs , 以及 ys.

被这些函数引用 selectAvoidanceVelocity().

◆ rebuildGrid()

void eve::crowd::Crowd::Impl::rebuildGrid ( )

◆ resolveOverlapsPass()

float eve::crowd::Crowd::Impl::resolveOverlapsPass ( )

在文件 CrowdSimulation.cpp 第 260 行定义.

引用了 actions, angle, d, dx, dy, first, hash, left, length, limit, n, nx, ny, radii, right, scale, second , 以及 value.

◆ resolveWalls()

void eve::crowd::Crowd::Impl::resolveWalls ( )

在文件 CrowdSimulation.cpp 第 338 行定义.

引用了 dx, dy, height, radii , 以及 width.

◆ selectAvoidanceVelocity()

◆ stepAgents()

void eve::crowd::Crowd::Impl::stepAgents ( float  dt)

在文件 CrowdSimulation.cpp 第 65 行定义.

引用了 action, actions, c, cell, d, dx, dy, n, radii, sx, sy, x , 以及 y.

◆ validId()

bool eve::crowd::Crowd::Impl::validId ( int  id) const
inline

在文件 CrowdInternal.h 第 78 行定义.

引用了 actions.

类成员变量说明

◆ actions

std::vector<int32_t> eve::crowd::Crowd::Impl::actions

在文件 CrowdInternal.h 第 58 行定义.

被这些函数引用 rebuildGrid() , 以及 validId().

◆ alignWeight

float eve::crowd::Crowd::Impl::alignWeight = 0.f

在文件 CrowdInternal.h 第 27 行定义.

◆ arriveFactors

std::vector<float> eve::crowd::Crowd::Impl::arriveFactors

在文件 CrowdInternal.h 第 56 行定义.

◆ arriveRadius

float eve::crowd::Crowd::Impl::arriveRadius = 64.f

在文件 CrowdInternal.h 第 23 行定义.

◆ avoidance

AvoidanceSettings eve::crowd::Crowd::Impl::avoidance

在文件 CrowdInternal.h 第 35 行定义.

被这些函数引用 selectAvoidanceVelocity().

◆ avoidanceChecks

std::int64_t eve::crowd::Crowd::Impl::avoidanceChecks = 0

在文件 CrowdInternal.h 第 36 行定义.

被这些函数引用 selectAvoidanceVelocity().

◆ avoidanceMaxRadius

float eve::crowd::Crowd::Impl::avoidanceMaxRadius = 0.f

在文件 CrowdInternal.h 第 38 行定义.

被这些函数引用 selectAvoidanceVelocity().

◆ avoidanceMaxSpeed

float eve::crowd::Crowd::Impl::avoidanceMaxSpeed = 0.f

在文件 CrowdInternal.h 第 38 行定义.

被这些函数引用 selectAvoidanceVelocity().

◆ avoidanceNeighbors

std::vector<AvoidanceNeighbor> eve::crowd::Crowd::Impl::avoidanceNeighbors

Per-step avoidance neighbor scratch space. @cost Linear in checked neighbors and bounded by avoidance work limits.

在文件 CrowdInternal.h 第 47 行定义.

被这些函数引用 selectAvoidanceVelocity().

◆ avoidancePriorities

std::vector<int32_t> eve::crowd::Crowd::Impl::avoidancePriorities

在文件 CrowdInternal.h 第 58 行定义.

被这些函数引用 selectAvoidanceVelocity().

◆ avoidanceTruncations

int eve::crowd::Crowd::Impl::avoidanceTruncations = 0

在文件 CrowdInternal.h 第 37 行定义.

被这些函数引用 selectAvoidanceVelocity().

◆ cellCount

std::vector<int32_t> eve::crowd::Crowd::Impl::cellCount

Per-frame counting-sort broadphase workspace. @cost Linear in grid cells plus agent count when rebuilt.

在文件 CrowdInternal.h 第 71 行定义.

被这些函数引用 forEachNeighbor() , 以及 rebuildGrid().

◆ cellStart

std::vector<int32_t> eve::crowd::Crowd::Impl::cellStart

在文件 CrowdInternal.h 第 71 行定义.

被这些函数引用 forEachNeighbor() , 以及 rebuildGrid().

◆ clampToField

bool eve::crowd::Crowd::Impl::clampToField = true

在文件 CrowdInternal.h 第 32 行定义.

被这些函数引用 selectAvoidanceVelocity().

◆ cohesionWeight

float eve::crowd::Crowd::Impl::cohesionWeight = 0.f

在文件 CrowdInternal.h 第 28 行定义.

◆ correctionXs

std::vector<float> eve::crowd::Crowd::Impl::correctionXs

在文件 CrowdInternal.h 第 55 行定义.

◆ correctionYs

std::vector<float> eve::crowd::Crowd::Impl::correctionYs

在文件 CrowdInternal.h 第 55 行定义.

◆ cursor

std::vector<int32_t> eve::crowd::Crowd::Impl::cursor

在文件 CrowdInternal.h 第 71 行定义.

被这些函数引用 rebuildGrid().

◆ datas

std::vector<int32_t> eve::crowd::Crowd::Impl::datas

在文件 CrowdInternal.h 第 58 行定义.

◆ defaultRadius

float eve::crowd::Crowd::Impl::defaultRadius = 6.f

在文件 CrowdInternal.h 第 21 行定义.

◆ defaultSpeed

float eve::crowd::Crowd::Impl::defaultSpeed = 120.f

在文件 CrowdInternal.h 第 20 行定义.

◆ defaultTurnRate

float eve::crowd::Crowd::Impl::defaultTurnRate = 6.f

在文件 CrowdInternal.h 第 22 行定义.

◆ field

CrowdField eve::crowd::Crowd::Impl::field

在文件 CrowdInternal.h 第 18 行定义.

被这些函数引用 selectAvoidanceVelocity().

◆ goalWeight

float eve::crowd::Crowd::Impl::goalWeight = 1.f

在文件 CrowdInternal.h 第 30 行定义.

◆ gridCell

float eve::crowd::Crowd::Impl::gridCell = 1.f

在文件 CrowdInternal.h 第 76 行定义.

被这些函数引用 forEachNeighbor() , 以及 rebuildGrid().

◆ gridH

int eve::crowd::Crowd::Impl::gridH = 0

在文件 CrowdInternal.h 第 73 行定义.

被这些函数引用 forEachNeighbor() , 以及 rebuildGrid().

◆ gridOriginX

float eve::crowd::Crowd::Impl::gridOriginX = 0.f

在文件 CrowdInternal.h 第 74 行定义.

被这些函数引用 forEachNeighbor() , 以及 rebuildGrid().

◆ gridOriginY

float eve::crowd::Crowd::Impl::gridOriginY = 0.f

在文件 CrowdInternal.h 第 75 行定义.

被这些函数引用 forEachNeighbor() , 以及 rebuildGrid().

◆ gridW

int eve::crowd::Crowd::Impl::gridW = 0

在文件 CrowdInternal.h 第 72 行定义.

被这些函数引用 forEachNeighbor() , 以及 rebuildGrid().

◆ hasTargets

std::vector<uint8_t> eve::crowd::Crowd::Impl::hasTargets

在文件 CrowdInternal.h 第 59 行定义.

◆ headings

std::vector<float> eve::crowd::Crowd::Impl::headings

在文件 CrowdInternal.h 第 54 行定义.

被这些函数引用 selectAvoidanceVelocity().

◆ interactions

std::vector<AgentInteraction> eve::crowd::Crowd::Impl::interactions

在文件 CrowdInternal.h 第 60 行定义.

被这些函数引用 canInteract().

◆ maxAccels

std::vector<float> eve::crowd::Crowd::Impl::maxAccels

在文件 CrowdInternal.h 第 57 行定义.

被这些函数引用 selectAvoidanceVelocity().

◆ maxAgents

int eve::crowd::Crowd::Impl::maxAgents = 100000

在文件 CrowdInternal.h 第 33 行定义.

◆ maxSpeeds

std::vector<float> eve::crowd::Crowd::Impl::maxSpeeds

在文件 CrowdInternal.h 第 57 行定义.

被这些函数引用 selectAvoidanceVelocity().

◆ namedAgents

std::unordered_map<std::string, int> eve::crowd::Crowd::Impl::namedAgents

在文件 CrowdInternal.h 第 64 行定义.

◆ nextVxs

std::vector<float> eve::crowd::Crowd::Impl::nextVxs

在文件 CrowdInternal.h 第 55 行定义.

◆ nextVys

std::vector<float> eve::crowd::Crowd::Impl::nextVys

在文件 CrowdInternal.h 第 55 行定义.

◆ perceiveRadius

float eve::crowd::Crowd::Impl::perceiveRadius = 64.f

在文件 CrowdInternal.h 第 25 行定义.

被这些函数引用 rebuildGrid().

◆ preferredVxs

std::vector<float> eve::crowd::Crowd::Impl::preferredVxs

在文件 CrowdInternal.h 第 56 行定义.

被这些函数引用 selectAvoidanceVelocity().

◆ preferredVys

std::vector<float> eve::crowd::Crowd::Impl::preferredVys

在文件 CrowdInternal.h 第 56 行定义.

被这些函数引用 selectAvoidanceVelocity().

◆ radii

std::vector<float> eve::crowd::Crowd::Impl::radii

在文件 CrowdInternal.h 第 57 行定义.

被这些函数引用 selectAvoidanceVelocity().

◆ resolveOverlaps

bool eve::crowd::Crowd::Impl::resolveOverlaps = true

在文件 CrowdInternal.h 第 31 行定义.

◆ sepRadius

float eve::crowd::Crowd::Impl::sepRadius = 28.f

在文件 CrowdInternal.h 第 24 行定义.

被这些函数引用 rebuildGrid().

◆ sepWeight

float eve::crowd::Crowd::Impl::sepWeight = 1.f

在文件 CrowdInternal.h 第 26 行定义.

◆ simTime

float eve::crowd::Crowd::Impl::simTime = 0.f

在文件 CrowdInternal.h 第 34 行定义.

◆ sorted

std::vector<int32_t> eve::crowd::Crowd::Impl::sorted

在文件 CrowdInternal.h 第 71 行定义.

被这些函数引用 forEachNeighbor() , 以及 rebuildGrid().

◆ speeds

std::vector<float> eve::crowd::Crowd::Impl::speeds

在文件 CrowdInternal.h 第 54 行定义.

◆ stableIds

std::vector<std::string> eve::crowd::Crowd::Impl::stableIds

在文件 CrowdInternal.h 第 63 行定义.

被这些函数引用 selectAvoidanceVelocity().

◆ targetXs

std::vector<float> eve::crowd::Crowd::Impl::targetXs

在文件 CrowdInternal.h 第 61 行定义.

◆ targetYs

std::vector<float> eve::crowd::Crowd::Impl::targetYs

在文件 CrowdInternal.h 第 61 行定义.

◆ turnRates

std::vector<float> eve::crowd::Crowd::Impl::turnRates

在文件 CrowdInternal.h 第 57 行定义.

◆ vxs

std::vector<float> eve::crowd::Crowd::Impl::vxs

在文件 CrowdInternal.h 第 54 行定义.

被这些函数引用 selectAvoidanceVelocity().

◆ vys

std::vector<float> eve::crowd::Crowd::Impl::vys

在文件 CrowdInternal.h 第 54 行定义.

被这些函数引用 selectAvoidanceVelocity().

◆ wanderPhases

std::vector<float> eve::crowd::Crowd::Impl::wanderPhases

在文件 CrowdInternal.h 第 62 行定义.

◆ wanderWeight

float eve::crowd::Crowd::Impl::wanderWeight = 0.f

在文件 CrowdInternal.h 第 29 行定义.

◆ xs

std::vector<float> eve::crowd::Crowd::Impl::xs

SOA agent storage, indexed by compact slot id. @cost Linear in agent count; mutation keeps all owned vectors aligned.

在文件 CrowdInternal.h 第 54 行定义.

被这些函数引用 forEachNeighbor(), rebuildGrid() , 以及 selectAvoidanceVelocity().

◆ ys

std::vector<float> eve::crowd::Crowd::Impl::ys

在文件 CrowdInternal.h 第 54 行定义.

被这些函数引用 forEachNeighbor(), rebuildGrid() , 以及 selectAvoidanceVelocity().


该结构体的文档由以下文件生成: