| 99 | float SHeliMovementState::GetDistanceToDestPosition() { return desiredPoint.distance_to(currP); } |
| 100 | |
| 101 | void SHeliMovementState::UpdatePatrolPath() |
| 102 | { |
| 103 | if (AlreadyOnPoint()) |
| 104 | { |
| 105 | float dist = GetDistanceToDestPosition(); |
| 106 | parent->callback(GameObject::eHelicopterOnPoint)(dist, currP, currPatrolVertex ? currPatrolVertex->vertex_id() : -1); |
| 107 | CPatrolPath::const_iterator b, e; |
| 108 | currPatrolPath->begin(currPatrolVertex, b, e); |
| 109 | if (b != e) |
| 110 | { |
| 111 | if (need_to_del_path && currPatrolVertex->data().flags()) // fake flags that signals entrypoint for round path |
| 112 | SetPointFlags(currPatrolVertex->vertex_id(), 0); |
| 113 | |
| 114 | currPatrolVertex = currPatrolPath->vertex((*b).vertex_id()); |
| 115 | |
| 116 | Fvector p = currPatrolVertex->data().position(); |
| 117 | desiredPoint = p; |
| 118 | } |
| 119 | else |
| 120 | { |
| 121 | type = eMovNone; |
| 122 | // curLinearSpeed = 0.0f; |
| 123 | // curLinearAcc = 0.0f; |
| 124 | } |
| 125 | } |
| 126 | } |
| 127 | |
| 128 | void SHeliMovementState::UpdateMovToPoint() |
| 129 | { |