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:
parent
247f66f60d
commit
eb71f59594
@ -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);
|
||||
|
@ -154,6 +154,8 @@ public:
|
||||
return currentState;
|
||||
}
|
||||
|
||||
void setRotation(const glm::quat& orientation) override;
|
||||
|
||||
/**
|
||||
* @brief Loads the model and texture for a character skin.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user