iPcSteer Struct 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. |
Detailed Description
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 to the behaviour (add prefix 'cel.parameter.' to get the ID for parameters):
- pcsteer_arrived: arrived at final position.
- pcsteer_interrupted: movement has been interrupted.
This property class supports the following actions (add prefix 'cel.action.' to get the ID of the action and add prefix 'cel.parameter.' to get the ID of the parameter):
- Seek: parameters 'sectorname' (string), 'position' (vector3).
- Flee: parameters 'sectorname' (string), 'position' (vector3).
- Pursue: parameters 'target' (iCelEntity*), 'max_prediction' (float),
- Interrupt: interrupt the current movement. This property class supports the following properties (add prefix 'cel.property.' to get the ID of the property:
- position (vector3, read only): current end position.
- sqradius (float, read/write): current squared radius.
- moving (bool, read only): returns true if currently moving.
- cur_position (vector3, read only): current position.
- cur_direction (vector3, read only): current direction.
- check_cohesion (bool, read/write): returns true if currently checking for cohesion.
- check_separation (bool, read/write): returns true if currently checking for separation.
- check_arrival (bool, read/write): returns true if currently checking for arrival.
- check_dm (bool, read/write): returns true if currently checking for direction matching.
- arrival_radius (bool, read/write): current arrival radius.
- collision_avoidance (bool, read only): returns true if currently checking for collisions.
- ca_lookahead (float, read/write): current collision avoidance max lookahead.
- separation_radius (float, read/write): current min radius before separating.
- cohesion_radius (float, read/write): current max radius before activating cohesion.
- separation_weight (float, read/write): current separation weight.
- cohesion_weight (float, read/write): current cohesion weight.
- dm_weight (float, read/write): current direction matching weight.
- pursue_max_prediction (float, read/write): current pursue max prediction.
- current_action (int, read only): current action code value.
- delay_recheck (int, read/write): current delay before calling TickOnce.
Definition at line 69 of file steer.h.
Member Function Documentation
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.
- Parameters:
-
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.
- Parameters:
-
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.
Sets collision avoidance on.
- Parameters:
-
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.
- Parameters:
-
targets sets current dm_targets weight sets current dm_weight
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).
- Parameters:
-
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).
- Parameters:
-
target is the desired target to pursue. max_prediction is the maximun prediction that can be used to calculate target's future position.
Returns a random number using a random binomial.
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).
- Parameters:
-
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.
- Parameters:
-
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.
- Parameters:
-
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.
The documentation for this struct was generated from the following file:
- propclass/steer.h
Generated for CEL: Crystal Entity Layer 1.4.1 by doxygen 1.7.1