aotrautils 0.0.241 → 0.0.244

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
 
2
2
 
3
- /*utils COMMONS library associated with aotra version : «1_29072022-2359 (02/08/2022-02:28:47)»*/
3
+ /*utils COMMONS library associated with aotra version : «1_29072022-2359 (18/08/2022-00:50:26)»*/
4
4
  /*-----------------------------------------------------------------------------*/
5
5
 
6
6
 
@@ -4827,7 +4827,7 @@ AOTRAUTILS_LIB_IS_LOADED=true;
4827
4827
 
4828
4828
 
4829
4829
 
4830
- /*utils CLIENT library associated with aotra version : «1_29072022-2359 (02/08/2022-02:28:47)»*/
4830
+ /*utils CLIENT library associated with aotra version : «1_29072022-2359 (18/08/2022-00:50:26)»*/
4831
4831
  /*-----------------------------------------------------------------------------*/
4832
4832
  /* ## Utility global methods in a browser (htmljs) client environment.
4833
4833
  *
@@ -11676,7 +11676,7 @@ createFusrodaClient=function(doOnClientReady, doOnDataReception, urlParam=null,
11676
11676
 
11677
11677
 
11678
11678
 
11679
- /*utils GEOMETRY library associated with aotra version : «1_29072022-2359 (02/08/2022-02:28:47)»*/
11679
+ /*utils GEOMETRY library associated with aotra version : «1_29072022-2359 (18/08/2022-00:50:26)»*/
11680
11680
  /*-----------------------------------------------------------------------------*/
11681
11681
 
11682
11682
 
@@ -12067,12 +12067,35 @@ Math.coerceAngle=function(angle,isRadians=false,isOnlyPositive=false){
12067
12067
  }
12068
12068
 
12069
12069
 
12070
- Math.getAnglesDiff=(angleSource,angleDestination,isDegrees=false)=>{
12071
- let result=angleDestination-angleSource;
12072
- const DEMI_CIRCLE_ANGLE=(isDegrees?180:Math.PI);
12073
- const WHOLE_ARC=(isDegrees?360:Math.TAU);
12074
- result= (result + DEMI_CIRCLE_ANGLE) % WHOLE_ARC - DEMI_CIRCLE_ANGLE
12075
- return result;
12070
+ Math.getAnglesDiffOnDemiCircle=(angleSourceParam, angleDestinationParam, isDegrees=false)=>{
12071
+
12072
+ // // DOES NOT WORK IN CERTAIN CASES :
12073
+ // let result=angleDestination-angleSource;
12074
+ // const DEMI_CIRCLE_ANGLE=(isDegrees?180:Math.PI);
12075
+ // const WHOLE_ARC=(isDegrees?360:Math.TAU);
12076
+ // result= (result + DEMI_CIRCLE_ANGLE) % WHOLE_ARC - DEMI_CIRCLE_ANGLE
12077
+ // return result;
12078
+ // // DOES NOT WORK IN CERTAIN CASES :
12079
+ // let angleDiff=(angleDestination-angleSource);
12080
+ // let result=((angleDiff+Math.PI)%Math.TAU)-Math.PI;
12081
+
12082
+
12083
+ // We do the treatment in radians only, and we convert back to degrees if necessary :
12084
+ let angleSource=(isDegrees?Math.toRadians(angleSourceParam):angleSourceParam);
12085
+ let angleDestination=(isDegrees?Math.toRadians(angleDestinationParam):angleDestinationParam);
12086
+ let angleDiff=Math.abs(angleDestination-angleSource);
12087
+ let direction;
12088
+ if(Math.PI<angleDiff){
12089
+ angleDiff=(Math.TAU-angleDiff);
12090
+ if(angleSourceParam<angleDestinationParam) direction=-1;
12091
+ else direction=1;
12092
+ }else{
12093
+ if(angleSourceParam<angleDestinationParam) direction=1;
12094
+ else direction=-1;
12095
+ }
12096
+
12097
+ let result=direction*(isDegrees?Math.toDegrees(angleDiff):angleDiff);
12098
+ return result;
12076
12099
  }
12077
12100
 
12078
12101
 
@@ -12881,7 +12904,7 @@ function rayVsUnitSphereClosestPoint(p, r) {
12881
12904
  // MUST REMAIN AT THE END OF THIS LIBRARY FILE !
12882
12905
 
12883
12906
  AOTRAUTILS_GEOMETRY_LIB_IS_LOADED=true;
12884
- /*utils SERVER library associated with aotra version : «1_29072022-2359 (02/08/2022-02:28:47)»*/
12907
+ /*utils SERVER library associated with aotra version : «1_29072022-2359 (18/08/2022-00:50:26)»*/
12885
12908
  /*-----------------------------------------------------------------------------*/
12886
12909
 
12887
12910
 
@@ -13233,7 +13256,7 @@ WebsocketImplementation={
13233
13256
 
13234
13257
  onClientLostListeners:[],
13235
13258
 
13236
- clientTimeoutMillis:20000,
13259
+ clientPingIntervalMillis:5000,
13237
13260
  // clientsSockets:[],
13238
13261
  serverSocket:serverSocket,
13239
13262
  receptionEntryPoints:[],
@@ -13434,7 +13457,7 @@ WebsocketImplementation={
13434
13457
  nodeServerInstance.send("protocol",{type:"ping"});
13435
13458
 
13436
13459
 
13437
- }, nodeServerInstance.clientTimeoutMillis);
13460
+ }, nodeServerInstance.clientPingIntervalMillis);
13438
13461
 
13439
13462
 
13440
13463
  // // OLD :
aotrautils/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aotrautils",
3
- "version": "0.0.241",
3
+ "version": "0.0.244",
4
4
  "main": "aotrautils.build.js",
5
5
  "description": "A library for vanilla javascript utils (client-side) used in aotra javascript CMS",
6
6
  "author": "Jeremie Ratomposon <info@alqemia.com> (https://alqemia.com)",
@@ -23,8 +23,6 @@
23
23
  "atob": "^2.1.2",
24
24
  "fs": "^0.0.1-security",
25
25
  "sjcl": "^1.0.8",
26
- "socket.io": "^4.5.1",
27
- "socket.io-client": "^4.5.1",
28
26
  "ws": "^8.1.0"
29
27
  }
30
28
  }