Sign in to follow this  

collada and importation manager

This topic is 2666 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello.
I have a class that controls the importation and a class that imports data from collada with colladaDom.
This because i can import from collada ,fbx and 3ds with polimorphism
I would structure my collada importer to scroll through the scene and , each node would like to see what kind of node is: light, mesh, etc. ... controller and call the import functions that are in the control class.
In this class, depending on the type of node called the Import function found on, for example Importlight (), ImportMesh (), Importcontroller ().
Only it did not succeed.
This is the test code:

//import manager

//.h
GenericImporter m_pApi;
//.cpp
ImportManager::ImportManager(nTypeImporter)
{
switch(nTypeImporter)
{
case COLLADA_MY:
m_pApi = new colladaImporter();
break;

case FBX_MY:
m_pApi = new FBXImporter();
break;

case 3DS_MY:
m_pApi new 3DSImporter();
break;
}

}
int nType = 0;
ImportSceneNode(string* strID, string* strIDParent, bool* bISJoint, DX_POSITION* pos, int* pType/*pType is returned by the function to the controller class*/)
switch(pType)
{
case MESH_MY:
m_pApi->importMesh();
break;

case CONTROLLER_MY:
m_pApi->importController();
break;

case SKELETON_MY:
m_pApi->importSkeleton();
break;

}




bool CColladaSkinMeshImporter::ImportSceneNode(string* strID, string* strIDParent, bool* bISJoint, DX_POSITION* pos, int* pNNodeType/*pNNodeType is returned by the function to the controller class*/)
{
if(m_CurrentNode->getType() == NODETYPE_NODE )
{
int n =m_CurrentNode->getElementType();
switch( m_CurrentNode->getType()){
case COLLADA_TYPE::INSTANCE_GEOMETRY:
*pNNodeType = MESH_MY;
break;
case COLLADA_TYPE::INSTANCE_CONTROLLER:
*pNNodeType = MESH_MY;
break;
case COLLADA_TYPE::INSTANCE_NODE:
*pNNodeType = SKELETON_MY;
return true;
}
}
return false;
}



I saw that you could also count the number of instances of a node and import with a switch on the panel, would work equally, but I would do one thing clear: how can I "control" the import depending on the type of node?
Thank you.

Share this post


Link to post
Share on other sites

This topic is 2666 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this