mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-04 16:23:52 +00:00
feat(animation): 452 named constants, 30-phase character animation state machine
Add animation_ids.hpp/cpp with all 452 WoW animation ID constants (anim::STAND, anim::RUN, anim::FIRE_BOW, ... anim::FLY_BACKWARDS, etc.), nameFromId() O(1) lookup, and flyVariant() compact 218-element ground→FLY_* resolver. Expand AnimationController into a full state machine with 20+ named states: spell cast (directed→omni→cast fallback chain, instant one-shot release), hit reactions (WOUND/CRIT/DODGE/BLOCK/SHIELD_BLOCK), stun, wounded idle, stealth animation substitution, loot, fishing channel, sit/sleep/kneel down→loop→up transitions, sheathe/unsheathe combat enter/exit, ranged weapons (BOW/GUN/CROSSBOW/THROWN with reload states), game object OPEN/CLOSE/DESTROY, vehicle enter/exit, mount flight directionals (FLY_LEFT/RIGHT/UP/DOWN/BACKWARDS), emote state variants, off-hand/pierce/dual-wield alternation, NPC birth/spawn/drown/rise, sprint aura override, totem idle, NPC greeting/farewell. Add spell_defines.hpp with SpellEffect (~45 constants) and SpellMissInfo (12 constants) namespaces; replace all magic numbers in spell_handler.cpp. Add GAMEOBJECT_BYTES_1 to update field table (all 4 expansion JSONs) and wire GameObjectStateCallback. Add DBC cross-validation on world entry. Expand tools/_ANIM_NAMES from ~35 to 452 entries in m2_viewer.py and asset_pipeline_gui.py. Add tests/test_animation_ids.cpp. Bug fixes included: - Stand state 1 was animating READY_2H(27) — fixed to SITTING(97) - Spell casts ended freeze-frame — add one-shot release animation - NPC 2H swing probe chain missing ATTACK_2H_LOOSE (polearm/staff) - Chair sits (states 2/4/5/6) incorrectly played floor-sit transition - STOP(3) used for all spell casts — replaced with model-aware chain
This commit is contained in:
parent
d54e262048
commit
e58f9b4b40
59 changed files with 3903 additions and 483 deletions
|
|
@ -295,7 +295,7 @@ public:
|
|||
*/
|
||||
/** Pre-allocate GPU resources (bone SSBOs, descriptors) on main thread before parallel render. */
|
||||
void prepareRender(uint32_t frameIndex, const Camera& camera);
|
||||
/** Phase 2.3: Dispatch GPU frustum culling compute shader on primary cmd before render pass. */
|
||||
/** Dispatch GPU frustum culling compute shader on primary cmd before render pass. */
|
||||
void dispatchCullCompute(VkCommandBuffer cmd, uint32_t frameIndex, const Camera& camera);
|
||||
void render(VkCommandBuffer cmd, VkDescriptorSet perFrameSet, const Camera& camera);
|
||||
|
||||
|
|
@ -329,6 +329,11 @@ public:
|
|||
void setInstancePosition(uint32_t instanceId, const glm::vec3& position);
|
||||
void setInstanceTransform(uint32_t instanceId, const glm::mat4& transform);
|
||||
void setInstanceAnimationFrozen(uint32_t instanceId, bool frozen);
|
||||
/// Set the animation sequence by animation ID (e.g. anim::OPEN, anim::CLOSE).
|
||||
/// Finds the first sequence with matching ID. Unfreezes the instance and resets time.
|
||||
void setInstanceAnimation(uint32_t instanceId, uint32_t animationId, bool loop = true);
|
||||
/// Check if a model instance has a specific animation ID in its sequence table.
|
||||
bool hasAnimation(uint32_t instanceId, uint32_t animationId) const;
|
||||
float getInstanceAnimDuration(uint32_t instanceId) const;
|
||||
void removeInstance(uint32_t instanceId);
|
||||
void removeInstances(const std::vector<uint32_t>& instanceIds);
|
||||
|
|
@ -439,7 +444,7 @@ private:
|
|||
void* megaBoneMapped_[2] = {};
|
||||
VkDescriptorSet megaBoneSet_[2] = {};
|
||||
|
||||
// Phase 2.1: GPU instance data SSBO — per-instance transforms, fade, bones for instanced draws.
|
||||
// GPU instance data SSBO — per-instance transforms, fade, bones for instanced draws.
|
||||
// Shader reads instanceData[push.instanceDataOffset + gl_InstanceIndex].
|
||||
struct M2InstanceGPU {
|
||||
glm::mat4 model; // 64 bytes @ offset 0
|
||||
|
|
@ -458,7 +463,7 @@ private:
|
|||
VkDescriptorSet instanceSet_[2] = {};
|
||||
uint32_t instanceDataCount_ = 0; // reset each frame in render()
|
||||
|
||||
// Phase 2.3: GPU Frustum Culling via Compute Shader
|
||||
// GPU Frustum Culling via Compute Shader
|
||||
// Compute shader tests each M2 instance against frustum planes + distance, writes visibility[].
|
||||
// CPU reads back visibility to build sortedVisible_ without per-instance frustum/distance tests.
|
||||
struct CullInstanceGPU { // matches CullInstance in m2_cull.comp.glsl (32 bytes, std430)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue