sm.debugDraw
The Debug Draw api can be used for drawing geometric primitives for debug purposes.
Functions:
sm.debugDraw.addArrow(name, from, to=nil, color=nil)
Adds a named arrow debug draw.
Parameters:
Type | Name | Description |
---|---|---|
string | name | The debug arrow name. |
Vec3 | from | The from position. |
Vec3 | to=nil | The to position. Defaults to the from position plus one along the z axis. (World up vector) |
Color | color=nil | The color. Defaults to white. |
sm.debugDraw.addSphere(name, center, radius=nil, color=nil)
Adds a named sphere debug draw.
Parameters:
Type | Name | Description |
---|---|---|
string | name | The debug sphere name. |
Vec3 | center | The sphere center. |
Vec3 | radius=nil | The sphere radius. Defaults to 0.125. |
Color | color=nil | The color. Defaults to white. |
sm.debugDraw.addTransform(name, origin, rotation, scale=nil)
Adds a named transform debug draw.
Parameters:
Type | Name | Description |
---|---|---|
string | name | The debug transform name. |
Vec3 | origin | The transform origin. |
Quat | rotation | The transform rotation. |
number | scale=nil | The transform scale. Defaults to 1.0. |
sm.debugDraw.clear(name="")
Removes all debug draws beginning with a given name.
Parameters:
Type | Name | Description |
---|---|---|
string | name="" | The name to match (Defaults to "", matching all debug draws). |
sm.debugDraw.removeArrow(name)
Removes a named arrow debug draw.
Parameters:
Type | Name | Description |
---|---|---|
string | name | The debug arrow name. |
sm.debugDraw.removeSphere(name)
Removes a named sphere debug draw.
Parameters:
Type | Name | Description |
---|---|---|
string | name | The debug sphere name. |
sm.debugDraw.removeTransform(name)
Removes a named transform debug draw.
Parameters:
Type | Name | Description |
---|---|---|
string | name | The debug transform name. |