void sb7fbxmodel::ProcessNode(FbxNode* pNode) { if(pNode->GetNodeAttribute()) { switch(pNode->GetNodeAttribute()->GetAttributeType()) { case FbxNodeAttribute::eMesh: ProcessMesh(pNode); break; case FbxNodeAttribute::eSkeleton: ProcessSkeleton(pNode); break; case FbxNodeAttribute::eLight: ProcessLight(pNode); break; case FbxNodeAttribute::eCamera: ProcessCamera(); break; } } for(int i = 0 ; i < pNode->GetChildCount() ; ++i) { ProcessNode(pNode->GetChild(i)); } }
void Rendering::Render(void) { auto cameraIter = cameras.begin(); auto cameraEnd = cameras.end(); for(unsigned int i = 0; i < 32 && cameraIter != cameraEnd; ++i) { currentCamera = *cameraIter; ProcessCamera(); //- For each visible renderer // - PrelitProcess if( renderableTree.GetRoot() != 0 ) PreLitTraversal( *cameraIter, renderableTree.GetRoot() ); ProcessPreLitVisibleSet(); //- For each visible light // - Build visible renderer set // - ProcessLight if( lightTree.GetRoot() != 0 ) LightTraversal( *cameraIter, lightTree.GetRoot() ); auto directionalIter = directionalLightList.begin(); auto directionalEnd = directionalLightList.end(); for(; directionalIter != directionalEnd; ++directionalIter) { IDirectionalLight* directionalLight = *directionalIter; if( !currentCamera->CullLight( directionalLight ) ) continue; directionalLight->visibleSetHead = 0; directionalLight->SetAabb( currentCamera->GetFrustumAabb() ); LightSubTraversal( directionalLight, renderableTree.GetRoot() ); ProcessLight( directionalLight ); } ProcessVisibleLightSet(); //- For each visible renderer // - PostLitProcess if( renderableTree.GetRoot() != 0 ) PostLitTraversal( *cameraIter, renderableTree.GetRoot() ); ProcessPostLitVisibleSet(); PostProcessCamera(); ++cameraIter; } currentCamera = 0; }
void FbxParser::ProcessNode(FbxNode* pNode,std::vector<GS::BaseMesh*>& meshs, std::vector<GS::Light*>& lights, GS::Camera& camera) { FbxNodeAttribute::EType lAttributeType; int i; if(pNode->GetNodeAttribute() == NULL) { return ; } else { lAttributeType = (pNode->GetNodeAttribute()->GetAttributeType()); switch (lAttributeType) { default: break; //case FbxNodeAttribute::eMarker: // DisplayMarker(pNode); // break; //case FbxNodeAttribute::eSkeleton: // DisplaySkeleton(pNode); // break; case FbxNodeAttribute::eMesh: ProcessMesh(pNode, meshs); break; //case FbxNodeAttribute::eNurbs: // DisplayNurb(pNode); // break; //case FbxNodeAttribute::ePatch: // DisplayPatch(pNode); // break; case FbxNodeAttribute::eCamera: ProcessCamera(pNode, camera); break; case FbxNodeAttribute::eLight: ProcessLight(pNode, lights); break; //case FbxNodeAttribute::eLODGroup: // DisplayLodGroup(pNode); // break; } } /* DisplayUserProperties(pNode); DisplayTarget(pNode); DisplayPivotsAndLimits(pNode); DisplayTransformPropagation(pNode); DisplayGeometricTransform(pNode);*/ for(i = 0; i < pNode->GetChildCount(); i++) { ProcessNode(pNode->GetChild(i), meshs, lights, camera); } }