![]() |
Public API Reference |
This is a steering property class. More...
#include <propclass/steer.h>
Public Member Functions | |
| virtual void | CheckArrivalOff ()=0 |
| Sets arrival checking off. | |
| virtual void | CheckArrivalOn (float radius)=0 |
| Sets arrival checking on with arrival_radius = radius. | |
| virtual void | CohesionOff ()=0 |
| Sets Cohesion off. | |
| virtual void | CohesionOn (iCelEntityList *targets, float radius, float max_radius, float weight)=0 |
| Sets Cohesion on. | |
| virtual void | CollisionAvoidanceOff ()=0 |
| Sets Collision Avoidance off. | |
| virtual void | CollisionAvoidanceOn (float lookahead, float weight)=0 |
| Sets collision avoidance on. | |
| virtual void | DirectionMatchingOff ()=0 |
| Sets Direction Matching off. | |
| virtual void | DirectionMatchingOn (iCelEntityList *targets, float weight)=0 |
| Sets Direction Matching on. | |
| virtual bool | Flee (iSector *sector, const csVector3 &position)=0 |
| Move away from the specified position. | |
| virtual const csVector3 & | GetPosition () const =0 |
| Get the end position that we want to move to. | |
| virtual iSector * | GetSector () const =0 |
| Get the end sector that we want to move to. | |
| virtual void | Interrupt ()=0 |
| Interrupt a movement. | |
| virtual bool | IsMoving () const =0 |
| Return true if currently moving. | |
| virtual bool | Pursue (iCelEntity *target, float max_prediction)=0 |
| Move to the specified targets position. | |
| virtual float | RandomBinomial (float rate)=0 |
| Returns a random number using a random binomial. | |
| virtual bool | Seek (iSector *sector, const csVector3 &position)=0 |
| Move to the specified position. | |
| virtual void | SeparationOff ()=0 |
| Sets Separation off. | |
| virtual void | SeparationOn (iCelEntityList *targets, float radius, float weight)=0 |
| Sets Separation on. | |
| virtual void | SetDelayRecheck (int delay)=0 |
| Sets current delay_recheck. | |
| virtual bool | Vigilant ()=0 |
| Stay vigilant about changes around. | |
This is a steering property class.
It works closely with pclinmove and pcactormove in order to move an object from one position to another while checking collision detection along the way.
This property class can send out the following messages:
This property class supports the following actions (add prefix 'cel.move.steer.action.' if you want to access this action through a message):
| virtual void iPcSteer::CheckArrivalOff | ( | ) | [pure virtual] |
Sets arrival checking off.
| virtual void iPcSteer::CheckArrivalOn | ( | float | radius | ) | [pure virtual] |
Sets arrival checking on with arrival_radius = radius.
| radius | sets current arrival_radius |
| virtual void iPcSteer::CohesionOff | ( | ) | [pure virtual] |
Sets Cohesion off.
| virtual void iPcSteer::CohesionOn | ( | iCelEntityList * | targets, |
| float | radius, | ||
| float | max_radius, | ||
| float | weight | ||
| ) | [pure virtual] |
Sets Cohesion on.
| targets | sets current cohesion_targets |
| radius | sets current cohesion_radius |
| max_radius | sets current cohesion_max_radius |
| weight | sets current cohesion_weight |
| virtual void iPcSteer::CollisionAvoidanceOff | ( | ) | [pure virtual] |
Sets Collision Avoidance off.
| virtual void iPcSteer::CollisionAvoidanceOn | ( | float | lookahead, |
| float | weight | ||
| ) | [pure virtual] |
Sets collision avoidance on.
| lookahead | sets current ca_lookahead |
| weight | sets current ca_weight |
| virtual void iPcSteer::DirectionMatchingOff | ( | ) | [pure virtual] |
Sets Direction Matching off.
| virtual void iPcSteer::DirectionMatchingOn | ( | iCelEntityList * | targets, |
| float | weight | ||
| ) | [pure virtual] |
Sets Direction Matching on.
| targets | sets current dm_targets |
| weight | sets current dm_weight |
| virtual bool iPcSteer::Flee | ( | iSector * | sector, |
| const csVector3 & | position | ||
| ) | [pure virtual] |
Move away from the specified position.
When you call this function this property class will attempt to move the linmove to oposite of the specified position. If this property class was already controlling a movement then that movement will be interrupted (possibly giving a pcsteer_interrupted message).
| sector | is the desired sector to move away from. |
| position | is the desired position to move away from. |
| virtual const csVector3& iPcSteer::GetPosition | ( | ) | const [pure virtual] |
Get the end position that we want to move to.
| virtual iSector* iPcSteer::GetSector | ( | ) | const [pure virtual] |
Get the end sector that we want to move to.
| virtual void iPcSteer::Interrupt | ( | ) | [pure virtual] |
Interrupt a movement.
The behaviour will get a 'pcsteer_interrupted' message if the mover was really moving. Otherwise nothing happens.
| virtual bool iPcSteer::IsMoving | ( | ) | const [pure virtual] |
Return true if currently moving.
| virtual bool iPcSteer::Pursue | ( | iCelEntity * | target, |
| float | max_prediction | ||
| ) | [pure virtual] |
Move to the specified targets position.
When you call this function this property class will attempt to move the linmove to the targets current position. The targets position will be updated periodically. Also, if max_prediction > 0, this function will calculate targets future position instead of its actual position in order to have more chance to cacth its target. If arrival checking is activated it will stop at the specified position and it will get a 'pcsteer_arrived' message. If this property class was already controlling a movement then that movement will be interrupted (possibly giving a pcsteer_interrupted message).
| target | is the desired target to pursue. |
| max_prediction | is the maximun prediction that can be used to calculate target's future position. |
| virtual float iPcSteer::RandomBinomial | ( | float | rate | ) | [pure virtual] |
Returns a random number using a random binomial.
| virtual bool iPcSteer::Seek | ( | iSector * | sector, |
| const csVector3 & | position | ||
| ) | [pure virtual] |
Move to the specified position.
When you call this function this property class will attempt to move the linmove to the correct position. If arrival checking is activated it will stop at the specified position and it will get a 'pcsteer_arrived' message. If this property class was already controlling a movement then that movement will be interrupted (possibly giving a pcsteer_interrupted message).
| sector | is the desired sector to move to. |
| position | is the desired position to move to. |
| virtual void iPcSteer::SeparationOff | ( | ) | [pure virtual] |
Sets Separation off.
| virtual void iPcSteer::SeparationOn | ( | iCelEntityList * | targets, |
| float | radius, | ||
| float | weight | ||
| ) | [pure virtual] |
Sets Separation on.
| targets | sets current separation_targets |
| radius | sets current separation_radius |
| weight | sets current separation_weight |
| virtual void iPcSteer::SetDelayRecheck | ( | int | delay | ) | [pure virtual] |
Sets current delay_recheck.
| delay | sets delay_recheck |
| virtual bool iPcSteer::Vigilant | ( | ) | [pure virtual] |
Stay vigilant about changes around.
Enables checking for collision and separation even when not moving.