I am making a 3D game in OpenGL from scratch. In this game I have a ship with stuff inside it. How can I attach the stuff to the ship in the CAD program and maintain that hierarchy in my own game?
For example say I have a fire extinguisher in my ship that mounts on the wall. There are two approaches both with problems.
Solution 1: Save fire extinguisher and ship as separate obj files.
Problem: How can I place the fire extinguisher in the proper place inside my ship in my game? With hundreds of objects manually placing them is completely infeasible. I want to arrange stuff in my CAD and load it into the game and be done.
Solution 2: Save fire extinguisher as its own group inside the ship obj file.
Problem: Now I can't reuse the fire extinguisher in other ships. The obj files for game assets will balloon out of control in size with new instances of reused sub-objects.
Is there some way I can specify the position of an external object? A 3d point in my ship obj file representing the origin of another obj model?