atl/debugdraw.hpp
sm.debugDraw: draws shapes in the world for debugging (dev mode only).
sm::debugDraw
Section titled "sm::debugDraw"inline void arrow(StringView name, Vec3 from, Vec3 to, Optional<Color> color = atl::none);Persistent shapes, identified by name. Drawing again under a name replaces the shape.
An arrow from from to to.
Parameters
name(StringView): The debug arrow name.from(Vec3): The from position.to(Vec3): The to position. Defaults to the from position plus one along the z axis. (World up vector)color(Optional<Color>): The color. Defaults to white.
Lua: sm.debugDraw.addArrow
inline void sphere(StringView name, Vec3 center, double radius = 0.25, Optional<Color> color = atl::none);A sphere.
Parameters
name(StringView): The debug sphere name.center(Vec3): The sphere center.radius(double): The sphere radius. Defaults to 0.125.color(Optional<Color>): The color. Defaults to white.
Lua: sm.debugDraw.addSphere
inline void aabb(StringView name, Vec3 min, Vec3 max, Optional<Color> color = atl::none);An axis-aligned box from min to max (world space).
Parameters
name(StringView): The debug transform name.min(Vec3): The box minimum extent.max(Vec3): The box maximum extent.color(Optional<Color>): The color. Defaults to white.
Lua: sm.debugDraw.addAabb
inline void box(StringView name, Vec3 min, Vec3 max, Vec3 position, Quat rotation = {}, Optional<Color> color = atl::none);A box with local extents min..max, placed at position/rotation.
Parameters
name(StringView): The debug transform name.min(Vec3): The box minimum extent.max(Vec3): The box maximum extent.position(Vec3): The box position.rotation(Quat): The box rotation. Defaults to identity.color(Optional<Color>): The color. Defaults to white.
Lua: sm.debugDraw.addBox
inline void text(StringView name, StringView text, Vec3 position, Optional<Color> color = atl::none, double scale = 1);Text at a world position.
Parameters
name(StringView)text(StringView)position(Vec3)color(Optional<Color>)scale(double)
Lua: sm.debugDraw.addText
inline void transform(StringView name, Vec3 origin, Quat rotation, double scale = 1);XYZ axes at a transform.
Parameters
name(StringView): The debug transform name.origin(Vec3): The transform origin.rotation(Quat): The transform rotation.scale(double): The transform scale. Defaults to 1.0.
Lua: sm.debugDraw.addTransform
inline void remove(StringView name);Removes a named shape, whatever kind it was.
Parameters
name(StringView): The debug arrow name.
Lua: sm.debugDraw.removeArrow
inline void clear(Optional<String> name = atl::none);Removes everything, or only what name identifies.
Parameters
name(Optional<String>): The name to match (Defaults to "", matching all debug draws).
Lua: sm.debugDraw.clear
inline void flashArrow(Vec3 from, Vec3 to, Optional<Color> color = atl::none, double seconds = 1);Temporary shapes that disappear after seconds.
Parameters
from(Vec3): The starting position of the arrow.to(Vec3): The ending position of the arrow. Defaults to the starting position plus one unit along the z-axis (world up vector).color(Optional<Color>): The color of the arrow. Defaults to white.seconds(double): The duration of the flash animation in seconds. Defaults to 0.5 seconds.
Lua: sm.debugDraw.flashArrow
inline void flashSphere(Vec3 center, double radius = 0.25, Optional<Color> color = atl::none, double seconds = 1);Temporary shapes that disappear after seconds.
Parameters
center(Vec3): The center position of the sphere.radius(double): The radius of the sphere. Defaults to 0.125.color(Optional<Color>): The color of the sphere. Defaults to white.seconds(double): The duration of the flash animation in seconds. Defaults to 0.5 seconds.
Lua: sm.debugDraw.flashSphere
inline void flashAabb(Vec3 min, Vec3 max, Optional<Color> color = atl::none, double seconds = 1);Temporary shapes that disappear after seconds.
Parameters
min(Vec3): The minimum world extent of the box.max(Vec3): The maximum world extent of the box.color(Optional<Color>): The color of the box. Defaults to white.seconds(double): The duration of the flash animation in seconds. Defaults to 0.5 seconds.
Lua: sm.debugDraw.flashAabb
inline void flashBox(Vec3 min, Vec3 max, Vec3 position, Quat rotation = {}, Optional<Color> color = atl::none, double seconds = 1);Temporary shapes that disappear after seconds.
Parameters
min(Vec3): The minimum extent of the box.max(Vec3): The maximum extent of the box.position(Vec3): The position of the box.rotation(Quat): The rotation of the box. Defaults to identity.color(Optional<Color>): The color of the box. Defaults to white.seconds(double): The duration of the flash animation in seconds. Defaults to 0.5 seconds.
Lua: sm.debugDraw.flashBox
inline void flashText(StringView text, Vec3 position, Optional<Color> color = atl::none, double scale = 1, double seconds = 1);Temporary shapes that disappear after seconds.
Parameters
text(StringView)position(Vec3)color(Optional<Color>)scale(double)seconds(double)
Lua: sm.debugDraw.flashText
sm::debugDraw::topDown
Section titled "sm::debugDraw::topDown"The top-down (map) view: drawn for one frame, or flashed for seconds.
inline void arrow(Vec3 from, Vec3 to, Optional<Color> color = atl::none);Draws an arrow.
Parameters
from(Vec3): The starting position of the arrow.to(Vec3): The ending position of the arrow. Defaults to the starting position plus one unit along the z-axis (world up vector).color(Optional<Color>): The color of the arrow. Defaults to white.
Lua: sm.debugDraw.drawArrowTopDown
inline void box(Vec3 min, Vec3 max, Vec3 position, Quat rotation = {}, Optional<Color> color = atl::none);Draws a box.
Parameters
min(Vec3)max(Vec3)position(Vec3)rotation(Quat)color(Optional<Color>)
Lua: sm.debugDraw.drawBoxTopDown
inline void circle(Vec3 center, double radius = 0.25, Optional<Color> color = atl::none);Draws a circle.
Parameters
center(Vec3): The center position of the circle.radius(double): The radius of the circle. Defaults to 0.125.color(Optional<Color>): The color of the circle. Defaults to white.
Lua: sm.debugDraw.drawCircleTopDown
inline void rect(Vec3 min, Vec3 max, Optional<Color> color = atl::none);Draws a rectangle.
Parameters
min(Vec3): The minimum extent of the rectangle.max(Vec3): The maximum extent of the rectangle.color(Optional<Color>): The color of the rectangle. Defaults to white.
Lua: sm.debugDraw.drawRectTopDown
inline void sphere(Vec3 center, double radius = 0.25, Optional<Color> color = atl::none);Draws a sphere.
Parameters
center(Vec3): The center position of the sphere.radius(double): The radius of the sphere. Defaults to 0.125.color(Optional<Color>): The color of the sphere. Defaults to white.
Lua: sm.debugDraw.drawSphereTopDown
inline void flashArrow(Vec3 from, Vec3 to, Optional<Color> color = atl::none, double seconds = 1);Flashes an arrow for a specified duration.
Parameters
from(Vec3): The starting position of the arrow.to(Vec3): The ending position of the arrow. Defaults to the starting position plus one unit along the z-axis (world up vector).color(Optional<Color>): The color of the arrow. Defaults to white.seconds(double): The duration of the flash animation in seconds. Defaults to 0.5 seconds.
Lua: sm.debugDraw.flashArrowTopDown
inline void flashBox(Vec3 min, Vec3 max, Vec3 position, Quat rotation = {}, Optional<Color> color = atl::none, double seconds = 1);Flashes a box for a specified duration.
Parameters
min(Vec3): The minimum extent of the box.max(Vec3): The maximum extent of the box.position(Vec3): The position of the box.rotation(Quat): The rotation of the box. Defaults to identity.color(Optional<Color>): The color of the box. Defaults to white.seconds(double): The duration of the flash animation in seconds. Defaults to 0.5 seconds.
Lua: sm.debugDraw.flashBoxTopDown
inline void flashCircle(Vec3 center, double radius = 0.25, Optional<Color> color = atl::none, double seconds = 1);Flashes a circle for a specified duration.
Parameters
center(Vec3): The center position of the circle.radius(double): The radius of the circle. Defaults to 0.125.color(Optional<Color>): The color of the circle. Defaults to white.seconds(double): The duration of the flash animation in seconds. Defaults to 0.5 seconds.
Lua: sm.debugDraw.flashCircleTopDown
inline void flashRect(Vec3 min, Vec3 max, Optional<Color> color = atl::none, double seconds = 1);Flashes a rectangle for a specified duration.
Parameters
min(Vec3): The minimum extent of the rectangle.max(Vec3): The maximum extent of the rectangle.color(Optional<Color>): The color of the rectangle. Defaults to white.seconds(double): The duration of the flash animation in seconds. Defaults to 0.5 seconds.
Lua: sm.debugDraw.flashRectTopDown
inline void flashSphere(Vec3 center, double radius = 0.25, Optional<Color> color = atl::none, double seconds = 1);Flashes a sphere for a specified duration.
Parameters
center(Vec3): The center position of the sphere.radius(double): The radius of the sphere. Defaults to 0.125.color(Optional<Color>): The color of the sphere. Defaults to white.seconds(double): The duration of the flash animation in seconds. Defaults to 0.5 seconds.
Lua: sm.debugDraw.flashSphereTopDown