For these vehicles, I want to have multiple "skins" ( like in Quake 3 the players had multiple skins ).
Using setMaterial on an entity will set it to every submesh of the entity, which is not what I want. But to call setMaterial on the submeshes, my code will require more knowledge on the structure of the meshes, which would lead to some hardcoded setup.
My solution would be the following:
The "material" in the mesh file is just an understandable name, like "truck_chassis", "truck_glass", "truck_driver".
a skin file links these to the actual materials, e.g.
Code: Select all
default_skin="Red"
[Red]
truck_chassis="Truck/Red_chassis"
truck_glass="Truck/Glass"
truck_driver="Truck/Driver"
[Blue]
truck_chassis="Truck/Blue_chassis"
truck_glass="Truck/Glass"
truck_driver="Truck/Driver"
I'd like to hear your ideas on this before I start out implementing it. Do you have alternative solutions? or suggestions to make this solution better?