***********SOLVED*************
Thanks, marvelous!
Took the code from there and it works, now those elevators, doors etc also appear with the bsp but without the rotating, moving animations. Since you can get a reference to the meshes its very easy to make them animated like in the game. For those who were coping with the same problem: If you have static animation objects in the map
they are called func_bobbing , func_rotate etc. in gtkradiant. For making the func_bobbing (func_bobbing animates an object to move forth and back) objects appear, here is the code (put it into irrlicht exampe 16):
Code: Select all
quake3::tQ3EntityList &entityList = mesh->getEntityList();
quake3::IEntity search;
IMesh *static_animations = 0;
search.name = "func_bobbing"; // this is what we are looking for
s32 index = entityList.binary_search(search); // search in bsp file
if (index >= 0)
{
static_animations = mesh->getBrushEntityMesh(entityList[index]); // get the reference to the mesh
}
if (!static_animations)
{
device->drop();
return 1;
}
ISceneNode *static_animation_node = smgr->addMeshSceneNode(static_animations ); // add it to the node
core::vector3df closedpos = static_animation_node ->getPosition(); // you can get, set whatever you want with the node later...
As mentioned before, they are still not animated yet, but at least they appear as they should. With the mesh reference and node you can define the proper moving, rotating, oscilating, other behaviours.