API Docs for:
Show:

LS.RenderInstance Class

RenderInstance contains info of one object to be rendered on the scene. It shouldnt contain ids to resources (strings), instead if must contain the direct reference (to mesh, material)

Constructor

LS.RenderInstance

()

Methods

computeNormalMatrix

()

Updates the normal matrix using the matrix

enableFlag

(
  • flag
)

Enable flag in the flag bit field

Parameters:

  • flag Number

    id

enableFlag

(
  • flag
)

Disable flag in the flag bit field

Parameters:

  • flag Number

    id

enableFlag

(
  • flag
)
Boolean

Tells if a flag is enabled

Parameters:

  • flag Number

    id

Returns:

Boolean:

flag value

render

(
  • shader
)

Calls render taking into account primitive and range

Parameters:

  • shader Shader

update

()

Used to update the RI info without having to go through the collectData process, it is faster but some changes may take a while

updateAABB

()

Computes the instance bounding box in world space from the one in local space

wasVisibleByCamera

(
  • camera
)
Boolean

Checks if this object was visible by a camera during the last frame

Parameters:

  • camera LS.Camera

    [optional] if a camera is supplied it checks if it was visible by that camera, otherwise tells you if it was visible by any camera

Returns:

Boolean:

true if it was visible by the camera (or any camera if no camera supplied), false otherwise