mirror of
https://github.com/AxioDL/PrimeWorldEditor.git
synced 2025-12-21 02:39:17 +00:00
Removed dependencies on GLM
This commit is contained in:
@@ -101,9 +101,7 @@ void CMaterialPass::SetAnimCurrent(FRenderOptions Options, u32 PassIndex)
|
||||
case eInverseMV: // Mode 0
|
||||
case eSimpleMode: // Mode 10 - maybe not correct?
|
||||
{
|
||||
glm::mat4 InvMV = glm::inverse(glm::transpose(ViewMtx.ToGlmMat4()) * glm::transpose(ModelMtx.ToGlmMat4()));
|
||||
InvMV[0][3] = InvMV[1][3] = InvMV[2][3] = 0.f;
|
||||
TexMtx = CMatrix4f::FromGlmMat4(InvMV);
|
||||
TexMtx = (ModelMtx * ViewMtx).Transpose().Inverse();
|
||||
PostMtx = CMatrix4f(0.5f, 0.0f, 0.0f, 0.5f,
|
||||
0.0f, 0.5f, 0.0f, 0.5f,
|
||||
0.0f, 0.0f, 0.0f, 1.0f,
|
||||
@@ -113,8 +111,7 @@ void CMaterialPass::SetAnimCurrent(FRenderOptions Options, u32 PassIndex)
|
||||
|
||||
case eInverseMVTranslated: // Mode 1
|
||||
{
|
||||
glm::mat4 InvMV = glm::inverse(glm::transpose(ViewMtx.ToGlmMat4()) * glm::transpose(ModelMtx.ToGlmMat4()));
|
||||
TexMtx = CMatrix4f::FromGlmMat4(InvMV);
|
||||
TexMtx = (ModelMtx * ViewMtx).Transpose().Inverse();
|
||||
PostMtx = CMatrix4f(0.5f, 0.0f, 0.0f, 0.5f,
|
||||
0.0f, 0.5f, 0.0f, 0.5f,
|
||||
0.0f, 0.0f, 0.0f, 1.0f,
|
||||
@@ -166,7 +163,7 @@ void CMaterialPass::SetAnimCurrent(FRenderOptions Options, u32 PassIndex)
|
||||
case eModelMatrix: // Mode 6
|
||||
{
|
||||
// It looks ok, but I can't tell whether it's correct...
|
||||
TexMtx = CMatrix4f::FromGlmMat4(glm::transpose(ModelMtx.ToGlmMat4()));
|
||||
TexMtx = ModelMtx.Transpose();
|
||||
PostMtx = CMatrix4f(0.5f, 0.0f, 0.0f, TexMtx[0][3] * 0.50000001f,
|
||||
0.0f, 0.5f, 0.0f, TexMtx[1][3] * 0.50000001f,
|
||||
0.0f, 0.0f, 0.0f, 1.0f,
|
||||
@@ -180,9 +177,8 @@ void CMaterialPass::SetAnimCurrent(FRenderOptions Options, u32 PassIndex)
|
||||
{
|
||||
CMatrix4f View = CGraphics::sMVPBlock.ViewMatrix;
|
||||
|
||||
glm::mat4 Mtx = glm::inverse(glm::transpose(ViewMtx.ToGlmMat4()) * glm::transpose(ModelMtx.ToGlmMat4()));
|
||||
Mtx[0][3] = Mtx[1][3] = Mtx[2][3] = 0.f;
|
||||
TexMtx = CMatrix4f::FromGlmMat4(Mtx);
|
||||
TexMtx = (ModelMtx * ViewMtx).Transpose().Inverse();
|
||||
TexMtx[0][3] = TexMtx[1][3] = TexMtx[2][3] = 0.f;
|
||||
|
||||
float XY = (View[3][0] + View[3][1]) * 0.025f * mAnimParams[1];
|
||||
XY = (XY - (int) XY);
|
||||
|
||||
Reference in New Issue
Block a user