Объясните за JiggleBones что это и как он связан с хуком билдтрансформ
bool C_LocalAnimations::SetupPlayerBones(matrix3x4_t* aMatrix, int nMask)
{
// save globals
std::tuple < float, float, float, float, float, int, int > m_Globals = std::make_tuple
(
// backup globals
m_globals()->m_curtime,
m_globals()->m_realtime,
m_globals()->m_frametime,
m_globals()->m_absoluteframetime,
m_globals()->m_interpolation_amount,
// backup frame count and tick count
m_globals()->m_framecount,
m_globals()->m_tickcount
);
// save player data
std::tuple < int, int, int, int, int, bool > m_PlayerData = std::make_tuple
(
g_ctx.local()->m_nLastSkipFramecount(),
g_ctx.local()->m_fEffects(),
g_ctx.local()->m_nClientEffects(),
g_ctx.local()->m_nOcclusionFrame(),
g_ctx.local()->m_nOcclusionMask(),
g_ctx.local()->m_bJiggleBones()
);
// backup animation layers
std::array < AnimationLayer, 13 > m_Layers;
std::memcpy(m_Layers.data(), g_ctx.local()->get_animlayers(), sizeof(AnimationLayer) * 13);
/* set owners */
for (int nLayer = 0; nLayer < 13; nLayer++)
{
AnimationLayer* m_Layer = &g_ctx.local()->get_animlayers()[nLayer];
if (!m_Layer)
continue;
m_Layer->m_pOwner = g_ctx.local();
}
// get simulation time
float flSimulationTime = TICKS_TO_TIME(g_ctx.get_command()->m_tickcount);
// setup globals
m_globals()->m_curtime = flSimulationTime;
m_globals()->m_realtime = flSimulationTime;
m_globals()->m_frametime = m_globals()->m_intervalpertick;
m_globals()->m_absoluteframetime = m_globals()->m_intervalpertick;
m_globals()->m_interpolation_amount = 0.0f;
m_globals()->m_tickcount = g_ctx.get_command()->m_tickcount;
// fix skipanimframe ( part 1 )
m_globals()->m_framecount = INT_MAX;
// invalidate bone cache
g_ctx.local()->invalidate_bone_cache();
// disable ugly lean animation
g_ctx.local()->get_animlayers()[ANIMATION_LAYER_LEAN].m_flWeight = 0.0f;
// disable bones jiggle
g_ctx.local()->m_bJiggleBones() = false;
// force client effects
g_ctx.local()->m_nClientEffects() |= 2; // disable ik
// force effects to disable interp
g_ctx.local()->m_fEffects() |= EF_NOINTERP;
// fix PVS occlusion
g_ctx.local()->m_nOcclusionFrame() = -1;
g_ctx.local()->m_nOcclusionMask() &= ~2;
// fix skipanimframe ( part 2 )
g_ctx.local()->m_nLastSkipFramecount() = 0;
// setup bones
g_ctx.globals.setuping_bones = true;
auto res = g_ctx.local()->SetupBones(aMatrix, MAXSTUDIOBONES, nMask, 0.0f);
g_ctx.globals.setuping_bones = false;
// restore animation layers
std::memcpy(g_ctx.local()->get_animlayers(), m_Layers.data(), sizeof(AnimationLayer) * 13);
// restore player data
g_ctx.local()->m_nLastSkipFramecount() = std::get < 0 >(m_PlayerData);
g_ctx.local()->m_fEffects() = std::get < 1 >(m_PlayerData);
g_ctx.local()->m_nClientEffects() = std::get < 2 >(m_PlayerData);
g_ctx.local()->m_nOcclusionFrame() = std::get < 3 >(m_PlayerData);
g_ctx.local()->m_nOcclusionMask() = std::get < 4 >(m_PlayerData);
g_ctx.local()->m_bJiggleBones() = std::get < 5 >(m_PlayerData);
// restore globals
m_globals()->m_curtime = std::get < 0 >(m_Globals);
m_globals()->m_realtime = std::get < 1 >(m_Globals);
m_globals()->m_frametime = std::get < 2 >(m_Globals);
m_globals()->m_absoluteframetime = std::get < 3 >(m_Globals);
m_globals()->m_interpolation_amount = std::get < 4 >(m_Globals);
// restore frame count and tick count
m_globals()->m_framecount = std::get < 5 >(m_Globals);
m_globals()->m_tickcount = std::get < 6 >(m_Globals);
return res;
}
auto res = g_ctx.local()->SetupBones(aMatrix, MAXSTUDIOBONES, nMask, 0.0f);
Проект предоставляет различный материал, относящийся к сфере киберспорта, программирования, ПО для игр, а также позволяет его участникам общаться на многие другие темы. Почта для жалоб: admin@yougame.biz