mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-02 15:53:51 +00:00
Initial commit: wowee native WoW 3.3.5a client
This commit is contained in:
commit
ce6cb8f38e
147 changed files with 32347 additions and 0 deletions
57
include/game/npc_manager.hpp
Normal file
57
include/game/npc_manager.hpp
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <unordered_map>
|
||||
#include <glm/glm.hpp>
|
||||
|
||||
namespace wowee {
|
||||
namespace pipeline { class AssetManager; }
|
||||
namespace rendering { class CharacterRenderer; }
|
||||
namespace game {
|
||||
|
||||
class EntityManager;
|
||||
|
||||
struct NpcSpawnDef {
|
||||
std::string name;
|
||||
std::string m2Path;
|
||||
uint32_t level;
|
||||
uint32_t health;
|
||||
glm::vec3 glPosition; // GL world coords (pre-converted)
|
||||
float rotation; // radians around Z
|
||||
float scale;
|
||||
bool isCritter; // critters don't do humanoid emotes
|
||||
};
|
||||
|
||||
struct NpcInstance {
|
||||
uint64_t guid;
|
||||
uint32_t renderInstanceId;
|
||||
float emoteTimer; // countdown to next random emote
|
||||
float emoteEndTimer; // countdown until emote animation finishes
|
||||
bool isEmoting;
|
||||
bool isCritter;
|
||||
};
|
||||
|
||||
class NpcManager {
|
||||
public:
|
||||
void initialize(pipeline::AssetManager* am,
|
||||
rendering::CharacterRenderer* cr,
|
||||
EntityManager& em,
|
||||
const glm::vec3& playerSpawnGL);
|
||||
void update(float deltaTime, rendering::CharacterRenderer* cr);
|
||||
|
||||
private:
|
||||
void loadCreatureModel(pipeline::AssetManager* am,
|
||||
rendering::CharacterRenderer* cr,
|
||||
const std::string& m2Path,
|
||||
uint32_t modelId);
|
||||
|
||||
std::vector<NpcInstance> npcs;
|
||||
std::unordered_map<std::string, uint32_t> loadedModels; // path -> modelId
|
||||
uint64_t nextGuid = 0xF1300000DEAD0001ULL;
|
||||
uint32_t nextModelId = 100;
|
||||
};
|
||||
|
||||
} // namespace game
|
||||
} // namespace wowee
|
||||
Loading…
Add table
Add a link
Reference in a new issue