#
# HELP: SYNOPSIS:
# HELP:     sonoctux/options/cutaway
# HELP:
# HELP: DESCRIPTION:
# HELP:     En-/Disable a Cut away view shown over the PlanesYZ view.
#

DECLARE struct $help

IF ${((int)$argv[1])!=1} GOTO cutaway_off

# Start from the main view.
VIEW_SET Main
# Make it autorender on move. Gets confusing if you don't.
# draw not only when current view
VIEW_DRAWWHENFLAGS &~0x04

VIEW_SET Planes_YZ
GWINDOW
CECHO ${$help=$root.rc}
VIEW_ADD Cutaway
VIEW_CAMERA_JOIN Main Cutaway
VIEW_RENDER
VIEW_SET Cutaway
VIEW_SIZE ${$root.view[Main].size.x} ${$root.view[Main].size.y}
MARKER_DEL Cutaway
# make it float 2cm ahead
VIEW_OFFSET 20 0 0
RENDERER_ENGINE Greyplane
CAMERA_GEOMETRY PAR
GWINDOW ${$help.start} ${$help.end}
ZOOM 2
RENDERER_MODE IGREY
# draw not only when current view
VIEW_DRAWWHENFLAGS &~0x04
VIEW_ORIENT BEFORE Planes_YZ
MARKER_VIS 4

VIEW_SET Main

VIEW_RENDER
USLEEP 500000
VIEW_REORIENT
VIEW_RENDER

QUIT

# Turn it off again
:cutaway_off

# Start from the main view.
# Stop it form autorendering.
VIEW_SET Main
# draw only when current view
VIEW_DRAWWHENFLAGS |0x04

VIEW_DEL Cutaway
VIEW_SET Main
