|
Toast Engine
|
Member-robber pattern used by the generated reflection code. More...
Classes | |
| struct | Accessor |
| struct | ControlBox |
| Reference-count control block embedded inside the Node allocation. More... | |
| struct | Defer |
| struct | ExecuteOptions |
| class | ItemRunner |
| struct | NodeCluster |
| struct | Robber |
| struct | TickSchedule |
| struct | WaveJob |
| struct | WorldTestAccess |
Typedefs | |
| using | Interactions = std::unordered_map<Box<Node>, std::vector<Box<Node>>> |
| For a node, the nodes whose scripts it calls or is called by, see Node::interactsWith(). | |
Enumerations | |
| enum | : uint8_t { k_message_outside = 40 , k_message_misaligned = 41 } |
Functions | |
| void TOAST_API | callNodeScripts (Node *node, std::string_view name, std::span< const std::any > args) noexcept |
| void TOAST_API | setNodeScriptVar (Node *node, std::string_view name, const std::any &value) noexcept |
| auto TOAST_API | getNodeScriptVar (const Node *node, std::string_view name) noexcept -> std::any |
| template<typename R = void, typename... Args> | |
| auto | callMethodChain (const NodeInfo *info, void *obj, std::string_view method_name, const Args &... args) -> R |
| auto | toVoxel (glm::vec3 pos) noexcept -> glm::ivec3 |
| auto | toId (int id) noexcept -> uint8_t |
| template<typename T> | |
| auto | assetOfType (const assets::Handle< T > &handle, std::string_view type) -> const T * |
| auto | instantiateModel (const assets::VoxelModel &model) -> std::unique_ptr< voxel::Volume > |
| auto | planWave (const TickSchedule::Wave &wave, TickFunctionList func, const Interactions *interactions=nullptr) -> std::vector< WaveJob > |
| Splits a wave into the jobs that run it in parallel. | |
| void | runJobs (const std::vector< WaveJob > &jobs, size_t item_count, ItemRunner run_item, const ExecuteOptions &options={}) |
| Runs the jobs of a plan in parallel and returns once every item has run. | |
Variables | |
| template<typename Tag, typename Tag::type Ptr> | |
| Robber< Tag, Ptr > | Robber< Tag, Ptr >::instance |
| constexpr std::string_view | asset_uri = "asset://" |
| constexpr std::string_view | artwork_uri = "artwork://" |
| constexpr std::string_view | node_uri = "node://" |
| std::string | assets_path |
| std::string | artworks_path |
Member-robber pattern used by the generated reflection code.
A Robber<Tag,Ptr> static instance runs at startup and writes the private member pointer Ptr into the public Accessor<Tag>::member. This is the only standards-conforming way to obtain a pointer-to-private-member at compile time without modifying the Node class header.
| anonymous enum : uint8_t |
Inspector message ids the procedural pieces use
|
nodiscard |
The loaded asset when it is really of type, null otherwise

|
inlinenodiscard |
Loads a model into the procedural pool

| TOAST_API auto toast::_detail::planWave | ( | const TickSchedule::Wave & | wave, |
| TickFunctionList | func, | ||
| const Interactions * | interactions = nullptr ) -> std::vector< WaveJob > |
Splits a wave into the jobs that run it in parallel.
Everything that runs Lua on the same interpreter ends up in one job
A cluster that spans interpreters ties them together into one job

| TOAST_API void toast::_detail::runJobs | ( | const std::vector< WaveJob > & | jobs, |
| size_t | item_count, | ||
| ItemRunner | run_item, | ||
| const ExecuteOptions & | options = {} ) |
Runs the jobs of a plan in parallel and returns once every item has run.
| item_count | How many items the plan has, every item in exactly one job |

|
inlinenodiscardnoexcept |
Clamps a script id to a palette id

|
inlinenodiscardnoexcept |
Snaps a position to the voxel it falls in
