OK, So I have found a couple of tutorials on Keyframe Animation, but I am having trouble making sense of some of it. I have an allocation class derived from ID3DXALLOCATEHIERARCHY here
Code:
class CAllocateHierarchy: public ID3DXAllocateHierarchy
{
public:
STDMETHOD(CreateFrame)(THIS_ LPCTSTR Name, LPD3DXFRAME *ppNewFrame);
STDMETHOD(CreateMeshContainer)(THIS_ LPCTSTR Name,
LPD3DXMESHDATA pMeshData,
LPD3DXMATERIAL pMaterials,
LPD3DXEFFECTINSTANCE pEffectInstances,
DWORD NumMaterials,
DWORD *pAdjacency,
LPD3DXSKININFO pSkinInfo,
LPD3DXMESHCONTAINER *ppNewMeshContainer);
STDMETHOD(DestroyFrame)(THIS_ LPD3DXFRAME pFrameToFree);
STDMETHOD(DestroyMeshContainer)(THIS_ LPD3DXMESHCONTAINER pMeshContainerBase);
};
and I have a CModel class that handles the loading, rendering, ect... of the mesh. Here is where I load the mesh
Code:
void CModel::LoadXFile(char* strFileName)
{
//Allocation class
CAllocateHierarchy Alloc;
//Load the mesh
if(FAILED(D3DXLoadMeshHierarchyFromX(strFileName, // File load
D3DXMESH_MANAGED, // Load Options
m_pd3dDevice, // D3D Device
&Alloc, // Hierarchy allocation class
NULL, // NO Effects
&m_pFrameRoot, // Frame hierarchy
&m_pAnimController)))// Animation Controller
{
MessageBox(NULL, strFileName, "Model Load Error", MB_OK);
}
if(m_pAnimController)
m_dwAnimationSetCount = m_pAnimController->GetMaxNumAnimationSets();
if(m_pFrameRoot)
{
//Set the bones up
SetupBoneMatrices((LPFRAME)m_pFrameRoot, NULL);
//Setup the bone matrices array
m_pBoneMatrices = new D3DXMATRIX[m_uMaxBones];
ZeroMemory(m_pBoneMatrices, sizeof(D3DXMATRIX)*m_uMaxBones);
//Calculate the Bounding Sphere
D3DXFrameCalculateBoundingSphere(m_pFrameRoot, &m_vecCenter, &m_fRadius);
}
}
In red above I get an error
Code:
cannot declare variable `Alloc' to be of type `CAllocateHierarchy'
since type `CAllocateHierarchy' has abstract virtual functions
I am still kinda fuzzy when it comes to virtual functions. I tried removing the virtual tags from the functions in my derived class but I still get the same error.
I'm kinda stuck here, any help would be appreciated.