| 1047 | } |
| 1048 | |
| 1049 | void hanging_state_type::update_detach_camera(F32 dt) |
| 1050 | { |
| 1051 | xMat4x3 cammat; |
| 1052 | xQuat dir; |
| 1053 | |
| 1054 | detach.time += dt; |
| 1055 | |
| 1056 | F32 detachTimeRatio; |
| 1057 | if (detach.time < detach.end_time) |
| 1058 | { |
| 1059 | detachTimeRatio = detach.time / detach.end_time; |
| 1060 | } |
| 1061 | else |
| 1062 | { |
| 1063 | detachTimeRatio = 1.0f; |
| 1064 | } |
| 1065 | |
| 1066 | F32 curve = xSCurve(detachTimeRatio); |
| 1067 | cammat.pos = detach.start_loc + (detach.end_loc - detach.start_loc) * curve; |
| 1068 | cammat.pos += local_to_world(loc); |
| 1069 | |
| 1070 | xQuatSlerp(&dir, &detach.start_dir, &detach.end_dir, curve); |
| 1071 | xQuatToMat(&dir, &cammat); |
| 1072 | |
| 1073 | xCameraMove(&globals.camera, cammat.pos); |
| 1074 | xCameraRotate(&globals.camera, cammat, 0.0f, 0.0f, 0.0f); |
| 1075 | } |
| 1076 | |
| 1077 | void hanging_state_type::start_detaching() |
| 1078 | { |
nothing calls this directly
no test coverage detected