MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / update_moving_in

Method update_moving_in

src/SB/Game/zEntPlayerOOBState.cpp:556–580  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers 1

supdate_moving_inMethod · 0.80

Calls 3

normalMethod · 0.80
move_handFunction · 0.70
dotMethod · 0.45

Tested by

no test coverage detected