File: MD2CharacterComplex.md | Updated: 11/15/2025
This class represents a management component for animated MD2 character assets. It provides a larger API compared to MD2Character.
MD2CharacterComplex is an addon, and must be imported explicitly, see Installation#Addons.
import { MD2CharacterComplex } from 'three/addons/misc/MD2CharacterComplex.js';
Constructs a new MD2 character.
The character's angular speed.
Default is 2.5.
The FPS
Default is 6.
The character's back acceleration.
Default is 600.
The movement controls.
Default is null.
The current skin.
Default is undefined.
The character's front acceleration.
Default is 600.
The character's front deceleration.
Default is 600.
The character's maximum reverse speed.
Default is - 275.
The character's maximum speed.
Default is 275.
The body mesh.
Default is null.
The weapon mesh.
Default is null.
The root 3D object
The mesh scale.
Default is 1.
The body skins.
The weapon skins.
The transition frames.
Default is 15.
The weapon meshes.
Toggles shadow casting and receiving on the character's meshes.
enable | Whether to enable shadows or not.
---|---
Loads the character model for the given config.
config | The config which defines the model and textures paths.
---|---
Sets the defined animation clip as the active animation.
animationName | 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.
---|---
Toggles visibility on the character's meshes.
enable | Whether the character is visible or not.
---|---
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.
---|---
Shares certain resources from a different character model.
original | The original MD2 character.
---|---
Updates the animations of the mesh. Must be called inside the animation loop.
delta | The delta time in seconds.
---|---
Updates the animation state based on the control inputs.
Transforms the character model based on the control input.
delta | The delta time in seconds.
---|---