Panda3D
Public Member Functions | Public Attributes | List of all members
Flee Class Reference

Public Member Functions

 Flee (AICharacter *ai_ch, NodePath target_object, double panic_distance=10.0, double relax_distance=10.0, float flee_wt=1.0)
 
 Flee (AICharacter *ai_ch, LVecBase3 pos, 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. More...
 
void flee_activate ()
 This function checks for whether the target is within the panic distance. More...
 

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.

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().

◆ 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().


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