- fbx: create dummy root node and assign converted meshes. This is a temporary solution to be able to test mesh reading.
parent
524285c90d
commit
7a3e3b1353
|
@ -64,7 +64,29 @@ public:
|
|||
: out(out)
|
||||
, doc(doc)
|
||||
{
|
||||
ConvertRootNode();
|
||||
//ConvertRootNode();
|
||||
|
||||
// hack to process all meshes
|
||||
BOOST_FOREACH(const ObjectMap::value_type& v,doc.Objects()) {
|
||||
|
||||
const Object* ob = v.second->Get();
|
||||
if(!ob) {
|
||||
continue;
|
||||
}
|
||||
const MeshGeometry* geo = dynamic_cast<const MeshGeometry*>(ob);
|
||||
if(geo) {
|
||||
ConvertMesh(*geo);
|
||||
}
|
||||
}
|
||||
|
||||
// dummy root node
|
||||
out->mRootNode = new aiNode();
|
||||
out->mRootNode->mNumMeshes = static_cast<unsigned int>(meshes.size());
|
||||
out->mRootNode->mMeshes = new unsigned int[meshes.size()];
|
||||
for(unsigned int i = 0; i < out->mRootNode->mNumMeshes; ++i) {
|
||||
out->mRootNode->mMeshes[i] = i;
|
||||
}
|
||||
|
||||
TransferDataToScene();
|
||||
}
|
||||
|
||||
|
|
|
@ -352,7 +352,7 @@ const Object* LazyObject::Get()
|
|||
if (!strncmp(obtype,"Geometry",static_cast<size_t>(key.end()-key.begin()))) {
|
||||
|
||||
if (!strcmp(classtag.c_str(),"Mesh")) {
|
||||
object = new MeshGeometry(element,name,settings);
|
||||
object.reset(new MeshGeometry(element,name,settings));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -91,7 +91,7 @@ class Object
|
|||
public:
|
||||
|
||||
Object(const Element& element, const std::string& name);
|
||||
~Object();
|
||||
virtual ~Object();
|
||||
|
||||
public:
|
||||
|
||||
|
|
Loading…
Reference in New Issue