Skip to main content

sm.debugDraw

The Debug Draw api can be used for drawing geometric primitives for debug purposes.

Functions

addArrow

sm.debugDraw.addArrow( name, startPos, endPos, color )

Adds a named arrow debug draw.

Arguments:
  • name [ string ]: The debug arrow name.
  • startPos [ Vec3 ]: The start position.
  • endPos [ Vec3 ]: The end position. Defaults to startPos plus 1 on the Z axis.
  • color [ Color ]: The color. Defaults to white.

addSphere

sm.debugDraw.addSphere( name, center, radius, color )

Adds a named sphere debug draw.

Arguments:
  • name [ string ]: The debug sphere name.
  • center [ Vec3 ]: The center position.
  • radius [ number ]: The radius. Defaults to 0.125.
  • color [ Color ]: The color. Defaults to white.

addTransform

sm.debugDraw.addTransform( name, origin, rotation, scale )

Adds a named transform debug draw.

Arguments:
  • name [ string ]: The debug transform name.
  • origin [ Vec3 ]: The transform origin.
  • rotation [ Quat ]: The transform rotation.
  • scale [ number ]: The transform scale. Defaults to 1.0.

clear

sm.debugDraw.clear( name )

Removes all debug draws beginning with a given name.

Arguments:
  • name [ string ]: The name. Defaults to "", matching all debug draws.

removeArrow

sm.debugDraw.removeArrow( name )

Removes a named arrow debug draw.

Arguments:
  • name [ string ]: The name.

removeSphere

sm.debugDraw.removeSphere( name )

Removes a named sphere debug draw.

Arguments:
  • name [ string ]: The name.

removeTransform

sm.debugDraw.removeTransform( name )

Removes a named transform debug draw.

Arguments:
  • name [ string ]: The name.