mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-26 09:35:28 +00:00
Pass player rotation through the movement settings
This commit is contained in:
parent
18e8ff7198
commit
13c098266c
@ -538,11 +538,11 @@ namespace MWInput
|
|||||||
{
|
{
|
||||||
resetIdleTime();
|
resetIdleTime();
|
||||||
|
|
||||||
float x = arg.state.X.rel * mCameraSensitivity * 0.2;
|
float x = arg.state.X.rel * mCameraSensitivity * 0.2f;
|
||||||
float y = arg.state.Y.rel * mCameraSensitivity * 0.2 * (mInvertY ? -1 : 1) * mUIYMultiplier;
|
float y = arg.state.Y.rel * mCameraSensitivity * 0.2f * (mInvertY ? -1 : 1) * mUIYMultiplier;
|
||||||
|
|
||||||
MWBase::World *world = MWBase::Environment::get().getWorld();
|
mPlayer.setYaw(x);
|
||||||
world->rotateObject(world->getPlayer().getPlayer(), -y, 0.f, x, true);
|
mPlayer.setPitch(-y);
|
||||||
|
|
||||||
if (arg.state.Z.rel)
|
if (arg.state.Z.rel)
|
||||||
MWBase::Environment::get().getWorld()->changeVanityModeScale(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);
|
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()
|
MWMechanics::DrawState_ Player::getDrawState()
|
||||||
{
|
{
|
||||||
MWWorld::Ptr ptr = getPlayer();
|
MWWorld::Ptr ptr = getPlayer();
|
||||||
|
@ -67,6 +67,10 @@ namespace MWWorld
|
|||||||
|
|
||||||
void setRunState(bool run);
|
void setRunState(bool run);
|
||||||
void setSneak(bool sneak);
|
void setSneak(bool sneak);
|
||||||
|
|
||||||
|
void setYaw(float yaw);
|
||||||
|
void setPitch(float pitch);
|
||||||
|
void setRoll(float roll);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user