Methods
# startMotion(dx, dy)
Called when the shell sends the motion-start
DOM message from the Microverse shell, typically when the joystick is pressed down.
Name | Type | Description |
---|---|---|
dx |
number | the offset of joystick knob |
dy |
number | the offset of joystick knob |
# updateMotion(dx, dy)
Called repeatedly when the shell sends the motion-update
DOM message from the Microverse shell, typically when the joystick is moved from the off-center.
Name | Type | Description |
---|---|---|
dx |
number | the offset of joystick knob |
dy |
number | the offset of joystick knob |
# endMotion(dx, dy)
Called when the shell sends the motion-end
DOM message from the Microverse shell, typically when the joystick is released.
Name | Type | Description |
---|---|---|
dx |
number | the offset of joystick knob |
dy |
number | the offset of joystick knob |
# walkLook()
This method specifies the global camera position. The implementation can use various properties such as the global transformation of the avatar, lookPitch and other properties that the behavior defines.
Matrix4
# pointerDown(evt)
Implementing them at the AvatarPawn overrides their actions. Note that the first responder and last responder mechanism is involved so some methods expects certain patterns. In general, you can simply copy the default implementation in src/avatar.js
into your own behavior file as ther starting point for your own custom implementation.
Name | Type | Description |
---|---|---|
evt |
Event | the p3e event from Pointer. |
# pointerUp(evt)
Name | Type | Description |
---|---|---|
evt |
Event | the p3e event from Pointer. |
# pointerMove(evt)
Name | Type | Description |
---|---|---|
evt |
Event | the p3e event from Pointer. |
# pointerMove(evt)
Name | Type | Description |
---|---|---|
evt |
Event | the p3e event from Pointer. |
# pointerTap(evt)
Name | Type | Description |
---|---|---|
evt |
Event | the p3e event from Pointer. |
# pointerWheel(evt)
Name | Type | Description |
---|---|---|
evt |
Event | the p3e event from Pointer. |
# pointerDoubleDown(evt)
Name | Type | Description |
---|---|---|
evt |
Event | the p3e event from Pointer. |
# keyDown(evt)
Name | Type | Description |
---|---|---|
evt |
Event | the p3e event from Pointer. |
# keyUp(evt)
Name | Type | Description |
---|---|---|
evt |
Event | the p3e event from Pointer. |
# mapOpacity()
This method controls the opacity used to render avatars. Typically a remote avatar close to yours become translucent. the custom implementation of mapOpacity
defined at the AvatarPawn maps the value in the [0, 1] range.
a number to represent modified opacity between [0, 1]