Equipment Visual System
The Equipment Visual System handles rendering equipped items on VRM avatars, including weapons, shields, helmets, and temporary gathering tools (e.g., fishing rods during fishing).Equipment visual code lives in
packages/shared/src/systems/client/EquipmentVisualSystem.ts with fitting tools in packages/asset-forge/.Architecture
Key Components
Equipment Fitting V2 Format
Export Format
Equipment models exported from Asset Forge include metadata for proper attachment:V2 vs V1 Format
V2 Format (Current):- Uses world-space relative matrix approach
- Captures exact visual relationship between hand bone and weapon
- Preserves scale compensation automatically
- No scale hacks needed in Hyperscape
- Used baked position/rotation with scale multiplier hack
- Required
WEAPON_SCALE_MULTIPLIER = 1.75in Hyperscape - Less accurate for complex bone hierarchies
V2 Export Process
Avatar Height Normalization
Asset Forge normalizes avatar height to 1.6m to match Hyperscape’s VRM factory:Equipment Loading in Hyperscape
V2 Format Loading
V1 Format Loading (Legacy)
Gathering Tool Display (OSRS-Style)
During gathering activities (fishing, mining, woodcutting), the appropriate tool is shown in the player’s hand even though it’s in inventory, not equipped. This matches OSRS behavior.Flow
Implementation
Visual System Handling
Tool Detection
The resource system now checks both inventory AND equipped items when detecting tools:- Equip a pickaxe and mine without it being in inventory
- Equip a hatchet and chop trees
- Use tools from either inventory or equipment slot