| 719 | BOOL CCustomMonster::UsedAI_Locations() { return (TRUE); } |
| 720 | |
| 721 | void CCustomMonster::PitchCorrection() |
| 722 | { |
| 723 | CLevelGraph::SContour contour; |
| 724 | ai().level_graph().contour(contour, ai_location().level_vertex_id()); |
| 725 | |
| 726 | Fplane P; |
| 727 | P.build(contour.v1, contour.v2, contour.v3); |
| 728 | |
| 729 | Fvector position_on_plane; |
| 730 | P.project(position_on_plane, Position()); |
| 731 | |
| 732 | // находим проекцию точки, лежащей на векторе текущего направления |
| 733 | Fvector dir_point, proj_point; |
| 734 | dir_point.mad(position_on_plane, Direction(), 1.f); |
| 735 | P.project(proj_point, dir_point); |
| 736 | |
| 737 | // получаем искомый вектор направления |
| 738 | Fvector target_dir; |
| 739 | target_dir.sub(proj_point, position_on_plane); |
| 740 | |
| 741 | float yaw, pitch; |
| 742 | target_dir.getHP(yaw, pitch); |
| 743 | |
| 744 | movement().m_body.target.pitch = -pitch; |
| 745 | } |
| 746 | |
| 747 | BOOL CCustomMonster::feel_touch_on_contact(CObject* O) |
| 748 | { |