Major Update - Physique Fixed Update And Thread

Physics process run in a fixed update in a thread
This commit is contained in:
2025-01-17 15:47:09 +01:00
parent 15217a5df8
commit 4ae55e73b2
7 changed files with 142 additions and 114 deletions

View File

@@ -93,12 +93,25 @@ XMVECTOR Object::GetScale()
{
XMFLOAT4X4 matrix;
XMStoreFloat4x4(&matrix, m_scaleMatrix);
float scaleX = XMVectorGetX(XMVector3Length(XMVectorSet(matrix._11, matrix._12, matrix._13, 0.0f)));
float scaleY = XMVectorGetX(XMVector3Length(XMVectorSet(matrix._21, matrix._22, matrix._23, 0.0f)));
float scaleZ = XMVectorGetX(XMVector3Length(XMVectorSet(matrix._31, matrix._32, matrix._33, 0.0f)));
return XMVectorSet(scaleX, scaleY, scaleZ, 0.0f);
// Utiliser des vecteurs pour les lignes de la matrice
XMVECTOR row1 = XMLoadFloat3(reinterpret_cast<XMFLOAT3*>(&matrix._11));
XMVECTOR row2 = XMLoadFloat3(reinterpret_cast<XMFLOAT3*>(&matrix._21));
XMVECTOR row3 = XMLoadFloat3(reinterpret_cast<XMFLOAT3*>(&matrix._31));
// Calculer les longueurs des vecteurs
XMVECTOR scale = XMVectorSet(
XMVectorGetX(XMVector3Length(row1)),
XMVectorGetX(XMVector3Length(row2)),
XMVectorGetX(XMVector3Length(row3)),
0.0f
);
return scale;
}
void Object::SetPosition(XMVECTOR position)
{
XMFLOAT4X4 matrix;