Quote: "I assumed that the iUseScaling means that it would use the change in scale"
As far as my experience goes this is correct.
BUT: The problem here is that you refer to
dbObjectSizeY and not the objects
scale! The command you are using returns the objects size in the world measured in units, the scale is always entered as percentage of the objects original size (or its scaled size if you set the second parameter to 1).
I had this problem too when I was working on an editor.
You either need to keep track of the scale values for yourself by using an array or something, or you work just with sizes in units.
That's how I did it, and ended up with a SizeObject function.
Here's the code:
void SizeObject ( int id, float x, float y, float z )
{
float sx = dbObjectSizeX ( id ),
sy = dbObjectSizeY ( id ),
sz = dbObjectSizeZ ( id );
float sx2 = x / sx,
sy2 = y / sy,
sz2 = z / sz;
dbScaleObject ( id, sx2 * 100, sy2 * 100, sz2 * 100 );
}
That way you don't have to deal with percentages at all and just give the function your desired object size.
Now the plot thickens, the fps decreases, and the awesomeness goes through the roof.