DebugDraw

Description

Helper functions to render ephemeral debug markers and lines. DebugDraw markers and lines are only visible locally, they are not visible by other users.

Supported Script Types: Interface Scripts • Client Entity Scripts • Avatar Scripts • Server Entity Scripts • Assignment Client Scripts

Methods

Name Return Value Summary
addMarker None Adds a debug marker to the world. This marker will be drawn every frame until it is removed with DebugDraw.removeMarker. This can be called repeatedly to change the position of the marker.
addMyAvatarMarker None Adds a debug marker to the world, this marker will be drawn every frame until it is removed with DebugDraw.removeMyAvatarMarker. This can be called repeatedly to change the position of the marker.
drawRay None Draws a line in world space, but it will only be visible for a single frame.
drawRay None Draws a line in world space, but it will only be visible for a single frame.
removeMarker None Removes debug marker from the world. Once a marker is removed, it will no longer be visible.
removeMyAvatarMarker None Removes debug marker from the world. Once a marker is removed, it will no longer be visible

Method Details

(static) addMarker( key, rotation, position, color )

Adds a debug marker to the world. This marker will be drawn every frame until it is removed with DebugDraw.removeMarker. This can be called repeatedly to change the position of the marker.

Parameters

Name Type Description
key string name to uniquely identify this marker, later used for DebugDraw.removeMarker.
rotation Quat start position of line in world space.
position Vec3 position of the marker in world space.
color Vec4 color of the marker.
(static) addMyAvatarMarker( key, rotation, position, color )

Adds a debug marker to the world, this marker will be drawn every frame until it is removed with DebugDraw.removeMyAvatarMarker. This can be called repeatedly to change the position of the marker.

Parameters

Name Type Description
key string name to uniquely identify this marker, later used for DebugDraw.removeMyAvatarMarker.
rotation Quat start position of line in avatar space.
position Vec3 position of the marker in avatar space.
color Vec4 color of the marker.
(static) drawRay( start, end, color )

Draws a line in world space, but it will only be visible for a single frame.

Parameters

Name Type Description
start Vec3 start position of line in world space.
end Vec3 end position of line in world space.
color Vec4 color of line, each component should be in the zero to one range. x = red, y = blue, z = green, w = alpha.
(static) drawRay( start, end, color )

Draws a line in world space, but it will only be visible for a single frame.

Parameters

Name Type Description
start Vec3 start position of line in world space.
end Vec3 end position of line in world space.
color Vec4 color of line, each component should be in the zero to one range. x = red, y = blue, z = green, w = alpha.
(static) removeMarker( key )

Removes debug marker from the world. Once a marker is removed, it will no longer be visible.

Parameters

Name Type Description
key string name of marker to remove.
(static) removeMyAvatarMarker( key )

Removes debug marker from the world. Once a marker is removed, it will no longer be visible

Parameters

Name Type Description
key string name of marker to remove.