@tresjs/cientos 4.3.1 → 5.0.0-next.1

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 (101) hide show
  1. package/dist/core/abstractions/AnimatedSprite/component.vue.d.ts +14 -4
  2. package/dist/core/abstractions/Billboard.vue.d.ts +24 -6
  3. package/dist/core/abstractions/CubeCamera/component.vue.d.ts +14 -4
  4. package/dist/core/abstractions/Edges.vue.d.ts +14 -4
  5. package/dist/core/abstractions/GradientTexture.vue.d.ts +14 -1
  6. package/dist/core/abstractions/Image/ImageMaterial.vue.d.ts +3 -1
  7. package/dist/core/abstractions/Image/component.vue.d.ts +3 -9
  8. package/dist/core/abstractions/Lensflare/LensflareImpl.d.ts +23 -0
  9. package/dist/core/abstractions/Lensflare/component.vue.d.ts +12 -3
  10. package/dist/core/abstractions/Levioso.vue.d.ts +22 -16
  11. package/dist/core/abstractions/MarchingCubes/MarchingCube.vue.d.ts +22 -0
  12. package/dist/core/abstractions/MarchingCubes/MarchingCubes.vue.d.ts +35 -0
  13. package/dist/core/abstractions/MarchingCubes/MarchingPlane.vue.d.ts +20 -0
  14. package/dist/core/abstractions/MarchingCubes/const.d.ts +2 -0
  15. package/dist/core/abstractions/Mask/component.vue.d.ts +14 -4
  16. package/dist/core/abstractions/MouseParallax.vue.d.ts +11 -1
  17. package/dist/core/abstractions/Outline/component.vue.d.ts +11 -1
  18. package/dist/core/abstractions/PositionalAudio.vue.d.ts +11 -2
  19. package/dist/core/abstractions/Reflector.vue.d.ts +5 -2
  20. package/dist/core/abstractions/ScreenSizer.vue.d.ts +24 -6
  21. package/dist/core/abstractions/ScreenSpace.vue.d.ts +14 -4
  22. package/dist/core/abstractions/Text3D.vue.d.ts +2 -17
  23. package/dist/core/abstractions/index.d.ts +4 -1
  24. package/dist/core/abstractions/useAnimations.d.ts +4 -4
  25. package/dist/core/abstractions/useSurfaceSampler/component.vue.d.ts +14 -4
  26. package/dist/core/controls/CameraControls.vue.d.ts +4 -2
  27. package/dist/core/controls/Helper/component.vue.d.ts +17 -0
  28. package/dist/core/controls/Helper/useHelper.d.ts +9 -0
  29. package/dist/core/controls/MapControls.vue.d.ts +3 -1
  30. package/dist/core/controls/OrbitControls.vue.d.ts +3 -1
  31. package/dist/core/controls/PointerLockControls.vue.d.ts +3 -1
  32. package/dist/core/controls/ScrollControls.vue.d.ts +23 -18
  33. package/dist/core/controls/TransformControls.vue.d.ts +3 -1
  34. package/dist/core/controls/index.d.ts +2 -1
  35. package/dist/core/loaders/SVG/component.vue.d.ts +10 -1
  36. package/dist/core/loaders/index.d.ts +4 -1
  37. package/dist/core/loaders/useGLTF/component.vue.d.ts +3 -10
  38. package/dist/core/loaders/useGLTF/index.d.ts +38 -27
  39. package/dist/core/loaders/useTexture/component.vue.d.ts +5077 -0
  40. package/dist/core/loaders/useTexture/index.d.ts +3 -0
  41. package/dist/core/loaders/useTextures/index.d.ts +13 -0
  42. package/dist/core/materials/customShaderMaterial/index.vue.d.ts +3 -1
  43. package/dist/core/materials/holographicMaterial/index.vue.d.ts +7 -16
  44. package/dist/core/materials/index.d.ts +2 -1
  45. package/dist/core/materials/meshDiscardMaterial/index.vue.d.ts +3 -1
  46. package/dist/core/materials/meshGlassMaterial/index.vue.d.ts +3 -1
  47. package/dist/core/materials/meshReflectionMaterial/index.vue.d.ts +4 -2
  48. package/dist/core/materials/meshWobbleMaterial/index.vue.d.ts +7 -7
  49. package/dist/core/materials/pointMaterial/component.vue.d.ts +8 -0
  50. package/dist/core/materials/pointMaterial/material.d.ts +4 -0
  51. package/dist/core/misc/LOD.vue.d.ts +52 -0
  52. package/dist/core/misc/html/HTML.vue.d.ts +25 -7
  53. package/dist/core/misc/index.d.ts +3 -1
  54. package/dist/core/misc/useIntersect.d.ts +9 -0
  55. package/dist/core/shapes/Box.vue.d.ts +14 -4
  56. package/dist/core/shapes/Circle.vue.d.ts +15 -5
  57. package/dist/core/shapes/Cone.vue.d.ts +14 -4
  58. package/dist/core/shapes/CubicBezierLine.vue.d.ts +49 -0
  59. package/dist/core/shapes/Cylinder.vue.d.ts +14 -4
  60. package/dist/core/shapes/Dodecahedron.vue.d.ts +14 -4
  61. package/dist/core/shapes/Icosahedron.vue.d.ts +14 -4
  62. package/dist/core/shapes/Octahedron.vue.d.ts +14 -4
  63. package/dist/core/shapes/Plane.vue.d.ts +15 -5
  64. package/dist/core/shapes/QuadraticBezierLine.vue.d.ts +48 -0
  65. package/dist/core/shapes/Ring.vue.d.ts +14 -4
  66. package/dist/core/shapes/RoundedBox.vue.d.ts +14 -4
  67. package/dist/core/shapes/ScreenQuad.vue.d.ts +38 -0
  68. package/dist/core/shapes/Sphere.vue.d.ts +14 -4
  69. package/dist/core/shapes/Superformula.vue.d.ts +14 -4
  70. package/dist/core/shapes/Tetrahedron.vue.d.ts +14 -4
  71. package/dist/core/shapes/Torus.vue.d.ts +14 -4
  72. package/dist/core/shapes/TorusKnot.vue.d.ts +14 -4
  73. package/dist/core/shapes/Tube.vue.d.ts +14 -4
  74. package/dist/core/shapes/index.d.ts +4 -1
  75. package/dist/core/staging/AccumulativeShadows/ProgressiveLightMap.d.ts +35 -0
  76. package/dist/core/staging/AccumulativeShadows/SoftShadowMaterial.d.ts +10 -0
  77. package/dist/core/staging/AccumulativeShadows/component.vue.d.ts +115 -0
  78. package/dist/core/staging/Align.vue.d.ts +42 -12
  79. package/dist/core/staging/Backdrop.vue.d.ts +23 -5
  80. package/dist/core/staging/Bounds/Bounds.d.ts +73 -0
  81. package/dist/core/staging/Bounds/component.vue.d.ts +60 -0
  82. package/dist/core/staging/CircleShadow.vue.d.ts +27 -0
  83. package/dist/core/staging/Fit.vue.d.ts +35 -9
  84. package/dist/core/staging/Grid.vue.d.ts +11 -2
  85. package/dist/core/staging/Ocean.vue.d.ts +6 -3
  86. package/dist/core/staging/Precipitation.vue.d.ts +18 -1
  87. package/dist/core/staging/RandomizedLights/RandomizedLights.d.ts +29 -0
  88. package/dist/core/staging/RandomizedLights/component.vue.d.ts +43 -0
  89. package/dist/core/staging/Smoke.vue.d.ts +18 -1
  90. package/dist/core/staging/Stage.vue.d.ts +677 -0
  91. package/dist/core/staging/Stars.vue.d.ts +11 -2
  92. package/dist/core/staging/index.d.ts +6 -1
  93. package/dist/core/staging/useEnvironment/component.vue.d.ts +7 -4
  94. package/dist/core/staging/useEnvironment/lightformer/index.vue.d.ts +24 -13
  95. package/dist/trescientos.js +15333 -9636
  96. package/package.json +24 -24
  97. package/dist/composables/useLogger.d.ts +0 -8
  98. package/dist/core/loaders/useFBX/component.vue.d.ts +0 -45
  99. package/dist/core/staging/Sky.vue.d.ts +0 -46
  100. package/dist/core/staging/Sparkles/component.vue.d.ts +0 -168
  101. package/dist/trescientos.umd.cjs +0 -1721
@@ -1,39 +1,50 @@
1
- import { TresLoader, TresObject3D } from '@tresjs/core';
2
- import { DRACOLoader, GLTF } from 'three-stdlib';
3
- import { AnimationClip, Material, Scene } from 'three';
4
- export interface GLTFLoaderOptions {
1
+ import { MaybeRef } from 'vue';
2
+ import { GLTF } from 'three-stdlib';
3
+ export interface UseGLTFOptions {
5
4
  /**
6
- * Whether to use Draco compression.
7
- *
5
+ * Whether to use DRACO compression for loading the model
8
6
  * @type {boolean}
9
- * @memberof GLTFLoaderOptions
10
7
  */
11
8
  draco?: boolean;
12
9
  /**
13
- * The path to the Draco decoder.
14
- *
10
+ * Path to the DRACO decoder. Defaults to https://www.gstatic.com/draco/versioned/decoders/1.5.6/
15
11
  * @type {string}
16
- * @memberof GLTFLoaderOptions
17
12
  */
18
13
  decoderPath?: string;
19
14
  }
20
- export interface GLTFResult {
21
- animations: Array<AnimationClip>;
22
- nodes: Record<string, TresObject3D>;
23
- materials: Record<string, Material>;
24
- scene: Scene;
25
- }
26
- export interface TresGLTFLoaderType extends TresLoader<GLTF> {
27
- setDRACOLoader?: (dracoLoader: DRACOLoader) => void;
28
- }
29
15
  /**
30
- * Loads a GLTF file and returns a THREE.Object3D.
16
+ * Vue composable for loading GLTF models in TresJS
17
+ *
18
+ * @remarks
19
+ * This composable uses Three.js GLTFLoader under the hood and supports DRACO compression.
20
+ * When DRACO compression is enabled, it will use the specified decoder path or fallback to Google's CDN.
21
+ *
22
+ * @example
23
+ * ```ts
24
+ * const { state: model } = useGLTF('/path/to/model.glb', { draco: true })
25
+ * ```
31
26
  *
32
- * @export
33
- * @template T
34
- * @param {T} path - Path or array of paths to the GLTF file(s)
35
- * @param {GLTFLoaderOptions} [options] - Options for the loader
36
- * @param {(loader: TresGLTFLoaderType) => void} [extendLoader] - Function to extend the loader
37
- * @returns {Promise<T extends string[] ? GLTFResult[] : GLTFResult>} Promise that resolves with the loaded model(s)
27
+ * @param {MaybeRef<string>} path - Path to the GLTF model file
28
+ * @param {UseGLTFOptions} options - Options for loading the model
29
+ * @returns {{ state: GLTF, isLoading: boolean, execute: () => Promise<void> }} Object containing the model state, loading state and reload function
38
30
  */
39
- export declare function useGLTF<T extends string | string[]>(path: T, options?: GLTFLoaderOptions, extendLoader?: (loader: TresGLTFLoaderType) => void): Promise<T extends string[] ? GLTFResult[] : GLTFResult>;
31
+ export declare function useGLTF(path: MaybeRef<string>, options?: UseGLTFOptions): {
32
+ nodes: import('vue').ComputedRef<{
33
+ [name: string]: import('three').Object3D<import('three').Object3DEventMap>;
34
+ }>;
35
+ materials: import('vue').ComputedRef<{
36
+ [name: string]: import('three').Material;
37
+ }>;
38
+ state: import('vue').Ref<GLTF, GLTF>;
39
+ isReady: import('vue').Ref<boolean>;
40
+ isLoading: import('vue').Ref<boolean>;
41
+ error: import('vue').Ref<unknown>;
42
+ execute: (delay?: number, args_0: string) => Promise<GLTF>;
43
+ then<TResult1 = import('@vueuse/core').UseAsyncStateReturnBase<GLTF, [string], true>, TResult2 = never>(onfulfilled?: ((value: import('@vueuse/core').UseAsyncStateReturnBase<GLTF, [string], true>) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): PromiseLike<TResult1 | TResult2>;
44
+ load: (path: string) => void;
45
+ progress: {
46
+ loaded: number;
47
+ total: number;
48
+ percentage: number;
49
+ };
50
+ };