Struct PIDMovement

Public

Core control loop for the FollowerEntity movement script.

Inner Types

Public Methods

Accelerate (speed, timeToReachMaxSpeed, dt)

Accelerates as quickly as possible.

CurveFollowingStrength (signedDistToClearArea, radiusToWall, remainingDistance)
ScaleByAgentScale (agentScale)
Speed (remainingDistance)

Public Static Methods

ClipLineByHalfPlaneX (a, b, x, side)
ClipLineByHalfPlaneYt (a, b, y, side, mnT, mxT)
Control (settings, dt, controlParams, draw, maxDesiredWallDistance)
DrawChisel (start, direction, pointiness, length, width, draw, col)
InterestingEdgeBounds (settings, position, nextCorner, height, plane)

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

Linecast (a, b, edges)
MaxAngle (a, b, [c], clockwise)

Returns either the most clockwise, or most counter-clockwise direction of the t...

OffsetCornerForApproach (position2D, endOfPath2D, facingDir2D, settings, nextCorner2D, gammaAngle, gammaAngleWeight, debugFlags, draw, edges)
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.

SmallestDistanceWithinWedge (point, dir1, dir2, shrinkAmount, edges)

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

SplitSegment (e1, e2, desiredRadius, length, pointiness, buffers)
SplitSegment2 (e1, e2, desiredRadius, pointiness, buffers)
SplitSegment3 (e1, e2, desiredRadius, inTriangularRegion, buffers)
SplitSegment4 (e1, e2, inTriangularRegion, left, buffers)

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 rotating 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