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

Method g_SetAnimation

ogsr_engine/xrGame/ActorAnimation.cpp:314–670  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

312#endif
313
314void CActor::g_SetAnimation(u32 mstate_rl)
315{
316 if (!g_Alive())
317 {
318 if (m_current_legs || m_current_torso)
319 {
320 SActorState* ST = 0;
321 if (mstate_rl & mcCrouch)
322 ST = &m_anims->m_crouch;
323 else
324 ST = &m_anims->m_normal;
325 mstate_real = 0;
326 m_current_legs.invalidate();
327 m_current_torso.invalidate();
328
329 smart_cast<IKinematicsAnimated*>(Visual())->PlayCycle(m_anims->m_dead_stop);
330 }
331
332 return;
333 }
334 STorsoWpn::eMovingState moving_idx = STorsoWpn::eIdle;
335 SActorState* ST = 0;
336 SAnimState* AS = 0;
337
338 if (mstate_rl & mcCrouch)
339 ST = &m_anims->m_crouch;
340 else if (mstate_rl & mcClimb)
341 ST = &m_anims->m_climb;
342 else
343 ST = &m_anims->m_normal;
344
345 bool bAccelerated = isActorAccelerated(mstate_rl, IsZoomAimingMode());
346 if (bAccelerated)
347 {
348 AS = &ST->m_run;
349 }
350 else
351 {
352 AS = &ST->m_walk;
353 }
354 if (mstate_rl & mcAnyMove)
355 {
356 if (bAccelerated)
357 moving_idx = STorsoWpn::eRun;
358 else
359 moving_idx = STorsoWpn::eWalk;
360 }
361 // анимации
362 MotionID M_legs;
363 MotionID M_torso;
364 MotionID M_head;
365
366 //если мы просто стоим на месте
367 bool is_standing = false;
368
369 // Legs
370 if (mstate_rl & mcLanding)
371 M_legs = ST->landing[0];

Callers

nothing calls this directly

Calls 15

g_AliveFunction · 0.85
VisualFunction · 0.85
isActorAcceleratedFunction · 0.85
fis_zeroFunction · 0.85
MsgFunction · 0.85
PlayCycleMethod · 0.80
ActiveItemMethod · 0.80
GetActiveSlotMethod · 0.80
IsTriStateReloadMethod · 0.80
GetReloadStateMethod · 0.80
ID_CycleMethod · 0.80
randIMethod · 0.80

Tested by

no test coverage detected