Struct PIDMovement

Public

Core control loop for the FollowerEntity movement script.

Inner Types

Public Methods

Accelerate (speed, timeToReachMaxSpeed, dt)

Accelerates as quickly as possible.

Public
CurveFollowingStrength (signedDistToClearArea, radiusToWall, remainingDistance)
Public
SidewaysAvoidance (position, reference, edges, estimatedForward, maxDesiredWallDistance, remainingDistance, draw, debugFlags, centerRadius, signedDistToCurve, signedDistToClearArea)
Public
Speed (remainingDistance)
Public

Public Static Methods

ClipLineByHalfPlaneX (a, b, x, side)
Public Static
ClipLineByHalfPlaneYt (a, b, y, side, mnT, mxT)
Public Static
Control (settings, dt, controlParams, draw, maxDesiredWallDistance)
Public Static
InterestingEdgeBounds (settings, position, nextCorner, height, plane)

Finds the bounding box in which this controller is interested in navmesh edges.

Public Static
Linecast (a, b, edges)
Public Static
MaxAngle (a, b, c, clockwise)

Returns either the most clockwise, or most counter-clockwise direction of the three given directions.

Public Static
OffsetCornerForApproach (position2D, endOfPath2D, facingDir2D, settings, nextCorner2D, gammaAngle, gammaAngleWeight, debugFlags, draw, edges)
Public Static
OptimizeDirection (start, end, desiredRadius, remainingDistance, edges, draw, debugFlags)
Public Static
SegmentPointDistanceSq (e1, e2, point)
Public Static
SmallestDistance (point, edges)
Public Static
SmallestDistanceWithinWedge (point, dir1, dir2, shrinkAmount, edges)

Calculates the closest point on any point of an edge that is inside a wedge.

Public Static

Public Variables

allowRotatingOnSpot

If rotation on the spot is allowed or not.

Public
allowRotatingOnSpotBacking

If rotation on the spot is allowed or not.

Public
desiredWallDistance

How big of a distance to try to keep from obstacles.

Public
leadInRadiusWhenApproachingDestination

How wide of a turn to make when approaching a destination for which a desired facing direction has been set.

Public
maxOnSpotRotationSpeed

Maximum rotation speed in degrees per second while rotating on the spot.

Public
maxRotationSpeed

Maximum rotation speed in degrees per second.

Public
rotationSpeed

Desired rotation speed in degrees per second.

Public
slowdownTime

Time for the agent to slow down to a complete stop when it approaches the destination point.

Public
slowdownTimeWhenTurningOnSpot

Time for the agent to slow down to a complete stop when it decides to change direction by turning on the spot.

Public
speed

Desired speed of the agent in meters per second.

Public

Public Static Variables

ALLOWED_OVERLAP_FACTOR
Public Static
DESTINATION_CLEARANCE_FACTOR
Public Static
MAX_FRACTION_OF_REMAINING_DISTANCE
Public Static
OPTIMIZATION_ITERATIONS
Public Static
STEP_MULTIPLIER
Public Static

Public Enums

DebugFlags
Public

Private/Protected Members

MarkerConvertObstacles
Private Static Readonly
MarkerOptimizeDirection
Private Static Readonly
MarkerPID
Private Static Readonly
MarkerSidewaysAvoidance
Private Static Readonly
MarkerSmallestDistance
Private Static Readonly