@babylonjs/core 6.1.0 → 6.2.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 (33) hide show
  1. package/Collisions/pickingInfo.js +24 -9
  2. package/Collisions/pickingInfo.js.map +1 -1
  3. package/Engines/Extensions/engine.rawTexture.js +1 -0
  4. package/Engines/Extensions/engine.rawTexture.js.map +1 -1
  5. package/Engines/engine.d.ts +90 -0
  6. package/Engines/thinEngine.js +2 -2
  7. package/Engines/thinEngine.js.map +1 -1
  8. package/Gamepads/gamepadManager.js +2 -4
  9. package/Gamepads/gamepadManager.js.map +1 -1
  10. package/Materials/Node/nodeMaterialConnectionPointCustomObject.d.ts +1 -1
  11. package/Materials/Node/nodeMaterialConnectionPointCustomObject.js +3 -1
  12. package/Materials/Node/nodeMaterialConnectionPointCustomObject.js.map +1 -1
  13. package/Materials/Textures/renderTargetTexture.js +1 -1
  14. package/Materials/Textures/renderTargetTexture.js.map +1 -1
  15. package/Materials/material.js +1 -1
  16. package/Materials/material.js.map +1 -1
  17. package/Meshes/abstractMesh.js +4 -1
  18. package/Meshes/abstractMesh.js.map +1 -1
  19. package/Misc/dumpTools.js +1 -1
  20. package/Misc/dumpTools.js.map +1 -1
  21. package/Misc/tools.d.ts +5 -4
  22. package/Misc/tools.js +35 -6
  23. package/Misc/tools.js.map +1 -1
  24. package/Physics/v2/Plugins/havokPlugin.d.ts +4 -4
  25. package/Physics/v2/Plugins/havokPlugin.js +23 -5
  26. package/Physics/v2/Plugins/havokPlugin.js.map +1 -1
  27. package/Physics/v2/physicsAggregate.d.ts +5 -1
  28. package/Physics/v2/physicsAggregate.js +4 -4
  29. package/Physics/v2/physicsAggregate.js.map +1 -1
  30. package/Physics/v2/physicsBody.d.ts +5 -1
  31. package/Physics/v2/physicsBody.js +5 -1
  32. package/Physics/v2/physicsBody.js.map +1 -1
  33. package/package.json +1 -1
@@ -1,11 +1,9 @@
1
1
  import { Quaternion, Vector3 } from "../../../Maths/math.vector";
2
- import { PhysicsShapeType, PhysicsMotionType } from "../IPhysicsEnginePlugin";
3
- import type { PhysicsShapeParameters, PhysicsConstraintMotorType, IPhysicsEnginePluginV2, PhysicsMassProperties, IPhysicsCollisionEvent } from "../IPhysicsEnginePlugin";
2
+ import { PhysicsShapeType, PhysicsMotionType, PhysicsConstraintMotorType, PhysicsConstraintAxis, PhysicsConstraintAxisLimitMode } from "../IPhysicsEnginePlugin";
3
+ import type { PhysicsShapeParameters, IPhysicsEnginePluginV2, PhysicsMassProperties, IPhysicsCollisionEvent } from "../IPhysicsEnginePlugin";
4
4
  import type { PhysicsBody } from "../physicsBody";
5
5
  import type { PhysicsConstraint } from "../physicsConstraint";
6
6
  import type { PhysicsMaterial } from "../physicsMaterial";
7
- import { PhysicsConstraintAxis } from "../IPhysicsEnginePlugin";
8
- import { PhysicsConstraintAxisLimitMode } from "../IPhysicsEnginePlugin";
9
7
  import { PhysicsShape } from "../physicsShape";
10
8
  import type { BoundingBox } from "../../../Culling/boundingBox";
11
9
  import type { TransformNode } from "../../../Meshes/transformNode";
@@ -679,6 +677,8 @@ export declare class HavokPlugin implements IPhysicsEnginePluginV2 {
679
677
  private _v3ToBvecRef;
680
678
  private _bVecToV3;
681
679
  private _bQuatToV4;
680
+ private _constraintMotorTypeToNative;
681
+ private _nativeToMotorType;
682
682
  private _materialCombineToNative;
683
683
  private _constraintAxisToNative;
684
684
  private _nativeToLimitMode;
@@ -1,9 +1,7 @@
1
1
  import { Matrix, Quaternion, TmpVectors, Vector3 } from "../../../Maths/math.vector.js";
2
- import { PhysicsShapeType, PhysicsConstraintType, PhysicsMotionType } from "../IPhysicsEnginePlugin.js";
2
+ import { PhysicsShapeType, PhysicsConstraintType, PhysicsMotionType, PhysicsConstraintMotorType, PhysicsConstraintAxis, PhysicsConstraintAxisLimitMode, } from "../IPhysicsEnginePlugin.js";
3
3
  import { Logger } from "../../../Misc/logger.js";
4
4
  import { PhysicsMaterialCombineMode } from "../physicsMaterial.js";
5
- import { PhysicsConstraintAxis } from "../IPhysicsEnginePlugin.js";
6
- import { PhysicsConstraintAxisLimitMode } from "../IPhysicsEnginePlugin.js";
7
5
  import { PhysicsShape } from "../physicsShape.js";
8
6
  import { Mesh } from "../../../Meshes/mesh.js";
9
7
  import { VertexBuffer } from "../../../Buffers/buffer.js";
@@ -384,12 +382,14 @@ export class HavokPlugin {
384
382
  for (let i = pluginInstancesCount; i < instancesCount; i++) {
385
383
  this._hknp.HP_Body_SetShape(body._pluginDataInstances[i].hpBodyId, firstBodyShape);
386
384
  this._internalUpdateMassProperties(body._pluginDataInstances[i]);
385
+ this._bodies.set(body._pluginDataInstances[i].hpBodyId[0], { body: body, index: i });
387
386
  }
388
387
  }
389
388
  else if (instancesCount < pluginInstancesCount) {
390
389
  const instancesToRemove = pluginInstancesCount - instancesCount;
391
390
  for (let i = 0; i < instancesToRemove; i++) {
392
391
  const hkbody = body._pluginDataInstances.pop();
392
+ this._bodies.delete(hkbody.hpBodyId[0]);
393
393
  this._hknp.HP_World_RemoveBody(this.world, hkbody.hpBodyId);
394
394
  this._hknp.HP_Body_Release(hkbody.hpBodyId);
395
395
  }
@@ -1342,7 +1342,7 @@ export class HavokPlugin {
1342
1342
  *
1343
1343
  */
1344
1344
  setAxisMotorType(constraint, axis, motorType) {
1345
- this._hknp.HP_Constraint_SetAxisMotorType(constraint._pluginData, this._constraintAxisToNative(axis), motorType);
1345
+ this._hknp.HP_Constraint_SetAxisMotorType(constraint._pluginData, this._constraintAxisToNative(axis), this._constraintMotorTypeToNative(motorType));
1346
1346
  }
1347
1347
  /**
1348
1348
  * Gets the motor type of the specified axis of the given constraint.
@@ -1352,7 +1352,7 @@ export class HavokPlugin {
1352
1352
  *
1353
1353
  */
1354
1354
  getAxisMotorType(constraint, axis) {
1355
- return this._hknp.HP_Constraint_GetAxisMotorType(constraint._pluginData, this._constraintAxisToNative(axis))[1];
1355
+ return this._nativeToMotorType(this._hknp.HP_Constraint_GetAxisMotorType(constraint._pluginData, this._constraintAxisToNative(axis))[1]);
1356
1356
  }
1357
1357
  /**
1358
1358
  * Sets the target of an axis motor of a constraint.
@@ -1535,6 +1535,24 @@ export class HavokPlugin {
1535
1535
  _bQuatToV4(q) {
1536
1536
  return [q._x, q._y, q._z, q._w];
1537
1537
  }
1538
+ _constraintMotorTypeToNative(motorType) {
1539
+ switch (motorType) {
1540
+ case PhysicsConstraintMotorType.POSITION:
1541
+ return this._hknp.ConstraintMotorType.POSITION;
1542
+ case PhysicsConstraintMotorType.VELOCITY:
1543
+ return this._hknp.ConstraintMotorType.VELOCITY;
1544
+ }
1545
+ return this._hknp.ConstraintMotorType.NONE;
1546
+ }
1547
+ _nativeToMotorType(motorType) {
1548
+ switch (motorType) {
1549
+ case this._hknp.ConstraintMotorType.POSITION:
1550
+ return PhysicsConstraintMotorType.POSITION;
1551
+ case this._hknp.ConstraintMotorType.VELOCITY:
1552
+ return PhysicsConstraintMotorType.VELOCITY;
1553
+ }
1554
+ return PhysicsConstraintMotorType.NONE;
1555
+ }
1538
1556
  _materialCombineToNative(mat) {
1539
1557
  switch (mat) {
1540
1558
  case PhysicsMaterialCombineMode.GEOMETRIC_MEAN: