@babylonjs-toolkit/next 9.34.100 → 9.35.0

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.
Files changed (109) hide show
  1. package/lib/index.d.ts +80 -14
  2. package/lib/index.d.ts.map +1 -1
  3. package/lib/index.js +80 -14
  4. package/lib/leaderboardaroundpage.d.ts +5 -0
  5. package/lib/leaderboardaroundpage.d.ts.map +1 -0
  6. package/lib/leaderboardaroundpage.js +1 -0
  7. package/lib/leaderboardcallresult.d.ts +13 -0
  8. package/lib/leaderboardcallresult.d.ts.map +1 -0
  9. package/lib/leaderboardcallresult.js +1 -0
  10. package/lib/leaderboardclient.d.ts +95 -0
  11. package/lib/leaderboardclient.d.ts.map +1 -0
  12. package/lib/leaderboardclient.js +448 -0
  13. package/lib/leaderboardclientoptions.d.ts +12 -0
  14. package/lib/leaderboardclientoptions.d.ts.map +1 -0
  15. package/lib/leaderboardclientoptions.js +1 -0
  16. package/lib/leaderboardentriespage.d.ts +10 -0
  17. package/lib/leaderboardentriespage.d.ts.map +1 -0
  18. package/lib/leaderboardentriespage.js +1 -0
  19. package/lib/leaderboardentryview.d.ts +14 -0
  20. package/lib/leaderboardentryview.d.ts.map +1 -0
  21. package/lib/leaderboardentryview.js +1 -0
  22. package/lib/leaderboarderrorbody.d.ts +6 -0
  23. package/lib/leaderboarderrorbody.d.ts.map +1 -0
  24. package/lib/leaderboarderrorbody.js +1 -0
  25. package/lib/leaderboardfetch.d.ts +2 -0
  26. package/lib/leaderboardfetch.d.ts.map +1 -0
  27. package/lib/leaderboardfetch.js +1 -0
  28. package/lib/leaderboardkeeppolicy.d.ts +2 -0
  29. package/lib/leaderboardkeeppolicy.d.ts.map +1 -0
  30. package/lib/leaderboardkeeppolicy.js +1 -0
  31. package/lib/leaderboardmetadata.d.ts +5 -0
  32. package/lib/leaderboardmetadata.d.ts.map +1 -0
  33. package/lib/leaderboardmetadata.js +1 -0
  34. package/lib/leaderboardmetadatavalue.d.ts +4 -0
  35. package/lib/leaderboardmetadatavalue.d.ts.map +1 -0
  36. package/lib/leaderboardmetadatavalue.js +1 -0
  37. package/lib/leaderboardplayersession.d.ts +6 -0
  38. package/lib/leaderboardplayersession.d.ts.map +1 -0
  39. package/lib/leaderboardplayersession.js +1 -0
  40. package/lib/leaderboardplayerview.d.ts +7 -0
  41. package/lib/leaderboardplayerview.d.ts.map +1 -0
  42. package/lib/leaderboardplayerview.js +1 -0
  43. package/lib/leaderboardpostattempt.d.ts +6 -0
  44. package/lib/leaderboardpostattempt.d.ts.map +1 -0
  45. package/lib/leaderboardpostattempt.js +1 -0
  46. package/lib/leaderboardpublicboardview.d.ts +17 -0
  47. package/lib/leaderboardpublicboardview.d.ts.map +1 -0
  48. package/lib/leaderboardpublicboardview.js +1 -0
  49. package/lib/leaderboardrangequery.d.ts +7 -0
  50. package/lib/leaderboardrangequery.d.ts.map +1 -0
  51. package/lib/leaderboardrangequery.js +1 -0
  52. package/lib/leaderboardrefusalreason.d.ts +2 -0
  53. package/lib/leaderboardrefusalreason.d.ts.map +1 -0
  54. package/lib/leaderboardrefusalreason.js +1 -0
  55. package/lib/leaderboardscoreformat.d.ts +2 -0
  56. package/lib/leaderboardscoreformat.d.ts.map +1 -0
  57. package/lib/leaderboardscoreformat.js +1 -0
  58. package/lib/leaderboardscoreresult.d.ts +18 -0
  59. package/lib/leaderboardscoreresult.d.ts.map +1 -0
  60. package/lib/leaderboardscoreresult.js +1 -0
  61. package/lib/leaderboardscoresubmission.d.ts +8 -0
  62. package/lib/leaderboardscoresubmission.d.ts.map +1 -0
  63. package/lib/leaderboardscoresubmission.js +1 -0
  64. package/lib/leaderboardseasonview.d.ts +7 -0
  65. package/lib/leaderboardseasonview.d.ts.map +1 -0
  66. package/lib/leaderboardseasonview.js +1 -0
  67. package/lib/leaderboardsortorder.d.ts +2 -0
  68. package/lib/leaderboardsortorder.d.ts.map +1 -0
  69. package/lib/leaderboardsortorder.js +1 -0
  70. package/lib/leaderboardstorage.d.ts +6 -0
  71. package/lib/leaderboardstorage.d.ts.map +1 -0
  72. package/lib/leaderboardstorage.js +1 -0
  73. package/lib/leaderboardstoredplayer.d.ts +5 -0
  74. package/lib/leaderboardstoredplayer.d.ts.map +1 -0
  75. package/lib/leaderboardstoredplayer.js +1 -0
  76. package/lib/leaderboardsubmission.d.ts +8 -0
  77. package/lib/leaderboardsubmission.d.ts.map +1 -0
  78. package/lib/leaderboardsubmission.js +1 -0
  79. package/lib/leaderboardsubmissionrequest.d.ts +12 -0
  80. package/lib/leaderboardsubmissionrequest.d.ts.map +1 -0
  81. package/lib/leaderboardsubmissionrequest.js +1 -0
  82. package/lib/leaderboardsubmissionresponse.d.ts +7 -0
  83. package/lib/leaderboardsubmissionresponse.d.ts.map +1 -0
  84. package/lib/leaderboardsubmissionresponse.js +1 -0
  85. package/lib/leaderboardsubmitresult.d.ts +15 -0
  86. package/lib/leaderboardsubmitresult.d.ts.map +1 -0
  87. package/lib/leaderboardsubmitresult.js +1 -0
  88. package/lib/leaderboardtarget.d.ts +6 -0
  89. package/lib/leaderboardtarget.d.ts.map +1 -0
  90. package/lib/leaderboardtarget.js +1 -0
  91. package/lib/leaderboardtargetentry.d.ts +9 -0
  92. package/lib/leaderboardtargetentry.d.ts.map +1 -0
  93. package/lib/leaderboardtargetentry.js +1 -0
  94. package/lib/leaderboardtrustlevel.d.ts +2 -0
  95. package/lib/leaderboardtrustlevel.d.ts.map +1 -0
  96. package/lib/leaderboardtrustlevel.js +1 -0
  97. package/lib/leaderboardvariantdimension.d.ts +6 -0
  98. package/lib/leaderboardvariantdimension.d.ts.map +1 -0
  99. package/lib/leaderboardvariantdimension.js +1 -0
  100. package/lib/leaderboardwriteoutcome.d.ts +2 -0
  101. package/lib/leaderboardwriteoutcome.d.ts.map +1 -0
  102. package/lib/leaderboardwriteoutcome.js +1 -0
  103. package/lib/project.d.ts +15 -0
  104. package/lib/project.d.ts.map +1 -1
  105. package/lib/project.js +74 -14
  106. package/lib/scenemanager.d.ts +5 -0
  107. package/lib/scenemanager.d.ts.map +1 -1
  108. package/lib/scenemanager.js +46 -23
  109. package/package.json +17 -13
package/lib/project.js CHANGED
@@ -39,6 +39,7 @@ export const DRIVER_TURN_LEFT_PARAMETER = "TurnLeft";
39
39
  export const DRIVER_TURN_RIGHT_PARAMETER = "TurnRight";
40
40
  export const DRIVER_HAS_ITEM_PARAMETER = "hasItem";
41
41
  export const DRIVER_REVERSE_PARAMETER = "Reverse";
42
+ export const DRIVER_TRICK_TRIGGERS = ["JumpTrick1", "JumpTrick2", "GliderTrick"];
42
43
  export class KartDriverAnimation {
43
44
  constructor(kartRoot, driverAnimator, headNode) {
44
45
  this.pathError = Number.NaN;
@@ -49,6 +50,7 @@ export class KartDriverAnimation {
49
50
  this.headWrittenRotation = new BABYLON.Quaternion();
50
51
  this.hasWrittenHead = false;
51
52
  this.reverseWritten = false;
53
+ this.trickAnimationIndex = 0;
52
54
  this.lookRotation = new BABYLON.Quaternion();
53
55
  this.localAxis = new BABYLON.Vector3();
54
56
  this.inverseKartMatrix = new BABYLON.Matrix();
@@ -132,6 +134,12 @@ export class KartDriverAnimation {
132
134
  if (receiverCount > 0)
133
135
  this.reverseWritten = reversing;
134
136
  }
137
+ playTrick(animators) {
138
+ const triggerName = DRIVER_TRICK_TRIGGERS[this.trickAnimationIndex];
139
+ KartRigLookup.setTrigger(animators, triggerName);
140
+ this.trickAnimationIndex = (this.trickAnimationIndex + 1) % DRIVER_TRICK_TRIGGERS.length;
141
+ return triggerName;
142
+ }
135
143
  applySteeringWheel(wheel, restRotation) {
136
144
  if (wheel == null)
137
145
  return;
@@ -2260,6 +2268,7 @@ const PLAYER_ENGINE_VOLUME = 0.45;
2260
2268
  const PLAYER_ENGINE_GLIDING_VOLUME = 0.3;
2261
2269
  const OPPONENT_ENGINE_VOLUME = 1;
2262
2270
  const OPPONENT_ENGINE_GLIDING_VOLUME = 0.5;
2271
+ const ENGINE_RACE_END_FADE_PER_SECOND = 0.6;
2263
2272
  const OPPONENT_ENGINE_RECORDED_LEVEL_FACTOR = 0.54;
2264
2273
  const UNITY_LISTENER_BEHIND_METERS = 6.25;
2265
2274
  const UNITY_LISTENER_ABOVE_METERS = 2.3;
@@ -2776,6 +2785,7 @@ export class StandardKartAudio extends ScriptComponent {
2776
2785
  this.voiceSet = "player";
2777
2786
  this.driftAudioEnabled = true;
2778
2787
  this.engineAudioEnabled = true;
2788
+ this.raceCompleted = false;
2779
2789
  this.boostAudioEnabled = true;
2780
2790
  this.hopAudioEnabled = true;
2781
2791
  this.trickAudioEnabled = true;
@@ -2837,6 +2847,7 @@ export class StandardKartAudio extends ScriptComponent {
2837
2847
  this.engineTime = 0;
2838
2848
  this.enginePlayhead = new KartEnginePlayhead();
2839
2849
  this.enginePitch = 1;
2850
+ this.raceEndEngineVolume = null;
2840
2851
  this.idleLevel = 0;
2841
2852
  this.sceneEntryFinished = false;
2842
2853
  this.chargeRetriggerCount = 0;
@@ -3454,6 +3465,7 @@ export class StandardKartAudio extends ScriptComponent {
3454
3465
  }
3455
3466
  const speed = this.kart.getCurrentSpeed();
3456
3467
  const gliding = this.kart.isGliding();
3468
+ const engineLevel = this.stepEngineLevel(gliding, dt);
3457
3469
  this.tickIdleLevel(dt);
3458
3470
  if (this.idleVoice != null)
3459
3471
  this.idleVoice.setVolume(this.masterVolume * this.idleLevel);
@@ -3466,7 +3478,7 @@ export class StandardKartAudio extends ScriptComponent {
3466
3478
  this.idleVoice.stop();
3467
3479
  if (speed >= 5 && gliding !== true) {
3468
3480
  if (this.engineVoice != null && this.engineVoice.isPlaying() !== true && this.isVoiceAllowed("engine") === true) {
3469
- this.engineVoice.setVolume(this.masterVolume * this.engineVolume(gliding));
3481
+ this.engineVoice.setVolume(this.masterVolume * engineLevel);
3470
3482
  this.engineVoice.play();
3471
3483
  this.enginePlayhead.restart();
3472
3484
  }
@@ -3479,7 +3491,7 @@ export class StandardKartAudio extends ScriptComponent {
3479
3491
  this.applyEngineBand(dt, band, rate);
3480
3492
  }
3481
3493
  if (this.engineVoice != null) {
3482
- this.engineVoice.setVolume(this.masterVolume * this.engineVolume(gliding));
3494
+ this.engineVoice.setVolume(this.masterVolume * engineLevel);
3483
3495
  }
3484
3496
  if (speed < 10 && this.engineVoice != null)
3485
3497
  this.engineVoice.stop();
@@ -3579,6 +3591,20 @@ export class StandardKartAudio extends ScriptComponent {
3579
3591
  return (gliding === true) ? OPPONENT_ENGINE_GLIDING_VOLUME : OPPONENT_ENGINE_VOLUME;
3580
3592
  return (gliding === true) ? PLAYER_ENGINE_GLIDING_VOLUME : PLAYER_ENGINE_VOLUME;
3581
3593
  }
3594
+ stepEngineLevel(gliding, deltaSeconds) {
3595
+ if (this.isEngineRaceCompleted() !== true) {
3596
+ this.raceEndEngineVolume = null;
3597
+ return this.engineVolume(gliding);
3598
+ }
3599
+ const fadeStart = this.raceEndEngineVolume ?? this.engineVolume(gliding);
3600
+ this.raceEndEngineVolume = Math.max(0, fadeStart - ENGINE_RACE_END_FADE_PER_SECOND * deltaSeconds);
3601
+ return this.raceEndEngineVolume;
3602
+ }
3603
+ isEngineRaceCompleted() {
3604
+ if (this.raceCompleted === true)
3605
+ return true;
3606
+ return typeof this.kart.isRaceCompleted === "function" && this.kart.isRaceCompleted() === true;
3607
+ }
3582
3608
  applyVoiceSetSpatial() {
3583
3609
  const isOpponent = (this.voiceSet === "opponent");
3584
3610
  this.applySpatialRole(this.engineVoice, isOpponent ? OPPONENT_ENGINE_SPATIAL_BLEND : PLAYER_ENGINE_SPATIAL_BLEND);
@@ -4160,14 +4186,14 @@ export const COMPUTER_JUMP_PANEL_THRUST = 80000;
4160
4186
  export const COMPUTER_DRIFT_SPEED_LOSS = 15;
4161
4187
  export const JUMP_PANEL_ROTATE_SECONDS = 0.6;
4162
4188
  export const JUMP_PANEL_ROTATE_RATE = 1;
4163
- export const TRICK_MIN_SPEED = 40;
4189
+ export const TRICK_MIN_SPEED = 30;
4164
4190
  export const TRICK_SECONDS = 0.3;
4165
4191
  export const TRICK_FORCE_START = 6500;
4166
4192
  export const TRICK_FORCE_DECAY = 300;
4167
4193
  export const TRICK_DECAY_STEP = 0.01;
4168
4194
  export const TRICK_FORCE_FLOOR = 300;
4169
4195
  export const TRICK_LANDING_BOOST = 0.9;
4170
- export const GLIDER_TRICK_SPEED = 60;
4196
+ export const GLIDER_TRICK_SPEED = 50;
4171
4197
  export const GLIDER_TRICK_OPEN_DELAY = 0.45;
4172
4198
  export const FALL_RESCUE_MIN_SINK_SPEED = 12;
4173
4199
  export const ANTI_GRAVITY_LOST_SECONDS = 0.3;
@@ -4536,7 +4562,11 @@ export class StandardKartController extends ScriptComponent {
4536
4562
  this.trickTime = -1;
4537
4563
  this.trickArmed = false;
4538
4564
  this.trickPerformed = false;
4565
+ this.trickLeftGround = false;
4566
+ this.trickGroundContact = false;
4539
4567
  this.trickPressed = false;
4568
+ this.trickPressQueued = false;
4569
+ this.lastTrickTrigger = null;
4540
4570
  this.verticalAccumulates = false;
4541
4571
  this.inputPitch = 0;
4542
4572
  this.chassisBody = null;
@@ -5341,10 +5371,6 @@ export class StandardKartController extends ScriptComponent {
5341
5371
  return false;
5342
5372
  if (this.trickTime >= 0)
5343
5373
  return false;
5344
- if (this.trickPerformed === true)
5345
- return false;
5346
- if (this.probeGrounded === true)
5347
- return false;
5348
5374
  if (this.trickArmed !== true)
5349
5375
  return false;
5350
5376
  if (this.REALCURRENTSPEED <= TRICK_MIN_SPEED)
@@ -5353,13 +5379,25 @@ export class StandardKartController extends ScriptComponent {
5353
5379
  return false;
5354
5380
  this.trickTime = 0;
5355
5381
  this.trickPerformed = true;
5382
+ this.trickLeftGround = false;
5383
+ this.trickArmed = false;
5356
5384
  return true;
5357
5385
  }
5386
+ trackTrickGroundContact() {
5387
+ const touchedGround = this.trickGroundContact;
5388
+ this.trickGroundContact = false;
5389
+ if (this.trickPerformed !== true || this.trickLeftGround === true)
5390
+ return;
5391
+ if (touchedGround !== true || this.probeGrounded !== true)
5392
+ this.trickLeftGround = true;
5393
+ }
5358
5394
  tickTrick(dt) {
5359
5395
  if (this.trickTime < 0)
5360
5396
  return;
5361
5397
  if (this.trickTime >= TRICK_SECONDS) {
5362
5398
  this.trickTime = -1;
5399
+ if (this.trickLeftGround !== true)
5400
+ this.clearTrickState();
5363
5401
  return;
5364
5402
  }
5365
5403
  const force = Math.max(TRICK_FORCE_FLOOR, TRICK_FORCE_START - TRICK_FORCE_DECAY * (this.trickTime / TRICK_DECAY_STEP));
@@ -5367,10 +5405,20 @@ export class StandardKartController extends ScriptComponent {
5367
5405
  this.trickTime += dt;
5368
5406
  }
5369
5407
  landTrick() {
5370
- if (this.trickPerformed === true)
5371
- this.floorBoost(TRICK_LANDING_BOOST, EKartBoostSource.TrickLanding);
5408
+ if (this.trickPerformed !== true || this.trickLeftGround !== true)
5409
+ return;
5410
+ this.floorBoost(TRICK_LANDING_BOOST, EKartBoostSource.TrickLanding);
5411
+ this.clearTrickState();
5412
+ }
5413
+ playTrickAnimation() {
5414
+ if (this.driverAnimation == null)
5415
+ return;
5416
+ this.lastTrickTrigger = this.driverAnimation.playTrick(this.getRigAnimators());
5417
+ }
5418
+ clearTrickState() {
5372
5419
  this.trickPerformed = false;
5373
5420
  this.trickTime = -1;
5421
+ this.trickLeftGround = false;
5374
5422
  }
5375
5423
  enterGliderSection(volume) {
5376
5424
  if (this.gliderEnabled !== true)
@@ -5713,9 +5761,12 @@ export class StandardKartController extends ScriptComponent {
5713
5761
  if (tag === "Ground" || tag === "Dirt") {
5714
5762
  this.FellInWater = false;
5715
5763
  this.outOfBounds = false;
5716
- this.landTrick();
5717
5764
  this.closeGlider();
5718
5765
  }
5766
+ if (tag === "Ground" || tag === "Dirt" || tag === "AntiGravity") {
5767
+ this.trickGroundContact = true;
5768
+ this.landTrick();
5769
+ }
5719
5770
  if (tag === "Ground" || tag === "AntiGravity") {
5720
5771
  this.grounded = true;
5721
5772
  if (tag === "Ground" && this.JUMP_PANEL === true) {
@@ -5884,9 +5935,11 @@ export class StandardKartController extends ScriptComponent {
5884
5935
  : this.assignedVelocity.y * 0.98;
5885
5936
  }
5886
5937
  this.tickJumpPanel(dt);
5887
- if (this.inputTrick === true && this.trickPressed !== true)
5888
- this.tryTrick();
5889
- this.trickPressed = this.inputTrick;
5938
+ this.trackTrickGroundContact();
5939
+ const trickPress = this.trickPressQueued;
5940
+ this.trickPressQueued = false;
5941
+ if (trickPress === true && this.tryTrick() === true)
5942
+ this.playTrickAnimation();
5890
5943
  this.tickTrick(dt);
5891
5944
  this.tickGliderImpulse(dt);
5892
5945
  this.applyAirForce(dt);
@@ -6725,6 +6778,7 @@ export class StandardKartController extends ScriptComponent {
6725
6778
  this.pendingAcceleration.setAll(0);
6726
6779
  this.clearWallContacts();
6727
6780
  this.resetDepthWater();
6781
+ this.clearTrickState();
6728
6782
  this.PlayerBeingMoved = false;
6729
6783
  this.respawnStage = 2;
6730
6784
  this.respawnTimer = 0.5;
@@ -6969,6 +7023,7 @@ export class StandardKartController extends ScriptComponent {
6969
7023
  }
6970
7024
  else {
6971
7025
  this.assignedVelocity.setAll(0);
7026
+ this.trickPressQueued = false;
6972
7027
  }
6973
7028
  this.applyDriftDownforce();
6974
7029
  this.probeGround();
@@ -7030,6 +7085,9 @@ export class StandardKartController extends ScriptComponent {
7030
7085
  this.inputBraking = braking;
7031
7086
  this.inputSteering = steering;
7032
7087
  this.inputDrifting = drifting;
7088
+ if (trick === true && this.trickPressed !== true)
7089
+ this.trickPressQueued = true;
7090
+ this.trickPressed = trick;
7033
7091
  this.inputTrick = trick;
7034
7092
  this.inputPitch = pitch;
7035
7093
  }
@@ -7101,6 +7159,7 @@ export class StandardKartController extends ScriptComponent {
7101
7159
  this.inputBraking = false;
7102
7160
  this.inputDrifting = false;
7103
7161
  this.inputTrick = false;
7162
+ this.trickPressQueued = false;
7104
7163
  this.currentspeed = this.autoDrive.speed;
7105
7164
  const target = this.autoDrive.targetProvider();
7106
7165
  if (target == null) {
@@ -7541,6 +7600,7 @@ export class StandardKartController extends ScriptComponent {
7541
7600
  getJumpPanelRotateTime() { return this.jumpPanelRotateTime; }
7542
7601
  isTricking() { return this.trickTime >= 0; }
7543
7602
  getTrickTime() { return this.trickTime; }
7603
+ getLastTrickTrigger() { return this.lastTrickTrigger; }
7544
7604
  isTrickArmed() { return this.trickArmed; }
7545
7605
  isTrickPending() { return this.trickPerformed; }
7546
7606
  getWheelSteer() { return this.wheelSteer; }
@@ -15925,6 +15925,10 @@ export declare class LightProbeNetwork extends ScriptComponent {
15925
15925
  private registerDynamic;
15926
15926
  private static WarnLightmappedMaterial;
15927
15927
  detach(mesh: AbstractMesh): void;
15928
+ private detachDisposed;
15929
+ private releaseMesh;
15930
+ private removeDynamicEntry;
15931
+ private dropDisposedEntries;
15928
15932
  sampleMeshNow(mesh: AbstractMesh): number;
15929
15933
  private sampleDynamic;
15930
15934
  private ensureCapacity;
@@ -16921,6 +16925,7 @@ export interface GameServerInfo {
16921
16925
  protocolVersion: number;
16922
16926
  transports: GameServerTransports;
16923
16927
  authRequired: boolean;
16928
+ discordSignIn?: boolean;
16924
16929
  }
16925
16930
  export interface GameServerTransports {
16926
16931
  webSocket: boolean;