floatd(var a,var b)
returns float(a)/float(b). Used for increasing the precision of
var -> float conversions for small values.
Parameters:
a - any var.
b- any var.
Return:
a/b
converted to a 32 bit IEEE floating point value, but still with type varSpeed:
F
ast
Remarks:
In lite-C a var is automatically converted when assigned to a float variable,
but this function is still useful if a var variable is to be interpreted
as a float (as in matrix skills used for shaders).
Example:
function mtl_shift_texture()
{
mtl.skill1 += time_step; // shift texture left
mtl.matrix41 = floatd(mtl.skill1,1000); // change texture u offset by 0.001 units
}
See also:
floatv, floatr, fixed