1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-22 10:22:52 +01:00

Update character look direction when setting orientation

This commit is contained in:
Daniel Evans 2016-12-04 15:41:16 +00:00
parent 247f66f60d
commit eb71f59594
2 changed files with 9 additions and 0 deletions

View File

@ -24,6 +24,7 @@ CharacterObject::CharacterObject(GameWorld* engine, const glm::vec3& pos,
, currentState({})
, currentVehicle(nullptr)
, currentSeat(0)
, m_look(0.f, glm::half_pi<float>())
, running(false)
, jumped(false)
, jumpSpeed(DefaultJumpSpeed)
@ -275,6 +276,12 @@ void CharacterObject::tick(float dt) {
}
}
void CharacterObject::setRotation(const glm::quat &orientation)
{
m_look.x = glm::roll(orientation);
rotation = orientation;
}
#include <algorithm>
void CharacterObject::changeCharacterModel(const std::string& name) {
auto modelName = std::string(name);

View File

@ -154,6 +154,8 @@ public:
return currentState;
}
void setRotation(const glm::quat& orientation) override;
/**
* @brief Loads the model and texture for a character skin.
*/