AvatarComponent3D Class
This component adds and handles a 3D avatar on the scene.
Constructor
AvatarComponent3D
(
-
core
Parameters:
-
core
CoreThe main engine.
Item Index
Methods
Properties
Methods
compute
()
private
Recompute of the component.
destroy
()
Destructor.
disable
()
Disables event listening.
enable
()
Enables event listening.
getFloor
(
BABYLON.Mesh
-
[structure]
Gets the 3D mesh of the floor structure in parameter (by default current floor).
Parameters:
-
[structure]
FloorStructure optionalThe floor structure.
Returns:
BABYLON.Mesh:
The floor mesh in 3D.
initialize
()
Method called when Wanaplan is initialized.
You don't need to call this method manually.
onContextChanged
(
-
context
Method called when the context is switched (2D -> 3D or 3D -> 2D)
Parameters:
-
context
StringThe new context
onKeyDown
(
-
event
Triggered on event wnp.keyboardManager.keyDown
. Used to rotate the avatar.
Parameters:
-
event
EventThe JS event.
onKeyUp
(
-
event
Triggered on event wnp.keyboardManager.keyUp
.
Parameters:
-
event
EventThe JS event.
setVisibility
(
-
isVisible
Changes the Avatar visibility state.
Parameters:
-
isVisible
BooleanTrue to set visible and false to set invisible.
startListening
()
Calls all the event listeners.
stopListening
()
Removes all the event listeners.
update
(
-
deltaTime
Updates the dynamic part of the component.
Parameters:
-
deltaTime
NumberThe time interval.
Properties
avatar
BABYLON.Mesh
The avatar mesh.
keyboardManager
wnp.KeyboardManager
Instance of the Keyboard Manager (shortcut to wanaplan.keyboardManager).
structure
wnp.Structure
Instance of the structure (shortcut to wanaplan.structure).
Events
wnp.engine3D.camera.move
Fired when the 3D camera has been moved.
wnp.engine3D.UIobject.transform
Fired when the transform of an object is modified.
wnp.request.disable-orbit-camera
Fired to disable the orbit camera.
wnp.request.enable-orbit-camera
Fired to enable the orbit camera.