Avara3D 0.2.0
C++ API reference
a3d::ext::Wanderer Class Reference

Moves a Node along a smooth deterministic path within a configurable box. More...

#include <a3d/extension/Wanderer.h>

Classes

struct  Config
 Configures the wander volume, pace, and deterministic random sequence. More...
 

Public Member Functions

 Wanderer (const std::shared_ptr< Node > &node)
 Creates a Wanderer centered on node's current position using the default Config. More...
 
 Wanderer (const std::shared_ptr< Node > &node, const Config &config)
 Creates a Wanderer centered on node's current position using config. More...
 
const Configconfig () const
 Returns the current configuration. More...
 
void config (const Config &config)
 Replaces the configuration and restarts the deterministic path from the current center. More...
 
const math::vec3center () const
 Returns the center of the wander volume in the Node's parent coordinate space. More...
 
void update (double deltaTime)
 Advances the wander path by deltaTime seconds; non-positive values do nothing. More...
 
void reset ()
 Returns the Node to the current center and restarts the same deterministic path. More...
 
void recenter ()
 Makes the Node's current position the new center and restarts the deterministic path. More...
 

Detailed Description

Moves a Node along a smooth deterministic path within a configurable box.

The wander volume is centered on a position in the Node's parent coordinate space.

Definition at line 31 of file Wanderer.h.

Constructor & Destructor Documentation

◆ Wanderer() [1/2]

a3d::ext::Wanderer::Wanderer ( const std::shared_ptr< Node > &  node)
explicit

Creates a Wanderer centered on node's current position using the default Config.

Exceptions
std::invalid_argumentif node is null.

◆ Wanderer() [2/2]

a3d::ext::Wanderer::Wanderer ( const std::shared_ptr< Node > &  node,
const Config config 
)

Creates a Wanderer centered on node's current position using config.

Exceptions
std::invalid_argumentif node is null or config is invalid.

Member Function Documentation

◆ center()

const math::vec3 & a3d::ext::Wanderer::center ( ) const

Returns the center of the wander volume in the Node's parent coordinate space.

◆ config() [1/2]

const Config & a3d::ext::Wanderer::config ( ) const

Returns the current configuration.

◆ config() [2/2]

void a3d::ext::Wanderer::config ( const Config config)

Replaces the configuration and restarts the deterministic path from the current center.

Exceptions
std::invalid_argumentif config is invalid.

◆ recenter()

void a3d::ext::Wanderer::recenter ( )

Makes the Node's current position the new center and restarts the deterministic path.

◆ reset()

void a3d::ext::Wanderer::reset ( )

Returns the Node to the current center and restarts the same deterministic path.

◆ update()

void a3d::ext::Wanderer::update ( double  deltaTime)

Advances the wander path by deltaTime seconds; non-positive values do nothing.


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