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
()
Item Index
Methods
computeNormalMatrix
()
Updates the normal matrix using the matrix
enableFlag
-
flag
Enable flag in the flag bit field
Parameters:
-
flag
Numberid
enableFlag
-
flag
Disable flag in the flag bit field
Parameters:
-
flag
Numberid
enableFlag
-
flag
Tells if a flag is enabled
Parameters:
-
flag
Numberid
Returns:
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
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:
true if it was visible by the camera (or any camera if no camera supplied), false otherwise