Game Development Community

All InteriorInstance sharing the same Interior?

by Huan Li · in Torque Game Engine Advanced · 05/08/2009 (12:47 am) · 2 replies

Recently, I was adapting Gareth Fouche's : Dynamic Skins & Material Swapping Resource to Interior system. The skin can be swapped and networked properly, but not works the way exactly what I expected. Here's the problem:
Say there are 2 InteriorInstances using the same DIF model, if I change one's material, the other also changed. The materialList was stored in Interior but not InteriorInstance.
Do all instances of the same DIF share the same interior info?
So any one could show me some hints on the inner working of TGEA's interior/interiorinstance/interiorRes?

#1
05/08/2009 (2:51 pm)
That's right, interiorInstances share a material list. This is done so because Interiors weren't never supposed to be skinned, while each TSShapeInstance stores a copy of their material list so they can support skins.

You'd need to have InteriorInstance clone the InteriorRes material list during creation, and use that when rendering.
#2
05/10/2009 (5:44 pm)
Thanks @Manoel, that helps.