B.Graph.Visual() -> B.Graph.Locator

Represents a visual (transformed mesh + material).

To create the object use B.Graph.makeVisual().

METHODS:

visible(enable, deep)

Sets visibility enable.

PARAMETERS:

{boolean} enable

{boolean} [deep] = false

true if you want to set value through the whole hierarchy

RETURNS:

FIRES:

visible()

Gets visibility enable.

RETURNS:

{boolean}

material(material, deep)

Sets a new material.

PARAMETERS:

{B.Render.Material} material

{boolean} [deep] = false

true if you want to set value through the whole hierarchy

RETURNS:

material()

Returns material.

RETURNS:

mesh(mesh, deep)

Sets a new mesh.

PARAMETERS:

{B.Render.Mesh} mesh

{boolean} [deep] = false

true if you want to set value through the whole hierarchy

RETURNS:

mesh()

Returns mesh.

RETURNS:

uniforms()

Returns array of uniforms names.

RETURNS:

{Array.<string>}

uniform(name, value, deep)

Sets a uniform value.

visual.
    uniform("someNumber", 1.5).
    uniform("someVector2", B.Math.makeVector2(1, 2)).
    uniform("someVector3", B.Math.makeVector3(1, 2, 3)).
    uniform("someVector4", B.Math.makeVector4(1, 2, 3, 4)).
    uniform("someColor", B.Math.makeColor(1, 0, 0, 0.5)).
    uniform("someMatrix3", B.Math.makeMatrix3().setRotationX(Math.PI)).
    uniform("someMatrix4", B.Math.makeMatrix4().setTranslation(1, 2, 3)).
    uniform("someTexture", dev.makeTexture(image)).
    uniform("someTexture", dev.stage("someStage").output().color()).
    uniform("someDepth", dev.stage("someStage").output().depth());

visual.uniform("someTexture", null); // removing

PARAMETERS:

{string} name

{null | number | B.Math.Vector2 | B.Math.Vector3 | B.Math.Vector4 | B.Math.Color | B.Math.Matrix3 | B.Math.Matrix4 | B.Render.Texture | B.Render.Depth} value

{boolean} [deep] = false

true if you want to set value through the whole hierarchy

RETURNS:

uniform(name)

Gets a uniform value.

PARAMETERS:

{string} name

RETURNS:

culling(enable, deep)

Sets frustum culling enable.

PARAMETERS:

{boolean} enable

{boolean} [deep] = false

true if you want to set value through the whole hierarchy

RETURNS:

culling()

Gets frustum culling enable.

RETURNS:

{boolean}

bounds(deep)

Returns bounds.

PARAMETERS:

{boolean} [deep]

true if you want to return bounds for the whole hierarchy

RETURNS:

{B.Math.AABox | null}

null if the node is not visible

EVENTS:

{B.Std.Event} shown

Reporting that the visual has been shown.

{B.Std.Event} hidden

Reporting that the visual has been hidden.

METHODS:

EVENTS: