Results 1 to 2 of 2

Thread: importation from node type name

  1. #1

    importation from node type name

    Hello.
    I have a class that controls the importation and a class that imports data from collada collada with Dom.
    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:
    Code :
    bool CColladaSkinMeshImporter::ImportSceneNode(string* strID, string* strIDParent, bool* bISJoint, DX_POSITION* pos, int* pNNodeType)	
    {
    	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.

  2. #2
    Senior Member
    Join Date
    Aug 2004
    Location
    California
    Posts
    771

    Re: importation from node type name

    You can't do it that way because your assumption doesn't hold.

    A node element is not a typed object to switch on, rather it's a place defined by its local coordinate system. Also, node can contain any number of instances. You can try iterating over the list of instances and switching on their type.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •