2014-12-21 16:45:30 +01:00
|
|
|
#include "actor.hpp"
|
|
|
|
|
2015-04-25 15:19:17 +02:00
|
|
|
#include "character.hpp"
|
2014-12-21 16:45:30 +01:00
|
|
|
|
|
|
|
namespace MWMechanics
|
|
|
|
{
|
|
|
|
Actor::Actor(const MWWorld::Ptr &ptr, MWRender::Animation *animation)
|
2021-09-30 22:58:16 +02:00
|
|
|
: mPositionAdjusted(false)
|
2014-12-21 16:45:30 +01:00
|
|
|
{
|
2015-04-25 15:19:17 +02:00
|
|
|
mCharacterController.reset(new CharacterController(ptr, animation));
|
2014-12-21 16:45:30 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void Actor::updatePtr(const MWWorld::Ptr &newPtr)
|
|
|
|
{
|
2015-04-25 15:19:17 +02:00
|
|
|
mCharacterController->updatePtr(newPtr);
|
2014-12-21 16:45:30 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
CharacterController* Actor::getCharacterController()
|
|
|
|
{
|
2015-04-25 15:19:17 +02:00
|
|
|
return mCharacterController.get();
|
2014-12-21 16:45:30 +01:00
|
|
|
}
|
2020-05-17 04:06:39 +03:00
|
|
|
|
|
|
|
int Actor::getGreetingTimer() const
|
|
|
|
{
|
|
|
|
return mGreetingTimer;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Actor::setGreetingTimer(int timer)
|
|
|
|
{
|
|
|
|
mGreetingTimer = timer;
|
|
|
|
}
|
|
|
|
|
|
|
|
float Actor::getAngleToPlayer() const
|
|
|
|
{
|
|
|
|
return mTargetAngleRadians;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Actor::setAngleToPlayer(float angle)
|
|
|
|
{
|
|
|
|
mTargetAngleRadians = angle;
|
|
|
|
}
|
|
|
|
|
|
|
|
GreetingState Actor::getGreetingState() const
|
|
|
|
{
|
|
|
|
return mGreetingState;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Actor::setGreetingState(GreetingState state)
|
|
|
|
{
|
|
|
|
mGreetingState = state;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Actor::isTurningToPlayer() const
|
|
|
|
{
|
|
|
|
return mIsTurningToPlayer;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Actor::setTurningToPlayer(bool turning)
|
|
|
|
{
|
|
|
|
mIsTurningToPlayer = turning;
|
|
|
|
}
|
2021-09-30 22:58:16 +02:00
|
|
|
|
|
|
|
void Actor::setPositionAdjusted(bool adjusted)
|
|
|
|
{
|
|
|
|
mPositionAdjusted = adjusted;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Actor::getPositionAdjusted() const
|
|
|
|
{
|
|
|
|
return mPositionAdjusted;
|
|
|
|
}
|
2014-12-21 16:45:30 +01:00
|
|
|
}
|