| 330 | } |
| 331 | |
| 332 | void CTorch::UpdateCL() |
| 333 | { |
| 334 | inherited::UpdateCL(); |
| 335 | |
| 336 | UpdateSwitchNightVision(); |
| 337 | |
| 338 | if (!m_switched_on) |
| 339 | return; |
| 340 | |
| 341 | CActor* actor = smart_cast<CActor*>(H_Parent()); |
| 342 | |
| 343 | #pragma todo("Simp: Добавить отдельную команду/настройку?") |
| 344 | //light_render->set_shadow(actor || !Core.Features.test(xrCore::Feature::npc_simplified_shooting)); |
| 345 | |
| 346 | if (useVolumetric) |
| 347 | { |
| 348 | if (actor) |
| 349 | light_render->set_volumetric(useVolumetricForActor); |
| 350 | else |
| 351 | light_render->set_volumetric(psActorFlags.test(AF_AI_VOLUMETRIC_LIGHTS)); |
| 352 | } |
| 353 | |
| 354 | CBoneInstance& BI = smart_cast<IKinematics*>(Visual())->LL_GetBoneInstance(guid_bone); |
| 355 | Fmatrix M; |
| 356 | |
| 357 | if (H_Parent()) |
| 358 | { |
| 359 | // if (actor) |
| 360 | // { |
| 361 | // todo("переделать под новый рендер!") |
| 362 | // light_render->set_actor_torch(true); |
| 363 | // } |
| 364 | |
| 365 | if (H_Parent()->XFORM().c.distance_to_sqr(Device.vCameraPosition) < _sqr(OPTIMIZATION_DISTANCE)) |
| 366 | { |
| 367 | // near camera |
| 368 | |
| 369 | smart_cast<IKinematics*>(H_Parent()->Visual())->CalculateBones(TRUE); |
| 370 | |
| 371 | M.mul_43(XFORM(), BI.mTransform); |
| 372 | } |
| 373 | else |
| 374 | { |
| 375 | // approximately the same |
| 376 | M = H_Parent()->XFORM(); |
| 377 | H_Parent()->Center(M.c); |
| 378 | M.c.y += H_Parent()->Radius() * 2.f / 3.f; |
| 379 | } |
| 380 | |
| 381 | if (actor && actor->g_Alive()) |
| 382 | { |
| 383 | if (actor->active_cam() == eacLookAt) |
| 384 | { |
| 385 | m_prev_hp.x = |
| 386 | angle_inertion_var(m_prev_hp.x, -actor->cam_Active()->yaw, TORCH_INERTION_SPEED_MIN, TORCH_INERTION_SPEED_MAX, TORCH_INERTION_CLAMP, Device.fTimeDelta); |
| 387 | m_prev_hp.y = |
| 388 | angle_inertion_var(m_prev_hp.y, -actor->cam_Active()->pitch, TORCH_INERTION_SPEED_MIN, TORCH_INERTION_SPEED_MAX, TORCH_INERTION_CLAMP, Device.fTimeDelta); |
| 389 | } |
nothing calls this directly
no test coverage detected