Toast Engine
Loading...
Searching...
No Matches
toast::Workspace::VoxelToolState Struct Reference

#include <workspace.hpp>

Collaboration diagram for toast::Workspace::VoxelToolState:

Public Types

enum class  Phase : uint8_t {
  idle , face , part , box ,
  height , cut , pick_side
}

Public Member Functions

auto box () const -> std::pair< glm::ivec3, glm::ivec3 >

Public Attributes

uint32_t tool = 0
uint8_t paint_id = 1
UID default_script
 What new volumes draw with.
uint8_t default_mode = 0
 voxel::WriteMode new fill volumes land with
Phase phase = Phase::idle
bool dragging = false
 if its drawing the mouse make it 2 clicks rather than 3
UID extrude_source
 The piece Extrude grows from.
int axis = 2
 The face the box lies on.
int32_t surface = 0
 The voxel layer of the face that was clicked.
float plane = 0.0f
 Where along axis the mouse ray is cut to find the rectangle.
int32_t sign = 1
 Which way is out of the face.
int32_t depth = 1
glm::ivec3 anchor {0}
glm::ivec3 current {0}
glm::ivec3 face_min {std::numeric_limits<int32_t>::min()}
 Extrude keeps the footprint on its face.
glm::ivec3 face_max {std::numeric_limits<int32_t>::max()}
int cut_axis = 0
 Extrude: 0 first in face axis, 1 second.
int32_t cut_at = 0
 Extrude: the voxel boundary the cut sits on.
glm::vec2 cut_start {0.0f}
glm::vec4 cut_plane {0.0f}

Detailed Description

The VoxelEditor tools in the 3D viewport

Member Enumeration Documentation

◆ Phase

enum class toast::Workspace::VoxelToolState::Phase : uint8_t
strong
Enumerator
face 

Extrude: the cut line follows the mouse over a face of the selected box, Tab swaps its axis.

part 

Extrude: the cut is set, the part of the face under the mouse is the one that grows.

box 

Dragging the footprint on a face for buildup, carve or paint.

height 

Moving the mouse pulls the footprint out, a click places it.

cut 

Dragging the Split or Slice line.

pick_side 

Slice waits for a click on the side to keep.

Member Function Documentation

◆ box()

auto toast::Workspace::VoxelToolState::box ( ) const -> std::pair< glm::ivec3, glm::ivec3 >
nodiscard

The footprint pulled depth layers out of the face, or into it when negative


The documentation for this struct was generated from the following files:
  • engine/src/toast/world/workspace.hpp
  • engine/src/toast/world/workspace_voxel.cpp