Drag and drop ImGui

This commit is contained in:
2024-04-04 10:50:40 +02:00
parent 6d2cb2531b
commit 4a3b540b6f
6 changed files with 128 additions and 16 deletions

View File

@@ -117,4 +117,48 @@ void Object::SetScale(XMVECTOR scale)
matrix._22 = XMVectorGetY(scale);
matrix._33 = XMVectorGetZ(scale);
m_scaleMatrix = XMLoadFloat4x4(&matrix);
}
void Object::UpdateWorldMatrix()
{
m_worldMatrix = m_scaleMatrix * m_rotateMatrix * m_translateMatrix;
}
void Object::UpdateSRMatrix()
{
m_srMatrix = m_scaleMatrix * m_rotateMatrix;
}
void Object::UpdateTranslateMatrix()
{
m_translateMatrix = XMMatrixTranslationFromVector(GetPosition());
}
void Object::UpdateRotateMatrix()
{
m_rotateMatrix = XMMatrixRotationRollPitchYawFromVector(GetRotation());
}
void Object::UpdateScaleMatrix()
{
m_scaleMatrix = XMMatrixScalingFromVector(GetScale());
}
void Object::Update()
{
UpdateWorldMatrix();
UpdateSRMatrix();
UpdateTranslateMatrix();
UpdateRotateMatrix();
UpdateScaleMatrix();
}
std::string Object::GetName()
{
return m_name;
}
void Object::SetName(std::string name)
{
m_name = name;
}