Game Development Community

TSStatics and material instances

by Konrad Kiss · in Torque Game Engine Advanced · 10/16/2008 (1:26 pm) · 2 replies

Hi

I am creating a TSStatic derivative that could have material swapping on a per instance basis. I need this without the GameBase overhead. I've hit a snag, and I am begining to believe that unlike shapes and materials, statics do not have a separate material per instance matrix, instead, a material is directly assigned to a TSStatic.

I've realized that while trying to change the material of a single TSStatic instance, all instances of the given static had the material changed. This same approach has worked with TSShape derivatives, but not with TSStatic. It looks as if the solution is the same, so it's a very likely possibility that I might have messed something up.

I've been working on this all day, and I'm about to drop dead - I was hoping that a fresh mind could enlighten me. Any response is much appreciated!

Konrad.

#1
10/17/2008 (3:04 am)
One night later I see that TSStatic has an mShapeInstance which is the key to what I'm trying to do.
#2
10/17/2008 (4:04 am)
Just for the record, the final solution was to clone the material list (cloneMaterialList) for each static if the materialList was not owned by the static (if it was a client object, server would not work with materials anyway). Thanks to anyone giving this a thought.