21 _pursue_target = target_object;
22 _pursue_weight = pursue_wt;
41 assert(_pursue_target &&
"pursue target not assigned");
43 LVecBase3 present_pos = _ai_char->_ai_char_np.
get_pos(_ai_char->_window_render);
44 double target_distance = (_pursue_target.
get_pos(_ai_char->_window_render) - present_pos).length();
46 if(
int(target_distance) == 0) {
48 _ai_char->_steering->_steering_force =
LVecBase3(0.0, 0.0, 0.0);
49 _ai_char->_steering->_pursue_force =
LVecBase3(0.0, 0.0, 0.0);
56 _pursue_direction = _pursue_target.
get_pos(_ai_char->_window_render) - present_pos;
59 LVecBase3 desired_force = _pursue_direction * _ai_char->_movt_force;
60 return(desired_force);
This is the base class for all three-component vectors and points.
LPoint3 get_pos() const
Retrieves the translation component of the transform.
LVecBase3 do_pursue()
This function performs the pursue and returns a pursue force which is used in the calculate_prioritiz...
bool normalize()
Normalizes the vector in place.
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...