mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-24 08:00:14 +00:00
Add WoW-style footsteps and improve third-person movement/collision
This commit is contained in:
parent
54dc27c2ec
commit
dfb1f3cfdc
11 changed files with 724 additions and 85 deletions
|
|
@ -1141,6 +1141,30 @@ void CharacterRenderer::removeInstance(uint32_t instanceId) {
|
|||
instances.erase(instanceId);
|
||||
}
|
||||
|
||||
bool CharacterRenderer::getAnimationState(uint32_t instanceId, uint32_t& animationId,
|
||||
float& animationTimeMs, float& animationDurationMs) const {
|
||||
auto it = instances.find(instanceId);
|
||||
if (it == instances.end()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const CharacterInstance& instance = it->second;
|
||||
auto modelIt = models.find(instance.modelId);
|
||||
if (modelIt == models.end()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const auto& sequences = modelIt->second.data.sequences;
|
||||
if (instance.currentSequenceIndex < 0 || instance.currentSequenceIndex >= static_cast<int>(sequences.size())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
animationId = instance.currentAnimationId;
|
||||
animationTimeMs = instance.animationTime;
|
||||
animationDurationMs = static_cast<float>(sequences[instance.currentSequenceIndex].duration);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CharacterRenderer::attachWeapon(uint32_t charInstanceId, uint32_t attachmentId,
|
||||
const pipeline::M2Model& weaponModel, uint32_t weaponModelId,
|
||||
const std::string& texturePath) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue