NavigationBlocker

C++
struct NavigationBlocker {
  Sphere sphere;
  bool radialDecay;
  bool directional;
  float costAddMod;
  float costMultMod;
  bool restrictedLocation;
  IAISystem::ENavigationType navType;
  union Location {
    struct {
      int nBuildingID;
    } waypoint;
  };
  Location location;
};
File

IPathfinder.h

Description

NavigationBlocker Represents an object that might be blocking a link. Each blocker is assumed to be spherical, with the position centred around the floor so that links can intersect it.

NavigationBlocker::Location Union
C++
union Location {
  struct {
    int nBuildingID;
  } waypoint;
};
File

IPathfinder.h

Members
Members
Description
int nBuildingID;
no node because the node "areas" can overlap so it's not useful
NavigationBlocker::costAddMod Data Member
C++
float costAddMod;
Description

absolute cost added to any link going through this blocker (useful for small blockers)

NavigationBlocker::costMultMod Data Member
C++
float costMultMod;
Description

multiplier for link costs going through this blocker (0 means no extra cost, 1 means to double etc)

NavigationBlocker::directional Data Member
C++
bool directional;
NavigationBlocker::location Data Member
C++
Location location;
Description

Only gets used if restrictedLocation = true

NavigationBlocker::navType Data Member
C++
NavigationBlocker::radialDecay Data Member
C++
bool radialDecay;
NavigationBlocker::restrictedLocation Data Member
C++
bool restrictedLocation;
Description

info to speed up the intersection checks If this is true then the blocker is small enough that it only affects the nav type it resides in. If false then it affects everything.

NavigationBlocker::sphere Data Member
C++
Sphere sphere;
NavigationBlocker::NavigationBlocker Constructor ()
C++
NavigationBlocker();
Description

Just to allow std::vector::resize(0)

NavigationBlocker::NavigationBlocker Constructor (Vec3&, float, float, float, bool, bool)
C++
NavigationBlocker(const Vec3& pos, float radius, float costAddMod, float costMultMod, bool radialDecay, bool directional);
Description

pos and radius define the sphere. costAddMod is a fixed cost (in m) associated with the blocker obscuring a link - a value of 0 has no effect - a value of 10 would make the link effectively 10m longer than it is. costMultMod is the cost modification factor - a value of 0 has no effect - a value of 10 would make the link 10x more costly. -ve disables the link radialDecay indicates if the cost modifiers should decay linearly to 0 over the radius of the sphere directional indicates if the cost should be unaffected for motion in a radial direction