Helper normalizes the direction, assuming that it is at the given unnormed_pos, using the given denorm, starting at the root_denorm.
| 169 | // Helper normalizes the direction, assuming that it is at the given |
| 170 | // unnormed_pos, using the given denorm, starting at the root_denorm. |
| 171 | uinT8 NormalizeDirection(uinT8 dir, const FCOORD& unnormed_pos, |
| 172 | const DENORM& denorm, const DENORM* root_denorm) { |
| 173 | // Convert direction to a vector. |
| 174 | FCOORD unnormed_end; |
| 175 | unnormed_end.from_direction(dir); |
| 176 | unnormed_end += unnormed_pos; |
| 177 | FCOORD normed_pos, normed_end; |
| 178 | denorm.NormTransform(root_denorm, unnormed_pos, &normed_pos); |
| 179 | denorm.NormTransform(root_denorm, unnormed_end, &normed_end); |
| 180 | normed_end -= normed_pos; |
| 181 | return normed_end.to_direction(); |
| 182 | } |
| 183 | |
| 184 | // Helper returns the mean direction vector from the given stats. Use the |
| 185 | // mean direction from dirs if there is information available, otherwise, use |
no test coverage detected