Originally Posted By: Uhrwerk
This explanation is perfectly fine for me. So, more precisely it is not a conversion that takes place but instead a hint to the compiler concerning the actual number representation format the number is encoded in, isn't it?

Correct, that's why a simple cast ala ((float)x) won't work here, because then the compiler would attempt to convert the variable into a float, which it already is. By taking the address of the variable and casting it to a float pointer, no conversion is done, and dereferencing a float pointer won't do any conversion either.

imho this is pretty dirty since it actively tries to "outsmart" the compilers typesystem. Wouldn't it be better to make at least the material skills float by default and then use an implicit type cast? (As far as I can see, they are expected to be float anyways)

Quote:
That explanation is probably not much better

It should be noted that there is no actual conversion happening (with the exception being var -> float), but instead that the functions are used to force a float into a var without any implicit conversion that would occur if one would just type 'x = y'


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com