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