DecorationComponent
Summary
This component manages the decoration of all the objects in the scene.
Constructor
DecorationComponent
Syntax
DecorationComponent
-
core
Summary
Parameters:
-
coreCoreWanaplan 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:
-
objectBABYLON.MeshInstance of an object3D BABYLON.Mesh.
-
materialBABYLON.MaterialInstance of material to use on the object.
-
collidedBooleanThe 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:
-
objectBABYLON.MeshInstance of an 3D object mesh.
-
materialBABYLON.MaterialInstance of material to use on the object.
-
collisionInfoObjectInformation 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:
-
targetTargetThe target of the undo or redo.
-
paramsObjectparams of the paint.
-
modifiedMaterialwnp.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:
-
objectObjectthe selected submesh.
onClick
Syntax
onClick
-
event
Summary
Triggered on event wnp.engine3D.click.collided to change the material of an object.
Parameters:
-
eventObjectThe object associated to the event.
onContextChanged
Syntax
onContextChanged
-
context
Summary
Called when the context changes
Parameters:
-
contextStringThe 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:
-
eventObjectThe 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:
-
targetTargetThe target of the redo.
-
paramsObjectparams 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:
-
targetTargetThe target of the undo.
-
paramsObjectparams of the paint.
update
Syntax
update
-
deltaTime
Summary
Updates the dynamic part of the component.Parameters:
-
deltaTimeNumberThe time interval.
updateLastItemMenu
Syntax
updateLastItemMenu
-
item
Summary
Updates the item of the menu with the last color
Parameters:
-
itemObjectThe 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.