Toast Engine
Loading...
Searching...
No Matches
toast::PaintVolume Class Reference

#include <paint_volume.hpp>

Inheritance diagram for toast::PaintVolume:
Collaboration diagram for toast::PaintVolume:

Public Member Functions

auto kind () const noexcept -> PieceKind override
auto writeMode () const noexcept -> voxel::WriteMode override
Public Member Functions inherited from toast::VoxelVolume
auto getId () const -> int
void setId (int value)
void setSize (glm::vec3 value)
auto getMode () const -> voxel::WriteMode
void setMode (voxel::WriteMode value)
auto getMatchId () const -> int
void setMatchId (int value)
auto sizeVoxels () const noexcept -> glm::ivec3
void setSizeVoxels (glm::ivec3 size)
auto resizable () const noexcept -> bool override
auto writeMode () const noexcept -> voxel::WriteMode override
auto matchId () const noexcept -> uint8_t override
Public Member Functions inherited from toast::VoxelPiece
auto getSize () -> glm::vec3
auto getVoxel (glm::vec3 pos) -> int
void setVoxel (glm::vec3 pos, int id)
void removeVoxel (glm::vec3 pos)
void fillBox (glm::vec3 min, glm::vec3 max, int id, voxel::WriteMode mode=voxel::WriteMode::replace, int match_id=0)
void fillRoundBox (glm::vec3 min, glm::vec3 max, float radius, int id, voxel::WriteMode mode=voxel::WriteMode::replace, int match_id=0)
void fillSphere (glm::vec3 center, float radius, int id, voxel::WriteMode mode=voxel::WriteMode::replace, int match_id=0)
void fillEllipsoid (glm::vec3 min, glm::vec3 max, int id, voxel::WriteMode mode=voxel::WriteMode::replace, int match_id=0)
void fillCylinder (glm::vec3 a, glm::vec3 b, float radius, int id, voxel::WriteMode mode=voxel::WriteMode::replace, int match_id=0)
void fillCapsule (glm::vec3 a, glm::vec3 b, float radius, int id, voxel::WriteMode mode=voxel::WriteMode::replace, int match_id=0)
void carveBox (glm::vec3 min, glm::vec3 max)
void carveSphere (glm::vec3 center, float radius)
void paintBox (glm::vec3 min, glm::vec3 max, int id)
void stamp (const assets::Handle< assets::VoxelModel > &asset, glm::vec3 pos, glm::quat rotation=glm::quat(1.0f, 0.0f, 0.0f, 0.0f), voxel::WriteMode mode=voxel::WriteMode::replace, int match_id=0)
void tile (const assets::Handle< assets::VoxelModel > &asset, int fit=0, glm::vec3 anchor=glm::vec3(0.0f), glm::vec3 offset=glm::vec3(0.0f), glm::vec3 mirror=glm::vec3(0.0f), voxel::WriteMode mode=voxel::WriteMode::replace, int match_id=0)
void redraw ()
auto getShapeScript () const -> const assets::Handle< assets::Script > &
void setShapeScript (assets::Handle< assets::Script > script)
auto getClipPlanes () const -> std::vector< glm::vec4 >
void setClipPlanes (std::vector< glm::vec4 > planes)
void addClipPlane (glm::vec4 plane)
void clearClipPlanes ()
auto getShapeBounds () -> std::vector< glm::vec3 >
auto getShape () -> Box< Node >
auto isMisaligned () const noexcept -> bool
virtual auto sourcePaletteUid () const -> uint64_t
auto grid () -> const voxel::Volume *
auto gridRef () -> GridRef
void requestGrid ()
auto collectGrid () -> bool
auto readyGrid () -> GridRef
auto gridBuilding () const noexcept -> bool
auto gridStale () const noexcept -> bool
void waitForGrid ()
auto inputRevision () const noexcept -> uint32_t
auto buildCount () const noexcept -> uint32_t
auto clipPlanes () const noexcept -> const std::vector< glm::vec4 > &
auto nominalSize () -> glm::ivec3
void releaseGrid ()
void setMisaligned (bool misaligned)
Public Member Functions inherited from toast::Node3D
auto raycast (glm::vec3 dir, glm::vec3 offset=glm::vec3(0.0f), float max_distance=-1.0f, bool ignore_self=true, const std::vector< int > &layers=std::vector< int > {}) const -> std::optional< physics::RayHit >
 The nearest thing a ray from this node hits.
auto raymulticast (glm::vec3 dir, glm::vec3 offset=glm::vec3(0.0f), float max_distance=-1.0f, int max_hits=-1, bool ignore_self=true, const std::vector< int > &layers=std::vector< int > {}) const -> std::vector< physics::RayHit >
 Up to max_hits things collisions.
auto linecast (glm::vec3 from, glm::vec3 to, int max_hits=-1, bool ignore_self=true, const std::vector< int > &layers=std::vector< int > {}) const -> std::vector< physics::RayHit >
 Everything on the line between two points, nearest to from first.
void lookAt (glm::vec3 target, glm::vec3 up={0.0f, 0.0f, 1.0f})
 Orients the node so its forward axis points at a world-space target.
void lookAtZ (glm::vec3 target)
 lookAt() constrained to the XY plane; the node faces the target with no roll
auto up () const -> glm::vec3
auto forward () const -> glm::vec3
void syncTransform () const
void syncWorldTransform () const
void refreshTransformParent ()
auto getTransform () const noexcept -> const glm::mat4 &
auto getWorldTransform () const noexcept -> const glm::mat4 &
virtual void onEditorTransformChanged ()
Public Member Functions inherited from toast::Node
auto uid () const noexcept -> const UID &
 Stable unique identifier, assigned at construction or deserialization. Never changes.
auto rid () const noexcept -> std::uintptr_t
 Runtime identifier for this node, guaranteed to be unique but changes every time.
auto name () const noexcept -> std::string_view
 Display name. Siblings may share one - this is not an identifier.
void name (std::string_view name) noexcept
 Sets the display name.
auto enabled () const noexcept -> bool
 Whether this node is currently active.
auto participatesIn (NodeOwnerParticipation use) const noexcept -> bool
auto owner () const noexcept -> INodeOwner *
 The World or Workspace this node belongs to.
void enabled (bool value) noexcept
 Sets the local enabled flag and propagates the change to all children.
auto box () const noexcept -> Box< Node >
 Returns an owning handle to this node.
auto info () const -> const NodeInfo *
 Reflection metadata registered by the code generator.
auto sourcePrefab () const noexcept -> const assets::Handle< assets::Prefab > &
 The prefab this node was instantiated from.
auto isInstanceRoot () const noexcept -> bool
 Whether this node is the root of a prefab instance.
auto root () const noexcept -> Box< Node >
 The topmost ancestor that is not the world root.
auto state () const noexcept -> NodeState
auto type () const noexcept -> NodeType
auto listener () noexcept -> event::Listener &
 The event Listener owned by this node. Lazy-allocated, freed only with the node.
auto parent () noexcept -> Box< Node >
 The immediate parent of this node.
auto children () const noexcept -> const std::vector< Box< Node > > &
 The ordered list of direct children.
auto childrenSnapshot () const -> std::vector< Box< Node > >
auto create (std::string_view type="toast::Node") noexcept -> Box< Node >
 Creates a new child node of the given type and attaches it to this node.
auto spawn (UID uid) noexcept -> Box< Node >
 Asynchronously instantiates a prefab as a child of this node.
auto spawn (std::string_view uri) noexcept -> Box< Node >
 Asynchronously instantiates a prefab as a child of this node.
auto find (std::string_view query) -> Box< Node >
 Depth-first search for a single descendant.
auto find (const UID &uid) -> Box< Node >
 Looks up a node by UID within this node's local root.
auto search (std::string_view query) -> std::vector< Box< Node > >
 Depth-first search for all matching descendants.
auto childrenOfType (const NodeInfo *type) const -> std::vector< Box< Node > >
auto searchType (const NodeInfo *type) const -> std::vector< Box< Node > >
void addDependsOn (Node &other)
void removeDependsOn (Node &other)
void interactsWith (Node &other)
 Declares that the scripts of this node and of other call each other.
auto scriptRuntime () noexcept -> scripting::ScriptRuntime *
auto hasTickFunction (TickFunctionList mask) const noexcept -> bool
auto scriptVm (TickFunctionList func) const noexcept -> std::optional< size_t >
 The interpreter this node runs Lua on while it executes func, empty when it runs none.
auto scriptVmAny () const noexcept -> std::optional< size_t >
 The interpreter the scripts of this node live on whatever phase they define.
auto hasCallable (std::string_view name) const noexcept -> bool
void reloadScripts () noexcept
 Rebuilds the script runtime after a script asset changed (hot reload or attach).
auto scripts () const noexcept -> const std::vector< assets::Handle< assets::Script > > &
void setScripts (std::vector< assets::Handle< assets::Script > > scripts) noexcept
void addScript (const assets::Handle< assets::Script > &script) noexcept
template<typename R = void, typename... Args>
auto call (std::string_view name, Args &&... args) -> R
 Invokes all C++ reflected implementations of name (base→derived) and all same-named Lua functions across every attached script, forwarding args.
template<typename T>
auto get (std::string_view name) const -> T
 Reads a named value: reflected C++ field first, then the first matching Lua instance variable.
template<typename T>
void set (std::string_view name, const T &value)
 Writes a named value: reflected C++ field if present and every Lua instance variable of that name that already exists.
auto isRecursivePrefab () const noexcept -> bool

Additional Inherited Members

Public Types inherited from toast::VoxelPiece
using GridRef = std::shared_ptr<const Grid>
Public Attributes inherited from toast::VoxelPiece
signals::Signal drawn
 Sent after editShape drew the grid again.
Public Attributes inherited from toast::Node3D
glm::vec3 position = glm::vec3(0.0f)
glm::quat rotation = glm::quat(1.0f, 0.0f, 0.0f, 0.0f)
glm::vec3 scale = glm::vec3(1.0f)
glm::vec3 world_position = glm::vec3(0.0f)
glm::quat world_rotation = glm::quat(1.0f, 0.0f, 0.0f, 0.0f)
glm::vec3 world_scale = glm::vec3(1.0f)
Public Attributes inherited from toast::Node
signals::Signal< Box< Node > > on_enable
signals::Signal< Box< Node > > on_disable
signals::Signal< Box< Node > > on_begin
signals::Signal< Box< Node > > on_end
Static Public Attributes inherited from toast::Node3D
static const glm::vec3 world_up = {0.0f, 0.0f, 1.0f}
static const glm::vec3 world_forward = {0.0f, 1.0f, 0.0f}
 Z axis.
static const glm::vec3 world_right = {1.0f, 0.0f, 0.0f}
 Y axis.
Protected Member Functions inherited from toast::VoxelVolume
void init ()
auto prepareGrid () -> std::unique_ptr< voxel::Volume > override
void finishGrid (voxel::Volume &grid) override
auto pieceSize () -> glm::ivec3 override
void onReflectedFieldChanged (std::string_view field_name) override
void sizeChanged ()
Protected Member Functions inherited from toast::VoxelPiece
void markGridDirty () noexcept
void markLandingDirty () noexcept
void onScriptsReloading () override
void onScriptsReloaded () override
void onScriptVarChanged (std::string_view path) override
void updateInspectorMessages () override
template<typename Kernel>
void draw (std::string_view operation, Kernel &&kernel)
auto drawing () const noexcept -> voxel::Volume *
void init ()
void destroy ()
Protected Member Functions inherited from toast::Node3D
void init ()
 X axis.
Protected Member Functions inherited from toast::Node
virtual auto luaAffinity () const noexcept -> std::optional< size_t >
void addInspectorMessage (const NodeMessage &message)
void removeInspectorMessage (const NodeMessage &message)
Protected Attributes inherited from toast::VoxelVolume
glm::ivec3 m_sized_for {0}
glm::vec3 size = glm::vec3(10.0f)
int id = 1
voxel::WriteMode mode = voxel::WriteMode::replace
int match_id = 0
Protected Attributes inherited from toast::VoxelPiece
assets::Handle< assets::Script > m_shape_script
std::vector< glm::vec4 > m_clip_planes
Protected Attributes inherited from toast::Node
INodeOwner * m_owner = nullptr

Detailed Description

Recolors the shape where it is already solid

Member Function Documentation

◆ kind()

auto toast::PaintVolume::kind ( ) const -> PieceKind
inlinenodiscardoverridevirtualnoexcept

Reimplemented from toast::VoxelPiece.

◆ writeMode()

auto toast::PaintVolume::writeMode ( ) const -> voxel::WriteMode
inlinenodiscardoverridevirtualnoexcept

Reimplemented from toast::VoxelPiece.


The documentation for this class was generated from the following file: