Code: Select all
for(...)
{
//move the prev matrix to the next positions
subEnt->setCustomParameter(4, subEnt->getCustomParameter(0) );
subEnt->setCustomParameter(5, subEnt->getCustomParameter(1) );
subEnt->setCustomParameter(6, subEnt->getCustomParameter(2) );
subEnt->setCustomParameter(7, subEnt->getCustomParameter(3) );
//then fill the first 4 indexes with the current matrix
subEnt->setCustomParameter(0, Vector4( currWVP[0] ));
subEnt->setCustomParameter(1, Vector4( currWVP[1] ));
subEnt->setCustomParameter(2, Vector4( currWVP[2] ));
subEnt->setCustomParameter(3, Vector4( currWVP[3] ));
}
So, if i try an "if(subEnt->getCustomParameter(0))" it crashes when false, and if i leave it like now it will crash at startup when the parameters aren't initialised...
I prefer to avoid storing a temp matrix for performance reasons.
IMHO, the exception should be removed or there should be another method to know if a parameter exists...

