Add 3D level-up effect using LevelUp.m2 spell model

Replace 2D screen-space ding rings with real WoW LevelUp.m2 particle/geometry
effect. Fix FBlock particle color parsing (C3Vector floats, not CImVector bytes)
which was producing blue/red instead of golden yellow. Spell effect models bypass
particle dampeners, glow sprite conversion, Mod→Additive blend override, and all
collision (floor/wall/camera) to prevent camera zoom-in. Other players' level-ups
trigger the 3D effect at their position with group chat notification. F7 hotkey
for testing.
This commit is contained in:
Kelsi 2026-02-19 20:36:25 -08:00
parent 1fb1daea7f
commit da49593268
13 changed files with 321 additions and 128 deletions

View file

@ -0,0 +1,51 @@
#pragma once
#include <glm/glm.hpp>
#include <cstdint>
#include <vector>
namespace wowee {
namespace rendering {
class M2Renderer;
/// Manages spawning the real LevelUp.m2 spell effect at world positions.
/// The M2 model contains particle emitters that produce the golden pillar/ring effect.
class LevelUpEffect {
public:
LevelUpEffect();
~LevelUpEffect();
/// Load the LevelUp.m2 model (call once after M2Renderer is ready)
/// @param m2Renderer The M2 renderer to register the model with
/// @param m2FileData Raw bytes of Spell/LevelUp/LevelUp.m2
/// @param skinFileData Raw bytes of Spell/LevelUp/LevelUp00.skin
/// @return true if model loaded successfully
bool loadModel(M2Renderer* m2Renderer,
const std::vector<uint8_t>& m2FileData,
const std::vector<uint8_t>& skinFileData);
/// Trigger the level-up effect at a world position (render coords)
void trigger(const glm::vec3& position);
/// Remove expired effect instances
void update(float deltaTime);
bool isModelLoaded() const { return modelLoaded_; }
private:
static constexpr float EFFECT_DURATION = 3.5f;
static constexpr uint32_t MODEL_ID = 999900; // Unique model ID for level-up effect
struct ActiveEffect {
uint32_t instanceId;
float elapsed;
};
M2Renderer* m2Renderer_ = nullptr;
bool modelLoaded_ = false;
std::vector<ActiveEffect> activeEffects_;
};
} // namespace rendering
} // namespace wowee

View file

@ -98,6 +98,7 @@ struct M2ModelGPU {
std::vector<uint32_t> globalSequenceDurations; // Loop durations for global sequence tracks
bool hasAnimation = false; // True if any bone has keyframes
bool isSmoke = false; // True for smoke models (UV scroll animation)
bool isSpellEffect = false; // True for spell effect models (skip particle dampeners)
bool disableAnimation = false; // Keep foliage/tree doodads visually stable
bool hasTextureAnimation = false; // True if any batch has UV animation

View file

@ -31,6 +31,7 @@ class LightingManager;
class SkySystem;
class SwimEffects;
class MountDust;
class LevelUpEffect;
class CharacterRenderer;
class WMORenderer;
class M2Renderer;
@ -122,6 +123,7 @@ public:
// Emote support
void playEmote(const std::string& emoteName);
void triggerLevelUpEffect(const glm::vec3& position);
void cancelEmote();
bool isEmoteActive() const { return emoteActive; }
static std::string getEmoteText(const std::string& emoteName, const std::string* targetName = nullptr);
@ -186,6 +188,7 @@ private:
std::unique_ptr<SkySystem> skySystem; // Coordinator for sky rendering
std::unique_ptr<SwimEffects> swimEffects;
std::unique_ptr<MountDust> mountDust;
std::unique_ptr<LevelUpEffect> levelUpEffect;
std::unique_ptr<CharacterRenderer> characterRenderer;
std::unique_ptr<WMORenderer> wmoRenderer;
std::unique_ptr<M2Renderer> m2Renderer;