File: MD2Character.md | Updated: 11/15/2025
This class represents a management component for animated MD2 character assets.
MD2Character is an addon, and must be imported explicitly, see Installation#Addons.
import { MD2Character } from 'three/addons/misc/MD2Character.js';
Constructs a new MD2 character.
The name of the active animation clip.
Default is null.
The FPS
Default is 6.
The body mesh.
Default is null.
The weapon mesh.
Default is null.
The animation mixer.
Default is null.
The root 3D object
The mesh scale.
Default is 1.
The body skins.
The weapon skins.
The weapon meshes.
Loads the character model for the given config.
config | The config which defines the model and textures paths.
---|---
The onLoad callback function.
Sets the defined animation clip as the active animation.
clipName | The name of the animation clip.
---|---
Sets the animation playback rate.
rate | The playback rate to set.
---|---
Sets the skin defined by the given skin index. This will result in a different texture for the body mesh.
index | The skin index.
---|---
Sets the weapon defined by the given weapon index. This will result in a different weapon hold by the character.
index | The weapon index.
---|---
Sets the wireframe material flag.
wireframeEnabled | Whether to enable wireframe rendering or not.
---|---
Synchronizes the weapon with the body animation.
Updates the animations of the mesh. Must be called inside the animation loop.
delta | The delta time in seconds.
---|---