User Tools

Site Tools


DzDebugViewUtil

Allows drawing three dimensional debugging information in the scene.

More...

Inherits :

Constructors

DAZ Script
DzDebugViewUtil ()

Methods

DAZ Script
voidaddLine ( Number channel, DzVec3 startPosWS, DzVec3 endPosWS )
voidaddPoint ( Number channel, DzVec3 posWS )
voidclearChannels ()
voidclearChannelsFromScene ()
voidcreateLineChannel ( Number channel, Color color, DzTimeRange range=DzTimeRange )
voidcreatePointChannel ( Number channel, Color color, DzTimeRange range=DzTimeRange )
voidpostDebugData ()

Detailed Description

Provides the ability to post three dimensional debugging information, such as points and/or lines, to the scene and thereby cause it to be drawn within a view of the scene - e.g., in a viewport.

Each instance of this object maintains a list of points and/or lines.

Each set of points and/or lines is defined in terms of a “channel.” Each channel is identified by a number - point channels and line channels are defined independent of one another, but may use the same identifier to establish a weak association between them.

Each channel is assigned a color at creation.

Basic workflow is to create a point/line channel, add points/lines to the channel, then post the debug data.

Example:

(function(){
 
	var vecOrigin = new DzVec3( 0, 0, 0 );
 
	var oViewUtil = new DzDebugViewUtil();
 
	oViewUtil.createLineChannel( 0, Color( 255, 0, 0 ) );
	oViewUtil.addLine( 0, vecOrigin, new DzVec3( 20, 0, 0 ) );
 
	oViewUtil.createLineChannel( 1, Color( 0, 255, 0 ) );
	oViewUtil.addLine( 1, vecOrigin, new DzVec3( 0, 20, 0 ) );
 
	oViewUtil.createLineChannel( 2, Color( 0, 0, 255 ) );
	oViewUtil.addLine( 2, vecOrigin, new DzVec3( 0, 0, 20 ) );
 
	oViewUtil.postDebugData();
 
})();

Attention:

  • Instances of this object are intended for developers that want to visualize three dimensional debugging information, not for display to end users. No attempt is made to prevent one instance of this object from trampling over the debugging information posted to the scene by another instance.

Since:

  • 4.11.0.216

Constructors


DzDebugViewUtil()

Constructor.

Methods


void : addLine( Number channel, DzVec3 startPosWS, DzVec3 endPosWS )

Adds a line to the specified channel.

Parameter(s):

  • channel - The index of the channel to add the line to.
  • startPosWS - The world space starting position of the line to add.
  • endPosWS - The world space ending position of the line to add.

void : addPoint( Number channel, DzVec3 posWS )

Adds a point to the specified channel.

Parameter(s):

  • channel - The index of the channel to add the point to.
  • posWS - The world space position of the point to add.

void : clearChannels()

Clears the point and line channels for this object (i.e., local).


void : clearChannelsFromScene()

Clears the point and line channels for this object from the scene (i.e., global).


void : createLineChannel( Number channel, Color color, DzTimeRange range=DzTimeRange )

Creates a channel to use for drawing lines in the scene.

Parameter(s):

  • channel - The index of the channel.
  • color - The color to use when drawing the channel.
  • range - The range of time to draw this channel.

void : createPointChannel( Number channel, Color color, DzTimeRange range=DzTimeRange )

Creates a channel to use for drawing points in the scene.

Parameter(s):

  • channel - The index of the channel.
  • color - The color to use when drawing the channel.
  • range - The range of time to draw this channel.

void : postDebugData()

Posts the point and line channel data for this object (i.e., local) to the scene (i.e., global).