Expand description
Takes care of the placing functionality of the track editor.
Implemented using bevyโs state machines. The current shape and current step are tracked via their respective states, CurrentShape and CurrentStep. Keybinds change states and systems responding to state changes change the virtual node, segment, etc. Observers are then used to change between virtual and physical from/to node types.
Modulesยง
- gizmos ๐
- input_
handlers ๐ - move_
to_ ๐cursor - observers ๐
- states ๐
Structsยง
- From
Node ๐Type - Used to determine whether to place the segment from a physical node or the virtual one (cursor position).
- Last
Connected ๐Block - Keeps track of the last connected block so that segments which either do not have any node to take blocks from or the choice of a block would be too ambiguous can join this one.
- Placing ๐
- Marker component for entities which pertain to this editor.
- Placing
Plugin - Virtual
Node ๐ - A virtual track node. Used to provide the user visual feedback on where the next node is going to be placed.
- Virtual
Segment ๐ - A virtual track segment. Stores the information needed to place a new track segment, like its neighbouring nodes and current shape.
Enumsยง
- Node
Type ๐ - A node type. Used together with FromNodeType and in the VirtualSegment to determine if the node is a virtual one (currently not existing and needing to be placed), or a physical one (already placed).
Functionsยง
- register_
state_ ๐handlers - take_
points ๐ - update_
state_ ๐text