载入中...
搜索中...
未找到
CrowdAvoidance.cpp
浏览该文件的文档.
16constexpr std::int64_t scoresPerNeighbor = 3 + std::size(predictionAngles) * std::size(predictionFractions);
25 Diagnostic::error(DiagnosticCode::InvalidArgument, "Invalid predictive avoidance settings", "avoidance"));
43 const auto prepareRange = [&](size_t first, size_t last, StepReport* partitionReport, std::int64_t& checks,
114 partition.report.candidatesVisited > activeBudget.maxNeighborVisits - workReport.candidatesVisited)
150 std::hypot(x - preferredX, y - preferredY) / speed + 0.15 * std::hypot(x - vxs[i], y - vys[i]) / speed;
186 if (clampToField && (px - radii[i] < field.getOriginX() || py - radii[i] < field.getOriginY() ||
210 const float baseAngle = preferredLength > 1e-5f ? std::atan2(preferredY, preferredX) : headings[i];
#define EV_PROFILE_MODULE(module, name)
Profile the enclosing scope, tagged with a module for grouping.
Definition Profile.h:158
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.cpp:21
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:196
static Status success(StatusCode code=StatusCode::Ok)
Construct a successful status with an explicit non-error outcome.
Definition Status.cpp:19
bool resolvePenetration(float &wx, float &wy, float radius) const
圆 vs 阻挡格碰撞消解:把圆心从覆盖到的阻挡格中推出来。
Definition CrowdField.cpp:373
Result< void > configureAvoidance(AvoidanceSettings settings)
Configure predictive velocity sampling; invalid input leaves settings unchanged.
Definition CrowdAvoidance.cpp:20
AvoidanceSettings getAvoidanceSettings() const
Return an owning settings snapshot. @thread Simulation thread only.
Definition CrowdAvoidance.cpp:30
Definition Crowd.cpp:14
@ InvalidArgument
@ Applied
Optional bounded velocity sampling for RTS local avoidance.
Definition Crowd.h:129
std::vector< float > xs
SOA agent storage, indexed by compact slot id. @cost Linear in agent count; mutation keeps all owned ...
Definition CrowdInternal.h:167
std::vector< float > preferredVys
Definition CrowdInternal.h:169
void prepareAvoidanceNeighbors()
Definition CrowdAvoidance.cpp:32
std::vector< float > preferredVxs
Definition CrowdInternal.h:169
bool canContact(size_t a, size_t b) const
Definition CrowdInternal.h:227
bool canAvoid(size_t a, size_t b) const
Definition CrowdInternal.h:231
void dispatchWork(std::size_t items, const std::function< void(std::size_t, std::size_t)> &body)
Definition CrowdScheduler.cpp:17
void forEachNeighbor(float qx, float qy, float radius, Fn &&fn, StepReport *partitionReport=nullptr) const
Definition CrowdInternal.h:248
std::vector< InteractionPolicy > interactions
Definition CrowdInternal.h:173
std::vector< int32_t > avoidancePriorities
Definition CrowdInternal.h:171
std::vector< std::vector< AvoidanceNeighbor > > predictionNeighbors
Per-step avoidance neighbor scratch space. @cost Linear in checked neighbors and bounded by avoidance...
Definition CrowdInternal.h:160
void selectAvoidanceVelocity(size_t index, float dt, float &vx, float &vy)
Definition CrowdAvoidance.cpp:126
Owning observations of one completed advance; simulation-thread only.
Definition Crowd.h:94
std::int64_t cellsVisited
Occupied cells enumerated by all neighborhood queries.
Definition Crowd.h:105
std::int64_t spatialVisits
Query row/cell enumeration and binary-search comparisons.
Definition Crowd.h:108
std::int64_t candidatesVisited
Bucket entries inspected before radius or interaction filtering.
Definition Crowd.h:111
Non-allocating internal unwind signal, translated at the checked simulation boundary.
Definition CrowdSpatialIndex.h:13