mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
refactor: extract shared attachment lookup logic into helper function
Consolidated duplicate attachment point resolution code used by both attachWeapon() and getAttachmentTransform(). New findAttachmentBone() helper encapsulates the complete lookup chain: attachment by ID, fallback scan, key-bone fallback, and validation. Eliminates ~55 lines of duplicate code while improving maintainability and consistency.
This commit is contained in:
parent
bc6cd6e5f2
commit
3202c1392d
2 changed files with 67 additions and 98 deletions
|
|
@ -217,6 +217,10 @@ private:
|
|||
static glm::quat interpolateQuat(const pipeline::M2AnimationTrack& track,
|
||||
int seqIdx, float time);
|
||||
|
||||
// Attachment point lookup helper — shared by attachWeapon() and getAttachmentTransform()
|
||||
bool findAttachmentBone(uint32_t modelId, uint32_t attachmentId,
|
||||
uint16_t& outBoneIndex, glm::vec3& outOffset) const;
|
||||
|
||||
public:
|
||||
/**
|
||||
* Build a composited character skin texture by alpha-blending overlay
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue