Skip to content

C++ SDK reference

Every header in the C++ SDK. Include them all with #include <atl.hpp>. Declarations that share one comment in the header are shown together.

Header Covers
atl/ai.hpp Combat and AI: sm.projectile, sm.melee, sm.ai, sm.pathfinder and sm.pathNode.
atl/base.hpp Freestanding essentials: the small subset of <type_traits> and <utility> the SDK needs.
atl/callback.hpp Callback slots: lets C++ lambdas stand in where the game expects a callback method name.
atl/client.hpp Client-only APIs: the local player (sm.localPlayer) and the camera (sm.camera).
atl/containers.hpp Vector<T> and Optional<T>: the parts of std::vector and std::optional the SDK needs.
atl/debugdraw.hpp sm.debugDraw: draws shapes in the world for debugging (dev mode only).
atl/function.hpp atl::Function<R(A...)>: a copyable, type-erased callable (like std::function).
atl/gui.hpp GUIs (sm.gui): layouts, the game's built-in GUIs, and HUD, text and fade helpers.
atl/item.hpp sm.item: static information about item and shape uuids.
atl/math.hpp Math helpers and the value types Vec3, Quat, Color and Uuid. Their math runs in WASM.
atl/memory.hpp Memory allocator for the AllTheLanguages C++ SDK: malloc/free, operator new/delete and the C++ runtime hooks a freestanding WASM build needs.
atl/render.hpp Rendering and visual helpers: sm.render, sm.visualization, sm.debris, sm.particle, sm.cullSphereGroup, sm.builderGuide and sm.jsonGui.
atl/script.hpp Script classes: the C++ base classes for parts, tools, characters, worlds, games and terrain, split server/client classes, and the registration macros that expose them.
atl/sm.hpp The core Scrap Mechanic API: game object types (Shape, Body, Interactable, Character, Player, World, ...) and the sm.* namespaces that operate on them.
atl/string.hpp StringView, String, toString and format.
atl/terrain.hpp Terrain generation: sm.terrainData, sm.terrainTile, sm.terrainGeneration, sm.voxelTerrainCell, sm.terrainHarvestable and sm.tunnelGenerator, mostly for terrain scripts (sm::TerrainScript in script.hpp).
atl/trigger.hpp Area triggers (sm.areaTrigger): volumes that report what enters, stays in and leaves them.
atl/util.hpp sm.util and sm.noise: interpolation, hashing, UTF-8 helpers and noise functions.
atl/value.hpp atl::Value: a handle to a Lua value, and the conversions between C++ and Lua types.
atl/wire.hpp atl::wire: the binary encoding of typed network messages and saved state.
atl/world.hpp Worlds and what's in them: sm.world, sm.portal, sm.cell, sm.event, sm.message, sm.creation, sm.construction, sm.lift, sm.garage, sm.pipeGraph, sm.fire, sm.compromised, sm.challenge, sm.menuCreation, sm.achievement, sm.tool and sm.clientScriptableObject.