Constructor
(abstract) new Avatar(scene, folder, shadowGenerator)
Parameters:
| Name | Type | Description | 
|---|---|---|
scene | 
            
            ||
folder | 
            
            ServerFolder with the content | |
shadowGenerator | 
            
            optional to cast shadows | 
- Source:
 
Classes
Members
attachments
    Custom nodes to be disposed when this avatar is disposed
- Source:
 
displayName
    Whether to display the name above the head, defaults to value of static displayName
- Source:
 
displayName
    Whether to display the name above the head, default true
- Source:
 
displayText
    Should written/spoken text be displayed above the head, defaults to value of static displayText
- Source:
 
displayText
    Should written/spoken text be displayed above the head, default true
- Source:
 
fps
    Animation frames per second, default 10
- Source:
 
name
    Name of the avatar/user
- Source:
 
textOffset
    Distance for text above the avatar
- Source:
 
use3dText
    Should we use 3d text (as opposed to Label and TextArea) - performance penalty
- Source:
 
use3dText
    Should 3d text be used for name/spoken text, defaults to value of static use3dText
- Source:
 
userHeight
    Height of the user, default 1.8
- Source:
 
Methods
attach()
    Add an attachment to the attachment object
- Source:
 
baseMesh()
    Returns the top-level mesh of the avatar
- Source:
 
basePosition()
    Returns the current base position of the avatar, e.g. where the feet are
- Source:
 
containsAttachment()
    Shortcut for this.attachments.hasOwnProperty(name)
- Source:
 
detach()
    Delete an attachment, does not dispose
- Source:
 
dispose()
    Disposes of all attachments
- Source:
 
(async) emoji()
    Remote emoji event routed by WorldManager/EventRouter
- Source:
 
getUrl()
    Returns the URL of the avatar file
- Source:
 
humanoidChanged(obj)
Parameters:
| Name | Type | Description | 
|---|---|---|
obj | 
            
            User | 
- Source:
 
meshChanged(obj)
Parameters:
| Name | Type | Description | 
|---|---|---|
obj | 
            
            User | 
- Source:
 
nameChanged(obj, node)
    Handles name change network event
    Parameters:
| Name | Type | Description | 
|---|---|---|
obj | 
            
            VRObject | contains already changed name | 
node | 
            
            * | babylon node | 
- Source:
 
positionChanged(obj, node)
    Handles position change network event
    Parameters:
| Name | Type | Description | 
|---|---|---|
obj | 
            
            VRObject | contains already changed position | 
node | 
            
            * | babylon node | 
- Source:
 
rotationChanged(obj, node)
    Handles rotation change network event
    Parameters:
| Name | Type | Description | 
|---|---|---|
obj | 
            
            VRObject | contains already changed rotation | 
node | 
            
            * | babylon node | 
- Source:
 
(async) setName(name)
    Set the name and display it above the avatar. The avatar needs to be displayed first.
    Parameters:
| Name | Type | Description | 
|---|---|---|
name | 
            
            
- Source:
 
textPositionRelative()
    Position of text above the avatar, default implementation returns topPositionRelative()+textOffset
- Source:
 
topPositionAbsolute()
    Position of top of the avatar, default implementation returns basePosition()+topPositionRelative()
- Source:
 
topPositionRelative()
    Position of top of the avatar, default implementation returns userHeight Vector3
- Source:
 
videoChanged(obj)
Parameters:
| Name | Type | Description | 
|---|---|---|
obj | 
            
            User | 
- Source:
 
(async) write(wrote)
    Write locally generated text, used internally
    Parameters:
| Name | Type | Description | 
|---|---|---|
wrote | 
            
            text to write above the head | 
- Source:
 
(async) wrote(client)
    Remote event routed by WorldManager, displays whatever user wrote above avatar's head
    Parameters:
| Name | Type | Description | 
|---|---|---|
client | 
            
            Client that wrote a text | 
- Source: