M_walkmove. @param yaw - where the entitiy is looking at (in degrees) @param dist - distance to travel during this frame
(SubgameEntity ent, float yaw, float dist, GameExportsImpl gameExports)
| 207 | * @param dist - distance to travel during this frame |
| 208 | */ |
| 209 | public static boolean M_walkmove(SubgameEntity ent, float yaw, float dist, GameExportsImpl gameExports) { |
| 210 | |
| 211 | // if we are falling (or swimming) and cannot fly (swim) -> return |
| 212 | if ((ent.groundentity == null) |
| 213 | && (ent.flags & (GameDefines.FL_FLY | GameDefines.FL_SWIM)) == 0) |
| 214 | return false; |
| 215 | |
| 216 | float yaw_radian = (float) (yaw * Math.PI * 2 / 360); |
| 217 | |
| 218 | float[] move = { |
| 219 | (float) Math.cos(yaw_radian) * dist, |
| 220 | (float) Math.sin(yaw_radian) * dist, |
| 221 | 0 |
| 222 | }; |
| 223 | |
| 224 | return SV.SV_movestep(ent, move, true, gameExports); |
| 225 | } |
| 226 | |
| 227 | /** |
| 228 | * M_CatagorizePosition |
no test coverage detected