mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 07:40:14 +00:00
Add transport registration to movement packets (WIP - awaiting server MOVEMENT updates)
- Added transport fields to MovementInfo struct (transportGuid, transportX/Y/Z/O, transportTime) - Updated MovementPacket::build() to serialize transport data when ONTRANSPORT flag set - Modified GameHandler::sendMovement() to include transport info when player on transport - Fixed coordinate conversion for transport offsets (server↔canonical) - Added transport tracking in both CREATE_OBJECT and MOVEMENT update handlers - Connected M2Renderer to WMORenderer for hierarchical doodad transforms - Server-authoritative transport movement (no client-side animation) Issue: Server not sending MOVEMENT updates for transports, so they remain stationary. Transports register successfully but don't animate without server position updates.
This commit is contained in:
parent
f3f3b62880
commit
55a40fc3aa
8 changed files with 425 additions and 60 deletions
|
|
@ -21,6 +21,7 @@ namespace rendering {
|
|||
class Camera;
|
||||
class Shader;
|
||||
class Frustum;
|
||||
class M2Renderer;
|
||||
|
||||
/**
|
||||
* WMO (World Model Object) Renderer
|
||||
|
|
@ -49,6 +50,11 @@ public:
|
|||
*/
|
||||
void shutdown();
|
||||
|
||||
/**
|
||||
* Set M2 renderer for hierarchical transform updates (doodads follow parent WMO)
|
||||
*/
|
||||
void setM2Renderer(M2Renderer* renderer) { m2Renderer_ = renderer; }
|
||||
|
||||
/**
|
||||
* Load WMO model and create GPU resources
|
||||
* @param model WMO model with geometry data
|
||||
|
|
@ -89,6 +95,27 @@ public:
|
|||
*/
|
||||
void setInstanceTransform(uint32_t instanceId, const glm::mat4& transform);
|
||||
|
||||
/**
|
||||
* Add doodad (child M2) to WMO instance
|
||||
* @param instanceId WMO instance to add doodad to
|
||||
* @param m2InstanceId M2 instance ID of the doodad
|
||||
* @param localTransform Local transform relative to WMO origin
|
||||
*/
|
||||
void addDoodadToInstance(uint32_t instanceId, uint32_t m2InstanceId, const glm::mat4& localTransform);
|
||||
|
||||
// Forward declare DoodadTemplate for public API
|
||||
struct DoodadTemplate {
|
||||
std::string m2Path;
|
||||
glm::mat4 localTransform;
|
||||
};
|
||||
|
||||
/**
|
||||
* Get doodad templates for a WMO model
|
||||
* @param modelId WMO model ID
|
||||
* @return Vector of doodad templates (empty if no doodads or model not found)
|
||||
*/
|
||||
const std::vector<DoodadTemplate>* getDoodadTemplates(uint32_t modelId) const;
|
||||
|
||||
/**
|
||||
* Remove WMO instance
|
||||
* @param instanceId Instance to remove
|
||||
|
|
@ -363,6 +390,10 @@ private:
|
|||
glm::vec3 boundingBoxMax;
|
||||
bool isLowPlatform = false;
|
||||
|
||||
// Doodad templates (M2 models placed in WMO, stored for instancing)
|
||||
// Uses the public DoodadTemplate struct defined above
|
||||
std::vector<DoodadTemplate> doodadTemplates;
|
||||
|
||||
// Texture handles for this model (indexed by texture path order)
|
||||
std::vector<GLuint> textures;
|
||||
|
||||
|
|
@ -510,6 +541,9 @@ private:
|
|||
// Asset manager for loading textures
|
||||
pipeline::AssetManager* assetManager = nullptr;
|
||||
|
||||
// M2 renderer for hierarchical transforms (doodads following WMO parent)
|
||||
M2Renderer* m2Renderer_ = nullptr;
|
||||
|
||||
// Current map name for zone-specific floor cache
|
||||
std::string mapName_;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue