mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-17 01:23:51 +00:00
Improve movement, crouching, and add M2 animation
Movement: - Fix speed controls: Shift=sprint (28), normal run (14), Ctrl=walk (5) - Reduce character height for doorway clearance (eye height 1.2) - Add working crouch (C or X key) with smooth transition (eye height 0.6) - Jump to stand up from crouch M2 Animation: - Add animation time tracking per M2 instance - Add procedural swaying animation in vertex shader - Update animation each frame for vegetation movement
This commit is contained in:
parent
4287878a73
commit
76a16a214e
5 changed files with 63 additions and 17 deletions
|
|
@ -57,6 +57,11 @@ struct M2Instance {
|
|||
float scale;
|
||||
glm::mat4 modelMatrix;
|
||||
|
||||
// Animation state
|
||||
float animTime = 0.0f; // Current animation time
|
||||
float animSpeed = 1.0f; // Animation playback speed
|
||||
uint32_t animId = 0; // Current animation sequence
|
||||
|
||||
void updateModelMatrix();
|
||||
};
|
||||
|
||||
|
|
@ -100,6 +105,12 @@ public:
|
|||
uint32_t createInstanceWithMatrix(uint32_t modelId, const glm::mat4& modelMatrix,
|
||||
const glm::vec3& position);
|
||||
|
||||
/**
|
||||
* Update animation state for all instances
|
||||
* @param deltaTime Time since last frame
|
||||
*/
|
||||
void update(float deltaTime);
|
||||
|
||||
/**
|
||||
* Render all visible instances
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue