MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / set_State

Method set_State

ogsr_engine/xrGame/PHCharacter.cpp:76–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74 state.enabled = CPHObject::is_active(); //!!dBodyIsEnabled(m_body);
75}
76void CPHCharacter::set_State(const SPHNetState& state)
77{
78 m_body_interpolation.SetPosition(state.previous_position, 0);
79 m_body_interpolation.SetPosition(state.position, 1);
80 SetPosition(state.position);
81 SetVelocity(state.linear_vel);
82 setForce(state.force);
83
84 // SetAcceleration(state.accel);
85 // SetMaximumVelocity(state.max_velocity);
86
87 if (!b_exist)
88 return;
89 if (state.enabled)
90 {
91 Enable();
92 };
93 if (!state.enabled)
94 {
95 Disable();
96 };
97 VERIFY2(dBodyStateValide(m_body), "WRONG BODYSTATE WAS SET");
98}
99
100void CPHCharacter::Disable()
101{

Callers 5

RestoreNetStateMethod · 0.45
PHLoadStateMethod · 0.45
OnEventMethod · 0.45
RestoreVelocityStateFunction · 0.45

Calls 3

EnableFunction · 0.85
dBodyStateValideFunction · 0.85
SetPositionMethod · 0.45

Tested by

no test coverage detected