character foot placement also works when moving; leaning control; improvements;

This commit is contained in:
Turánszki János
2024-08-11 15:21:41 +02:00
parent a15a0f6026
commit 99c1d78211
7 changed files with 155 additions and 105 deletions
+10 -2
View File
@@ -2374,11 +2374,15 @@ namespace wi::scene
}
facing_next = direction;
}
void CharacterComponent::AddAnimation(wi::ecs::Entity entity)
void CharacterComponent::Lean(float amount)
{
leaning_next = amount;
}
void CharacterComponent::AddAnimation(Entity entity)
{
animations.push_back(entity);
}
void CharacterComponent::PlayAnimation(wi::ecs::Entity entity)
void CharacterComponent::PlayAnimation(Entity entity)
{
if (currentAnimation != entity)
{
@@ -2386,6 +2390,10 @@ namespace wi::scene
currentAnimation = entity;
}
}
void CharacterComponent::StopAnimation()
{
currentAnimation = INVALID_ENTITY;
}
void CharacterComponent::SetAnimationAmount(float amount)
{
anim_amount = amount;