Patch Update - Terrain Tweak

This commit is contained in:
CatChow0 2024-10-01 20:44:46 +02:00
parent d7965fec64
commit 7d2b962420
4 changed files with 21 additions and 43 deletions

View File

@ -910,9 +910,9 @@ bool ApplicationClass::RenderRefractionToTexture()
m_Camera->Render();
// Get the world, view, and projection matrices from the camera and d3d objects.
m_Direct3D->GetWorldMatrix(worldMatrix);
worldMatrix = m_Direct3D->GetWorldMatrix();
m_Camera->GetViewMatrix(viewMatrix);
m_Direct3D->GetProjectionMatrix(projectionMatrix);
projectionMatrix = m_Direct3D->GetProjectionMatrix();
// Get the light properties.
for (i = 0; i < m_numLights; i++)
@ -965,8 +965,8 @@ bool ApplicationClass::RenderReflectionToTexture()
m_Camera->GetReflectionViewMatrix(reflectionViewMatrix);
// Get the world and projection matrices from the d3d object.
m_Direct3D->GetWorldMatrix(worldMatrix);
m_Direct3D->GetProjectionMatrix(projectionMatrix);
worldMatrix = m_Direct3D->GetWorldMatrix();
projectionMatrix = m_Direct3D->GetProjectionMatrix();
// Reset the render target back to the original back buffer and not the render to texture anymore. And reset the viewport back to the original.
@ -989,7 +989,7 @@ bool ApplicationClass::RenderSceneToTexture(float rotation)
m_Camera->Render();
// Get the matrices.
m_Direct3D->GetWorldMatrix(worldMatrix);
worldMatrix = m_Direct3D->GetWorldMatrix();
m_Camera->GetViewMatrix(viewMatrix);
m_RenderTexture->GetProjectionMatrix(projectionMatrix);
@ -1030,10 +1030,10 @@ bool ApplicationClass::Render(float rotation, float x, float y, float z, float t
// Get the world, view, and projection matrices from the camera and d3d objects.
m_Direct3D->GetWorldMatrix(worldMatrix);
worldMatrix = m_Direct3D->GetWorldMatrix();
m_Camera->GetViewMatrix(viewMatrix);
m_Direct3D->GetProjectionMatrix(projectionMatrix);
m_Direct3D->GetOrthoMatrix(orthoMatrix);
projectionMatrix = m_Direct3D->GetProjectionMatrix();
orthoMatrix = m_Direct3D->GetOrthoMatrix();
// Get the light properties.
for (i = 0; i < m_numLights; i++)
@ -1122,8 +1122,8 @@ bool ApplicationClass::Render(float rotation, float x, float y, float z, float t
rotateMatrix = object->GetRotateMatrix();
}
translateMatrix = object->GetTranslateMatrix();
srMatrix = XMMatrixMultiply(scaleMatrix, rotateMatrix);
worldMatrix = XMMatrixMultiply(srMatrix, translateMatrix);
worldMatrix = m_Direct3D->GetWorldMatrix();
object->Render(m_Direct3D->GetDeviceContext());
@ -1216,7 +1216,7 @@ bool ApplicationClass::Render(float rotation, float x, float y, float z, float t
}
// Reset the world matrix.
m_Direct3D->GetWorldMatrix(worldMatrix);
worldMatrix = m_Direct3D->GetWorldMatrix();
// Get the camera reflection view matrix.
m_Camera->GetReflectionViewMatrix(reflectionMatrix);
@ -1334,7 +1334,7 @@ bool ApplicationClass::Render(float rotation, float x, float y, float z, float t
m_Direct3D->EnableAlphaBlending();
// Reset the world matrix.
m_Direct3D->GetWorldMatrix(worldMatrix);
worldMatrix = m_Direct3D->GetWorldMatrix();
// Render the render count text string using the font shader.
m_RenderCountString->Render(m_Direct3D->GetDeviceContext());
@ -1635,16 +1635,16 @@ void ApplicationClass::GenerateTerrain()
// for loop to generate terrain chunks for a 10x10 grid
for (int i = 0; i < 10; i++)
for (int i = 0; i < 20; i++)
{
for (int j = 0; j < 10; j++)
for (int j = 0; j < 20; j++)
{
Object* newTerrain = new Object();
newTerrain->Initialize(m_Direct3D->GetDevice(), m_Direct3D->GetDeviceContext(), modelFilename, textures);
newTerrain->SetScaleMatrix(scaleMatrix);
newTerrain->SetTranslateMatrix(XMMatrixTranslation(i / 2 * (scaleX * 2), -12.0f, j * (scaleZ * 2)));
newTerrain->SetTranslateMatrix(XMMatrixTranslation(i / 2 * scaleX, -12.0f, j * scaleZ));
newTerrain->SetName(filenameWithoutExtension);

View File

@ -565,28 +565,6 @@ ID3D11DeviceContext* D3DClass::GetDeviceContext()
return m_deviceContext;
}
XMMATRIX D3DClass::GetProjectionMatrix(XMMATRIX& projectionMatrix)
{
projectionMatrix = m_projectionMatrix;
return m_projectionMatrix;
}
void D3DClass::GetWorldMatrix(XMMATRIX& worldMatrix)
{
worldMatrix = m_worldMatrix;
return;
}
void D3DClass::GetOrthoMatrix(XMMATRIX& orthoMatrix)
{
orthoMatrix = m_orthoMatrix;
return;
}
void D3DClass::GetVideoCardInfo(char* cardName, int& memory)
{
strcpy_s(cardName, 128, m_videoCardDescription);

View File

@ -42,14 +42,14 @@ public:
ID3D11Device* GetDevice();
ID3D11DeviceContext* GetDeviceContext();
XMMATRIX GetProjectionMatrix(XMMATRIX& projectionMatrix);
//XMMATRIX GetProjectionMatrix(XMMATRIX& projectionMatrix);
IDXGISwapChain* m_swapChain;
IDXGISwapChain* GetSwapChain();
void ResizeSwapChain(int, int);
XMMATRIX GetProjectionMatrix();
void GetWorldMatrix(XMMATRIX&);
void GetOrthoMatrix(XMMATRIX&);
XMMATRIX GetProjectionMatrix() const { return m_projectionMatrix; };
XMMATRIX GetWorldMatrix() const { return m_worldMatrix;};
XMMATRIX GetOrthoMatrix() const { return m_orthoMatrix; };
void GetVideoCardInfo(char*, int&);

View File

@ -15,10 +15,10 @@ Pos=60,60
Size=342,82
[Window][Light]
Pos=1547,17
Pos=1548,17
Size=358,535
[Window][Shader Manager]
Pos=30,255
Pos=28,255
Size=172,284