The default Voxelize character. This can be used in Peers.createPeer to apply characters onto
multiplayer peers. This can also be attached to a RigidControls instance to have a character
follow the controls.
When character.set is called, the character's head will be lerp to the new rotation first, then the
body will be lerp to the new rotation. This is to create a more natural looking of character rotation.
Example
const character = new VOXELIZE.Character();
// Set the nametag content.
character.username = "<placeholder>";
// Load a texture to paint on the face.
world.loader.addTexture(FunnyImageSrc, (texture) => {
character.head.paint("front", texture);
})
// Attach the character to a rigid controls.
controls.attachCharacter(character);

Hierarchy
-
Group↳
Character
Constructors
constructor
• new Character(options?): Character
Create a new Voxelize character.
Parameters
| Name | Type | Description |
|---|---|---|
options | Partial<CharacterOptions> | Parameters to create a Voxelize character. |
Returns
Overrides
Group.constructor
Properties
body
• body: CanvasBox
The actual body mesh as a paint-able CanvasBox.
bodyGroup
• bodyGroup: Group<Object3DEventMap>
The sub-mesh holding the character's body.
extraData
• extraData: any = null
Somewhere to store whatever you want.
head
• head: CanvasBox
The actual head mesh as a paint-able CanvasBox.
headGroup
• headGroup: Group<Object3DEventMap>
The sub-mesh holding the character's head.
leftArm
• leftArm: CanvasBox
The actual left arm mesh as a paint-able CanvasBox.
leftArmGroup
• leftArmGroup: Group<Object3DEventMap>
The sub-mesh holding the character's left arm.
leftLeg
• leftLeg: CanvasBox
The actual left leg mesh as a paint-able CanvasBox.
leftLegGroup
• leftLegGroup: Group<Object3DEventMap>
The sub-mesh holding the character's left leg.
nametag
• nametag: NameTag
The nametag of the character that floats right above the head.
newBodyDirection
• newBodyDirection: Quaternion
The new body direction of the character. This is used to lerp the character's body rotation.
newDirection
• newDirection: Quaternion
The new head direction of the character. This is used to lerp the character's head rotation.
newPosition
• newPosition: Vector3
The new position of the character. This is used to lerp the character's position