Steering¶
-
namespace
tnt
-
namespace
doo
Variables
-
struct tnt::doo::steering_sys
steer
¶
-
struct
steering_sys
¶ - #include <Steering.hpp>
A system that adds support steering behaviours to the objects.
Public Functions
-
void
Flee
(object const &id, Vector const &target) const noexcept¶ Move object id away from target.
- Note
Use RangedFlee if you want obj to stay at a certain distance away from target.
- Note
Use Evade if target is supposed to be moving. It gives more “natural” results.
- See
- See
- Parameters
id
: The id of the moving object.target
: The position that the object will avoid.
-
void
RangedFlee
(object const &id, Vector const &target, float range) const noexcept¶ Move object id away from target if it is close enough.
-
void
Arrive
(object const &id, Vector const &target) const noexcept¶ Direct the given object towards target with a speed that decreases as distance decreases.
- Parameters
id
: The object to make seek towards target.target
: The position where obj will be directed to.
-
void
Pursuit
(object const &id, object const &target) const noexcept¶ Direct the first object towards target. Useful when target is supposed to be moving.
-
void
Evade
(object const &id, object const &target) const noexcept¶ Move object id away from target. Useful when target is supposed to be moving.
- Note
Use Flee if target is not supposed to be moving.
- See
tnt::steer::Flee
- Parameters
id
: The object to flee away from target.target
: The object which obj will avoid.
-
void
-
struct tnt::doo::steering_sys
-
namespace