diff --git a/src/DotRecast.Detour.Crowd/DtCrowd.cs b/src/DotRecast.Detour.Crowd/DtCrowd.cs index 892c4b3..4bbc440 100644 --- a/src/DotRecast.Detour.Crowd/DtCrowd.cs +++ b/src/DotRecast.Detour.Crowd/DtCrowd.cs @@ -1141,6 +1141,9 @@ namespace DotRecast.Detour.Crowd for (int j = 0; j < ag.neis.Count; ++j) { DtCrowdAgent nei = ag.neis[j].agent; + if(!nei.option.contributeObstacleAvoidance || nei.option.obstacleAvoidanceWeight < ag.option.obstacleAvoidanceWeight) + continue; + _obstacleQuery.AddCircle(nei.npos, nei.option.radius, nei.vel, nei.dvel); } diff --git a/src/DotRecast.Detour.Crowd/DtCrowdAgentParams.cs b/src/DotRecast.Detour.Crowd/DtCrowdAgentParams.cs index ca78784..2c18ca0 100644 --- a/src/DotRecast.Detour.Crowd/DtCrowdAgentParams.cs +++ b/src/DotRecast.Detour.Crowd/DtCrowdAgentParams.cs @@ -53,6 +53,9 @@ namespace DotRecast.Detour.Crowd /// [Limits: 0 <= value < #DT_CROWD_MAX_OBSTAVOIDANCE_PARAMS] public int obstacleAvoidanceType; + public bool contributeObstacleAvoidance; + public float obstacleAvoidanceWeight; + /// The index of the query filter used by this agent. public int queryFilterType; diff --git a/src/package.json b/src/package.json index c521e17..bcb0950 100644 --- a/src/package.json +++ b/src/package.json @@ -1,5 +1,5 @@ { "name": "com.rnd.dotrecast", "displayName": "DotRecast", - "version": "0.1.4-exp.1" + "version": "0.2.0" } \ No newline at end of file