I have modeled a mesh complete with smoke and fire coming out of it . I have exported the inn and the particle meshes (the fire and smoke) into a library using b2cs.
Now the issue is that while I am able to load the inn (a genmesh) into another map I can't seem to get the smoke and fire (particle meshes) to load, at any location in the map.
I have used minimal code to do this ofcourse:
vfs->PushDir ();
vfs->ChDir ("/Glob/globInn");
if (!loader->LoadLibraryFile ("library"))
{
csReport (object_reg, CS_REPORTER_SEVERITY_ERROR,
"globulation.error",
"Error loading inn!");
return false;
}
vfs->PopDir ();
iMeshFactoryWrapper* iSmokeFact = engine->FindMeshFactory ("partsmoke");
smoke = engine->CreateMeshWrapper (iSmokeFact, "chimmneySmoke", room, csVector3 (3, 2, 3));
smoke->SetZBufMode (CS_ZBUF_TEST);
smoke->SetRenderPriority (engine->GetObjectRenderPriority ());
This doesn't do the job as it does for genmesh. Evidently I am missing some particle system specific initialization. I can't figure out what. I have been digging into the documentation as well as code in the mazing tutorial as well as walktest app. I have also checked out this related previous post:
http://www.crystalspace3d.org/forum/index.php/topic,968.0.htmlAll the aforementioned sources (except walktest) talk about progrmatically creating the mesh factories and getting hold of the factory state to modify it. Clearly, I dont want to do that. I can't make out what to do to load from a library. As for the walktest source code, well, I just don't know where to start looking. As far as I can see the only files which mention particles are the walkdemo.cpp and walkcmd.cpp . Obviously,walktest does load the particle objects from my library but I am at a loss trying to find the code snippet that does this from amidst the massive tangle of code.
Is the problem that I am not adding an emitter to the particle system? But then, the mesh factory xml file seems to have the emitter detailed in it. How must I pass this emitter to the particle system?
If this isnt it, then what am I doing wrong?
CS Version 1.2.1