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

Method ChangeVisual

ogsr_engine/xrGame/Actor_Network.cpp:382–413  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

380};
381
382void CActor::ChangeVisual(shared_str NewVisual)
383{
384 if (!NewVisual.size())
385 return;
386 if (cNameVisual().size())
387 {
388 if (cNameVisual() == NewVisual)
389 return;
390 }
391
392 cNameVisual_set(NewVisual);
393
394 g_SetAnimation(mstate_real);
395 Visual()->dcast_PKinematics()->CalculateBones_Invalidate();
396 Visual()->dcast_PKinematics()->CalculateBones();
397
398 CCar* car;
399 if ((Holder()) && (car = smart_cast<CCar*>(Holder())))
400 {
401 IKinematicsAnimated* V = smart_cast<IKinematicsAnimated*>(Visual());
402 R_ASSERT(V);
403 u16 anim_type = car->DriverAnimationType();
404 SVehicleAnimCollection& anims = m_vehicle_anims->m_vehicles_type_collections[anim_type];
405 V->PlayCycle(anims.idles[0], FALSE);
406
407 ResetCallbacks();
408 u16 head_bone = V->dcast_PKinematics()->LL_BoneID("bip01_head");
409 V->dcast_PKinematics()->LL_GetBoneInstance(u16(head_bone)).set_callback(bctPhysics, VehicleHeadCallback, this);
410
411 character_physics_support()->movement()->DestroyCharacter();
412 }
413};
414
415void CActor::save(NET_Packet& output_packet)
416{

Callers 2

OnMoveToSlotMethod · 0.80
OnDropOrMoveToRuckMethod · 0.80

Calls 12

VisualFunction · 0.85
DriverAnimationTypeMethod · 0.80
PlayCycleMethod · 0.80
LL_BoneIDMethod · 0.80
set_callbackMethod · 0.80
DestroyCharacterMethod · 0.80
movementMethod · 0.80
sizeMethod · 0.45
dcast_PKinematicsMethod · 0.45
CalculateBonesMethod · 0.45

Tested by

no test coverage detected