DecorationComponent Class
This component manages the decoration of all the objects in the scene.
Constructor
DecorationComponent
-
core
Parameters:
-
core
CoreWanaplan core.
Item Index
Methods
Properties
Methods
addHistory
-
target
-
params
-
type
-
component
Adds a history action.
applyMaterial
-
object
-
material
-
collided
Applies a new Material on an object.
Parameters:
-
object
BABYLON.MeshInstance of an object3D BABYLON.Mesh.
-
material
BABYLON.MaterialInstance of material to use on the object.
-
collided
BooleanThe collision information
compute
()
private
decorate
-
object
-
material
-
collisionInfo
Assigns a new material to an object.
Parameters:
-
object
BABYLON.MeshInstance of an 3D object mesh.
-
material
BABYLON.MaterialInstance of material to use on the object.
-
collisionInfo
ObjectInformation on the collision between the ray sent on click and the object.
destroy
()
disable
()
enable
()
getFloor
-
[structure]
Parameters:
-
[structure]
FloorStructure optionalThe floor structure.
Returns:
The floor mesh in 3D.
historyPaint
-
target
-
params
-
modifiedMaterial
Function called at undo or redo
Parameters:
-
target
TargetThe target of the undo or redo.
-
params
Objectparams of the paint.
-
modifiedMaterial
wnp.materialThe material modified.
initialize
()
isSubMeshDecorable
-
object
determine if we can decorate the submesh targeted the list can be be extended
Parameters:
-
object
Objectthe selected submesh.
onClick
-
event
Triggered on event wnp.engine3D.click.collided
to change the material of an object.
Parameters:
-
event
ObjectThe object associated to the event.
onContextChanged
-
context
Called when the context changes
Parameters:
-
context
StringThe current context : 2D or 3D.
onPaintHandler
-
event
Starts brush mode to paint an object with a color.
Triggered on event wnp.engine3D.paint
Parameters:
-
event
ObjectThe object associated to the event.
redoPaint
-
target
-
params
Redoes painting by calling the redoFunction of the type action when the ctrl-y is pressed.
Parameters:
-
target
TargetThe target of the redo.
-
params
Objectparams of the paint.
setupHistory
()
Creates the history for the paint action
startListening
()
stopListening
()
stopPainMode
()
Stops the paint mode by setting all parameters to null.
undoPaint
-
target
-
params
Undoes painting by calling the undoFunction of the type action when the ctrl-z is pressed.
Parameters:
-
target
TargetThe target of the undo.
-
params
Objectparams of the paint.
update
-
deltaTime
Parameters:
-
deltaTime
NumberThe time interval.
updateLastItemMenu
-
item
Updates the item of the menu with the last color
Parameters:
-
item
ObjectThe last item.
Properties
keyboardManager
wnp.KeyboardManager
structure
wnp.Structure
Events
wnp.engine3D.brushReady
Fired when the decoration brush is ready.
wnp.engine3D.decorate
Fired to decorate an object with a material.
wnp.engine3D.paint
Fired when a paint texture is chosen in the decoration menu.
wnp.request.historyAction
Fired when an object is refreshed and if the history is needed.
wnp.request.saveHistory
Fired to request a save of the history.