george68 Posted January 4, 2016 Share Posted January 4, 2016 Hi, I cannot access all the entities in the start.map file using the following code: . . . bool App::Start() { window = Window::Create("Hello World", 100, 100, 1024, 768, Window::Titlebar); context = Context::Create(window); world = World::Create(); if (Map::Load("Maps/start.map")) { for (std::list<Entity *>::iterator it=world->entities.begin(); it != world->entities.end(); it++) { Entity *ent = *it; if (ent) { int class_id=ent->GetClass(); std::string class_name=ent->GetClassName(); std::string keyval=ent->GetKeyValue("name"); } } } return true; } . . . Although the class_name is "Model" the keyval is an empty string "" Also iterating the Map I found only one model instead of two, a directional light and a camera I don't know what I am doing wrong. Quote Link to comment Share on other sites More sharing options...
Ma-Shell Posted January 4, 2016 Share Posted January 4, 2016 Hi, are the missing models imported meshes or are they brushes (i.e. simple forms created in the editor, like boxes, spheres, etc)? In the latter case, it is important to know, that they get collapsed, so that they are only one model, which has several advantages with respect to performance. You can prevent them from being collapsed by either giving them a mass =/= 0 or by assigning a script (just a dummy one is enough). Quote Link to comment Share on other sites More sharing options...
george68 Posted January 4, 2016 Author Share Posted January 4, 2016 They are brushes. I don't know how to convert them to meshes using the editor. I am new to the editor and the leadwerks in general. I don't think they are one model. It is the map that comes with the default installation. Quote Link to comment Share on other sites More sharing options...
macklebee Posted January 4, 2016 Share Posted January 4, 2016 They are brushes. I don't know how to convert them to meshes using the editor. I am new to the editor and the leadwerks in general. I don't think they are one model. It is the map that comes with the default installation. Thats what Ma-Shell is telling you. If its a CSG object and it doesn't have a mass >0 or a script attached to it, it will be collapsed into one object for performance increase (behind the scenes automatically). If you want to be able to list the CSG created object via code as you have shown above, then give it a mass greater than 0 or add a script to it in the Editor. Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
george68 Posted January 5, 2016 Author Share Posted January 5, 2016 Its clear now. It works as expect it. Thank you both Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.