Create a new roundabout controller.
unique junction ID matching the Three.js group's userData
distinct entry-group keys that feed into this roundabout
accessor returning the current simulation config
Convenience wrapper around canEnterSafelyAtPosition that derives the entry position from an angle and the outer-lane radius.
angle (radians) of the entry arm around the roundabout
fallback radius when lane geometry is unavailable
OptionalentryKey: stringentry-group key of the approaching arm
true if the vehicle may enter without conflict
Determine whether a vehicle may safely enter at the given world position, checking all circulating vehicles across every ring lane and detecting conflicting entries from other arms.
world position where the vehicle would enter
OptionalentryKey: stringentry-group key of the approaching arm
true if the gap is sufficient for safe entry
Revoke a vehicle's entry commitment.
unique identifier of the vehicle
Remove a vehicle from all tracking maps (circulating, committed, entering).
unique identifier of the vehicle
Mark a vehicle as committed to enter the roundabout. Optionally records the entry position for conflicting-entry detection.
unique identifier of the vehicle
OptionalentryPosition: Vector3world-space position of the entry point
OptionalentryKey: stringstring key identifying an entry point
Return the first entry key that currently has a green signal, or null.
the first green entry key, or null if none
Compute the world position of the entry point at the given angle and radius.
angle of the entry point in radians
radius in world units
the computed position vector
Determines which ring lane a world position is on based on distance from centre.
position identifier or vector
the ring-lane index (0 = innermost)
Get lane width
the lane width in world units
Return "GREEN" when the roundabout is empty, otherwise "AMBER".
the signal colour string
Get the outermost lane index
the outermost ring-lane index
Get the outermost lane radius (vehicles enter through this lane)
the outermost ring-lane radius
Human-readable summary of the controller's current state.
a human-readable state summary
Check whether a vehicle has been committed (cleared to enter).
unique identifier of the vehicle
true if the vehicle has been committed to enter
Returns true when no vehicles are circulating.
true when no vehicles are circulating
Register a vehicle as entering the roundabout (alias for commitVehicle).
unique identifier of the vehicle
Register a vehicle as exiting the roundabout (alias for clearVehicle).
unique identifier of the vehicle
Remove a vehicle from the circulating and entering tracking maps.
unique identifier of the vehicle
Sets the roundabout centre and optional per-lane mid-radii for gap detection.
world-space position of the roundabout centre
OptionallaneMidRadii: number[]mid-radius of each ring lane
Flag a circulating vehicle as currently exiting the roundabout.
unique identifier of the vehicle
whether the vehicle is currently exiting
Advance the internal clock by dt seconds.
time delta in seconds since last frame
Update (or insert) a circulating vehicle's position, speed, lane, and heading.
numeric vehicle identifier
current world position
current scalar speed
ring-lane index the vehicle is on
normalised forward direction
OptionalentryKey: stringoptional entry-group key the vehicle entered from
Position-based gap-acceptance controller for roundabout junctions. Tracks circulating vehicles per ring lane and checks entry clearance.