OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
MWMechanics::ObstacleCheck Class Reference

#include <obstacle.hpp>

Collaboration diagram for MWMechanics::ObstacleCheck:

Public Member Functions

 ObstacleCheck ()
 
void clear ()
 
bool isNormalState () const
 
bool isEvading () const
 
bool check (const MWWorld::Ptr &actor, float duration, float scaleMinimumDistance=1.0f)
 
void takeEvasiveAction (MWMechanics::Movement &actorMovement)
 

Private Types

enum  WalkState { State_Norm, State_CheckStuck, State_Evade }
 

Private Member Functions

void chooseEvasionDirection ()
 

Private Attributes

float mPrevX
 
float mPrevY
 
WalkState mWalkState
 
float mStuckDuration
 
float mEvadeDuration
 
float mDistSameSpot
 
int mEvadeDirectionIndex
 

Static Private Attributes

static const float evadeDirections [NUM_EVADE_DIRECTIONS][2]
 

Member Enumeration Documentation

Enumerator
State_Norm 
State_CheckStuck 
State_Evade 

Constructor & Destructor Documentation

MWMechanics::ObstacleCheck::ObstacleCheck ( )

Member Function Documentation

bool MWMechanics::ObstacleCheck::check ( const MWWorld::Ptr actor,
float  duration,
float  scaleMinimumDistance = 1.0f 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void MWMechanics::ObstacleCheck::chooseEvasionDirection ( )
private

Here is the caller graph for this function:

void MWMechanics::ObstacleCheck::clear ( )

Here is the caller graph for this function:

bool MWMechanics::ObstacleCheck::isEvading ( ) const

Here is the caller graph for this function:

bool MWMechanics::ObstacleCheck::isNormalState ( ) const
void MWMechanics::ObstacleCheck::takeEvasiveAction ( MWMechanics::Movement actorMovement)

Member Data Documentation

const float MWMechanics::ObstacleCheck::evadeDirections
staticprivate
Initial value:
=
{
{ 1.0f, 0.0f },
{ 1.0f, -1.0f },
{ -1.0f, 0.0f },
{ -1.0f, -1.0f }
}
float MWMechanics::ObstacleCheck::mDistSameSpot
private
int MWMechanics::ObstacleCheck::mEvadeDirectionIndex
private
float MWMechanics::ObstacleCheck::mEvadeDuration
private
float MWMechanics::ObstacleCheck::mPrevX
private
float MWMechanics::ObstacleCheck::mPrevY
private
float MWMechanics::ObstacleCheck::mStuckDuration
private
WalkState MWMechanics::ObstacleCheck::mWalkState
private

The documentation for this class was generated from the following files: