| 203 | } |
| 204 | |
| 205 | void CProjector::SetTarget(const Fvector& target_pos) |
| 206 | { |
| 207 | float th, tp; |
| 208 | Fvector().sub(target_pos, Position()).getHP(th, tp); |
| 209 | |
| 210 | float delta_h; |
| 211 | delta_h = angle_difference(th, _start.yaw); |
| 212 | |
| 213 | if (angle_normalize_signed(th - _start.yaw) > 0) |
| 214 | delta_h = -delta_h; |
| 215 | clamp(delta_h, -PI_DIV_2, PI_DIV_2); |
| 216 | |
| 217 | _target.yaw = angle_normalize(_start.yaw + delta_h); |
| 218 | |
| 219 | clamp(tp, -PI_DIV_2, PI_DIV_2); |
| 220 | _target.pitch = tp; |
| 221 | } |
| 222 | |
| 223 | Fvector CProjector::GetCurrentDirection() { return (Fvector().setHP(_current.yaw, _current.pitch)); } |
| 224 |
nothing calls this directly
no test coverage detected