My favorites | English | Sign in

Faster JavaScript with Closure Tools New!

o3djs.debug Module Reference

List of all members.


Detailed Description

Defines a namespace for o3djs.debug.

Source

o3djs/debug.js

Public Types

o3djs.debug.DebugHelper o3djs.debug
o3djs.debug.DebugLine o3djs.debug
o3djs.debug.DebugLineGroup o3djs.debug
o3djs.debug.VertexInfo o3djs.debug

Public Member Functions

!o3djs.debug.DebugHelper  createDebugHelper(pack, viewInfo) o3djs.debug
!o3d.Shape  createLineCube(pack, material, size, opt_matrix) o3djs.debug
!o3djs.debug.VertexInfo  createLineCubeVertices(size, opt_matrix) o3djs.debug
!o3d.Shape  createLineShape(pack, material, vertices, indices) o3djs.debug
!o3d.Shape  createLineSphere(pack, material, radius, subdivisionsAxis, subdivisionsHeight, opt_matrix) o3djs.debug
!o3djs.debug.VertexInfo  createLineSphereVertices(radius, subdivisionsAxis, subdivisionsHeight, opt_matrix) o3djs.debug
!o3djs.debug.VertexInfo  createVertexInfo(opt_vertices, opt_indices) o3djs.debug
boolean  isDebugTransform(transform) o3djs.debug

Member Function Documentation

!o3djs.debug.DebugHelper o3djs.debug.createDebugHelper ( !o3d.Pack pack
!o3djs.rendergraph.ViewInfo viewInfo )

Creates a debug helper object.

A debug helper object provides functions to help debug your o3d application and manages the resources needed to do that for you. For example it can add axes, spheres and boxes to your transforms as well as draw lines in 3d space given 2 points.

Parameters:
pack Pack for DebugHelper to manage its resources with.
viewInfo ViewInfo for debug visuals.
Returns:
!o3djs.debug.DebugHelper.the DebugHelper object.
!o3d.Shape o3djs.debug.createLineCube ( !o3d.Pack pack
!o3d.Material material
number size
!o3djs.math.Matrix4 opt_matrix )

Creates a cube of lines.

Parameters:
pack Pack to create sphere elements in.
material to use.
size Width, height and depth of the cube.
opt_matrix A matrix by which to multiply all the vertices.
Returns:
!o3d.Shape.The created cube.
!o3djs.debug.VertexInfo o3djs.debug.createLineCubeVertices ( number size
!o3djs.math.Matrix4 opt_matrix )

Creates the vertices and indices for a cube of lines. The cube will be created around the origin. (-size / 2, size / 2) The created cube has a position stream only and can therefore only be used with shaders that support those a position stream.

Parameters:
size Width, height and depth of the cube.
opt_matrix A matrix by which to multiply all the vertices.
Returns:
!o3djs.debug.VertexInfo.The created cube vertices.
!o3d.Shape o3djs.debug.createLineShape ( !o3d.Pack pack
!o3d.Material material
!Array.<!o3djs.math.Vector3> vertices
!Array.<number> indices )

Creates a line list shape and primitive given a material, vertex array and index array.

Parameters:
pack Pack to create objects in.
material to use.
vertices array of numbers in the format positionX, positionY, positionZ.
indices array of vertex indices, 2 per line.
Returns:
!o3d.Shape.The created shape.
!o3d.Shape o3djs.debug.createLineSphere ( !o3d.Pack pack
!o3d.Material material
number radius
number subdivisionsAxis
number subdivisionsHeight
!o3djs.math.Matrix4 opt_matrix )

Creates a sphere. The created sphere has position, normal, uv and vertex color streams only and can therefore only be used with shaders that support those 4 streams.

Parameters:
pack Pack to create sphere elements in.
material to use.
radius radius of the sphere.
subdivisionsAxis number of steps around the sphere.
subdivisionsHeight number of vertically on the sphere.
opt_matrix A matrix by which to multiply all the vertices.
Returns:
!o3d.Shape.The created sphere.
See Also:
!o3djs.debug.VertexInfo o3djs.debug.createLineSphereVertices ( number radius
number subdivisionsAxis
number subdivisionsHeight
!o3djs.math.Matrix4 opt_matrix )

Creates sphere vertices. The created sphere has a position stream only and can therefore only be used with shaders that support those a position stream.

Parameters:
radius radius of the sphere.
subdivisionsAxis number of steps around the sphere.
subdivisionsHeight number of vertically on the sphere.
opt_matrix A matrix by which to multiply all the vertices.
Returns:
!o3djs.debug.VertexInfo.The created sphere vertices.
!o3djs.debug.VertexInfo o3djs.debug.createVertexInfo ( !Array.<!o3djs.math.Vector3> opt_vertices
!Array.<number> opt_indices )

Creates a new VertexInfo.

Parameters:
opt_vertices array of numbers in the format positionX, positionY, positionZ.
opt_indices array of indices, 2 per line.
Returns:
!o3djs.debug.VertexInfo.The new VertexInfo.
boolean o3djs.debug.isDebugTransform ( !o3d.Transform transform )

Checks whether or not a transform is a debug transform.

Parameters:
transform Transform to check.
Returns:
boolean.true if this transform is a debug transform.