Skip to content

Commit 42ac0ba

Browse files
no message
1 parent 48c43a2 commit 42ac0ba

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

LSQuickScripts/Example Project/LSQuickScripts Examples/Public/LSQuickScripts/LSQuickScripts.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//@ui {"widget":"label", "label":"LSQuickScripts v2.10"}
1+
//@ui {"widget":"label", "label":"LSQuickScripts v2.11"}
22
//@ui {"widget":"label", "label":"By Max van Leeuwen"}
33
//@ui {"widget":"label", "label":"-"}
44
//@ui {"widget":"label", "label":"Place on top of scene ('On Awake')"}
@@ -298,7 +298,7 @@
298298
// -
299299
//
300300
//
301-
// remap(value [Number], low1 [Number], high1 [Number], low2 [Number], high2 [Number], clamped [Bool]) : Number
301+
// remap(value [Number], low1 [Number], high1 [Number], low2 (optional, default 0) [Number], high2 (optional, default 1) [Number], clamped (optional, default false) [Bool]) : Number
302302
// Returns value remapped from range low1-high1 to range low2-high2.
303303
//
304304
//
@@ -1437,6 +1437,8 @@ global.pickRandomDistributed = function(obj){
14371437

14381438

14391439
global.remap = function(value, low1, high1, low2, high2, clamped){
1440+
low2 = low2 == null ? 0 : low2;
1441+
high2 = high2 == null ? 1 : high2;
14401442
var remapped = low2 + (high2 - low2) * (value - low1) / (high1 - low1);
14411443
return clamped ? clamp(remapped, low2, high2) : remapped;
14421444
}

LSQuickScripts/LSQuickScripts.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//@ui {"widget":"label", "label":"LSQuickScripts v2.10"}
1+
//@ui {"widget":"label", "label":"LSQuickScripts v2.11"}
22
//@ui {"widget":"label", "label":"By Max van Leeuwen"}
33
//@ui {"widget":"label", "label":"-"}
44
//@ui {"widget":"label", "label":"Place on top of scene ('On Awake')"}
@@ -298,7 +298,7 @@
298298
// -
299299
//
300300
//
301-
// remap(value [Number], low1 [Number], high1 [Number], low2 [Number], high2 [Number], clamped [Bool]) : Number
301+
// remap(value [Number], low1 [Number], high1 [Number], low2 (optional, default 0) [Number], high2 (optional, default 1) [Number], clamped (optional, default false) [Bool]) : Number
302302
// Returns value remapped from range low1-high1 to range low2-high2.
303303
//
304304
//
@@ -1437,6 +1437,8 @@ global.pickRandomDistributed = function(obj){
14371437

14381438

14391439
global.remap = function(value, low1, high1, low2, high2, clamped){
1440+
low2 = low2 == null ? 0 : low2;
1441+
high2 = high2 == null ? 1 : high2;
14401442
var remapped = low2 + (high2 - low2) * (value - low1) / (high1 - low1);
14411443
return clamped ? clamp(remapped, low2, high2) : remapped;
14421444
}

0 commit comments

Comments
 (0)