20 _pursue_target = target_object;
21 _pursue_weight = pursue_wt;
38 assert(_pursue_target &&
"pursue target not assigned");
40 LVecBase3 present_pos = _ai_char->_ai_char_np.
get_pos(_ai_char->_window_render);
41 double target_distance = (_pursue_target.
get_pos(_ai_char->_window_render) - present_pos).length();
43 if(
int(target_distance) == 0) {
45 _ai_char->_steering->_steering_force = LVecBase3(0.0, 0.0, 0.0);
46 _ai_char->_steering->_pursue_force = LVecBase3(0.0, 0.0, 0.0);
47 return LVecBase3(0.0, 0.0, 0.0);
53 _pursue_direction = _pursue_target.
get_pos(_ai_char->_window_render) - present_pos;
54 _pursue_direction.normalize();
56 LVecBase3 desired_force = _pursue_direction * _ai_char->_movt_force;
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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...
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...