Panda3D
Public Member Functions | Public Attributes
Flee Class Reference

List of all members.

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, LVecBase3f pos, double panic_distance=10.0, double relax_distance=10.0, float flee_wt=1.0)
LVecBase3f 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
LVecBase3f _flee_direction
double _flee_distance
bool _flee_done
LVecBase3f _flee_position
LVecBase3f _flee_present_pos
double _flee_relax_distance
float _flee_weight

Detailed Description

Definition at line 24 of file flee.h.


Member Function Documentation

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 60 of file flee.cxx.

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

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 92 of file flee.cxx.

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


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations