Showing the changes to notes (1 of 2 files). Show all
Unified · Split
| @@ -46,8 +46,13 @@ to be in BETA for some time (as we add more and also teach using chAI in · 45 unmodified lines | |||
| 46 | - (added) Math functions | 46 | - (added) Math functions |
| 47 | float map( float value, float x1, float y1, | 47 | float map( float value, float x1, float y1, |
| 48 | float x2, float y2 ); | 48 | float x2, float y2 ); |
| 49 | Map 'value' from range [x1,y1] into range [x2,y2]; | 49 | Map 'value' from range [x1,y1] into range [x2,y2]; 'value' |
| 50 | 'value' will be clamped to [x1,y1] if outside range. | 50 | can be outside range[x1,y1]. |
| 51 | float map2( float value, float x1, float y1, | ||
| 52 | float x2, float y2 ); | ||
| 53 | Map 'value' from range [x1,y1] into range [x2,y2]; 'value' | ||
| 54 | will be clamped to [x1,y1] if outside range. | ||
| 55 | (Math.remap() is the same as Math.map2()) | ||
| 51 | float clampi( int value, int min, int max ); | 56 | float clampi( int value, int min, int max ); |
| 52 | Clamp integer 'value' to range [min, max]. | 57 | Clamp integer 'value' to range [min, max]. |
| 53 | float clampf( float value, float min, float max ); | 58 | float clampf( float value, float min, float max ); |