mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 20:53:50 +00:00
Pass player rotation through the movement settings
This commit is contained in:
parent
18e8ff7198
commit
13c098266c
3 changed files with 24 additions and 4 deletions
|
@ -538,11 +538,11 @@ namespace MWInput
|
|||
{
|
||||
resetIdleTime();
|
||||
|
||||
float x = arg.state.X.rel * mCameraSensitivity * 0.2;
|
||||
float y = arg.state.Y.rel * mCameraSensitivity * 0.2 * (mInvertY ? -1 : 1) * mUIYMultiplier;
|
||||
float x = arg.state.X.rel * mCameraSensitivity * 0.2f;
|
||||
float y = arg.state.Y.rel * mCameraSensitivity * 0.2f * (mInvertY ? -1 : 1) * mUIYMultiplier;
|
||||
|
||||
MWBase::World *world = MWBase::Environment::get().getWorld();
|
||||
world->rotateObject(world->getPlayer().getPlayer(), -y, 0.f, x, true);
|
||||
mPlayer.setYaw(x);
|
||||
mPlayer.setPitch(-y);
|
||||
|
||||
if (arg.state.Z.rel)
|
||||
MWBase::Environment::get().getWorld()->changeVanityModeScale(arg.state.Z.rel);
|
||||
|
|
|
@ -84,6 +84,22 @@ namespace MWWorld
|
|||
MWWorld::Class::get (ptr).setStance (ptr, MWWorld::Class::Sneak, sneak);
|
||||
}
|
||||
|
||||
void Player::setYaw(float yaw)
|
||||
{
|
||||
MWWorld::Ptr ptr = getPlayer();
|
||||
MWWorld::Class::get(ptr).getMovementSettings(ptr).mRotation[2] = yaw;
|
||||
}
|
||||
void Player::setPitch(float pitch)
|
||||
{
|
||||
MWWorld::Ptr ptr = getPlayer();
|
||||
MWWorld::Class::get(ptr).getMovementSettings(ptr).mRotation[0] = pitch;
|
||||
}
|
||||
void Player::setRoll(float roll)
|
||||
{
|
||||
MWWorld::Ptr ptr = getPlayer();
|
||||
MWWorld::Class::get(ptr).getMovementSettings(ptr).mRotation[1] = roll;
|
||||
}
|
||||
|
||||
MWMechanics::DrawState_ Player::getDrawState()
|
||||
{
|
||||
MWWorld::Ptr ptr = getPlayer();
|
||||
|
|
|
@ -67,6 +67,10 @@ namespace MWWorld
|
|||
|
||||
void setRunState(bool run);
|
||||
void setSneak(bool sneak);
|
||||
|
||||
void setYaw(float yaw);
|
||||
void setPitch(float pitch);
|
||||
void setRoll(float roll);
|
||||
};
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue