ScummVM API documentation
Stark::FollowPath Class Reference

#include <followpath.h>

Inheritance diagram for Stark::FollowPath:
Stark::Movement

Public Member Functions

 FollowPath (Resources::ItemVisual *item)
 
void start () override
 
void onGameLoop () override
 
void stop (bool force=false) override
 
uint32 getType () const override
 
void saveLoad (ResourceSerializer *serializer) override
 
void setPath (Resources::Path *path)
 
void setSpeed (float speed)
 
void setAnim (Resources::Anim *anim)
 
- Public Member Functions inherited from Stark::Movement
 Movement (Resources::ItemVisual *item)
 
bool hasEnded () const
 
virtual bool hasReachedDestination () const
 

Additional Inherited Members

- Public Types inherited from Stark::Movement
enum  MovementType { kTypeWalk = 1, kTypeFollowPath = 2, kTypeFollowPathLight = 3, kTypeTurn = 4 }
 
- Static Public Member Functions inherited from Stark::Movement
static Movementconstruct (uint32 type, Resources::ItemVisual *item)
 
- Protected Types inherited from Stark::Movement
enum  TurnDirection { kTurnNone, kTurnLeft, kTurnRight }
 
- Protected Member Functions inherited from Stark::Movement
float computeAngleBetweenVectorsXYPlane (const Math::Vector3d &v1, const Math::Vector3d &v2) const
 
- Protected Attributes inherited from Stark::Movement
const float _defaultTurnAngleSpeed
 
bool _ended
 
Resources::ItemVisual_item
 

Detailed Description

Make an item follow pre-computed path

Works for 2D and 3D items, with respectively 2D and 3D paths

Member Function Documentation

◆ start()

void Stark::FollowPath::start ( )
overridevirtual

Initiate the movement

Reimplemented from Stark::Movement.

◆ onGameLoop()

void Stark::FollowPath::onGameLoop ( )
overridevirtual

Called once per game loop

Implements Stark::Movement.

◆ stop()

void Stark::FollowPath::stop ( bool  force = false)
overridevirtual

Stop / abort the movement

Reimplemented from Stark::Movement.

◆ getType()

uint32 Stark::FollowPath::getType ( ) const
overridevirtual

Obtain the effective movement type

Implements Stark::Movement.

◆ saveLoad()

void Stark::FollowPath::saveLoad ( ResourceSerializer serializer)
overridevirtual

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

Implements Stark::Movement.

◆ setPath()

void Stark::FollowPath::setPath ( Resources::Path path)

Set the path to follow

◆ setSpeed()

void Stark::FollowPath::setSpeed ( float  speed)

Set the movement speed on the path

◆ setAnim()

void Stark::FollowPath::setAnim ( Resources::Anim anim)

Override the animation to play while the item follows the path


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