i don't understand why this has to be this hard.
Cant it just create it automatically in world.init() ?
Isn't it just an object that uses the parent objects matrix?
well i guess this is not too hard.. im still a bit confused about the draw calls.
I guess i shouldn't call the p.draw() inside drawPrepare()?
Would the correct thing to do be that i create a draw() for items and call them in the main draw loop? also i probably will have to check in which mode they should be called?
Code:
// add custom children
for(Game::ObjParams *cur=&obj; cur; cur=cur->base()) // check 'obj' and all its bases
FREPA(cur->sub_obj) // for each sub-object in 'cur'
{
Game::ObjParams &objs=cur->sub_obj[i]; // get object
Game::World.objCreate(objs,Matrix(obj.scale(),obj.matrix.pos));
}
This seems to create it to the correct position and matrix.
Only thing is now that i need a way to point to that object so i can update its position.