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
ScaleByAgentScale (agentScale)
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
DrawChisel (start, direction, pointiness, length, width, draw, col)
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
MaxAngle (a, b, clockwise)

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

Public Static
OffsetCornerForApproach (position2D, endOfPath2D, facingDir2D, settings, nextCorner2D, gammaAngle, gammaAngleWeight, debugFlags, draw, edges)
Public Static
OptimizeDirection (start, end, desiredRadius, remainingDistance, pointiness, edges, draw, debugFlags)

Finds a direction to move in that is as close as possible to the desired direction while being clear of obstacles, if possible.

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
SplitSegment (e1, e2, desiredRadius, length, pointiness, buffers)
Public Static
SplitSegment2 (e1, e2, desiredRadius, pointiness, buffers)
Public Static
SplitSegment3 (e1, e2, desiredRadius, inTriangularRegion, buffers)
Public Static
SplitSegment4 (e1, e2, inTriangularRegion, left, buffers)
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, in seconds.

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