Skip to content

Commit

Permalink
Merge branch 'master' into 260824_Improve-docker
Browse files Browse the repository at this point in the history
  • Loading branch information
TracerDS authored Sep 12, 2024
2 parents 2277d51 + 6e127fd commit 6fb0f8f
Show file tree
Hide file tree
Showing 48 changed files with 1,366 additions and 893 deletions.
49 changes: 49 additions & 0 deletions Client/game_sa/CEntitySA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,28 @@ bool CEntitySA::GetBoneRotation(eBone boneId, float& yaw, float& pitch, float& r
return false;
}

bool CEntitySA::GetBoneRotationQuat(eBone boneId, float& x, float& y, float& z, float& w)
{
RpClump* clump = GetRpClump();
if (clump)
{
// updating the bone frame orientation will also update its children
// This rotation is only applied when UpdateElementRpHAnim is called
CAnimBlendClumpDataSAInterface* clumpDataInterface = *pGame->GetClumpData(clump);
AnimBlendFrameData* frameData = clumpDataInterface->GetFrameDataByNodeId(boneId);
if (frameData)
{
RtQuat* boneOrientation = &frameData->m_pIFrame->orientation;
x = boneOrientation->imag.x;
y = boneOrientation->imag.y;
z = boneOrientation->imag.z;
w = boneOrientation->real;
return true;
}
}
return false;
}

bool CEntitySA::SetBoneRotation(eBone boneId, float yaw, float pitch, float roll)
{
RpClump* clump = GetRpClump();
Expand All @@ -628,6 +650,33 @@ bool CEntitySA::SetBoneRotation(eBone boneId, float yaw, float pitch, float roll
return false;
}

bool CEntitySA::SetBoneRotationQuat(eBone boneId, float x, float y, float z, float w)
{
RpClump* clump = GetRpClump();
if (clump)
{
// updating the bone frame orientation will also update its children
// This rotation is only applied when UpdateElementRpHAnim is called
CAnimBlendClumpDataSAInterface* clumpDataInterface = *pGame->GetClumpData(clump);
AnimBlendFrameData* frameData = clumpDataInterface->GetFrameDataByNodeId(boneId);
if (frameData)
{
RtQuat* boneOrientation = &frameData->m_pIFrame->orientation;
boneOrientation->imag.x = x;
boneOrientation->imag.y = y;
boneOrientation->imag.z = z;
boneOrientation->real = w;
CEntitySAInterface* theInterface = GetInterface();
if (theInterface)
{
theInterface->bDontUpdateHierarchy = false;
}
return true;
}
}
return false;
}

bool CEntitySA::GetBonePosition(eBone boneId, CVector& position)
{
RwMatrix* rwBoneMatrix = GetBoneRwMatrix(boneId);
Expand Down
2 changes: 2 additions & 0 deletions Client/game_sa/CEntitySA.h
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,9 @@ class CEntitySA : public virtual CEntity
bool SetBoneMatrix(eBone boneId, const CMatrix& matrix);

bool GetBoneRotation(eBone boneId, float& yaw, float& pitch, float& roll);
bool GetBoneRotationQuat(eBone boneId, float& x, float& y, float& z, float& w);
bool SetBoneRotation(eBone boneId, float yaw, float pitch, float roll);
bool SetBoneRotationQuat(eBone boneId, float x, float y, float z, float w);
bool GetBonePosition(eBone boneId, CVector& position);
bool SetBonePosition(eBone boneId, const CVector& position);

Expand Down
16 changes: 15 additions & 1 deletion Client/game_sa/CSettingsSA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ void CSettingsSA::Save()
}
}

bool CSettingsSA::IsVolumetricShadowsEnabled()
bool CSettingsSA::IsVolumetricShadowsEnabled() const noexcept
{
return m_bVolumetricShadowsEnabled && !m_bVolumetricShadowsSuspended;
}
Expand All @@ -287,6 +287,20 @@ void CSettingsSA::SetVolumetricShadowsEnabled(bool bEnable)
MemPut<BYTE>(0x5E682A + 1, bEnable);
}


bool CSettingsSA::GetVolumetricShadowsEnabledByVideoSetting() const noexcept
{
bool volumetricShadow;
g_pCore->GetCVars()->Get("volumetric_shadows", volumetricShadow);
return volumetricShadow;
}

bool CSettingsSA::ResetVolumetricShadows() noexcept
{
pGame->GetSettings()->SetVolumetricShadowsEnabled(pGame->GetSettings()->GetVolumetricShadowsEnabledByVideoSetting());
return true;
}

void CSettingsSA::SetVolumetricShadowsSuspended(bool bSuspended)
{
m_bVolumetricShadowsSuspended = bSuspended;
Expand Down
5 changes: 4 additions & 1 deletion Client/game_sa/CSettingsSA.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,10 @@ class CSettingsSA : public CGameSettings
bool IsMipMappingEnabled();
void SetMipMappingEnabled(bool bEnable);

bool IsVolumetricShadowsEnabled();
bool IsVolumetricShadowsEnabled() const noexcept;
bool GetVolumetricShadowsEnabledByVideoSetting() const noexcept;
bool ResetVolumetricShadows() noexcept;

void SetVolumetricShadowsEnabled(bool bEnable);
void SetVolumetricShadowsSuspended(bool bSuspended);

Expand Down
9 changes: 6 additions & 3 deletions Client/mods/deathmatch/logic/CClientBuilding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,14 @@ void CClientBuilding::SetUsesCollision(bool state)
if (m_usesCollision == state)
return;

m_usesCollision = state;
if (m_pBuilding)
{
m_pBuilding->SetUsesCollision(state);
}

// Remove all contacts
for (const auto& ped : m_Contacts)
RemoveContact(ped);

m_usesCollision = state;
}

void CClientBuilding::Create()
Expand Down
Loading

0 comments on commit 6fb0f8f

Please sign in to comment.