From 655f48017c7beaf610fe65ff98af36d84d2fcffb Mon Sep 17 00:00:00 2001 From: lanariel Date: Fri, 14 Feb 2014 15:11:12 +0100 Subject: [PATCH] Anim Fix --- Code/OysterGraphics/Render/Resources.cpp | 4 ++-- .../Shader/Passes/Gather/Header.hlsli | 2 -- Code/Tester/MainTest.cpp | 17 +---------------- 3 files changed, 3 insertions(+), 20 deletions(-) diff --git a/Code/OysterGraphics/Render/Resources.cpp b/Code/OysterGraphics/Render/Resources.cpp index 696ee6f1..0c5bf592 100644 --- a/Code/OysterGraphics/Render/Resources.cpp +++ b/Code/OysterGraphics/Render/Resources.cpp @@ -340,8 +340,8 @@ namespace Oyster { "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0 }, { "TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT, 0, 12, D3D11_INPUT_PER_VERTEX_DATA, 0 }, { "NORMAL", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 20, D3D11_INPUT_PER_VERTEX_DATA, 0 }, - { "BONEINDEX", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, 56, D3D11_INPUT_PER_VERTEX_DATA, 0 }, - { "BONEWEIGHT", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, 72, D3D11_INPUT_PER_VERTEX_DATA, 0 } + { "BONEINDEX", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, 32, D3D11_INPUT_PER_VERTEX_DATA, 0 }, + { "BONEWEIGHT", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, 48, D3D11_INPUT_PER_VERTEX_DATA, 0 } }; Shader::CreateInputLayout(indesc,5,GetShader::Vertex(L"Gather"),Gather::Pass.IAStage.Layout); diff --git a/Code/OysterGraphics/Shader/Passes/Gather/Header.hlsli b/Code/OysterGraphics/Shader/Passes/Gather/Header.hlsli index 8747e46d..7584fcd3 100644 --- a/Code/OysterGraphics/Shader/Passes/Gather/Header.hlsli +++ b/Code/OysterGraphics/Shader/Passes/Gather/Header.hlsli @@ -13,8 +13,6 @@ struct VertexOut float4 ViewPos : POSITION; float2 UV : TEXCOORD; float3 normal : NORMAL; - //float3 tangent : TANGENT; - //float3 biTangent : BITANGENT; }; struct PixelOut diff --git a/Code/Tester/MainTest.cpp b/Code/Tester/MainTest.cpp index d30529a8..c3d19f29 100644 --- a/Code/Tester/MainTest.cpp +++ b/Code/Tester/MainTest.cpp @@ -171,14 +171,10 @@ HRESULT InitDirect3D() } m = Oyster::Graphics::API::CreateModel(L"crate_colonists.dan"); - //m->WorldMatrix.m[0][0] = 0.0002f; - //m->WorldMatrix.m[1][1] = 0.0002f; - //m->WorldMatrix.m[2][2] = 0.0002f; m2 = Oyster::Graphics::API::CreateModel(L"char_orca.dan"); m2->Tint = Oyster::Math::Float3(0.1f,0.1f,1); m3 = Oyster::Graphics::API::CreateModel(L"char_orca.dan"); - //m2->WorldMatrix = Oyster::Math3D::OrientationMatrix(Oyster::Math::Float3::null,Oyster::Math::Float3(4,0,0),Oyster::Math::Float3::null); - Oyster::Graphics::API::PlayAnimation(m2, L"movement", true); + //Oyster::Graphics::API::PlayAnimation(m2, L"movement", true); Oyster::Graphics::API::PlayAnimation(m3, L"movement", true); t = Oyster::Graphics::API::CreateTexture(L"structure_corp_mdg.png"); @@ -219,17 +215,10 @@ HRESULT InitDirect3D() float angle = 0; HRESULT Update(float deltaTime) { - //angle += Oyster::Math::pi/16 * deltaTime; m->WorldMatrix = Oyster::Math3D::OrientationMatrix(Oyster::Math::Float3(0,1,0) * angle,Oyster::Math::Float3(0,0,0),Oyster::Math::Float3::null); m2->WorldMatrix = Oyster::Math3D::OrientationMatrix(Oyster::Math::Float3(0,1,0) * angle,Oyster::Math::Float3(4,0,0),Oyster::Math::Float3::null); m3->WorldMatrix = Oyster::Math3D::OrientationMatrix(Oyster::Math::Float3(0,1,0) * -angle,Oyster::Math::Float3(-4,0,0),Oyster::Math::Float3::null); - Oyster::Math::Matrix ma = Oyster::Math::Matrix::identity; - ma.m[0][0] = 0.2f; - ma.m[1][1] = 0.2f; - ma.m[2][2] = 0.2f; - //m->WorldMatrix = m->WorldMatrix * ma; Oyster::Graphics::API::Update(deltaTime); - //m2->Animation.data.AnimationTime += deltaTime;// * 0.5f; return S_OK; } @@ -290,14 +279,10 @@ LRESULT CALLBACK WndProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam break; //Z - case 0x5A: - //m2->AnimationTime -= 0.1f; - //if(m2->AnimationTime < 0) - //m2->AnimationTime = 0; angle += Oyster::Math::pi / 16; break; //X + case 0x58: - //m2->AnimationTime += 0.1f; angle -= Oyster::Math::pi / 16; break;