Properly implement the real Deagle + AWP viewmodels with the arms - #40
Merged
Merged
Conversation
Fresh, from-scratch approach to both gun viewmodels using the real downloaded Sketchfab models, plus a keybind fix so you can actually reload. The breakthrough: both models ship a broken skinned export where the gun meshes are authored thousands of units from the hands — but I verified (via SkinnedMesh.applyBoneTransform, the only reliable way; computeBounds and headless bounds both lie about skinned meshes) that the Deagle's ARMS skin perfectly to the origin and its Weapon bone tracks the hand. So: - Deagle: keep the real animated arms (detailed tactical gloves + watch, posed gripping) and rigidly bolt the extracted gun (MainBody/Slide/ Magazine) to the Weapon bone, which the arm animation carries. Result: real hands holding a real Deagle, right-way-up, through equip/idle/fire/ reload. No more upside-down gun-only. - AWP (the hard one): its arms skin to a different place than the gun and are low-poly, so a hands-on-rifle view isn't achievable from this model. Hide the arms and present the gun fit by its bind-space geometry — a clean, correctly-oriented rifle (scope/receiver/stock/barrel), fixing the 'facing up / wrong side / blocky' look. Drop the one mesh that skins away. WeaponViewmodels is rewritten around this: load whole model, optional gun-attach to a bone, hide broken/aim helper meshes, fit by skinned bounds (Deagle) or bind-geometry bounds (AWP), play the authored clips. Brighter viewmodel lighting carried over so the dark gun textures read on the map. Keybind: R was bound to BOTH reset-to-spawn and reload, so it teleported you instead of reloading. R now reloads in combat; reset-to-spawn is kept for non-combat surf practice only. AWP ships as the raw 6MB GLB; the Deagle reuses the faithful 13MB build (its arms are intact — verified). CI green (138 tests).
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
A fresh, from-scratch pass at both gun viewmodels using the real downloaded Sketchfab models, done properly like the knife — plus a keybind fix so you can actually reload.
The breakthrough
Both models ship a broken skinned export where the gun meshes are authored thousands of units from the hands. Crucially, I verified this with
SkinnedMesh.applyBoneTransform(the only reliable way —computeBoundingBoxand headless bounds both lie about skinned meshes, which is what misled the earlier attempts). Ground truth: the Deagle's arms skin perfectly to the origin and itsWeaponbone tracks the hand.Deagle — real arms holding a real gun ✅
Keep the real animated arms (detailed tactical gloves + watch, posed gripping) and rigidly bolt the extracted gun (MainBody/Slide/Magazine) to the
Weaponbone, which the arm animation carries. Result: real hands holding a real Deagle, right-way-up, through equip/idle/fire/reload. No more upside-down gun-only.AWP — the hard one
Its arms skin to a different place than the gun and are low-poly, so a hands-on-rifle view genuinely isn't achievable from this model. So I hide the arms and present the gun fit by its bind-space geometry — a clean, correctly-oriented rifle (scope/receiver/stock/barrel), fixing the "facing up / wrong side / blocky" look. One mesh that skins away is dropped.
Reload keybind fix ✅
Rwas bound to both reset-to-spawn and reload, so it teleported you instead of reloading.Rnow reloads in combat; reset-to-spawn is kept for non-combat surf practice only.Implementation
WeaponViewmodelsis rewritten around this: load the whole model, optional gun-attach to a bone, hide broken/aim-helper meshes, fit by skinned bounds (Deagle) or bind-geometry bounds (AWP), and play the authored equip/idle/fire/reload clips. Brighter viewmodel lighting carried over so the dark gun textures read against the map.Verification
ViewmodelRenderer(same FOV/lights/camera-mount as in-game) — Deagle shows arms gripping the gun; AWP shows a clean rifle.npm run cigreen: typecheck + 138 tests + build.