wnp.Outliner Class
Outlining effect manager. Renders an outline on mesh/submeshes as an emphasis effect.
Constructor
wnp.Outliner
-
scene
Parameters:
-
scene
BABYLON.SceneThe scene.
Item Index
Methods
getMeshes
()
BABYLON.Mesh
Returns an array of currently outlined meshes. See also getSubMeshIndexes
for a more detailed understanding of the handled meshes/submeshes.
Returns:
An array of meshes.
getSubMeshIndexes
()
Number[]
Returns a 2D array of currently outlined subMesh indexes.
Returns:
The subMesh indexes.
Example:
var meshes = outliner.getMeshes();
var indexes = outliner.getSubMeshIndexes();
Given this configuration, if meshes[i]
is defined, two scenarios are possible :
- Either
indexes[i]
is an Array of submesh indexes, and only the subMeshes of these indexes will be highlighted (if they exist). - Either
indexes[i]
is undefined or an empty Array, and the whole mesh is highlighted.
hide
()
Hides the outline. Must be called when no meshes are outlined, in order to preserve the framerate.
setColor
-
color
Sets the color of the outline. Default is red.
Parameters:
-
color
BABYLON.Color4The requested color.
setMeshes
-
meshes
Sets an array of currently outlined meshes. See also getSubMeshIndexes
for a more detailed understanding of the handled meshes/submeshes.
Parameters:
-
meshes
BABYLON.MeshAn array of meshes.
setSubMeshesIndexes
-
subMeshesIndexes
Sets a 2D array of currently outlined subMesh indexes. See also getSubMeshIndexes
for a more detailed understanding of the handled meshes/submeshes.
Parameters:
-
subMeshesIndexes
Number[]The subMesh indexes.
setThickness
-
value
Sets the thickness of the outline. Default is 1.
Parameters:
-
value
NumberRequested thickness.
show
()
Shows the outline.