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

Make an item walk / run to its destination on the current location's floor. More...

#include <walk.h>

Inheritance diagram for Stark::Walk:
Collaboration diagram for Stark::Walk:

List of all members.

Public Member Functions

 Walk (Resources::FloorPositionedItem *item)
virtual ~Walk ()
void start () override
 Initiate the movement.
void stop (bool force=false) override
 Stop / abort the movement.
void onGameLoop () override
 Called once per game loop.
bool hasReachedDestination () const override
 Has the movement reached its destination successfully?
uint32 getType () const override
 Obtain the effective movement type.
void saveLoad (ResourceSerializer *serializer) override
 Persist / restore the state of the movement so it can be resumed using 'start'.
void setDestination (const Math::Vector3d &destination)
 Set the destination.
void setDestinationWithoutHeight (Math::Vector3d destination)
void changeDestination (const Math::Vector3d &destination)
 Change the destination and recompute the path.
void setRunning ()
 Set the running flag.

Private Member Functions

void doWalk ()
void doWalkCollisionSimple ()
void doWalkCollisionAvoid ()
float computeDistancePerGameLoop () const
float getAngularSpeed () const
void changeItemAnim ()
void updatePath () const
void queueDestinationToAvoidItem (Resources::FloorPositionedItem *item, const Math::Vector3d &destination)
bool isItemAlreadyAvoided (Resources::FloorPositionedItem *item) const

Static Private Member Functions

static bool isPointNearPath (const Math::Vector3d &point3d, const Math::Vector3d &pathStart3d, const Math::Vector3d &pathEnd3d)

Private Attributes

Resources::FloorPositionedItem_item3D
StringPullingPath_path
Math::Vector3d _destination
Common::Array< Math::Vector3d_destinations
Common::Array
< Resources::ItemVisual * > 
_avoidedItems
bool _running
bool _reachedDestination
TurnDirection _turnDirection
int32 _collisionWaitTimeout
int32 _collisionWaitCount
Math::Vector3d _previousPosition
Math::Vector3d _currentTarget

Detailed Description

Make an item walk / run to its destination on the current location's floor.

Definition at line 42 of file walk.h.


Constructor & Destructor Documentation

Stark::Walk::Walk ( Resources::FloorPositionedItem item  ) 

Definition at line 42 of file walk.cpp.

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

Definition at line 53 of file walk.cpp.


Member Function Documentation

void Stark::Walk::changeDestination ( const Math::Vector3d destination  ) 

Change the destination and recompute the path.

Definition at line 507 of file walk.cpp.

void Stark::Walk::changeItemAnim (  )  [private]

Definition at line 495 of file walk.cpp.

float Stark::Walk::computeDistancePerGameLoop (  )  const [private]

Definition at line 469 of file walk.cpp.

void Stark::Walk::doWalk (  )  [private]

Definition at line 151 of file walk.cpp.

void Stark::Walk::doWalkCollisionAvoid (  )  [private]

Definition at line 298 of file walk.cpp.

void Stark::Walk::doWalkCollisionSimple (  )  [private]

Definition at line 256 of file walk.cpp.

float Stark::Walk::getAngularSpeed (  )  const [private]

Definition at line 465 of file walk.cpp.

uint32 Stark::Walk::getType (  )  const [override, virtual]

Obtain the effective movement type.

Implements Stark::Movement.

Definition at line 517 of file walk.cpp.

bool Stark::Walk::hasReachedDestination (  )  const [override, virtual]

Has the movement reached its destination successfully?

Reimplemented from Stark::Movement.

Definition at line 513 of file walk.cpp.

bool Stark::Walk::isItemAlreadyAvoided ( Resources::FloorPositionedItem item  )  const [private]

Definition at line 130 of file walk.cpp.

bool Stark::Walk::isPointNearPath ( const Math::Vector3d point3d,
const Math::Vector3d pathStart3d,
const Math::Vector3d pathEnd3d 
) [static, private]

Definition at line 232 of file walk.cpp.

void Stark::Walk::onGameLoop (  )  [override, virtual]

Called once per game loop.

Implements Stark::Movement.

Definition at line 134 of file walk.cpp.

void Stark::Walk::queueDestinationToAvoidItem ( Resources::FloorPositionedItem item,
const Math::Vector3d destination 
) [private]

Definition at line 125 of file walk.cpp.

void Stark::Walk::saveLoad ( ResourceSerializer serializer  )  [override, virtual]

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

Implements Stark::Movement.

Definition at line 521 of file walk.cpp.

void Stark::Walk::setDestination ( const Math::Vector3d destination  ) 

Set the destination.

Definition at line 476 of file walk.cpp.

void Stark::Walk::setDestinationWithoutHeight ( Math::Vector3d  destination  ) 

Definition at line 480 of file walk.cpp.

void Stark::Walk::setRunning (  ) 

Set the running flag.

Definition at line 490 of file walk.cpp.

void Stark::Walk::start (  )  [override, virtual]

Initiate the movement.

Reimplemented from Stark::Movement.

Definition at line 57 of file walk.cpp.

void Stark::Walk::stop ( bool  force = false  )  [override, virtual]

Stop / abort the movement.

Reimplemented from Stark::Movement.

Definition at line 67 of file walk.cpp.

void Stark::Walk::updatePath (  )  const [private]

Definition at line 84 of file walk.cpp.


Member Data Documentation

Definition at line 87 of file walk.h.

Definition at line 94 of file walk.h.

Definition at line 93 of file walk.h.

Definition at line 96 of file walk.h.

Definition at line 84 of file walk.h.

Definition at line 85 of file walk.h.

Definition at line 81 of file walk.h.

Definition at line 82 of file walk.h.

Definition at line 95 of file walk.h.

Definition at line 90 of file walk.h.

bool Stark::Walk::_running [private]

Definition at line 89 of file walk.h.

Definition at line 91 of file walk.h.


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


Generated on Sat Mar 16 2019 05:06:53 for ResidualVM by doxygen 1.7.1
curved edge   curved edge