Scene Panels
The ImGui UI panels for browsing and editing the scene graph.
SceneHierarchyPanel (Left Panel)
Located at src/MeshCraft/Scene/SceneHierarchyPanel.cpp. Width: 220 px.
Displays the scene's object tree in a scrollable, indented list. Features:
- Recursive rendering with depth indentation and collapse/expand toggles for group-type nodes (Group, CSG, Instance).
- Type color strip and icon — each object type has a distinctive left-border color.
- Click to select; Ctrl+click for multi-select.
- Visibility toggle (eye icon per row).
- Inline rename: double-click or right-click → Rename. A text input appears; Enter commits, Escape cancels.
- Drag-and-drop reparenting: drag an object onto another to make it a child; drop on the footer area to promote to root.
- Search filter: a text field at the top filters the displayed nodes by name.
- Right-click context menu: Rename, Delete, Duplicate, Group, etc.
The hierarchy panel populates hierarchyRows_ during its draw call. These rows are then consumed by Update() in the next frame to handle mouse interaction. This intentional 1-frame lag is invisible to users.
PropertiesPanel (Right Panel)
Located at src/MeshCraft/Scene/PropertiesPanel.cpp. Width: 220 px.
Shows editable properties for the selected object. Organized into tabs:
Object Tab
- Name: click to rename (Enter applies, Escape cancels).
- Type: read-only label.
- Position / Rotation / Scale: DragFloat3 fields. Click a field to type a value; drag for continuous adjustment.
- Pivot: DragFloat3 for the rotation/scale pivot offset.
- [K] buttons: insert keyframes at the current animation time for Position, Rotation, Scale, Visible.
- Material: color swatch + dropdown to assign from the document's material list.
- Collision type: editable string field.
- Visible: checkbox.
- Tags: editable tag list.
- Type-specific fields: radius, height, segments for spheres/cylinders/cones; size for boxes/planes; etc.
Lights Tab
List of scene lights. Create, delete, and edit each light's type, name, color, brightness, position, direction, range, angle, cast_shadows.
Cameras Tab
List of scene cameras. Create, delete, and edit position, target, FOV, near/far, projection type.
Textures Tab
List of scene textures. Create, delete, edit URI, wrap modes, filter, color space.
Materials Tab
Full inline PBR material editor: baseColor RGBA picker, metallic/roughness sliders, emissive color, alpha mode, alpha cutoff, double-sided toggle, and five texture slot dropdowns (base color, normal, metallic-roughness, occlusion, emissive).
Defs Tab
Definitions manager. Add/remove definitions; rename (propagates to all Instance references); edit definition's root object transform and type.