NPC separation adjustments (#13176)
This commit is contained in:
@@ -394,7 +394,8 @@ public sealed partial class NPCSteeringSystem
|
|||||||
(layer & otherBody.CollisionMask) == 0x0 ||
|
(layer & otherBody.CollisionMask) == 0x0 ||
|
||||||
!factionQuery.TryGetComponent(ent, out var otherFaction) ||
|
!factionQuery.TryGetComponent(ent, out var otherFaction) ||
|
||||||
!_faction.IsFriendly(uid, ent, ourFaction, otherFaction) ||
|
!_faction.IsFriendly(uid, ent, ourFaction, otherFaction) ||
|
||||||
Vector2.Dot(otherBody.LinearVelocity, ourVelocity) < 0f)
|
// Use <= 0 so we ignore stationary friends in case.
|
||||||
|
Vector2.Dot(otherBody.LinearVelocity, ourVelocity) <= 0f)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -415,7 +416,7 @@ public sealed partial class NPCSteeringSystem
|
|||||||
obstacleDirection = offsetRot.RotateVec(obstacleDirection);
|
obstacleDirection = offsetRot.RotateVec(obstacleDirection);
|
||||||
var norm = obstacleDirection.Normalized;
|
var norm = obstacleDirection.Normalized;
|
||||||
var weight = obstableDistance <= agentRadius ? 1f : (detectionRadius - obstableDistance) / detectionRadius;
|
var weight = obstableDistance <= agentRadius ? 1f : (detectionRadius - obstableDistance) / detectionRadius;
|
||||||
weight *= 1.5f;
|
weight *= 1f;
|
||||||
|
|
||||||
for (var i = 0; i < InterestDirections; i++)
|
for (var i = 0; i < InterestDirections; i++)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user