Panda3D
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
Evade Class Reference

Public Member Functions

 Evade (AICharacter *ai_ch, NodePath target_object, double panic_distance, double relax_distance, float evade_wt)
 
LVecBase3 do_evade ()
 This function performs the evade and returns an evade force which is used in the calculate_prioritized function.
 
void evade_activate ()
 This function checks for whether the target is within the panic distance.
 

Public Attributes

AICharacter_ai_char
 
bool _evade_activate_done
 
LVecBase3 _evade_direction
 
double _evade_distance
 
bool _evade_done
 
double _evade_relax_distance
 
NodePath _evade_target
 
float _evade_weight
 

Detailed Description

Definition at line 22 of file evade.h.

Constructor & Destructor Documentation

◆ Evade()

Evade::Evade ( AICharacter * ai_ch,
NodePath target_object,
double panic_distance,
double relax_distance,
float evade_wt )

Definition at line 16 of file evade.cxx.

◆ ~Evade()

Evade::~Evade ( )

Definition at line 29 of file evade.cxx.

Member Function Documentation

◆ do_evade()

LVecBase3 Evade::do_evade ( )

This function performs the evade and returns an evade force which is used in the calculate_prioritized function.

In case the AICharacter is past the (panic + relax) distance, it resets to evade_activate. This function is not to be used by the user.

Definition at line 38 of file evade.cxx.

References NodePath::get_pos(), AIBehaviors::turn_off(), and AIBehaviors::turn_on().

◆ evade_activate()

void Evade::evade_activate ( )

This function checks for whether the target is within the panic distance.

When this is true, it calls the do_evade function and sets the evade direction. This function is not to be used by the user.

Definition at line 67 of file evade.cxx.

References NodePath::get_pos(), AIBehaviors::turn_off(), and AIBehaviors::turn_on().

Member Data Documentation

◆ _ai_char

AICharacter* Evade::_ai_char

Definition at line 24 of file evade.h.

◆ _evade_activate_done

bool Evade::_evade_activate_done

Definition at line 32 of file evade.h.

◆ _evade_direction

LVecBase3 Evade::_evade_direction

Definition at line 28 of file evade.h.

◆ _evade_distance

double Evade::_evade_distance

Definition at line 29 of file evade.h.

◆ _evade_done

bool Evade::_evade_done

Definition at line 31 of file evade.h.

◆ _evade_relax_distance

double Evade::_evade_relax_distance

Definition at line 30 of file evade.h.

◆ _evade_target

NodePath Evade::_evade_target

Definition at line 26 of file evade.h.

◆ _evade_weight

float Evade::_evade_weight

Definition at line 27 of file evade.h.


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