fix bug in mesh scaling
use struct material to contain a union of the various materials instead of passing around void *