diff --git a/scratch/math.ks b/scratch/math.ks new file mode 100644 index 0000000..dfd7b16 --- /dev/null +++ b/scratch/math.ks @@ -0,0 +1,9 @@ +@lazyglobal off. + +function Bound { + parameter minB. + parameter maxB. + parameter value. + + return min(max(value, minB), maxB). +} diff --git a/scratch/misc.ks b/scratch/misc.ks new file mode 100644 index 0000000..cf0fe7e --- /dev/null +++ b/scratch/misc.ks @@ -0,0 +1,15 @@ +// Check for various sensors and set appropriate global constants. +// Currently only checks for grav sensor, as that's the only one used by this library. +// global HAS_GRAV_SENSOR is false. +// function SensorCheck { +// local SensorList is 0. +// list SENSORS in SensorList. +// for s in SensorList { +// if s:type = "grav" { +// print "Gravometric sensor detected". +// set HAS_GRAV_SENSOR to true. +// return. +// } +// } +// set HAS_GRAV_SENSOR to false. +// }