| 336 | } |
| 337 | |
| 338 | void CPhysicsShellHolder::PHSaveState(NET_Packet& P) |
| 339 | { |
| 340 | // Msg("!!Called [CPhysicsShellHolder::PHSaveState]"); |
| 341 | // CPhysicsShell* pPhysicsShell=PPhysicsShell(); |
| 342 | IKinematics* K = smart_cast<IKinematics*>(Visual()); |
| 343 | // Flags8 lflags; |
| 344 | // if(pPhysicsShell&&pPhysicsShell->isActive()) lflags.set(CSE_PHSkeleton::flActive,pPhysicsShell->isEnabled()); |
| 345 | |
| 346 | // P.w_u8 (lflags.get()); |
| 347 | VisMask _vm; |
| 348 | if (K) |
| 349 | { |
| 350 | _vm = K->LL_GetBonesVisible(); |
| 351 | P.w_u64(_vm._visimask.flags); |
| 352 | P.w_u16(K->LL_GetBoneRoot()); |
| 353 | } |
| 354 | else |
| 355 | { |
| 356 | P.w_u64(u64(-1)); |
| 357 | P.w_u16(0); |
| 358 | } |
| 359 | ///////////////////////////// |
| 360 | Fvector min, max; |
| 361 | |
| 362 | min.set(flt_max, flt_max, flt_max); |
| 363 | max.set(-flt_max, -flt_max, -flt_max); |
| 364 | ///////////////////////////////////// |
| 365 | |
| 366 | u16 bones_number = PHGetSyncItemsNumber(); |
| 367 | for (u16 i = 0; i < bones_number; i++) |
| 368 | { |
| 369 | SPHNetState state; |
| 370 | PHGetSyncItem(i)->get_State(state); |
| 371 | Fvector& p = state.position; |
| 372 | if (p.x < min.x) |
| 373 | min.x = p.x; |
| 374 | if (p.y < min.y) |
| 375 | min.y = p.y; |
| 376 | if (p.z < min.z) |
| 377 | min.z = p.z; |
| 378 | |
| 379 | if (p.x > max.x) |
| 380 | max.x = p.x; |
| 381 | if (p.y > max.y) |
| 382 | max.y = p.y; |
| 383 | if (p.z > max.z) |
| 384 | max.z = p.z; |
| 385 | } |
| 386 | |
| 387 | min.sub(2.f * EPS_L); |
| 388 | max.add(2.f * EPS_L); |
| 389 | |
| 390 | VERIFY(!min.similar(max)); |
| 391 | P.w_vec3(min); |
| 392 | P.w_vec3(max); |
| 393 | |
| 394 | P.w_u16(bones_number); |
| 395 | if (bones_number > 64) |
no test coverage detected