19 _seek_position = target_object.
get_pos(_ai_char->_window_render);
20 _seek_weight = seek_wt;
22 _seek_direction = _seek_position - _ai_char->_ai_char_np.
get_pos(_ai_char->_window_render);
23 _seek_direction.normalize();
28 Seek::Seek(
AICharacter *ai_ch, LVecBase3 pos,
float seek_wt) {
32 _seek_weight = seek_wt;
34 _seek_direction = _seek_position - _ai_char->_ai_char_np.
get_pos(_ai_char->_window_render);
35 _seek_direction.normalize();
49 double target_distance = (_seek_position - _ai_char->_ai_char_np.
get_pos(_ai_char->_window_render)).length();
51 if(
int(target_distance) == 0) {
53 _ai_char->_steering->_steering_force = LVecBase3(0.0, 0.0, 0.0);
54 _ai_char->_steering->
turn_off(
"seek");
55 return(LVecBase3(0.0, 0.0, 0.0));
58 LVecBase3 desired_force = _seek_direction * _ai_char->_movt_force;
59 return(desired_force);
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void turn_off(std::string ai_type)
This function turns off any aiBehavior which is passed as a string.
LPoint3 get_pos() const
Retrieves the translation component of the transform.
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
LVecBase3 do_seek()
This function performs the seek and returns a seek force which is used in the calculate_prioritized f...