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

Method PHLoadState

ogsr_engine/xrGame/PhysicsShellHolder.cpp:409–448  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

407}
408
409void CPhysicsShellHolder::PHLoadState(IReader& P)
410{
411 // Msg("!!Called [CPhysicsShellHolder::PHLoadState]");
412
413 // Flags8 lflags;
414 IKinematics* K = smart_cast<IKinematics*>(Visual());
415 // P.r_u8 (lflags.flags);
416 u64 _low = 0;
417 u64 _high = 0;
418 if (K)
419 {
420 _low = P.r_u64();
421 K->LL_SetBoneRoot(P.r_u16());
422 }
423 else //Скорее всего K есть всегда, но на всякий случай.
424 {
425 P.r_u64();
426 P.r_u16();
427 }
428 Fvector min = P.r_vec3();
429 Fvector max = P.r_vec3();
430
431 VERIFY(!min.similar(max));
432
433 u16 bones_number = P.r_u16();
434 if (bones_number > 64)
435 {
436 Msg("!![CPhysicsShellHolder::PHLoadState] bones_number is [%u]!", bones_number);
437 _high = P.r_u64();
438 }
439 VisMask _vm(_low, _high);
440 K->LL_SetBonesVisible(_vm);
441
442 for (u16 i = 0; i < bones_number; i++)
443 {
444 SPHNetState state;
445 state.net_Load(P, min, max);
446 PHGetSyncItem(i)->set_State(state);
447 }
448}
449
450bool CPhysicsShellHolder::register_schedule() const { return (b_sheduled); }
451

Callers 1

loadMethod · 0.80

Calls 11

VisualFunction · 0.85
MsgFunction · 0.85
LL_SetBoneRootMethod · 0.80
LL_SetBonesVisibleMethod · 0.80
PHGetSyncItemFunction · 0.50
r_u64Method · 0.45
r_u16Method · 0.45
r_vec3Method · 0.45
similarMethod · 0.45
net_LoadMethod · 0.45
set_StateMethod · 0.45

Tested by

no test coverage detected