| 1016 | } |
| 1017 | |
| 1018 | S32 hanging_state_type::detach_update(xScene& scene, F32& dt) |
| 1019 | { |
| 1020 | xSphere sphere; |
| 1021 | |
| 1022 | last_hook_loc = shared.hook_loc; |
| 1023 | update_hook_loc(); |
| 1024 | |
| 1025 | stick_loc.x = stick_loc.y = 0.0f; // Chained assignment required for match |
| 1026 | last_loc = loc; |
| 1027 | |
| 1028 | xVec3 deltaVel = loc.normal() * -h.detach.accel; |
| 1029 | vel += deltaVel * dt; |
| 1030 | loc += deltaVel * dt * dt + vel * dt; |
| 1031 | |
| 1032 | update_animation(dt); |
| 1033 | update_detach_camera(dt); |
| 1034 | |
| 1035 | globals.player.ent.bound.sph = player_bound(); |
| 1036 | |
| 1037 | update_sound(dt); |
| 1038 | update_blur(dt); |
| 1039 | |
| 1040 | if (loc.y >= 0.0f || loc.length2() <= 0.1f) |
| 1041 | { |
| 1042 | play_sound(SOUND_DETACH, 0.0f); |
| 1043 | return -1; |
| 1044 | } |
| 1045 | |
| 1046 | return 1; |
| 1047 | } |
| 1048 | |
| 1049 | void hanging_state_type::update_detach_camera(F32 dt) |
| 1050 | { |
nothing calls this directly
no test coverage detected