damn... you are right
i just read that VLA's (variable-length-arrays) arent allowed in structs either...
i guess have to go with the fixed array length and shipping unused array-elements around
this app is for my c++ anim system and i want my vertex to have up to MAX_BONES_PER_VERT
bonesID's stored for vertex blending purposes
is it worth to allocate each bonesID in my vertex-class or simply allocate the whole vertex (and its members) only once?
kung, you are the yoda in here
EDIT: maybe i can go with sth like that:
PHP Code:
class myVert
{
public:
float* weights;
unsigned char* bones;
unsigned char numInfluencers;
//constructor
myVert( const unsigned char count , const unsigned char* bonesArray = NULL , const float* weigthsArray = NULL )
{
numInfluencers = count;
bones = new unsigned char [numInfluencers];
weights = new float [numInfluencers];
for( int i = 0 ; i < numInfluencers ; i++ )
{
bones[i] = bonesArray[i];
weights[i] = weigthsArray[i];
}
}
~myVert() //destructor
{
delete [] bones;
delete [] weights;
}
};