Skip to main content

DebugRender

Class

Provides methods to draw primitive visuals for debugging.

  • Available on all platforms
Platform details: Snapchat, SPECS, Camera Kit Web, Camera Kit Mobile fully supported.

Platform details

  • Snapchat — Fully supported.

  • SPECS — Fully supported.

  • Camera Kit Web — Fully supported.

  • Camera Kit Mobile — Fully supported.

Since Lens Scripting v303

Provides methods to draw primitive visuals for debugging. Accessible through global.debugRenderSystem.

Index

Extends

Properties

isAutoClear

isAutoClear: boolean

Currently unused.

Since

Lens Scripting Version 303

Default Value

false

Methods

clear()

clear(): void

Clears any visual on the debug render system.

Returns

void

Since

Lens Scripting Version 303


drawBox()

drawBox(position, width, height, depth, color): void

Draws a wireframe box.

Parameters

ParameterType
positionvec3
widthnumber
heightnumber
depthnumber
colorvec4

Returns

void

Since

Lens Scripting Version 303


drawBrokenLine()

drawBrokenLine(points, color): void

Draw a sequence of unconnected line segments (2 points per line).

Parameters

ParameterType
pointsvec3[]
colorvec4

Returns

void

Since

Lens Scripting Version 303


drawCircle()

drawCircle(position, radius, color): void

Draw a wireframe circle oriented on the XY plane.

Parameters

ParameterType
positionvec3
radiusnumber
colorvec4

Returns

void

Since

Lens Scripting Version 303


drawLine()

drawLine(posA, posB, color): void

Draw a single line segment.

Parameters

ParameterType
posAvec3
posBvec3
colorvec4

Returns

void

Since

Lens Scripting Version 303


drawSolidBox()

drawSolidBox(position, width, height, depth, color): void

Draws a solid box mesh.

Parameters

ParameterType
positionvec3
widthnumber
heightnumber
depthnumber
colorvec4

Returns

void

Since

Lens Scripting Version 303


drawSolidSphere()

drawSolidSphere(position, radius, color): void

Draws a solid sphere mesh.

Parameters

ParameterType
positionvec3
radiusnumber
colorvec4

Returns

void

Since

Lens Scripting Version 303


drawSolidTriangle()

drawSolidTriangle(vertex1, vertex2, vertex3, color): void

Draws a filled in triangle.

Parameters

ParameterType
vertex1vec3
vertex2vec3
vertex3vec3
colorvec4

Returns

void

Since

Lens Scripting Version 303


drawSphere()

drawSphere(position, radius, color): void

Draws a wireframe sphere as a 3 axis-aligned circle.

Parameters

ParameterType
positionvec3
radiusnumber
colorvec4

Returns

void

Since

Lens Scripting Version 303


getTypeName()

static getTypeName(): TypeName<DebugRender>

Returns the fully-qualified JavaScript type name for this class (for example, "Component.Camera"). This is a static accessor (no instance required) and returns the same value as the instance getTypeName().

Returns

TypeName<DebugRender>

Since

Lens Scripting Version 303

Overrides

ScriptObject.getTypeName


getTypeName()

getTypeName(): string

Returns the name of this object's type.

Returns

string

Inherited from

ScriptObject.getTypeName


isOfType()

isOfType(type): boolean

Returns true if the object matches or derives from the passed in type.

Parameters

ParameterType
typestring

Returns

boolean

Inherited from

ScriptObject.isOfType


isSame()

isSame(other): boolean

Returns true if this object is the same as other. Useful for checking if two references point to the same thing.

Parameters

ParameterType
otherScriptObject

Returns

boolean

Inherited from

ScriptObject.isSame