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

Public Member Functions

 Flee (AICharacter *ai_ch, LVecBase3 pos, double panic_distance=10.0, double relax_distance=10.0, float flee_wt=1.0)
 
 Flee (AICharacter *ai_ch, NodePath target_object, double panic_distance=10.0, double relax_distance=10.0, float flee_wt=1.0)
 
LVecBase3 do_flee ()
 This function performs the flee and returns a flee force which is used in the calculate_prioritized function.
 
void flee_activate ()
 This function checks for whether the target is within the panic distance.
 

Public Attributes

AICharacter_ai_char
 
bool _flee_activate_done
 
LVecBase3 _flee_direction
 
double _flee_distance
 
bool _flee_done
 
LVecBase3 _flee_position
 
LVecBase3 _flee_present_pos
 
double _flee_relax_distance
 
float _flee_weight
 

Detailed Description

Definition at line 22 of file flee.h.

Constructor & Destructor Documentation

◆ Flee() [1/2]

Flee::Flee ( AICharacter * ai_ch,
NodePath target_object,
double panic_distance = 10.0,
double relax_distance = 10.0,
float flee_wt = 1.0 )

Definition at line 16 of file flee.cxx.

◆ Flee() [2/2]

Flee::Flee ( AICharacter * ai_ch,
LVecBase3 pos,
double panic_distance = 10.0,
double relax_distance = 10.0,
float flee_wt = 1.0 )

Definition at line 30 of file flee.cxx.

◆ ~Flee()

Flee::~Flee ( )

Definition at line 44 of file flee.cxx.

Member Function Documentation

◆ do_flee()

LVecBase3 Flee::do_flee ( )

This function performs the flee and returns a flee force which is used in the calculate_prioritized function.

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

Definition at line 53 of file flee.cxx.

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

◆ flee_activate()

void Flee::flee_activate ( )

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

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

Definition at line 81 of file flee.cxx.

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

Member Data Documentation

◆ _ai_char

AICharacter* Flee::_ai_char

Definition at line 24 of file flee.h.

◆ _flee_activate_done

bool Flee::_flee_activate_done

Definition at line 33 of file flee.h.

◆ _flee_direction

LVecBase3 Flee::_flee_direction

Definition at line 28 of file flee.h.

◆ _flee_distance

double Flee::_flee_distance

Definition at line 29 of file flee.h.

◆ _flee_done

bool Flee::_flee_done

Definition at line 32 of file flee.h.

◆ _flee_position

LVecBase3 Flee::_flee_position

Definition at line 26 of file flee.h.

◆ _flee_present_pos

LVecBase3 Flee::_flee_present_pos

Definition at line 31 of file flee.h.

◆ _flee_relax_distance

double Flee::_flee_relax_distance

Definition at line 30 of file flee.h.

◆ _flee_weight

float Flee::_flee_weight

Definition at line 27 of file flee.h.


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