Graphics/ModelInstance: Add UpdateWorldMatrix method
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#include <Nazara/Graphics/ModelInstance.hpp>
|
||||
#include <Nazara/Core/Error.hpp>
|
||||
#include <Nazara/Graphics/Debug.hpp>
|
||||
|
||||
namespace Nz
|
||||
@@ -21,6 +22,22 @@ namespace Nz
|
||||
{
|
||||
return *m_shaderBinding;
|
||||
}
|
||||
|
||||
inline void ModelInstance::UpdateWorldMatrix(const Matrix4f& worldMatrix)
|
||||
{
|
||||
m_worldMatrix = worldMatrix;
|
||||
if (!m_worldMatrix.GetInverseAffine(&m_invWorldMatrix))
|
||||
NazaraError("failed to inverse world matrix");
|
||||
|
||||
m_dataInvalided = true;
|
||||
}
|
||||
|
||||
inline void ModelInstance::UpdateWorldMatrix(const Matrix4f& worldMatrix, const Matrix4f& invWorldMatrix)
|
||||
{
|
||||
m_worldMatrix = worldMatrix;
|
||||
m_invWorldMatrix = invWorldMatrix;
|
||||
m_dataInvalided = true;
|
||||
}
|
||||
}
|
||||
|
||||
#include <Nazara/Graphics/DebugOff.hpp>
|
||||
|
||||
Reference in New Issue
Block a user