| 554 | } |
| 555 | |
| 556 | drop_state_type::substate_enum drop_state_type::update_moving_in(xScene& scn, F32& dt) |
| 557 | { |
| 558 | move_hand(dt); |
| 559 | |
| 560 | xVec2 in_out_path = fixed.in_loc - fixed.out_loc; |
| 561 | xVec2 norm = in_out_path.normal(); |
| 562 | |
| 563 | F32 projection = norm.dot(fixed.in_loc - shared.loc); |
| 564 | if (projection > fixed.grab.in_stop_dist) |
| 565 | { |
| 566 | return SS_MOVING_IN; |
| 567 | } |
| 568 | else if (projection <= 0.0f) |
| 569 | { |
| 570 | shared.vel = 0.0f; |
| 571 | shared.loc = fixed.in_loc; |
| 572 | shared.accel = 0.0f; |
| 573 | } |
| 574 | else |
| 575 | { |
| 576 | shared.accel = (-shared.vel * shared.vel) / (2.0f * projection); |
| 577 | } |
| 578 | |
| 579 | return SS_STOPPING; |
| 580 | } |
| 581 | |
| 582 | state_type::state_type(state_enum state) |
| 583 | { |
no test coverage detected