Fixed Anim

This commit is contained in:
lanariel 2014-02-05 17:13:23 +01:00
parent aafbfa01f3
commit bfa54b9ccd
4 changed files with 8 additions and 4 deletions

View File

@ -111,6 +111,8 @@ namespace Oyster
void API::Clean()
{
DeleteModel(Render::Rendering::Basic::cube);
DeleteModel(Render::Rendering::Basic::cube2);
SAFE_DELETE(Core::viewPort);
Core::loader.Clean();
Oyster::Graphics::Core::PipelineManager::Clean();

View File

@ -135,7 +135,6 @@ void Oyster::Graphics::Loading::UnloadDAN(void* data)
if(info->Animated)
{
//clean animation
delete[] info->bones;
for(int a = 0; a < info->AnimationCount; ++a)
{
for(int x = 0; x < info->Animations[a].Bones; ++x)
@ -151,6 +150,8 @@ void Oyster::Graphics::Loading::UnloadDAN(void* data)
{
Core::loader.ReleaseResource(info->Material[i]);
}
if(info->BoneCount>0)
delete[] info->bones;
delete info;
}
@ -179,6 +180,7 @@ void* Oyster::Graphics::Loading::LoadDAN(const wchar_t filename[])
Oyster::Graphics::Model::ModelInfo* modelInfo = new Oyster::Graphics::Model::ModelInfo();
modelInfo->Indexed = false;
modelInfo->Animated = false;
modelInfo->BoneCount = 0;
// Open file in binary mode
std::ifstream danFile;
danFile.open(filename, std::ios::binary);

View File

@ -14,7 +14,7 @@ VertexOut main( VertexIn input )
AnimatedData[input.boneIndex.z]*input.boneWeight.z +
AnimatedData[input.boneIndex.w]*input.boneWeight.w;
input.pos = mul(boneTrans,input.pos) * Animated + input.pos * int(1-Animated);
input.pos = mul(boneTrans,float4(input.pos,1)) * Animated + input.pos * int(1-Animated);
input.normal = mul(boneTrans,input.normal) * Animated + input.normal * int(1-Animated);
/*input.pos =

View File

@ -162,7 +162,7 @@ HRESULT InitDirect3D()
}
m = Oyster::Graphics::API::CreateModel(L"untitled.dan");
m2 = Oyster::Graphics::API::CreateModel(L"rigidbind_animtest_arms_bindpose (1).dan");
m2 = Oyster::Graphics::API::CreateModel(L"still.dan");
m2->WorldMatrix = Oyster::Math3D::OrientationMatrix(Oyster::Math::Float3::null,Oyster::Math::Float3(0,0,0),Oyster::Math::Float3::null);
m2->AnimationPlaying = 0;
m2->AnimationTime = 0.0f;
@ -200,7 +200,7 @@ HRESULT Update(float deltaTime)
//ma *= 50;
//ma.m44 = 1;
//m2->WorldMatrix = m2->WorldMatrix * ma;
//m2->AnimationTime += deltaTime * 0.5f;
m2->AnimationTime += deltaTime;// * 0.5f;
//m3->WorldMatrix = Oyster::Math3D::OrientationMatrix(Oyster::Math::Float3(1,0,0)*-0,Oyster::Math::Float3(3,4,-1*angle),Oyster::Math::Float3::null);
return S_OK;
}