ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

Abstract movement of an item on the current location's floor. More...

#include <movement.h>

Inheritance diagram for Stark::Movement:
Collaboration diagram for Stark::Movement:

List of all members.

Public Types

enum  MovementType { kTypeWalk = 1, kTypeFollowPath = 2, kTypeFollowPathLight = 3, kTypeTurn = 4 }

Public Member Functions

 Movement (Resources::ItemVisual *item)
virtual ~Movement ()
virtual uint32 getType () const =0
 Obtain the effective movement type.
virtual void start ()
 Initiate the movement.
virtual void stop ()
 Stop / abort the movement.
virtual void onGameLoop ()=0
 Called once per game loop.
bool hasEnded () const
 Has the movement stopped?
virtual bool hasReachedDestination () const
 Has the movement reached its destination successfully?
virtual void saveLoad (ResourceSerializer *serializer)=0
 Persist / restore the state of the movement so it can be resumed using 'start'.

Static Public Member Functions

static Movementconstruct (uint32 type, Resources::ItemVisual *item)
 Movement factory.

Protected Types

enum  TurnDirection { kTurnNone, kTurnLeft, kTurnRight }

Protected Member Functions

float computeAngleBetweenVectorsXYPlane (const Math::Vector3d &v1, const Math::Vector3d &v2) const

Protected Attributes

const float _defaultTurnAngleSpeed
bool _ended
Resources::ItemVisual_item

Detailed Description

Abstract movement of an item on the current location's floor.

Definition at line 39 of file movement.h.


Member Enumeration Documentation

Enumerator:
kTypeWalk 
kTypeFollowPath 
kTypeFollowPathLight 
kTypeTurn 

Definition at line 44 of file movement.h.

Enumerator:
kTurnNone 
kTurnLeft 
kTurnRight 

Definition at line 88 of file movement.h.


Constructor & Destructor Documentation

Stark::Movement::Movement ( Resources::ItemVisual item  ) 

Definition at line 51 of file movement.cpp.

Stark::Movement::~Movement (  )  [virtual]

Definition at line 57 of file movement.cpp.


Member Function Documentation

float Stark::Movement::computeAngleBetweenVectorsXYPlane ( const Math::Vector3d v1,
const Math::Vector3d v2 
) const [protected]

Definition at line 72 of file movement.cpp.

Movement * Stark::Movement::construct ( uint32  type,
Resources::ItemVisual item 
) [static]

Movement factory.

Definition at line 36 of file movement.cpp.

virtual uint32 Stark::Movement::getType (  )  const [pure virtual]

Obtain the effective movement type.

Implemented in Stark::FollowPath, Stark::FollowPathLight, Stark::Turn, and Stark::Walk.

bool Stark::Movement::hasEnded (  )  const

Has the movement stopped?

Definition at line 68 of file movement.cpp.

bool Stark::Movement::hasReachedDestination (  )  const [virtual]

Has the movement reached its destination successfully?

Reimplemented in Stark::Walk.

Definition at line 88 of file movement.cpp.

virtual void Stark::Movement::onGameLoop (  )  [pure virtual]

Called once per game loop.

Implemented in Stark::FollowPath, Stark::FollowPathLight, Stark::Turn, and Stark::Walk.

virtual void Stark::Movement::saveLoad ( ResourceSerializer serializer  )  [pure virtual]

Persist / restore the state of the movement so it can be resumed using 'start'.

Implemented in Stark::FollowPath, Stark::FollowPathLight, Stark::Turn, and Stark::Walk.

void Stark::Movement::start (  )  [virtual]

Initiate the movement.

Reimplemented in Stark::FollowPath, Stark::FollowPathLight, and Stark::Walk.

Definition at line 60 of file movement.cpp.

void Stark::Movement::stop (  )  [virtual]

Stop / abort the movement.

Reimplemented in Stark::FollowPath, Stark::FollowPathLight, and Stark::Walk.

Definition at line 64 of file movement.cpp.


Member Data Documentation

const float Stark::Movement::_defaultTurnAngleSpeed [protected]

Definition at line 94 of file movement.h.

bool Stark::Movement::_ended [protected]

Definition at line 98 of file movement.h.

Definition at line 99 of file movement.h.


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


Generated on Sat Jan 19 2019 05:07:28 for ResidualVM by doxygen 1.7.1
curved edge   curved edge