Document toolboxDocument toolbox

2023.1.1344.2 Junction Cue



Overview

The goal of the Junction Cue is to make it possible to connect splines together to form road junctions so that actors on the incoming spline can chose on which outgoing spline to continue their journey. The Junction Cue is based on the DES Cue and it needs a DES Instructor to control the switching between the outgoing splines. Please find some screenshots and videos in the “How to Use” paragraph at the end of this page.

Example: The Junction Cue is used to let an AGV deliver boxes to different conveyor belts.


Where to find

 

The Junction Cue can be found under Add Component in the Inspector as shown below. It is not yet available under the Prespective Menu. The Junction Cue must be parented under a DSpline in the hierarchy.


Feature Layout

The following image shows the complete feature layout of the Junction Cue inspector. The top part of the Inspector is related to the DESCue baseclass and it is therefore described in the DESCue User Documentation https://unit040.atlassian.net/wiki/spaces/PRDO/pages/1981087829 . The bottom part is related to the Junction Cue and each field is described below.

Junction Settings

 

Main Junction Point
Connected Junction Point #0/1/2

 

Target Spline

Specify the spline connected to the Junction Point:

  • Drag spline game object into this field from the Hierarchy

  • Select spline in the pulldown menu at the icon on the right

This field is not visible for the Main Junction Point Spline, because this spline is implicitly defined as the parent Spline of the Junction Cue in the hierarchy.

Junction Mode

Use pull down menu to select how the Junction Point is connected to the Main Spline:

  • Control Point: The Junction Point is on one of the Control Points of the Connected Spline

  • Spline Percentage: The Junction Point is on a percentage of the Connected Spline

  • Spline Distance from Start: The Junction Point is at a distance from the start of the Connected Spline

  • Spline Distance from End: The Junction Point is at a distance from the end of the Connected Spline

Access Switching

This pull down menu selects from which direction an actor can go over the junction point:

  • ForwardMoveOnly: The actor is only allowed to use the junction point by moving forwards

  • BackwardsMoveOnly: The actor is only allowed to use the junction point by moving backwards

  • BidirectionalMove: The actor is allowed to use the junction point from both directions

Target Control Point

Pull down menu selects which spline control point to connect to:

  • Point[1]: Connect to control point 1

  • Point[2]: Connect to control point 2

This field is shown when Junction Mode = Control Point

Spline Percentage

Specify at which percentage of the spline the Junction Point is on. This field is only shown when Junction Mode is set to Spline Percentage. The range is 0.0 - 1.0 (not 0-100).

Distance From Spline Start

Specify the distance between the start of the spline and the Junction Point in Unity units. This field is only shown when Junction Mode is set to Spline Distance From Start.

Distance From Spline End

Specify the distance between the end of the spline and the Junction Point in Unity units. This field is only shown when Junction Mode is set to Spline Distance From End.

Add Junction Point (button)

Button adds an extra Connected Junction Point.

Remove Junction Point (button)

Button removes the specific Connected Junction Point

Enable Snapping Mode (toggle)

This toggle button is used to enable/disable snapping mode:

  • Enable: Snap all splines (except the target spline) to the target spline specified in the Snapping Mode pull down menu.

  • Disable: Don’t snap splines together

Snapping is only possible if the junction points that need to snap are in Junction Mode Control Point. In any other mode this button will disappear and a warning will be shown.

Snapping Mode

Sets the target spline to snap to:

  • Main Junction Point: Snap ConnectedSpline0 and ConnectedSpline1 to MainSpline (default)

  • Connected Junction Point 0: Snap MainSpline and ConnectedSpline1 to ConnectedSpline0

  • Connected Junction Point 1: Snap MainSpline and ConnectedSpline0 to ConnectedSpline1


How to use

The JunctionCue can only be inserted manually at this moment:

Add a JunctionCue to a Spline

  1. Create empty game object > Add Component > DES Controller

  2. Create empty game object > Add Component > D Spline

  3. Create empty game object > Add Component > Junction Cue

  4. Parent the DSpline under the DES Controller

  5. Parent the Junction Cue under the DSpline

  6. Set the Junction Mode to Spline Percentage:
    Inspector > Junction Settings > Main Junction Point > Junction Mode = Spline Percentage

  7. Set the Junction Cue position on the spline either by:
    1. Set the SplinePercentage, or
    2. Enable “Retain World Position” toggle button and move the JunctionCue using the arrow gizmo

Snap Two Splines Together

  1. Create empty game object > Add Component > DES Controller

  2. Create empty game object > Add Component > D Spline > Rename to MainSpline

  3. Create empty game object > Add Component > D Spline > Rename to ConnectedSpline

  4. Create empty game object > Add Component > Junction Cue

  5. Parent both DSplines under the DES Controller

  6. Parent the Junction Cue under the MainSpline

  7. Select the DES Controller > Inspector > Transform > Reset (resets XYZ)

  8. Select the ConnectedSpline

  9. Set ControlPoint[2] to X=0 Z=1

  10. Select the Junction Cue

  11. Main Junction Point > Junction Mode = Spline Percentage

  12. Drag the ConnectedSpline from the hierarchy to the TargetSpline of ConnectedJunctionPoint#0

  13. Connected Junction Point #0 > Junction Mode = Control Point

  14. Enable Snapping Mode = Turn the toggle box ON

  15. SnappingMode = Main Junction Point

  16. Move the JunctionCue along the MainSpline in two ways:
    1. Set the SplinePercentage of MainJunctionPoint
    2. Enable the “Retain World Position” toggle button (top of inspector) and move the JunctionCue using the arrow gizmo

 

Prespective Documentation