载入中...
搜索中...
未找到
BoidsCommon.h
浏览该文件的文档.
23inline bool isInFieldOfView(const glm::vec3& forward, const glm::vec3& toNeighbor, float fovDegrees) {
46inline NeighborAccum gatherNeighbors(std::span<const AgentState> agents, int selfIndex, const glm::vec3& forward,
76inline glm::vec3 markerForce(const glm::vec3& pos, const std::vector<EnvironmentMarker>& markers, bool attract) {
90inline void integrateBoid(AgentState& out, const AgentState& in, glm::vec3 accel, float dt, float maxAccel,
108 glm::vec3 prevH = glm::normalize(glm::vec3(prevDir.x, 0.f, prevDir.z) + glm::vec3(1e-5f, 0.f, 0.f));
109 glm::vec3 newH = glm::normalize(glm::vec3(newDir.x, 0.f, newDir.z) + glm::vec3(1e-5f, 0.f, 0.f));
Definition BoidsCommon.h:12
float compactWeight(float dist, float radius)
Compact-support radial weight w(q)=(1-q)^2 for q in [0,1).
Definition BoidsCommon.h:15
bool isInFieldOfView(const glm::vec3 &forward, const glm::vec3 &toNeighbor, float fovDegrees)
True when neighbor direction is inside a forward cone (degrees).
Definition BoidsCommon.h:23
glm::vec3 markerForce(const glm::vec3 &pos, const std::vector< EnvironmentMarker > &markers, bool attract)
Marker force.
Definition BoidsCommon.h:76
void integrateBoid(AgentState &out, const AgentState &in, glm::vec3 accel, float dt, float maxAccel, float maxSpeed, float maxHTurn, float maxVTurn)
Clamp acceleration then integrate semi-implicit Euler with turn-rate limits.
Definition BoidsCommon.h:90
NeighborAccum gatherNeighbors(std::span< const AgentState > agents, int selfIndex, const glm::vec3 &forward, float sepR, float cohR, float aliR, float fovDeg, int maxSamples)
Gather neighborhood forces with compact weights and FOV / sample caps.
Definition BoidsCommon.h:46
glm::quat lookRotation(const glm::vec3 &forward, const glm::vec3 &upHint=glm::vec3(0.f, 1.f, 0.f))
Builds a facing quaternion from a unit forward and approximate up.
Definition AgentState.h:36
Standardized per-agent simulation output shared by all effect kinds.
Definition AgentState.h:12
glm::vec3 alignmentVel
Definition BoidsCommon.h:36