LineRenderSystem

LineRenderSystem

Updates all of it's LineRenderers and exposes methods for drawing primitive line shapes.

Constructor

new LineRenderSystem(world)

Parameters:
Name Type Description
world World

the world this system exists in.

Members

renderList :Object

A managed array of all the LineRenderers render objects.

Methods

_drawAxisLine(start, startEndDelta, startDataIndex, endDataIndex, startPolarity, endPolarity, color, transformMatrix)

Used internally to calculate the line segments in an axis aligned box, and render them.

Parameters:
Name Type Description
start Vector3
startEndDelta Vector3
startDataIndex number
endDataIndex number
startPolarity number
endPolarity number
color Vector3

A vector with its components between 0-1.

transformMatrix Matrix4

drawAABox(min, max, color, transformMatrixopt)

Draws an axis aligned box between the min and max points, can be transformed to a specific space using the matrix.

Parameters:
Name Type Attributes Description
min Vector3
max Vector3
color Vector3

A vector with its components between 0-1.

transformMatrix Matrix4 <optional>

drawCross(position, color, sizeopt)

Draws a cross at a position with the given color and size.

Parameters:
Name Type Attributes Default Description
position Vector3
color Vector3

A vector with its components between 0-1.

size number <optional>
0.05

drawLine(start, end, color)

Draws a line between two Vector3's with the specified color.

Parameters:
Name Type Description
start Vector3
end Vector3
color Vector3

A vector with its components between 0-1.

Example
var vector1 = new Vector3(0, 0, 0);
var vector2 = new Vector3(13, 3, 7);
var redColor = lineRenderSystem.RED;
lineRenderSystem.drawLine(v1, v2, redColor);

render(renderer)

Called by SumerianRunner during rendering.

Parameters:
Name Type Description
renderer Renderer

The object used to render content.