@hellpig/anarchy-engine 22.0.3 → 22.0.4

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 (32) hide show
  1. package/dist/Controls/Models/TFpsControlsWrapper.d.ts +1 -1
  2. package/dist/Controls/Models/TOrbitControlsWrapper.d.ts +1 -1
  3. package/dist/Controls/Wrappers/FpsControls/FpsControlsAccessors.d.ts +1 -1
  4. package/dist/Controls/Wrappers/OrbitControls/OrbitControlsAccessors.d.ts +1 -1
  5. package/dist/Intersections/Models/TIntersectionsDirectionWatcher.d.ts +1 -1
  6. package/dist/Material/Mixins/WithMaterial.d.ts +1 -1
  7. package/dist/Material/Mixins/WithMaterial.js.map +1 -1
  8. package/dist/Material/Models/TMaterialParamsOptions.d.ts +1 -4
  9. package/dist/Math/Utils/AnglesUtils.js +1 -1
  10. package/dist/Math/Utils/AnglesUtils.js.map +1 -1
  11. package/dist/Models3d/Models/TModel3dParams.d.ts +1 -1
  12. package/dist/Models3d/Models/TModels3dLoader.d.ts +1 -1
  13. package/dist/Models3d/Models/TModels3dResourceAsyncRegistry.d.ts +1 -1
  14. package/dist/Models3d/Models/TModels3dService.d.ts +1 -1
  15. package/dist/Models3d/Utils/UtilsModel3d.d.ts +1 -1
  16. package/dist/Models3d/Utils/UtilsPrimitiveModels3d.d.ts +1 -1
  17. package/dist/Physics/Adapters/PhysicsBodyConfigToParams.js +1 -1
  18. package/dist/Physics/Adapters/PhysicsBodyConfigToParams.js.map +1 -1
  19. package/dist/Spatial/Services/SpatialHelper.d.ts +1 -1
  20. package/dist/Text/Models/TText2dRenderer.d.ts +1 -1
  21. package/dist/Text/Models/TText2dWrapper.d.ts +1 -1
  22. package/dist/Text/Models/TText3dRenderer.d.ts +1 -1
  23. package/dist/Text/Models/TText3dWrapper.d.ts +1 -1
  24. package/dist/Text/Models/TTextRenderer.d.ts +2 -2
  25. package/dist/Text/Models/TTextWrapper.d.ts +2 -2
  26. package/dist/Text/Renderers/TextRendererBuilder.d.ts +2 -2
  27. package/dist/Text/Wrappers/TextWrapper.d.ts +2 -2
  28. package/dist/Utils/DateTimeUtils.d.ts +1 -1
  29. package/dist/Utils/WrapperHelpers.d.ts +1 -1
  30. package/legal/NOTICE.md +1 -1
  31. package/legal/THIRD_PARTY_LICENSES.md +1 -1
  32. package/package.json +1 -1
@@ -4,7 +4,7 @@ import { ControlsType } from '../Constants';
4
4
  import { TMilliseconds } from '../../Math';
5
5
  import { TWithActiveMixin } from '../../Mixins';
6
6
  import { Euler, EventDispatcher, Quaternion } from 'three';
7
- import { FirstPersonControls } from 'three/examples/jsm/controls/FirstPersonControls';
7
+ import { FirstPersonControls } from '../../../../../node_modules/@types/three/examples/jsm/controls/FirstPersonControls';
8
8
  import { TControlsServiceDependencies } from './TControlsServiceDependencies';
9
9
  import { TFpsControlsAccessors } from './TFpsControlsAccessors';
10
10
  import { TFpsControlsConfig } from './TFpsControlsConfig';
@@ -5,7 +5,7 @@ import { TMilliseconds } from '../../Math';
5
5
  import { TWithActiveMixin } from '../../Mixins';
6
6
  import { TReadonlyVector3 } from '../../ThreeLib';
7
7
  import { Euler, Quaternion, Vector3 } from 'three';
8
- import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls';
8
+ import { OrbitControls } from '../../../../../node_modules/@types/three/examples/jsm/controls/OrbitControls';
9
9
  import { TControlsServiceDependencies } from './TControlsServiceDependencies';
10
10
  import { TOrbitControlsAccessors } from './TOrbitControlsAccessors';
11
11
  import { TOrbitControlsConfig } from './TOrbitControlsConfig';
@@ -1,4 +1,4 @@
1
1
  import { TFpsControlsAccessors } from '../../Models';
2
2
  import { TWriteable } from '../../../../../anarchy-shared/src/Utils';
3
- import { FirstPersonControls } from 'three/examples/jsm/controls/FirstPersonControls';
3
+ import { FirstPersonControls } from '../../../../../../node_modules/@types/three/examples/jsm/controls/FirstPersonControls';
4
4
  export declare function getFpsControlsAccessors(entity: TWriteable<FirstPersonControls>): TFpsControlsAccessors;
@@ -1,4 +1,4 @@
1
1
  import { TOrbitControlsAccessors } from '../../Models';
2
2
  import { TWriteable } from '../../../../../anarchy-shared/src/Utils';
3
- import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls';
3
+ import { OrbitControls } from '../../../../../../node_modules/@types/three/examples/jsm/controls/OrbitControls';
4
4
  export declare function getOrbitControlsAccessors(entity: TWriteable<OrbitControls>): TOrbitControlsAccessors;
@@ -2,7 +2,7 @@ import { TContainerDecorator } from '../../Global';
2
2
  import { TReadonlyVector3 } from '../../ThreeLib';
3
3
  import { BehaviorSubject } from 'rxjs';
4
4
  import { ColorRepresentation, Vector3Like } from 'three';
5
- import { Line2 } from 'three/examples/jsm/lines/Line2';
5
+ import { Line2 } from '../../../../../node_modules/@types/three/examples/jsm/lines/Line2';
6
6
  import { TIntersectionsWatcher } from './TIntersectionsWatcher';
7
7
  export type TIntersectionsDirectionWatcher = TIntersectionsWatcher & Readonly<{
8
8
  origin$: BehaviorSubject<TReadonlyVector3>;
@@ -1,5 +1,5 @@
1
1
  import { TWithMaterial } from '../Models';
2
2
  import { TRawModel3d } from '../../Models3d';
3
3
  import { TWriteable } from '../../../../anarchy-shared/src/Utils';
4
- import { Points } from 'three/src/objects/Points';
4
+ import { Points } from 'three';
5
5
  export declare function withMaterial<T extends TWriteable<TRawModel3d | Points>>(entity: T): TWithMaterial;
@@ -1 +1 @@
1
- {"version":3,"file":"WithMaterial.js","sources":["../../../src/Material/Mixins/WithMaterial.ts"],"sourcesContent":["import type { TWithMaterial } from '@hellpig/anarchy-engine/Material/Models';\nimport type { TRawModel3d } from '@hellpig/anarchy-engine/Models3d';\nimport type { TWriteable } from '@hellpig/anarchy-shared/Utils';\nimport { isDefined } from '@hellpig/anarchy-shared/Utils';\nimport type { Group, Material, Mesh, Object3D } from 'three';\nimport type { Points } from 'three/src/objects/Points';\n\nexport function withMaterial<T extends TWriteable<TRawModel3d | Points>>(entity: T): TWithMaterial {\n function useMaterial(material: Material): Material {\n if ((entity as Group).isGroup) {\n entity.traverse((object) => hasMaterial(object) && applyMaterial(object, material));\n } else if (hasMaterial(entity)) applyMaterial(entity, material);\n return material;\n }\n\n return {\n useMaterial\n };\n}\n\nconst hasMaterial = (entity: Mesh | Group | Points | Object3D): boolean => isDefined((entity as Mesh).material);\n// eslint-disable-next-line functional/immutable-data\nconst applyMaterial = (entity: Mesh | Group | Points | Object3D, material: Material): void => void ((entity as Mesh).material = material);\n"],"names":["withMaterial","entity","useMaterial","material","isGroup","traverse","object","hasMaterial","applyMaterial","isDefined"],"mappings":"6EAOO,SAASA,aAAyDC,QAQvE,MAAO,CACLC,YARF,SAAqBC,UAInB,OAHKF,OAAiBG,QACpBH,OAAOI,SAAUC,QAAWC,YAAYD,SAAWE,cAAcF,OAAQH,WAChEI,YAAYN,SAASO,cAAcP,OAAQE,UAC/CA,QACT,EAKF,CAEA,MAAMI,YAAeN,QAAsDQ,UAAWR,OAAgBE,UAEhGK,cAAgB,CAACP,OAA0CE,YAAoCF,OAAgBE,SAAWA"}
1
+ {"version":3,"file":"WithMaterial.js","sources":["../../../src/Material/Mixins/WithMaterial.ts"],"sourcesContent":["import type { TWithMaterial } from '@hellpig/anarchy-engine/Material/Models';\nimport type { TRawModel3d } from '@hellpig/anarchy-engine/Models3d';\nimport type { TWriteable } from '@hellpig/anarchy-shared/Utils';\nimport { isDefined } from '@hellpig/anarchy-shared/Utils';\nimport type { Group, Material, Mesh, Object3D, Points } from 'three';\n\nexport function withMaterial<T extends TWriteable<TRawModel3d | Points>>(entity: T): TWithMaterial {\n function useMaterial(material: Material): Material {\n if ((entity as Group).isGroup) {\n entity.traverse((object) => hasMaterial(object) && applyMaterial(object, material));\n } else if (hasMaterial(entity)) applyMaterial(entity, material);\n return material;\n }\n\n return {\n useMaterial\n };\n}\n\nconst hasMaterial = (entity: Mesh | Group | Points | Object3D): boolean => isDefined((entity as Mesh).material);\n// eslint-disable-next-line functional/immutable-data\nconst applyMaterial = (entity: Mesh | Group | Points | Object3D, material: Material): void => void ((entity as Mesh).material = material);\n"],"names":["withMaterial","entity","useMaterial","material","isGroup","traverse","object","hasMaterial","applyMaterial","isDefined"],"mappings":"6EAMO,SAASA,aAAyDC,QAQvE,MAAO,CACLC,YARF,SAAqBC,UAInB,OAHKF,OAAiBG,QACpBH,OAAOI,SAAUC,QAAWC,YAAYD,SAAWE,cAAcF,OAAQH,WAChEI,YAAYN,SAASO,cAAcP,OAAQE,UAC/CA,QACT,EAKF,CAEA,MAAMI,YAAeN,QAAsDQ,UAAWR,OAAgBE,UAEhGK,cAAgB,CAACP,OAA0CE,YAAoCF,OAAgBE,SAAWA"}
@@ -1,7 +1,4 @@
1
- import { LineBasicMaterialParameters, LineDashedMaterialParameters, MeshBasicMaterialParameters, MeshDepthMaterialParameters, MeshDistanceMaterialParameters, MeshLambertMaterialParameters, MeshMatcapMaterialParameters, MeshNormalMaterialParameters, MeshPhysicalMaterialParameters, MeshStandardMaterialParameters, MeshToonMaterialParameters, ShaderMaterialParameters, ShadowMaterialParameters, SpriteMaterialParameters } from 'three';
2
- import { MaterialParameters } from 'three/src/materials/Material';
3
- import { MeshPhongMaterialParameters } from 'three/src/materials/MeshPhongMaterial';
4
- import { PointsMaterialParameters } from 'three/src/materials/PointsMaterial';
1
+ import { LineBasicMaterialParameters, LineDashedMaterialParameters, MaterialParameters, MeshBasicMaterialParameters, MeshDepthMaterialParameters, MeshDistanceMaterialParameters, MeshLambertMaterialParameters, MeshMatcapMaterialParameters, MeshNormalMaterialParameters, MeshPhongMaterialParameters, MeshPhysicalMaterialParameters, MeshStandardMaterialParameters, MeshToonMaterialParameters, PointsMaterialParameters, ShaderMaterialParameters, ShadowMaterialParameters, SpriteMaterialParameters } from 'three';
5
2
  export type TOmitNonMaterialOptionsFields<T extends MaterialParameters> = Omit<T, 'allowOverride' | 'defines' | 'id' | 'isMaterial' | 'name' | 'type' | 'userData' | 'uuid' | 'version'>;
6
3
  export type TBasicMaterialParamsOptions = TOmitNonMaterialOptionsFields<MeshBasicMaterialParameters>;
7
4
  export type TDepthMaterialParamsOptions = TOmitNonMaterialOptionsFields<MeshDepthMaterialParameters>;
@@ -1,2 +1,2 @@
1
- import{isQuaternionLike,isEulerLike}from"../../Utils/CheckUtils.js";import{Vector3,Euler,Quaternion}from"three";import{euclideanModulo,degToRad,radToDeg}from"three/src/math/MathUtils";import{ForwardAxis}from"../../Kinematic/Constants/ForwardAxis.js";import{radiansPerSecond,metersPerSecond}from"../../Distance/Utils/DistanceUtils.js";function getHorizontalAzimuth(x,z,point,forwardAxis){let azimuthRad=Math.atan2(point.z-z,point.x-x);return forwardAxis.toLocaleLowerCase()==="Z".toLocaleLowerCase()&&(azimuthRad=-azimuthRad+Math.PI/2),azimuthRad=euclideanModulo(azimuthRad,2*Math.PI),azimuthRad}function getElevation(x,y,z,point){const dy=point.y-y,horizontalDistance=Math.sqrt((point.x-x)**2+(point.z-z)**2);return Math.atan2(dy,horizontalDistance)}function getAzimuthElevationFromQuaternion(q){const{x:x,y:y,z:z,w:w}=q;return{azimuth:Math.atan2(2*(w*z+x*y),1-2*(y*y+z*z)),elevation:Math.asin(2*(w*y-z*x))}}function getAzimuthElevationFromVector(v,forwardAxis){let azimuth;azimuth=forwardAxis===ForwardAxis.Z?Math.atan2(v.x,v.z):Math.atan2(v.z,v.x);const elevation=Math.atan2(v.y,Math.sqrt(v.x*v.x+v.z*v.z));return{azimuth:euclideanModulo(azimuth,2*Math.PI),elevation:elevation}}const getAzimuthFromDirection=direction=>{let azimuth=Math.atan2(direction.z,direction.x);return azimuth<0&&(azimuth+=2*Math.PI),azimuth},getAzimuthFromQuaternionDirection=quaternion=>{const{x:x,y:y,z:z,w:w}=quaternion;let azimuth=Math.atan2(2*(w*y+z*x),1-2*(x*x+y*y));return azimuth<0&&(azimuth+=2*Math.PI),azimuth},getElevationFromDirection=direction=>Math.atan2(direction.y,Math.sqrt(direction.x**2+direction.z**2)),getElevationFromQuaternionDirection=quaternion=>{const{x:x,y:y,z:z,w:w}=quaternion;return Math.asin(2*(w*x-y*z))},getDirectionFromLinearVelocity=linearVelocity=>linearVelocity.clone().normalize(),getSpeedFromLinearVelocity=linearVelocity=>metersPerSecond(linearVelocity.length()),getLinearVelocityByDeg=(speed,azimuth,elevation)=>{const azimuthRad=degToRad(azimuth),elevationRad=degToRad(elevation);return new Vector3(speed*Math.cos(elevationRad)*Math.cos(azimuthRad),speed*Math.sin(elevationRad),speed*Math.cos(elevationRad)*Math.sin(azimuthRad))},getLinearVelocity=(speed,azimuth,elevation)=>new Vector3(speed*Math.cos(elevation)*Math.cos(azimuth),speed*Math.sin(elevation),speed*Math.cos(elevation)*Math.sin(azimuth)),getSpeedFromAngularVelocity=angularVelocity=>radiansPerSecond(angularVelocity.length()),getDirectionFromAngularVelocity=angularVelocity=>angularVelocity.clone().normalize();function get3DAzimuth(center,point){const dx=point.x-center.x,dy=point.y-center.y,dz=point.z-center.z;let azimuth=Math.atan2(dz,dx);azimuth<0&&(azimuth+=2*Math.PI);const horizontalDistance=Math.sqrt(dx*dx+dz*dz);return{azimuth:azimuth,elevation:Math.atan2(dy,horizontalDistance)}}function degreesToEuler(degrees){const radians={x:degToRad(degrees.x),y:degToRad(degrees.y),z:degToRad(degrees.z)};return new Vector3(radians.x,radians.y,radians.z)}function degreesToQuaternion(degrees){const radians={x:degToRad(degrees.x),y:degToRad(degrees.y),z:degToRad(degrees.z)},euler=new Euler(radians.x,radians.y,radians.z);return(new Quaternion).setFromEuler(euler)}function quaternionToDegrees(quaternion){const q=new Quaternion(quaternion.x,quaternion.y,quaternion.z,quaternion.w),euler=(new Euler).setFromQuaternion(q,"XYZ");return new Vector3(radToDeg(euler.x),radToDeg(euler.y),radToDeg(euler.z))}function applyRotationOffsetWithReorder(target,source,offset,order="XYZ"){source.reorder(order),target.set(source.x+offset.x,source.y+offset.y,source.z+offset.z,order),target.set(euclideanModulo(target.x+Math.PI,2*Math.PI)-Math.PI,euclideanModulo(target.y+Math.PI,2*Math.PI)-Math.PI,euclideanModulo(target.z+Math.PI,2*Math.PI)-Math.PI)}function toQuaternion(quaternionOrEuler){if(isQuaternionLike(quaternionOrEuler))return new Quaternion(quaternionOrEuler.x,quaternionOrEuler.y,quaternionOrEuler.z,quaternionOrEuler.w);if(isEulerLike(quaternionOrEuler))return(new Quaternion).setFromEuler(new Euler(quaternionOrEuler.x,quaternionOrEuler.y,quaternionOrEuler.z));throw new Error("Entity must be Quaternion or Euler, but it is something else")}export{applyRotationOffsetWithReorder,degreesToEuler,degreesToQuaternion,get3DAzimuth,getAzimuthElevationFromQuaternion,getAzimuthElevationFromVector,getAzimuthFromDirection,getAzimuthFromQuaternionDirection,getDirectionFromAngularVelocity,getDirectionFromLinearVelocity,getElevation,getElevationFromDirection,getElevationFromQuaternionDirection,getHorizontalAzimuth,getLinearVelocity,getLinearVelocityByDeg,getSpeedFromAngularVelocity,getSpeedFromLinearVelocity,quaternionToDegrees,toQuaternion};
1
+ import{isQuaternionLike,isEulerLike}from"../../Utils/CheckUtils.js";import{Vector3,Euler,Quaternion,MathUtils}from"three";import{ForwardAxis}from"../../Kinematic/Constants/ForwardAxis.js";import{radiansPerSecond,metersPerSecond}from"../../Distance/Utils/DistanceUtils.js";const{degToRad:degToRad,euclideanModulo:euclideanModulo,radToDeg:radToDeg}=MathUtils;function getHorizontalAzimuth(x,z,point,forwardAxis){let azimuthRad=Math.atan2(point.z-z,point.x-x);return forwardAxis.toLocaleLowerCase()==="Z".toLocaleLowerCase()&&(azimuthRad=-azimuthRad+Math.PI/2),azimuthRad=euclideanModulo(azimuthRad,2*Math.PI),azimuthRad}function getElevation(x,y,z,point){const dy=point.y-y,horizontalDistance=Math.sqrt((point.x-x)**2+(point.z-z)**2);return Math.atan2(dy,horizontalDistance)}function getAzimuthElevationFromQuaternion(q){const{x:x,y:y,z:z,w:w}=q;return{azimuth:Math.atan2(2*(w*z+x*y),1-2*(y*y+z*z)),elevation:Math.asin(2*(w*y-z*x))}}function getAzimuthElevationFromVector(v,forwardAxis){let azimuth;azimuth=forwardAxis===ForwardAxis.Z?Math.atan2(v.x,v.z):Math.atan2(v.z,v.x);const elevation=Math.atan2(v.y,Math.sqrt(v.x*v.x+v.z*v.z));return{azimuth:euclideanModulo(azimuth,2*Math.PI),elevation:elevation}}const getAzimuthFromDirection=direction=>{let azimuth=Math.atan2(direction.z,direction.x);return azimuth<0&&(azimuth+=2*Math.PI),azimuth},getAzimuthFromQuaternionDirection=quaternion=>{const{x:x,y:y,z:z,w:w}=quaternion;let azimuth=Math.atan2(2*(w*y+z*x),1-2*(x*x+y*y));return azimuth<0&&(azimuth+=2*Math.PI),azimuth},getElevationFromDirection=direction=>Math.atan2(direction.y,Math.sqrt(direction.x**2+direction.z**2)),getElevationFromQuaternionDirection=quaternion=>{const{x:x,y:y,z:z,w:w}=quaternion;return Math.asin(2*(w*x-y*z))},getDirectionFromLinearVelocity=linearVelocity=>linearVelocity.clone().normalize(),getSpeedFromLinearVelocity=linearVelocity=>metersPerSecond(linearVelocity.length()),getLinearVelocityByDeg=(speed,azimuth,elevation)=>{const azimuthRad=degToRad(azimuth),elevationRad=degToRad(elevation);return new Vector3(speed*Math.cos(elevationRad)*Math.cos(azimuthRad),speed*Math.sin(elevationRad),speed*Math.cos(elevationRad)*Math.sin(azimuthRad))},getLinearVelocity=(speed,azimuth,elevation)=>new Vector3(speed*Math.cos(elevation)*Math.cos(azimuth),speed*Math.sin(elevation),speed*Math.cos(elevation)*Math.sin(azimuth)),getSpeedFromAngularVelocity=angularVelocity=>radiansPerSecond(angularVelocity.length()),getDirectionFromAngularVelocity=angularVelocity=>angularVelocity.clone().normalize();function get3DAzimuth(center,point){const dx=point.x-center.x,dy=point.y-center.y,dz=point.z-center.z;let azimuth=Math.atan2(dz,dx);azimuth<0&&(azimuth+=2*Math.PI);const horizontalDistance=Math.sqrt(dx*dx+dz*dz);return{azimuth:azimuth,elevation:Math.atan2(dy,horizontalDistance)}}function degreesToEuler(degrees){const radians={x:degToRad(degrees.x),y:degToRad(degrees.y),z:degToRad(degrees.z)};return new Vector3(radians.x,radians.y,radians.z)}function degreesToQuaternion(degrees){const radians={x:degToRad(degrees.x),y:degToRad(degrees.y),z:degToRad(degrees.z)},euler=new Euler(radians.x,radians.y,radians.z);return(new Quaternion).setFromEuler(euler)}function quaternionToDegrees(quaternion){const q=new Quaternion(quaternion.x,quaternion.y,quaternion.z,quaternion.w),euler=(new Euler).setFromQuaternion(q,"XYZ");return new Vector3(radToDeg(euler.x),radToDeg(euler.y),radToDeg(euler.z))}function applyRotationOffsetWithReorder(target,source,offset,order="XYZ"){source.reorder(order),target.set(source.x+offset.x,source.y+offset.y,source.z+offset.z,order),target.set(euclideanModulo(target.x+Math.PI,2*Math.PI)-Math.PI,euclideanModulo(target.y+Math.PI,2*Math.PI)-Math.PI,euclideanModulo(target.z+Math.PI,2*Math.PI)-Math.PI)}function toQuaternion(quaternionOrEuler){if(isQuaternionLike(quaternionOrEuler))return new Quaternion(quaternionOrEuler.x,quaternionOrEuler.y,quaternionOrEuler.z,quaternionOrEuler.w);if(isEulerLike(quaternionOrEuler))return(new Quaternion).setFromEuler(new Euler(quaternionOrEuler.x,quaternionOrEuler.y,quaternionOrEuler.z));throw new Error("Entity must be Quaternion or Euler, but it is something else")}export{applyRotationOffsetWithReorder,degreesToEuler,degreesToQuaternion,get3DAzimuth,getAzimuthElevationFromQuaternion,getAzimuthElevationFromVector,getAzimuthFromDirection,getAzimuthFromQuaternionDirection,getDirectionFromAngularVelocity,getDirectionFromLinearVelocity,getElevation,getElevationFromDirection,getElevationFromQuaternionDirection,getHorizontalAzimuth,getLinearVelocity,getLinearVelocityByDeg,getSpeedFromAngularVelocity,getSpeedFromLinearVelocity,quaternionToDegrees,toQuaternion};
2
2
  //# sourceMappingURL=AnglesUtils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AnglesUtils.js","sources":["../../../src/Math/Utils/AnglesUtils.ts"],"sourcesContent":["import { metersPerSecond, radiansPerSecond } from '@hellpig/anarchy-engine/Distance';\nimport { ForwardAxis } from '@hellpig/anarchy-engine/Kinematic/Constants';\nimport type { TDegrees, TMetersPerSecond, TRadians, TRadiansPerSecond } from '@hellpig/anarchy-engine/Math/Types';\nimport type { TEulerLike } from '@hellpig/anarchy-engine/ThreeLib';\nimport { isEulerLike, isQuaternionLike } from '@hellpig/anarchy-engine/Utils/CheckUtils';\nimport type { EulerOrder, QuaternionLike, Vector3Like } from 'three';\nimport { Euler, Quaternion, Vector3 } from 'three';\nimport { degToRad, euclideanModulo, radToDeg } from 'three/src/math/MathUtils';\n\nexport function getHorizontalAzimuth(x: number, z: number, point: Vector3Like, forwardAxis: ForwardAxis): TRadians {\n const dx: number = point.x - x;\n const dz: number = point.z - z;\n\n let azimuthRad: number = Math.atan2(dz, dx);\n if (forwardAxis.toLocaleLowerCase() === 'Z'.toLocaleLowerCase()) azimuthRad = -azimuthRad + Math.PI / 2;\n azimuthRad = euclideanModulo(azimuthRad, Math.PI * 2);\n\n return azimuthRad as TRadians;\n}\n\n// TODO add unit tests\nexport function getElevation(x: number, y: number, z: number, point: Vector3Like): TRadians {\n const dx: number = point.x - x;\n const dy: number = point.y - y;\n const dz: number = point.z - z;\n\n const horizontalDistance: number = Math.sqrt(dx ** 2 + dz ** 2);\n\n return Math.atan2(dy, horizontalDistance) as TRadians;\n}\n\n// TODO add unit tests\nexport function getAzimuthElevationFromQuaternion(q: Quaternion): { azimuth: TRadians; elevation: TRadians } {\n const { x, y, z, w } = q;\n\n const azimuth: TRadians = Math.atan2(2 * (w * z + x * y), 1 - 2 * (y * y + z * z)) as TRadians;\n const elevation: TRadians = Math.asin(2 * (w * y - z * x)) as TRadians;\n\n return { azimuth, elevation };\n}\n\nexport function getAzimuthElevationFromVector(v: Vector3Like, forwardAxis: ForwardAxis): { azimuth: TRadians; elevation: TRadians } {\n let azimuth: TRadians;\n\n if (forwardAxis === ForwardAxis.Z) {\n azimuth = Math.atan2(v.x, v.z) as TRadians;\n } else {\n azimuth = Math.atan2(v.z, v.x) as TRadians;\n }\n\n const elevation: TRadians = Math.atan2(v.y, Math.sqrt(v.x * v.x + v.z * v.z)) as TRadians;\n\n return { azimuth: euclideanModulo(azimuth, Math.PI * 2) as TRadians, elevation };\n}\n\n// TODO add unit tests\nexport const getAzimuthFromDirection = (direction: Vector3Like): TRadians => {\n let azimuth: TRadians = Math.atan2(direction.z, direction.x) as TRadians;\n if (azimuth < 0) (azimuth as number) += 2 * Math.PI;\n return azimuth;\n};\n\n// TODO add unit tests\nexport const getAzimuthFromQuaternionDirection = (quaternion: QuaternionLike): TRadians => {\n const { x, y, z, w } = quaternion;\n\n // Calculate azimuth using the quaternion components\n const sinY: number = 2 * (w * y + z * x);\n const cosY: number = 1 - 2 * (x * x + y * y);\n\n let azimuth: TRadians = Math.atan2(sinY, cosY) as TRadians;\n\n // Normalize azimuth to range [0, 2π]\n if (azimuth < 0) (azimuth as number) += 2 * Math.PI;\n\n return azimuth;\n};\n\n// TODO add unit tests\nexport const getElevationFromDirection = (direction: Vector3Like): TRadians => Math.atan2(direction.y, Math.sqrt(direction.x ** 2 + direction.z ** 2)) as TRadians;\n// TODO add unit tests\nexport const getElevationFromQuaternionDirection = (quaternion: QuaternionLike): TRadians => {\n const { x, y, z, w } = quaternion;\n return Math.asin(2 * (w * x - y * z)) as TRadians;\n};\n\n// TODO add unit tests\nexport const getDirectionFromLinearVelocity = (linearVelocity: Vector3): Vector3 => linearVelocity.clone().normalize();\n// TODO add unit tests\nexport const getSpeedFromLinearVelocity = (linearVelocity: Vector3): TMetersPerSecond => metersPerSecond(linearVelocity.length());\n// TODO add unit tests\nexport const getLinearVelocityByDeg = (speed: TMetersPerSecond, azimuth: TDegrees, elevation: TDegrees): Vector3 => {\n const azimuthRad: TRadians = degToRad(azimuth) as TRadians;\n const elevationRad: TRadians = degToRad(elevation) as TRadians;\n return new Vector3(speed * Math.cos(elevationRad) * Math.cos(azimuthRad), speed * Math.sin(elevationRad), speed * Math.cos(elevationRad) * Math.sin(azimuthRad));\n};\n\n// TODO add unit tests\nexport const getLinearVelocity = (speed: TMetersPerSecond, azimuth: TRadians, elevation: TRadians): Vector3 =>\n new Vector3(speed * Math.cos(elevation) * Math.cos(azimuth), speed * Math.sin(elevation), speed * Math.cos(elevation) * Math.sin(azimuth));\n\n// TODO add unit tests\nexport const getSpeedFromAngularVelocity = (angularVelocity: Quaternion): TRadiansPerSecond => radiansPerSecond(angularVelocity.length());\n\n// TODO add unit tests\nexport const getDirectionFromAngularVelocity = (angularVelocity: Quaternion): Quaternion => angularVelocity.clone().normalize();\n\n// TODO add unit tests\nexport function get3DAzimuth(center: Vector3Like, point: Vector3Like): { azimuth: TRadians; elevation: TRadians } {\n const dx: number = point.x - center.x;\n const dy: number = point.y - center.y;\n const dz: number = point.z - center.z;\n\n let azimuth: number = Math.atan2(dz, dx);\n\n // Ensure azimuth is in range [0, 2π]\n if (azimuth < 0) azimuth += 2 * Math.PI;\n\n const horizontalDistance: number = Math.sqrt(dx * dx + dz * dz);\n const elevation: number = Math.atan2(dy, horizontalDistance);\n\n return {\n azimuth: azimuth as TRadians,\n elevation: elevation as TRadians\n };\n}\n\n// TODO add unit tests\nexport function degreesToEuler(degrees: Vector3Like): Vector3 {\n const radians = {\n x: degToRad(degrees.x),\n y: degToRad(degrees.y),\n z: degToRad(degrees.z)\n };\n\n return new Vector3(radians.x, radians.y, radians.z);\n}\n\n// TODO add unit tests\nexport function degreesToQuaternion(degrees: Vector3Like): Quaternion {\n const radians = {\n x: degToRad(degrees.x),\n y: degToRad(degrees.y),\n z: degToRad(degrees.z)\n };\n\n const euler: Euler = new Euler(radians.x, radians.y, radians.z);\n return new Quaternion().setFromEuler(euler);\n}\n\n// TODO add unit tests\nexport function quaternionToDegrees(quaternion: QuaternionLike): Vector3 {\n const q: Quaternion = new Quaternion(quaternion.x, quaternion.y, quaternion.z, quaternion.w);\n const euler: Euler = new Euler().setFromQuaternion(q, 'XYZ');\n\n return new Vector3(radToDeg(euler.x), radToDeg(euler.y), radToDeg(euler.z));\n}\n\nexport function applyRotationOffsetWithReorder(target: Euler, source: Euler, offset: Euler, order: EulerOrder = 'XYZ'): void {\n source.reorder(order);\n\n target.set(source.x + offset.x, source.y + offset.y, source.z + offset.z, order);\n\n target.set(euclideanModulo(target.x + Math.PI, Math.PI * 2) - Math.PI, euclideanModulo(target.y + Math.PI, Math.PI * 2) - Math.PI, euclideanModulo(target.z + Math.PI, Math.PI * 2) - Math.PI);\n}\n\nexport function toQuaternion(quaternionOrEuler: QuaternionLike | TEulerLike): Quaternion | never {\n if (isQuaternionLike(quaternionOrEuler)) return new Quaternion(quaternionOrEuler.x, quaternionOrEuler.y, quaternionOrEuler.z, quaternionOrEuler.w);\n if (isEulerLike(quaternionOrEuler)) return new Quaternion().setFromEuler(new Euler(quaternionOrEuler.x, quaternionOrEuler.y, quaternionOrEuler.z));\n throw new Error('Entity must be Quaternion or Euler, but it is something else');\n}\n"],"names":["getHorizontalAzimuth","x","z","point","forwardAxis","azimuthRad","Math","atan2","toLocaleLowerCase","PI","euclideanModulo","getElevation","y","dy","horizontalDistance","sqrt","getAzimuthElevationFromQuaternion","q","w","azimuth","elevation","asin","getAzimuthElevationFromVector","v","ForwardAxis","Z","getAzimuthFromDirection","direction","getAzimuthFromQuaternionDirection","quaternion","getElevationFromDirection","getElevationFromQuaternionDirection","getDirectionFromLinearVelocity","linearVelocity","clone","normalize","getSpeedFromLinearVelocity","metersPerSecond","length","getLinearVelocityByDeg","speed","degToRad","elevationRad","Vector3","cos","sin","getLinearVelocity","getSpeedFromAngularVelocity","angularVelocity","radiansPerSecond","getDirectionFromAngularVelocity","get3DAzimuth","center","dx","dz","degreesToEuler","degrees","radians","degreesToQuaternion","euler","Euler","Quaternion","setFromEuler","quaternionToDegrees","setFromQuaternion","radToDeg","applyRotationOffsetWithReorder","target","source","offset","order","reorder","set","toQuaternion","quaternionOrEuler","isQuaternionLike","isEulerLike","Error"],"mappings":"8UASO,SAASA,qBAAqBC,EAAWC,EAAWC,MAAoBC,aAI7E,IAAIC,WAAqBC,KAAK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KG,IAAUH,KAAKG,GAAIC,gBAAgByD,OAAOvD,EAAIN,KAAKG,GAAc,EAAVH,KAAKG,IAAUH,KAAKG,GAAIC,gBAAgByD,OAAOjE,EAAII,KAAKG,GAAc,EAAVH,KAAKG,IAAUH,KAAKG,GAC7L,CAEO,SAASgE,aAAaC,mBAC3B,GAAIC,iBAAiBD,mBAAoB,OAAO,IAAIb,WAAWa,kBAAkBzE,EAAGyE,kBAAkB9D,EAAG8D,kBAAkBxE,EAAGwE,kBAAkBxD,GAChJ,GAAI0D,YAAYF,mBAAoB,OAAO,IAAIb,YAAaC,aAAa,IAAIF,MAAMc,kBAAkBzE,EAAGyE,kBAAkB9D,EAAG8D,kBAAkBxE,IAC/I,MAAM,IAAI2E,MAAM,+DAClB"}
1
+ {"version":3,"file":"AnglesUtils.js","sources":["../../../src/Math/Utils/AnglesUtils.ts"],"sourcesContent":["import { metersPerSecond, radiansPerSecond } from '@hellpig/anarchy-engine/Distance';\nimport { ForwardAxis } from '@hellpig/anarchy-engine/Kinematic/Constants';\nimport type { TDegrees, TMetersPerSecond, TRadians, TRadiansPerSecond } from '@hellpig/anarchy-engine/Math/Types';\nimport type { TEulerLike } from '@hellpig/anarchy-engine/ThreeLib';\nimport { isEulerLike, isQuaternionLike } from '@hellpig/anarchy-engine/Utils/CheckUtils';\nimport type { EulerOrder, QuaternionLike, Vector3Like } from 'three';\nimport { Euler, MathUtils, Quaternion, Vector3 } from 'three';\n\nconst { degToRad, euclideanModulo, radToDeg } = MathUtils;\n\nexport function getHorizontalAzimuth(x: number, z: number, point: Vector3Like, forwardAxis: ForwardAxis): TRadians {\n const dx: number = point.x - x;\n const dz: number = point.z - z;\n\n let azimuthRad: number = Math.atan2(dz, dx);\n if (forwardAxis.toLocaleLowerCase() === 'Z'.toLocaleLowerCase()) azimuthRad = -azimuthRad + Math.PI / 2;\n azimuthRad = euclideanModulo(azimuthRad, Math.PI * 2);\n\n return azimuthRad as TRadians;\n}\n\n// TODO add unit tests\nexport function getElevation(x: number, y: number, z: number, point: Vector3Like): TRadians {\n const dx: number = point.x - x;\n const dy: number = point.y - y;\n const dz: number = point.z - z;\n\n const horizontalDistance: number = Math.sqrt(dx ** 2 + dz ** 2);\n\n return Math.atan2(dy, horizontalDistance) as TRadians;\n}\n\n// TODO add unit tests\nexport function getAzimuthElevationFromQuaternion(q: Quaternion): { azimuth: TRadians; elevation: TRadians } {\n const { x, y, z, w } = q;\n\n const azimuth: TRadians = Math.atan2(2 * (w * z + x * y), 1 - 2 * (y * y + z * z)) as TRadians;\n const elevation: TRadians = Math.asin(2 * (w * y - z * x)) as TRadians;\n\n return { azimuth, elevation };\n}\n\nexport function getAzimuthElevationFromVector(v: Vector3Like, forwardAxis: ForwardAxis): { azimuth: TRadians; elevation: TRadians } {\n let azimuth: TRadians;\n\n if (forwardAxis === ForwardAxis.Z) {\n azimuth = Math.atan2(v.x, v.z) as TRadians;\n } else {\n azimuth = Math.atan2(v.z, v.x) as TRadians;\n }\n\n const elevation: TRadians = Math.atan2(v.y, Math.sqrt(v.x * v.x + v.z * v.z)) as TRadians;\n\n return { azimuth: euclideanModulo(azimuth, Math.PI * 2) as TRadians, elevation };\n}\n\n// TODO add unit tests\nexport const getAzimuthFromDirection = (direction: Vector3Like): TRadians => {\n let azimuth: TRadians = Math.atan2(direction.z, direction.x) as TRadians;\n if (azimuth < 0) (azimuth as number) += 2 * Math.PI;\n return azimuth;\n};\n\n// TODO add unit tests\nexport const getAzimuthFromQuaternionDirection = (quaternion: QuaternionLike): TRadians => {\n const { x, y, z, w } = quaternion;\n\n // Calculate azimuth using the quaternion components\n const sinY: number = 2 * (w * y + z * x);\n const cosY: number = 1 - 2 * (x * x + y * y);\n\n let azimuth: TRadians = Math.atan2(sinY, cosY) as TRadians;\n\n // Normalize azimuth to range [0, 2π]\n if (azimuth < 0) (azimuth as number) += 2 * Math.PI;\n\n return azimuth;\n};\n\n// TODO add unit tests\nexport const getElevationFromDirection = (direction: Vector3Like): TRadians => Math.atan2(direction.y, Math.sqrt(direction.x ** 2 + direction.z ** 2)) as TRadians;\n// TODO add unit tests\nexport const getElevationFromQuaternionDirection = (quaternion: QuaternionLike): TRadians => {\n const { x, y, z, w } = quaternion;\n return Math.asin(2 * (w * x - y * z)) as TRadians;\n};\n\n// TODO add unit tests\nexport const getDirectionFromLinearVelocity = (linearVelocity: Vector3): Vector3 => linearVelocity.clone().normalize();\n// TODO add unit tests\nexport const getSpeedFromLinearVelocity = (linearVelocity: Vector3): TMetersPerSecond => metersPerSecond(linearVelocity.length());\n// TODO add unit tests\nexport const getLinearVelocityByDeg = (speed: TMetersPerSecond, azimuth: TDegrees, elevation: TDegrees): Vector3 => {\n const azimuthRad: TRadians = degToRad(azimuth) as TRadians;\n const elevationRad: TRadians = degToRad(elevation) as TRadians;\n return new Vector3(speed * Math.cos(elevationRad) * Math.cos(azimuthRad), speed * Math.sin(elevationRad), speed * Math.cos(elevationRad) * Math.sin(azimuthRad));\n};\n\n// TODO add unit tests\nexport const getLinearVelocity = (speed: TMetersPerSecond, azimuth: TRadians, elevation: TRadians): Vector3 =>\n new Vector3(speed * Math.cos(elevation) * Math.cos(azimuth), speed * Math.sin(elevation), speed * Math.cos(elevation) * Math.sin(azimuth));\n\n// TODO add unit tests\nexport const getSpeedFromAngularVelocity = (angularVelocity: Quaternion): TRadiansPerSecond => radiansPerSecond(angularVelocity.length());\n\n// TODO add unit tests\nexport const getDirectionFromAngularVelocity = (angularVelocity: Quaternion): Quaternion => angularVelocity.clone().normalize();\n\n// TODO add unit tests\nexport function get3DAzimuth(center: Vector3Like, point: Vector3Like): { azimuth: TRadians; elevation: TRadians } {\n const dx: number = point.x - center.x;\n const dy: number = point.y - center.y;\n const dz: number = point.z - center.z;\n\n let azimuth: number = Math.atan2(dz, dx);\n\n // Ensure azimuth is in range [0, 2π]\n if (azimuth < 0) azimuth += 2 * Math.PI;\n\n const horizontalDistance: number = Math.sqrt(dx * dx + dz * dz);\n const elevation: number = Math.atan2(dy, horizontalDistance);\n\n return {\n azimuth: azimuth as TRadians,\n elevation: elevation as TRadians\n };\n}\n\n// TODO add unit tests\nexport function degreesToEuler(degrees: Vector3Like): Vector3 {\n const radians = {\n x: degToRad(degrees.x),\n y: degToRad(degrees.y),\n z: degToRad(degrees.z)\n };\n\n return new Vector3(radians.x, radians.y, radians.z);\n}\n\n// TODO add unit tests\nexport function degreesToQuaternion(degrees: Vector3Like): Quaternion {\n const radians = {\n x: degToRad(degrees.x),\n y: degToRad(degrees.y),\n z: degToRad(degrees.z)\n };\n\n const euler: Euler = new Euler(radians.x, radians.y, radians.z);\n return new Quaternion().setFromEuler(euler);\n}\n\n// TODO add unit tests\nexport function quaternionToDegrees(quaternion: QuaternionLike): Vector3 {\n const q: Quaternion = new Quaternion(quaternion.x, quaternion.y, quaternion.z, quaternion.w);\n const euler: Euler = new Euler().setFromQuaternion(q, 'XYZ');\n\n return new Vector3(radToDeg(euler.x), radToDeg(euler.y), radToDeg(euler.z));\n}\n\nexport function applyRotationOffsetWithReorder(target: Euler, source: Euler, offset: Euler, order: EulerOrder = 'XYZ'): void {\n source.reorder(order);\n\n target.set(source.x + offset.x, source.y + offset.y, source.z + offset.z, order);\n\n target.set(euclideanModulo(target.x + Math.PI, Math.PI * 2) - Math.PI, euclideanModulo(target.y + Math.PI, Math.PI * 2) - Math.PI, euclideanModulo(target.z + Math.PI, Math.PI * 2) - Math.PI);\n}\n\nexport function toQuaternion(quaternionOrEuler: QuaternionLike | TEulerLike): Quaternion | never {\n if (isQuaternionLike(quaternionOrEuler)) return new Quaternion(quaternionOrEuler.x, quaternionOrEuler.y, quaternionOrEuler.z, quaternionOrEuler.w);\n if (isEulerLike(quaternionOrEuler)) return new Quaternion().setFromEuler(new Euler(quaternionOrEuler.x, quaternionOrEuler.y, quaternionOrEuler.z));\n throw new Error('Entity must be Quaternion or Euler, but it is something else');\n}\n"],"names":["degToRad","euclideanModulo","radToDeg","MathUtils","getHorizontalAzimuth","x","z","point","forwardAxis","azimuthRad","Math","atan2","toLocaleLowerCase","PI","getElevation","y","dy","horizontalDistance","sqrt","getAzimuthElevationFromQuaternion","q","w","azimuth","elevation","asin","getAzimuthElevationFromVector","v","ForwardAxis","Z","getAzimuthFromDirection","direction","getAzimuthFromQuaternionDirection","quaternion","getElevationFromDirection","getElevationFromQuaternionDirection","getDirectionFromLinearVelocity","linearVelocity","clone","normalize","getSpeedFromLinearVelocity","metersPerSecond","length","getLinearVelocityByDeg","speed","elevationRad","Vector3","cos","sin","getLinearVelocity","getSpeedFromAngularVelocity","angularVelocity","radiansPerSecond","getDirectionFromAngularVelocity","get3DAzimuth","center","dx","dz","degreesToEuler","degrees","radians","degreesToQuaternion","euler","Euler","Quaternion","setFromEuler","quaternionToDegrees","setFromQuaternion","applyRotationOffsetWithReorder","target","source","offset","order","reorder","set","toQuaternion","quaternionOrEuler","isQuaternionLike","isEulerLike","Error"],"mappings":"gRAQA,MAAMA,SAAEA,SAAAC,gBAAUA,gBAAAC,SAAiBA,UAAaC,UAEzC,SAASC,qBAAqBC,EAAWC,EAAWC,MAAoBC,aAI7E,IAAIC,WAAqBC,KAAKC,MAFXJ,MAAMD,EAAIA,EADVC,MAAMF,EAAIA,GAO7B,OAHIG,YAAYI,sBAAwB,IAAIA,sBAAqBH,YAAcA,WAAaC,KAAKG,GAAK,GACtGJ,WAAaR,gBAAgBQ,WAAsB,EAAVC,KAAKG,IAEvCJ,UACT,CAGO,SAASK,aAAaT,EAAWU,EAAWT,EAAWC,OAC5D,MACMS,GAAaT,MAAMQ,EAAIA,EAGvBE,mBAA6BP,KAAKQ,MAJrBX,MAAMF,EAAIA,IAIsB,GAFhCE,MAAMD,EAAIA,IAEgC,GAE7D,OAAOI,KAAKC,MAAMK,GAAIC,mBACxB,CAGO,SAASE,kCAAkCC,GAChD,MAAMf,EAAEA,EAAAU,EAAGA,EAAAT,EAAGA,EAAAe,EAAGA,GAAMD,EAKvB,MAAO,CAAEE,QAHiBZ,KAAKC,MAAM,GAAKU,EAAIf,EAAID,E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'../../Mixins';
4
4
  import { PrimitiveModel3dType } from '../Constants';
5
5
  import { TObject3DParams } from '../../ThreeLib';
6
6
  import { AnimationClip } from 'three';
7
- import { GLTF } from 'three/examples/jsm/loaders/GLTFLoader';
7
+ import { GLTF } from '../../../../../node_modules/@types/three/examples/jsm/loaders/GLTFLoader';
8
8
  import { TModel3dOptions } from './TModel3dOptions';
9
9
  export type TModel3dParams = Readonly<{
10
10
  model3dSource: GLTF | PrimitiveModel3dType;
@@ -1,5 +1,5 @@
1
1
  import { TAbstractLoader } from '../../Abstract';
2
- import { GLTF } from 'three/examples/jsm/loaders/GLTFLoader';
2
+ import { GLTF } from '../../../../../node_modules/@types/three/examples/jsm/loaders/GLTFLoader';
3
3
  import { TModel3dResourceConfig } from './TModel3dResourceConfig';
4
4
  import { TModels3dMetaInfoRegistry } from './TModels3dMetaInfoRegistry';
5
5
  import { TModels3dResourceAsyncRegistry } from './TModels3dResourceAsyncRegistry';
@@ -1,3 +1,3 @@
1
1
  import { TAbstractResourceAsyncRegistry } from '../../Abstract';
2
- import { GLTF } from 'three/examples/jsm/loaders/GLTFLoader';
2
+ import { GLTF } from '../../../../../node_modules/@types/three/examples/jsm/loaders/GLTFLoader';
3
3
  export type TModels3dResourceAsyncRegistry = TAbstractResourceAsyncRegistry<GLTF>;
@@ -4,7 +4,7 @@ import { TMaterialService } from '../../Material';
4
4
  import { TWithCreateFromConfigService, TWithCreateService, TWithFactoryService, TWithLoadResourcesAsyncService, TWithRegistryService, TWithResourcesMetaInfoRegistryService, TWithResourcesRegistryService } from '../../Mixins';
5
5
  import { TModel3d, TModel3dConfig, TModel3dParams, TModel3dRawToModel3dConnectionRegistry, TModel3dResourceConfig, TModels3dFactory, TModels3dRegistry, TModels3dResourceAsyncRegistry, TModels3dServiceDependencies } from '.';
6
6
  import { TOptional } from '../../../../anarchy-shared/src/Utils';
7
- import { GLTF } from 'three/examples/jsm/loaders/GLTFLoader';
7
+ import { GLTF } from '../../../../../node_modules/@types/three/examples/jsm/loaders/GLTFLoader';
8
8
  export type TModel3dServiceWithCreate = TWithCreateService<TModel3d, TModel3dParams>;
9
9
  export type TModel3dServiceWithCreateFromConfig = TWithCreateFromConfigService<TModel3dConfig, TModel3d>;
10
10
  export type TModel3dServiceWithFactory = TWithFactoryService<TModel3d, TModel3dParams, Pick<TModels3dServiceDependencies, 'animationsService' | 'model3dRawToModel3dConnectionRegistry'>, TModels3dFactory>;
@@ -1,6 +1,6 @@
1
1
  import { TAnimationsService } from '../../Animations/Models';
2
2
  import { PrimitiveModel3dType } from '../Constants';
3
3
  import { TModel3dEntities, TModel3dParams, TModel3dRawToModel3dConnectionRegistry } from '../Models';
4
- import { GLTF } from 'three/examples/jsm/loaders/GLTFLoader';
4
+ import { GLTF } from '../../../../../node_modules/@types/three/examples/jsm/loaders/GLTFLoader';
5
5
  export declare function createModels3dEntities(params: TModel3dParams, animationsService: TAnimationsService): TModel3dEntities;
6
6
  export declare function isModel3dAlreadyInUse(model3dSource: GLTF | PrimitiveModel3dType, model3dRawToModel3dConnectionRegistry: TModel3dRawToModel3dConnectionRegistry): boolean;
@@ -1,7 +1,7 @@
1
1
  import { PrimitiveModel3dType } from '../Constants';
2
2
  import { TModel3dConfig, TModel3dParams, TModel3dResourceConfig, TRawModel3d } from '../Models';
3
3
  import { Mesh } from 'three';
4
- import { GLTF } from 'three/examples/jsm/loaders/GLTFLoader';
4
+ import { GLTF } from '../../../../../node_modules/@types/three/examples/jsm/loaders/GLTFLoader';
5
5
  export declare function createPrimitiveModel3d(params: TModel3dParams): Mesh | never;
6
6
  export declare const isPrimitiveModel3dResourceConfig: (params: TModel3dResourceConfig) => boolean;
7
7
  export declare const isPrimitiveModel3dData: (params: TModel3dConfig | TModel3dParams) => boolean;
@@ -1,2 +1,2 @@
1
- import{isDefined}from"../../packages/anarchy-shared/src/Utils/CheckUtils.js";import{Quaternion,Euler}from"three";import{Vector3}from"three/src/math/Vector3";import{isPhysicsBodyParamsComplete}from"../Utils/ParamsUtils.js";function physicsBodyConfigToParams(config){const{position:position,rotation:rotation,angularVelocity:angularVelocity,linearVelocity:linearVelocity,...rest}=config,result={...rest,position:new Vector3(position.x,position.y,position.z),rotation:(new Quaternion).setFromEuler(new Euler(rotation.x,rotation.y,rotation.z,rotation.order)),angularVelocity:isDefined(angularVelocity)?new Vector3(angularVelocity.x,angularVelocity.y,angularVelocity.z):void 0,linearVelocity:isDefined(linearVelocity)?new Vector3(linearVelocity.x,linearVelocity.y,linearVelocity.z):void 0};if(!isPhysicsBodyParamsComplete(result))throw new Error("Cannot create physics body: params are lacking of mandatory fields");return result}export{physicsBodyConfigToParams};
1
+ import{isDefined}from"../../packages/anarchy-shared/src/Utils/CheckUtils.js";import{Vector3,Quaternion,Euler}from"three";import{isPhysicsBodyParamsComplete}from"../Utils/ParamsUtils.js";function physicsBodyConfigToParams(config){const{position:position,rotation:rotation,angularVelocity:angularVelocity,linearVelocity:linearVelocity,...rest}=config,result={...rest,position:new Vector3(position.x,position.y,position.z),rotation:(new Quaternion).setFromEuler(new Euler(rotation.x,rotation.y,rotation.z,rotation.order)),angularVelocity:isDefined(angularVelocity)?new Vector3(angularVelocity.x,angularVelocity.y,angularVelocity.z):void 0,linearVelocity:isDefined(linearVelocity)?new Vector3(linearVelocity.x,linearVelocity.y,linearVelocity.z):void 0};if(!isPhysicsBodyParamsComplete(result))throw new Error("Cannot create physics body: params are lacking of mandatory fields");return result}export{physicsBodyConfigToParams};
2
2
  //# sourceMappingURL=PhysicsBodyConfigToParams.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PhysicsBodyConfigToParams.js","sources":["../../../src/Physics/Adapters/PhysicsBodyConfigToParams.ts"],"sourcesContent":["import type { TPhysicsBodyConfig, TPhysicsBodyParams } from '@hellpig/anarchy-engine/Physics/Models';\nimport { isPhysicsBodyParamsComplete } from '@hellpig/anarchy-engine/Physics/Utils';\nimport type { TOptional } from '@hellpig/anarchy-shared/Utils';\nimport { isDefined } from '@hellpig/anarchy-shared/Utils';\nimport { Euler, Quaternion } from 'three';\nimport { Vector3 } from 'three/src/math/Vector3';\n\nexport function physicsBodyConfigToParams(config: TPhysicsBodyConfig): TPhysicsBodyParams | never {\n const { position, rotation, angularVelocity, linearVelocity, ...rest } = config;\n\n const result: TPhysicsBodyParams | TOptional<TPhysicsBodyParams> = {\n // type: RigidBodyTypesMap[RigidBodyTypesNames[type]],\n ...rest,\n position: new Vector3(position.x, position.y, position.z),\n rotation: new Quaternion().setFromEuler(new Euler(rotation.x, rotation.y, rotation.z, rotation.order)),\n angularVelocity: isDefined(angularVelocity) ? new Vector3(angularVelocity.x, angularVelocity.y, angularVelocity.z) : undefined,\n linearVelocity: isDefined(linearVelocity) ? new Vector3(linearVelocity.x, linearVelocity.y, linearVelocity.z) : undefined\n };\n\n if (!isPhysicsBodyParamsComplete(result)) throw new Error('Cannot create physics body: params are lacking of mandatory fields');\n return result;\n}\n"],"names":["physicsBodyConfigToParams","config","position","rotation","angularVelocity","linearVelocity","rest","result","Vector3","x","y","z","Quaternion","setFromEuler","Euler","order","isDefined","isPhysicsBodyParamsComplete","Error"],"mappings":"8NAOO,SAASA,0BAA0BC,QACxC,MAAMC,SAAEA,SAAAC,SAAUA,SAAAC,gBAAUA,+BAAiBC,kBAAmBC,MAASL,OAEnEM,OAA6D,IAE9DD,KACHJ,SAAU,IAAIM,QAAQN,SAASO,EAAGP,SAASQ,EAAGR,SAASS,GACvDR,UAAU,IAAIS,YAAaC,aAAa,IAAIC,MAAMX,SAASM,EAAGN,SAASO,EAAGP,SAASQ,EAAGR,SAASY,QAC/FX,gBAAiBY,UAAUZ,iBAAmB,IAAII,QAAQJ,gBAAgBK,EAAGL,gBAAgBM,EAAGN,gBAAgBO,QAAK,EACrHN,eAAgBW,UAAUX,gBAAkB,IAAIG,QAAQH,eAAeI,EAAGJ,eAAeK,EAAGL,eAAeM,QAAK,GAGlH,IAAKM,4BAA4BV,QAAS,MAAM,IAAIW,MAAM,sEAC1D,OAAOX,MACT"}
1
+ {"version":3,"file":"PhysicsBodyConfigToParams.js","sources":["../../../src/Physics/Adapters/PhysicsBodyConfigToParams.ts"],"sourcesContent":["import type { TPhysicsBodyConfig, TPhysicsBodyParams } from '@hellpig/anarchy-engine/Physics/Models';\nimport { isPhysicsBodyParamsComplete } from '@hellpig/anarchy-engine/Physics/Utils';\nimport type { TOptional } from '@hellpig/anarchy-shared/Utils';\nimport { isDefined } from '@hellpig/anarchy-shared/Utils';\nimport { Euler, Quaternion, Vector3 } from 'three';\n\nexport function physicsBodyConfigToParams(config: TPhysicsBodyConfig): TPhysicsBodyParams | never {\n const { position, rotation, angularVelocity, linearVelocity, ...rest } = config;\n\n const result: TPhysicsBodyParams | TOptional<TPhysicsBodyParams> = {\n // type: RigidBodyTypesMap[RigidBodyTypesNames[type]],\n ...rest,\n position: new Vector3(position.x, position.y, position.z),\n rotation: new Quaternion().setFromEuler(new Euler(rotation.x, rotation.y, rotation.z, rotation.order)),\n angularVelocity: isDefined(angularVelocity) ? new Vector3(angularVelocity.x, angularVelocity.y, angularVelocity.z) : undefined,\n linearVelocity: isDefined(linearVelocity) ? new Vector3(linearVelocity.x, linearVelocity.y, linearVelocity.z) : undefined\n };\n\n if (!isPhysicsBodyParamsComplete(result)) throw new Error('Cannot create physics body: params are lacking of mandatory fields');\n return result;\n}\n"],"names":["physicsBodyConfigToParams","config","position","rotation","angularVelocity","linearVelocity","rest","result","Vector3","x","y","z","Quaternion","setFromEuler","Euler","order","isDefined","isPhysicsBodyParamsComplete","Error"],"mappings":"0LAMO,SAASA,0BAA0BC,QACxC,MAAMC,SAAEA,SAAAC,SAAUA,SAAAC,gBAAUA,+BAAiBC,kBAAmBC,MAASL,OAEnEM,OAA6D,IAE9DD,KACHJ,SAAU,IAAIM,QAAQN,SAASO,EAAGP,SAASQ,EAAGR,SAASS,GACvDR,UAAU,IAAIS,YAAaC,aAAa,IAAIC,MAAMX,SAASM,EAAGN,SAASO,EAAGP,SAASQ,EAAGR,SAASY,QAC/FX,gBAAiBY,UAAUZ,iBAAmB,IAAII,QAAQJ,gBAAgBK,EAAGL,gBAAgBM,EAAGN,gBAAgBO,QAAK,EACrHN,eAAgBW,UAAUX,gBAAkB,IAAIG,QAAQH,eAAeI,EAAGJ,eAAeK,EAAGL,eAAeM,QAAK,GAGlH,IAAKM,4BAA4BV,QAAS,MAAM,IAAIW,MAAM,sEAC1D,OAAOX,MACT"}
@@ -1,6 +1,6 @@
1
1
  import { TActor } from '../../Actor';
2
2
  import { ColorRepresentation, Mesh } from 'three';
3
- import { Line2 } from 'three/examples/jsm/lines/Line2';
3
+ import { Line2 } from '../../../../../node_modules/@types/three/examples/jsm/lines/Line2';
4
4
  export declare function createLine(color: ColorRepresentation, width: number, positions: Array<number>): Line2;
5
5
  export declare function createOutline(actor: TActor, color: ColorRepresentation, lineWidth: number): Line2;
6
6
  export declare function createBoundingBox(minX: number, minZ: number, maxX: number, maxZ: number, color?: ColorRepresentation, wireframe?: boolean, height?: number): Mesh;
@@ -1,3 +1,3 @@
1
- import { CSS2DRenderer } from 'three/examples/jsm/renderers/CSS2DRenderer';
1
+ import { CSS2DRenderer } from '../../../../../node_modules/@types/three/examples/jsm/renderers/CSS2DRenderer';
2
2
  import { TTextRenderer } from './TTextRenderer';
3
3
  export type TText2dRenderer = TTextRenderer<CSS2DRenderer>;
@@ -1,3 +1,3 @@
1
- import { CSS2DObject } from 'three/examples/jsm/renderers/CSS2DRenderer';
1
+ import { CSS2DObject } from '../../../../../node_modules/@types/three/examples/jsm/renderers/CSS2DRenderer';
2
2
  import { TTextWrapper } from './TTextWrapper';
3
3
  export type TText2dWrapper = TTextWrapper<CSS2DObject>;
@@ -1,3 +1,3 @@
1
- import { CSS3DRenderer } from 'three/examples/jsm/renderers/CSS3DRenderer';
1
+ import { CSS3DRenderer } from '../../../../../node_modules/@types/three/examples/jsm/renderers/CSS3DRenderer';
2
2
  import { TTextRenderer } from './TTextRenderer';
3
3
  export type TText3dRenderer = TTextRenderer<CSS3DRenderer>;
@@ -1,3 +1,3 @@
1
- import { CSS3DObject } from 'three/examples/jsm/renderers/CSS3DRenderer';
1
+ import { CSS3DObject } from '../../../../../node_modules/@types/three/examples/jsm/renderers/CSS3DRenderer';
2
2
  import { TTextWrapper } from './TTextWrapper';
3
3
  export type TText3dWrapper = TTextWrapper<CSS3DObject>;
@@ -1,7 +1,7 @@
1
1
  import { TDestroyable, TWithId } from '../../Mixins';
2
2
  import { TextRendererType } from '../Constants';
3
- import { CSS2DRenderer } from 'three/examples/jsm/renderers/CSS2DRenderer';
4
- import { CSS3DRenderer } from 'three/examples/jsm/renderers/CSS3DRenderer';
3
+ import { CSS2DRenderer } from '../../../../../node_modules/@types/three/examples/jsm/renderers/CSS2DRenderer';
4
+ import { CSS3DRenderer } from '../../../../../node_modules/@types/three/examples/jsm/renderers/CSS3DRenderer';
5
5
  export type TTextRenderer<T extends CSS2DRenderer | CSS3DRenderer> = Readonly<{
6
6
  type: TextRendererType;
7
7
  renderer: T;
@@ -2,8 +2,8 @@ import { TWrapper } from '../../Abstract';
2
2
  import { TextType } from '../Constants';
3
3
  import { TElementWithCssAccessors } from '.';
4
4
  import { TAbstractTextWrapper } from './TAbstractTextWrapper';
5
- import { CSS2DObject } from 'three/examples/jsm/renderers/CSS2DRenderer';
6
- import { CSS3DObject } from 'three/examples/jsm/renderers/CSS3DRenderer';
5
+ import { CSS2DObject } from '../../../../../node_modules/@types/three/examples/jsm/renderers/CSS2DRenderer';
6
+ import { CSS3DObject } from '../../../../../node_modules/@types/three/examples/jsm/renderers/CSS3DRenderer';
7
7
  export type TTextWrapper<T extends CSS2DObject | CSS3DObject> = TWrapper<T> & Readonly<{
8
8
  type: TextType;
9
9
  }> & TElementWithCssAccessors & TAbstractTextWrapper;
@@ -1,6 +1,6 @@
1
1
  import { TContainerDecorator } from '../../Global';
2
2
  import { TextCssClass, TextRendererType } from '../Constants';
3
3
  import { TTextRenderer } from '../Models';
4
- import { CSS2DRenderer } from 'three/examples/jsm/renderers/CSS2DRenderer';
5
- import { CSS3DRenderer } from 'three/examples/jsm/renderers/CSS3DRenderer';
4
+ import { CSS2DRenderer } from '../../../../../node_modules/@types/three/examples/jsm/renderers/CSS2DRenderer';
5
+ import { CSS3DRenderer } from '../../../../../node_modules/@types/three/examples/jsm/renderers/CSS3DRenderer';
6
6
  export declare function getTextRenderer<T extends CSS2DRenderer | CSS3DRenderer>(renderer: T, cssClass: TextCssClass, type: TextRendererType, container: TContainerDecorator): TTextRenderer<T>;
@@ -1,5 +1,5 @@
1
1
  import { TextType } from '../Constants';
2
2
  import { TTextParams, TTextServiceDependencies, TTextWrapper } from '../Models';
3
- import { CSS2DObject } from 'three/examples/jsm/renderers/CSS2DRenderer';
4
- import { CSS3DObject } from 'three/examples/jsm/renderers/CSS3DRenderer';
3
+ import { CSS2DObject } from '../../../../../node_modules/@types/three/examples/jsm/renderers/CSS2DRenderer';
4
+ import { CSS3DObject } from '../../../../../node_modules/@types/three/examples/jsm/renderers/CSS3DRenderer';
5
5
  export declare function createTextWrapper<T extends CSS2DObject | CSS3DObject>(params: TTextParams, type: TextType, dependencies: TTextServiceDependencies): TTextWrapper<T>;
@@ -1,4 +1,4 @@
1
- import { Locale } from 'date-fns/locale/types';
1
+ import { Locale } from '../../../../node_modules/date-fns/locale/types.d.ts';
2
2
  export declare function getDuration(minutes: number, locale: string, unit?: 'long' | 'short' | 'narrow'): string;
3
3
  export declare const toDate: (date: string, locale: Locale) => string;
4
4
  export declare const toTime: (date: string, locale: Locale) => string;
@@ -2,7 +2,7 @@ import { TAbstractWrapper } from '../Abstract';
2
2
  import { TWithObject3d } from '../Mixins';
3
3
  import { TObject3DParams } from '../ThreeLib';
4
4
  import { Vector2 } from 'three';
5
- import { CSS2DObject } from 'three/examples/jsm/renderers/CSS2DRenderer';
5
+ import { CSS2DObject } from '../../../../node_modules/@types/three/examples/jsm/renderers/CSS2DRenderer';
6
6
  export declare function applyObject3dParams(obj: TWithObject3d, { visible, castShadow, receiveShadow, frustumCulled, renderOrder, layers }: Partial<TObject3DParams>): void;
7
7
  export declare function applyCenter(obj: CSS2DObject, center?: Vector2): void;
8
8
  export declare function isWrapper<T extends TAbstractWrapper<E>, E>(obj: T | any): obj is T;
package/legal/NOTICE.md CHANGED
@@ -23,7 +23,7 @@ The following notices are reproduced as provided by the respective licensors (e.
23
23
 
24
24
  ---
25
25
 
26
- ## @hellpig/anarchy-shared@1.6.4
26
+ ## @hellpig/anarchy-shared@1.6.5
27
27
 
28
28
  **License(s):** MIT
29
29
 
@@ -20,7 +20,7 @@ _No license text file found; relying on package metadata._
20
20
 
21
21
  ---
22
22
 
23
- ## @hellpig/anarchy-shared@1.6.4
23
+ ## @hellpig/anarchy-shared@1.6.5
24
24
 
25
25
  **License:** MIT
26
26
 
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@hellpig/anarchy-engine",
3
3
  "author": "S. Panfilov",
4
4
  "private": false,
5
- "version": "22.0.3",
5
+ "version": "22.0.4",
6
6
  "type": "module",
7
7
  "repository": {
8
8
  "type": "git",