Hi,
i'm sure there is an easy answer to this but I am finding it particularly difficult. I want to store mesh data in a static array of C++ classes but when I allocate to each element in the array it sets all the elements in the array with the same value. I initialize the array as follows:
mMeshes = new AnimableMesh[mNumMeshes];
.........
for( int i = 0; i < mNumMeshes; i++ )
{
mMeshes[i].SetMaterial(materialName); // this sets the material but all elements are set to this value
.....
}
Normally I would use the C malloc function which works fine but it isn't ideal for class initialization.
EDIT: I declare the class array as an instance variable in the class definition.
Thanks.