DecorationComponent
Summary
This component manages the decoration of all the objects in the scene.
Constructor
DecorationComponent
Syntax
DecorationComponent
-
core
Summary
Parameters:
-
core
CoreWanaplan core.
Item Index
Methods
Properties
Methods
addHistory
Syntax
addHistory
-
target
-
params
-
type
-
component
Summary
Adds a history action.
applyMaterial
Syntax
applyMaterial
-
object
-
material
-
collided
Summary
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
Syntax
compute
()
private
Summary
Recompute of the component.decorate
Syntax
decorate
-
object
-
material
-
collisionInfo
Summary
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
Syntax
destroy
()
Summary
Destructor.disable
Syntax
disable
()
Summary
Disables the componentenable
Syntax
enable
()
Summary
Enables the componentgetFloor
Syntax
getFloor
-
[structure]
Summary
Gets the 3D mesh of the floor structure in parameter (by default current floor).Parameters:
-
[structure]
FloorStructure optionalThe floor structure.
Returns:
The floor mesh in 3D.
historyPaint
Syntax
historyPaint
-
target
-
params
-
modifiedMaterial
Summary
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
Syntax
initialize
()
Summary
Method called when Wanaplan is initialized. You don't need to call this method manually.isSubMeshDecorable
Syntax
isSubMeshDecorable
-
object
Summary
determine if we can decorate the submesh targeted the list can be be extended
Parameters:
-
object
Objectthe selected submesh.
onClick
Syntax
onClick
-
event
Summary
Triggered on event wnp.engine3D.click.collided
to change the material of an object.
Parameters:
-
event
ObjectThe object associated to the event.
onContextChanged
Syntax
onContextChanged
-
context
Summary
Called when the context changes
Parameters:
-
context
StringThe current context : 2D or 3D.
onPaintHandler
Syntax
onPaintHandler
-
event
Summary
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
Syntax
redoPaint
-
target
-
params
Summary
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
Syntax
setupHistory
()
Summary
Creates the history for the paint action
startListening
Syntax
startListening
()
Summary
Calls all the event listeners.stopListening
Syntax
stopListening
()
Summary
Removes all the event listeners.stopPainMode
Syntax
stopPainMode
()
Summary
Stops the paint mode by setting all parameters to null.
undoPaint
Syntax
undoPaint
-
target
-
params
Summary
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
Syntax
update
-
deltaTime
Summary
Updates the dynamic part of the component.Parameters:
-
deltaTime
NumberThe time interval.
updateLastItemMenu
Syntax
updateLastItemMenu
-
item
Summary
Updates the item of the menu with the last color
Parameters:
-
item
ObjectThe last item.
Properties
keyboardManager
Syntax
keyboardManager
wnp.KeyboardManager
Summary
Instance of the Keyboard Manager (shortcut to wanaplan.keyboardManager).structure
Syntax
structure
wnp.Structure
Summary
Instance of the structure (shortcut to wanaplan.structure).Events
wnp.engine3D.brushReady
Syntax
wnp.engine3D.brushReady
Summary
Fired when the decoration brush is ready.
wnp.engine3D.decorate
Syntax
wnp.engine3D.decorate
Summary
Fired to decorate an object with a material.
wnp.engine3D.paint
Syntax
wnp.engine3D.paint
Summary
Fired when a paint texture is chosen in the decoration menu.
wnp.request.historyAction
Syntax
wnp.request.historyAction
Summary
Fired when an object is refreshed and if the history is needed.
wnp.request.saveHistory
Syntax
wnp.request.saveHistory
Summary
Fired to request a save of the history.