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; };
IPathfinder.h
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.
union Location { struct { int nBuildingID; } waypoint; };
IPathfinder.h
Members |
Description |
int nBuildingID; |
no node because the node "areas" can overlap so it's not useful |
float costAddMod;
absolute cost added to any link going through this blocker (useful for small blockers)
float costMultMod;
multiplier for link costs going through this blocker (0 means no extra cost, 1 means to double etc)
bool directional;
Location location;
Only gets used if restrictedLocation = true
IAISystem::ENavigationType navType;
bool radialDecay;
bool restrictedLocation;
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.
Sphere sphere;
NavigationBlocker();
Just to allow std::vector::resize(0)
NavigationBlocker(const Vec3& pos, float radius, float costAddMod, float costMultMod, bool radialDecay, bool directional);
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