BoomConnectionTemplate is Physics3D.System:
    #############################
    # Common for the alternatives

    # Force system origin at origin of parent
    local_transform.position.x: 0

    # Two crane bodies
    boom_1 is MachineComponents.CraneSystemComponentNoVisuals
    boom_2 is MachineComponents.CraneSystemComponentNoVisuals
    # One hydraulic cylinder
    cylinder is MachineComponents.HydraulicCylinder

    # The connection between the two booms
    boom_1_boom_2_connection is Connections.AxleBearingConnection:
        input: boom_2.input
        output: boom_1.output

    # The connection of the cylinder to ground of the first boom
    boom_1_cylinder_connection is Connections.AxleBearingConnection:
        input: cylinder.piston.axle_bearing_interface
        output: boom_1.ground

    # Lock in axial direction of the second boom and the cylinder
    # to the first boom
    boom_1_boom_2_lock is Connections.AxleLock:
        connectors: [boom_1.output_bearing_left, boom_2.input_bearing_left]
    boom_1_cylinder_lock is Connections.AxleLock:
        connectors: [boom_1.ground_bearing_left, cylinder.piston.bearing_left]
