@tresjs/cientos 4.3.0 → 5.0.0-next.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 (101) hide show
  1. package/dist/core/abstractions/AnimatedSprite/component.vue.d.ts +12 -2
  2. package/dist/core/abstractions/Billboard.vue.d.ts +20 -2
  3. package/dist/core/abstractions/CubeCamera/component.vue.d.ts +12 -2
  4. package/dist/core/abstractions/Edges.vue.d.ts +12 -2
  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 +11 -2
  10. package/dist/core/abstractions/Levioso.vue.d.ts +20 -14
  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 +12 -2
  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 +10 -1
  19. package/dist/core/abstractions/Reflector.vue.d.ts +5 -2
  20. package/dist/core/abstractions/ScreenSizer.vue.d.ts +20 -2
  21. package/dist/core/abstractions/ScreenSpace.vue.d.ts +12 -2
  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 +12 -2
  26. package/dist/core/controls/CameraControls.vue.d.ts +3 -1
  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 +21 -16
  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 +3 -1
  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 +20 -2
  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 +12 -2
  56. package/dist/core/shapes/Circle.vue.d.ts +13 -3
  57. package/dist/core/shapes/Cone.vue.d.ts +12 -2
  58. package/dist/core/shapes/CubicBezierLine.vue.d.ts +49 -0
  59. package/dist/core/shapes/Cylinder.vue.d.ts +12 -2
  60. package/dist/core/shapes/Dodecahedron.vue.d.ts +12 -2
  61. package/dist/core/shapes/Icosahedron.vue.d.ts +12 -2
  62. package/dist/core/shapes/Octahedron.vue.d.ts +12 -2
  63. package/dist/core/shapes/Plane.vue.d.ts +13 -3
  64. package/dist/core/shapes/QuadraticBezierLine.vue.d.ts +48 -0
  65. package/dist/core/shapes/Ring.vue.d.ts +12 -2
  66. package/dist/core/shapes/RoundedBox.vue.d.ts +12 -2
  67. package/dist/core/shapes/ScreenQuad.vue.d.ts +38 -0
  68. package/dist/core/shapes/Sphere.vue.d.ts +12 -2
  69. package/dist/core/shapes/Superformula.vue.d.ts +12 -2
  70. package/dist/core/shapes/Tetrahedron.vue.d.ts +12 -2
  71. package/dist/core/shapes/Torus.vue.d.ts +12 -2
  72. package/dist/core/shapes/TorusKnot.vue.d.ts +12 -2
  73. package/dist/core/shapes/Tube.vue.d.ts +12 -2
  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 +36 -6
  79. package/dist/core/staging/Backdrop.vue.d.ts +20 -2
  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 +28 -2
  84. package/dist/core/staging/Grid.vue.d.ts +11 -2
  85. package/dist/core/staging/Ocean.vue.d.ts +5 -2
  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 +10 -1
  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 +25 -25
  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
@@ -2,6 +2,7 @@ export interface ScreenSpaceProps {
2
2
  depth?: number;
3
3
  }
4
4
  declare function __VLS_template(): {
5
+ attrs: Partial<{}>;
5
6
  slots: {
6
7
  default?(_: {}): any;
7
8
  };
@@ -15,14 +16,23 @@ declare function __VLS_template(): {
15
16
  Defaults: {};
16
17
  }, Readonly<import('@tresjs/core').Mutable<import('@tresjs/core').Overwrite<Partial<import('@tresjs/core').Overwrite<import('three').Group<import('three').Object3DEventMap>, import('@tresjs/core').WithMathProps<import('three').Group<import('three').Object3DEventMap>> & import('@tresjs/core').VueProps & Partial<import('@tresjs/core').EventHandlers>>>, Omit<import('@tresjs/core').InstanceProps<import('three').Group<import('three').Object3DEventMap>, typeof import('three').Group>, "object">>>>, {}, {}, import('vue').ComputedOptions, import('vue').MethodOptions, {}> | null;
17
18
  };
18
- attrs: Partial<{}>;
19
+ rootEl: any;
19
20
  };
20
21
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
21
22
  declare const __VLS_component: import('vue').DefineComponent<ScreenSpaceProps, {
22
23
  instance: import('vue').ShallowRef<any, any>;
23
24
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ScreenSpaceProps> & Readonly<{}>, {
24
25
  depth: number;
25
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
26
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
27
+ outerRef: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('@tresjs/core').Mutable<import('@tresjs/core').Overwrite<Partial<import('@tresjs/core').Overwrite<import('three').Group<import('three').Object3DEventMap>, import('@tresjs/core').WithMathProps<import('three').Group<import('three').Object3DEventMap>> & import('@tresjs/core').VueProps & Partial<import('@tresjs/core').EventHandlers>>>, Omit<import('@tresjs/core').InstanceProps<import('three').Group<import('three').Object3DEventMap>, typeof import('three').Group>, "object">>>>, {}, {}, import('vue').ComputedOptions, import('vue').MethodOptions, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
28
+ P: {};
29
+ B: {};
30
+ D: {};
31
+ C: {};
32
+ M: {};
33
+ Defaults: {};
34
+ }, Readonly<import('@tresjs/core').Mutable<import('@tresjs/core').Overwrite<Partial<import('@tresjs/core').Overwrite<import('three').Group<import('three').Object3DEventMap>, import('@tresjs/core').WithMathProps<import('three').Group<import('three').Object3DEventMap>> & import('@tresjs/core').VueProps & Partial<import('@tresjs/core').EventHandlers>>>, Omit<import('@tresjs/core').InstanceProps<import('three').Group<import('three').Object3DEventMap>, typeof import('three').Group>, "object">>>>, {}, {}, import('vue').ComputedOptions, import('vue').MethodOptions, {}> | null;
35
+ }, any>;
26
36
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
27
37
  export default _default;
28
38
  type __VLS_WithTemplateSlots<T, S> = T & {
@@ -114,22 +114,7 @@ export interface Text3DProps {
114
114
  */
115
115
  needUpdates?: boolean;
116
116
  }
117
- declare function __VLS_template(): {
118
- slots: {
119
- default?(_: {}): any;
120
- };
121
- refs: {
122
- text3DRef: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('@tresjs/core').Mutable<import('@tresjs/core').Overwrite<Partial<import('@tresjs/core').Overwrite<import('three').Mesh<import('three').BufferGeometry<import('three').NormalBufferAttributes>, import('three').Material | import('three').Material[], import('three').Object3DEventMap>, import('@tresjs/core').WithMathProps<import('three').Mesh<import('three').BufferGeometry<import('three').NormalBufferAttributes>, import('three').Material | import('three').Material[], import('three').Object3DEventMap>> & import('@tresjs/core').VueProps & Partial<import('@tresjs/core').EventHandlers>>>, Omit<import('@tresjs/core').InstanceProps<import('three').Mesh<import('three').BufferGeometry<import('three').NormalBufferAttributes>, import('three').Material | import('three').Material[], import('three').Object3DEventMap>, typeof import('three').Mesh>, "object">>>>, {}, {}, import('vue').ComputedOptions, import('vue').MethodOptions, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
123
- P: {};
124
- B: {};
125
- D: {};
126
- C: {};
127
- M: {};
128
- Defaults: {};
129
- }, Readonly<import('@tresjs/core').Mutable<import('@tresjs/core').Overwrite<Partial<import('@tresjs/core').Overwrite<import('three').Mesh<import('three').BufferGeometry<import('three').NormalBufferAttributes>, import('three').Material | import('three').Material[], import('three').Object3DEventMap>, import('@tresjs/core').WithMathProps<import('three').Mesh<import('three').BufferGeometry<import('three').NormalBufferAttributes>, import('three').Material | import('three').Material[], import('three').Object3DEventMap>> & import('@tresjs/core').VueProps & Partial<import('@tresjs/core').EventHandlers>>>, Omit<import('@tresjs/core').InstanceProps<import('three').Mesh<import('three').BufferGeometry<import('three').NormalBufferAttributes>, import('three').Material | import('three').Material[], import('three').Object3DEventMap>, typeof import('three').Mesh>, "object">>>>, {}, {}, import('vue').ComputedOptions, import('vue').MethodOptions, {}> | null;
130
- };
131
- attrs: Partial<{}>;
132
- };
117
+ declare function __VLS_template(): any;
133
118
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
134
119
  declare const __VLS_component: import('vue').DefineComponent<Text3DProps, {
135
120
  instance: import('vue').ShallowRef<any, any>;
@@ -144,7 +129,7 @@ declare const __VLS_component: import('vue').DefineComponent<Text3DProps, {
144
129
  bevelOffset: number;
145
130
  bevelSegments: number;
146
131
  needUpdates: boolean;
147
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
132
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, any, any>;
148
133
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
149
134
  export default _default;
150
135
  type __VLS_WithTemplateSlots<T, S> = T & {
@@ -6,6 +6,9 @@ import { default as GradientTexture } from './GradientTexture.vue';
6
6
  import { default as Image } from './Image/component.vue';
7
7
  import { default as Lensflare } from './Lensflare/component.vue';
8
8
  import { default as Levioso } from './Levioso.vue';
9
+ import { default as MarchingCube } from './MarchingCubes/MarchingCube.vue';
10
+ import { default as MarchingCubes } from './MarchingCubes/MarchingCubes.vue';
11
+ import { default as MarchingPlane } from './MarchingCubes/MarchingPlane.vue';
9
12
  import { default as Mask } from './Mask/component.vue';
10
13
  import { default as MouseParallax } from './MouseParallax.vue';
11
14
  import { default as Outline } from './Outline/component.vue';
@@ -22,4 +25,4 @@ import { default as Edges } from './Edges.vue';
22
25
  export * from '../staging/useEnvironment';
23
26
  export * from './useFBO/';
24
27
  export * from './useSurfaceSampler';
25
- export { AnimatedSprite, Billboard, CubeCamera, Edges, Fbo, GlobalAudio, GradientTexture, Image, Lensflare, Levioso, Mask, MouseParallax, Outline, PositionalAudio, Reflector, Sampler, ScreenSizer, ScreenSpace, Text3D, useAnimations, useMask, };
28
+ export { AnimatedSprite, Billboard, CubeCamera, Edges, Fbo, GlobalAudio, GradientTexture, Image, Lensflare, Levioso, MarchingCube, MarchingCubes, MarchingPlane, Mask, MouseParallax, Outline, PositionalAudio, Reflector, Sampler, ScreenSizer, ScreenSpace, Text3D, useAnimations, useMask, };
@@ -1,5 +1,5 @@
1
- import { AnimationMixer, AnimationAction, AnimationClip, Object3D, Scene } from 'three';
2
- import { Ref } from 'vue';
1
+ import { AnimationMixer, AnimationAction, AnimationClip, Object3D } from 'three';
2
+ import { MaybeRef } from 'vue';
3
3
  /**
4
4
  * Creates an AnimationMixer and returns it.
5
5
  *
@@ -9,9 +9,9 @@ import { Ref } from 'vue';
9
9
  * @param {(Scene | Ref<Object3D | undefined | null>)} [modelRef]
10
10
  * @return {*}
11
11
  */
12
- export declare function useAnimations<T extends AnimationClip>(animations: T[], modelRef?: Scene | Ref<Object3D | undefined | null>): {
12
+ export declare function useAnimations<T extends AnimationClip>(animations: MaybeRef<T[]>, modelRef?: MaybeRef<Object3D | undefined | null>): {
13
13
  actions: import('vue').ShallowReactive<{
14
- [key: string]: AnimationAction;
14
+ [key: string]: AnimationAction | undefined;
15
15
  }>;
16
16
  mixer: AnimationMixer;
17
17
  };
@@ -1,5 +1,6 @@
1
1
  import { useSurfaceSamplerProps } from '.';
2
2
  declare function __VLS_template(): {
3
+ attrs: Partial<{}>;
3
4
  slots: {
4
5
  default?(_: {}): any;
5
6
  };
@@ -13,12 +14,21 @@ declare function __VLS_template(): {
13
14
  Defaults: {};
14
15
  }, Readonly<import('@tresjs/core').Mutable<import('@tresjs/core').Overwrite<Partial<import('@tresjs/core').Overwrite<import('three').Group<import('three').Object3DEventMap>, import('@tresjs/core').WithMathProps<import('three').Group<import('three').Object3DEventMap>> & import('@tresjs/core').VueProps & Partial<import('@tresjs/core').EventHandlers>>>, Omit<import('@tresjs/core').InstanceProps<import('three').Group<import('three').Object3DEventMap>, typeof import('three').Group>, "object">>>>, {}, {}, import('vue').ComputedOptions, import('vue').MethodOptions, {}> | null;
15
16
  };
16
- attrs: Partial<{}>;
17
+ rootEl: any;
17
18
  };
18
19
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
19
20
  declare const __VLS_component: import('vue').DefineComponent<useSurfaceSamplerProps, {
20
21
  samplerRef: import('vue').Ref<any, any>;
21
- }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<useSurfaceSamplerProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
22
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<useSurfaceSamplerProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
23
+ samplerRef: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('@tresjs/core').Mutable<import('@tresjs/core').Overwrite<Partial<import('@tresjs/core').Overwrite<import('three').Group<import('three').Object3DEventMap>, import('@tresjs/core').WithMathProps<import('three').Group<import('three').Object3DEventMap>> & import('@tresjs/core').VueProps & Partial<import('@tresjs/core').EventHandlers>>>, Omit<import('@tresjs/core').InstanceProps<import('three').Group<import('three').Object3DEventMap>, typeof import('three').Group>, "object">>>>, {}, {}, import('vue').ComputedOptions, import('vue').MethodOptions, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
24
+ P: {};
25
+ B: {};
26
+ D: {};
27
+ C: {};
28
+ M: {};
29
+ Defaults: {};
30
+ }, Readonly<import('@tresjs/core').Mutable<import('@tresjs/core').Overwrite<Partial<import('@tresjs/core').Overwrite<import('three').Group<import('three').Object3DEventMap>, import('@tresjs/core').WithMathProps<import('three').Group<import('three').Object3DEventMap>> & import('@tresjs/core').VueProps & Partial<import('@tresjs/core').EventHandlers>>>, Omit<import('@tresjs/core').InstanceProps<import('three').Group<import('three').Object3DEventMap>, typeof import('three').Group>, "object">>>>, {}, {}, import('vue').ComputedOptions, import('vue').MethodOptions, {}> | null;
31
+ }, any>;
22
32
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
23
33
  export default _default;
24
34
  type __VLS_WithTemplateSlots<T, S> = T & {
@@ -300,5 +300,7 @@ declare const _default: import('vue').DefineComponent<CameraControlsProps, {
300
300
  boundaryFriction: number;
301
301
  restThreshold: number;
302
302
  colliderMeshes: Object3D[];
303
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
303
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
304
+ controlsRef: unknown;
305
+ }, any>;
304
306
  export default _default;
@@ -0,0 +1,17 @@
1
+ import { Object3D } from 'three';
2
+ type HelperConstructor = new (...args: any[]) => any;
3
+ export interface HelperProps {
4
+ type: HelperConstructor;
5
+ args?: any[];
6
+ }
7
+ declare const _default: import('vue').DefineComponent<HelperProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<HelperProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
8
+ objRef: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('@tresjs/core').Mutable<import('@tresjs/core').Overwrite<Partial<import('@tresjs/core').Overwrite<Object3D<import('three').Object3DEventMap>, import('@tresjs/core').WithMathProps<Object3D<import('three').Object3DEventMap>> & import('@tresjs/core').VueProps & Partial<import('@tresjs/core').EventHandlers>>>, Omit<import('@tresjs/core').InstanceProps<Object3D<import('three').Object3DEventMap>, typeof Object3D>, "object">>>>, {}, {}, import('vue').ComputedOptions, import('vue').MethodOptions, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
9
+ P: {};
10
+ B: {};
11
+ D: {};
12
+ C: {};
13
+ M: {};
14
+ Defaults: {};
15
+ }, Readonly<import('@tresjs/core').Mutable<import('@tresjs/core').Overwrite<Partial<import('@tresjs/core').Overwrite<Object3D<import('three').Object3DEventMap>, import('@tresjs/core').WithMathProps<Object3D<import('three').Object3DEventMap>> & import('@tresjs/core').VueProps & Partial<import('@tresjs/core').EventHandlers>>>, Omit<import('@tresjs/core').InstanceProps<Object3D<import('three').Object3DEventMap>, typeof Object3D>, "object">>>>, {}, {}, import('vue').ComputedOptions, import('vue').MethodOptions, {}> | null;
16
+ }, any>;
17
+ export default _default;
@@ -0,0 +1,9 @@
1
+ import { Object3D } from 'three';
2
+ import { MaybeRefOrGetter } from 'vue';
3
+ type HelperType = Object3D & {
4
+ update: () => void;
5
+ dispose: () => void;
6
+ };
7
+ type HelperConstructor = new (...args: any[]) => any;
8
+ export declare function useHelper<T extends HelperConstructor>(object3D: MaybeRefOrGetter<Object3D | null | undefined | false>, helperConstructor: T, ...args: any[]): import('vue').ShallowRef<HelperType | undefined, HelperType | undefined>;
9
+ export {};
@@ -254,5 +254,7 @@ declare const _default: import('vue').DefineComponent<MapControlsProps, {
254
254
  zoomSpeed: number;
255
255
  enableRotate: boolean;
256
256
  rotateSpeed: number;
257
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
257
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
258
+ controlsRef: unknown;
259
+ }, any>;
258
260
  export default _default;
@@ -279,5 +279,7 @@ declare const _default: import('vue').DefineComponent<OrbitControlsProps, {
279
279
  zoomSpeed: number;
280
280
  enableRotate: boolean;
281
281
  rotateSpeed: number;
282
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
282
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
283
+ controlsRef: unknown;
284
+ }, any>;
283
285
  export default _default;
@@ -45,5 +45,7 @@ declare const _default: import('vue').DefineComponent<PointerLockControlsProps,
45
45
  onIsLock?: ((...args: any[]) => any) | undefined;
46
46
  }>, {
47
47
  makeDefault: boolean;
48
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
48
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
49
+ controlsRef: unknown;
50
+ }, any>;
49
51
  export default _default;
@@ -40,7 +40,15 @@ export interface ScrollControlsProps {
40
40
  */
41
41
  htmlScroll?: boolean;
42
42
  }
43
+ type __VLS_Props = {
44
+ pages?: number;
45
+ distance?: number;
46
+ smoothScroll?: number;
47
+ horizontal?: boolean;
48
+ htmlScroll?: boolean;
49
+ };
43
50
  declare function __VLS_template(): {
51
+ attrs: Partial<{}>;
44
52
  slots: {
45
53
  default?(_: {}): any;
46
54
  };
@@ -54,26 +62,14 @@ declare function __VLS_template(): {
54
62
  Defaults: {};
55
63
  }, Readonly<import('@tresjs/core').Mutable<import('@tresjs/core').Overwrite<Partial<import('@tresjs/core').Overwrite<import('three').Group<import('three').Object3DEventMap>, import('@tresjs/core').WithMathProps<import('three').Group<import('three').Object3DEventMap>> & import('@tresjs/core').VueProps & Partial<import('@tresjs/core').EventHandlers>>>, Omit<import('@tresjs/core').InstanceProps<import('three').Group<import('three').Object3DEventMap>, typeof import('three').Group>, "object">>>>, {}, {}, import('vue').ComputedOptions, import('vue').MethodOptions, {}> | null;
56
64
  };
57
- attrs: Partial<{}>;
65
+ rootEl: any;
58
66
  };
59
67
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
60
- declare const __VLS_component: import('vue').DefineComponent<{
61
- pages?: number;
62
- distance?: number;
63
- smoothScroll?: number;
64
- horizontal?: boolean;
65
- htmlScroll?: boolean;
66
- }, {
68
+ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {
67
69
  instance: import('vue').ShallowRef<any, any>;
68
70
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
69
71
  "update:modelValue": (...args: any[]) => void;
70
- }, string, import('vue').PublicProps, Readonly<{
71
- pages?: number;
72
- distance?: number;
73
- smoothScroll?: number;
74
- horizontal?: boolean;
75
- htmlScroll?: boolean;
76
- }> & Readonly<{
72
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
77
73
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
78
74
  }>, {
79
75
  distance: number;
@@ -81,7 +77,16 @@ declare const __VLS_component: import('vue').DefineComponent<{
81
77
  smoothScroll: number;
82
78
  horizontal: boolean;
83
79
  htmlScroll: boolean;
84
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
80
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
81
+ wrapperRef: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('@tresjs/core').Mutable<import('@tresjs/core').Overwrite<Partial<import('@tresjs/core').Overwrite<import('three').Group<import('three').Object3DEventMap>, import('@tresjs/core').WithMathProps<import('three').Group<import('three').Object3DEventMap>> & import('@tresjs/core').VueProps & Partial<import('@tresjs/core').EventHandlers>>>, Omit<import('@tresjs/core').InstanceProps<import('three').Group<import('three').Object3DEventMap>, typeof import('three').Group>, "object">>>>, {}, {}, import('vue').ComputedOptions, import('vue').MethodOptions, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
82
+ P: {};
83
+ B: {};
84
+ D: {};
85
+ C: {};
86
+ M: {};
87
+ Defaults: {};
88
+ }, Readonly<import('@tresjs/core').Mutable<import('@tresjs/core').Overwrite<Partial<import('@tresjs/core').Overwrite<import('three').Group<import('three').Object3DEventMap>, import('@tresjs/core').WithMathProps<import('three').Group<import('three').Object3DEventMap>> & import('@tresjs/core').VueProps & Partial<import('@tresjs/core').EventHandlers>>>, Omit<import('@tresjs/core').InstanceProps<import('three').Group<import('three').Object3DEventMap>, typeof import('three').Group>, "object">>>>, {}, {}, import('vue').ComputedOptions, import('vue').MethodOptions, {}> | null;
89
+ }, any>;
85
90
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
86
91
  export default _default;
87
92
  type __VLS_WithTemplateSlots<T, S> = T & {
@@ -38,5 +38,7 @@ declare const _default: import('vue').DefineComponent<TransformControlsProps, {
38
38
  showX: boolean;
39
39
  showY: boolean;
40
40
  showZ: boolean;
41
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
41
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
42
+ controlsRef: unknown;
43
+ }, any>;
42
44
  export default _default;
@@ -1,8 +1,9 @@
1
1
  import { default as CameraControls, BaseCameraControls } from './CameraControls.vue';
2
+ import { default as Helper } from './Helper/component.vue';
2
3
  import { default as KeyboardControls } from './KeyboardControls.vue';
3
4
  import { default as MapControls } from './MapControls.vue';
4
5
  import { default as OrbitControls } from './OrbitControls.vue';
5
6
  import { default as PointerLockControls } from './PointerLockControls.vue';
6
7
  import { default as ScrollControls } from './ScrollControls.vue';
7
8
  import { default as TransformControls } from './TransformControls.vue';
8
- export { BaseCameraControls, CameraControls, KeyboardControls, MapControls, OrbitControls, PointerLockControls, ScrollControls, TransformControls, };
9
+ export { BaseCameraControls, CameraControls, Helper, KeyboardControls, MapControls, OrbitControls, PointerLockControls, ScrollControls, TransformControls, };
@@ -96,5 +96,14 @@ declare const _default: import('vue').DefineComponent<SVGProps, {
96
96
  depth: "renderOrder" | "flat" | "offsetZ" | number;
97
97
  skipStrokes: boolean;
98
98
  skipFills: boolean;
99
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
99
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
100
+ svgRef: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('@tresjs/core').Mutable<import('@tresjs/core').Overwrite<Partial<import('@tresjs/core').Overwrite<import('three').Group<import('three').Object3DEventMap>, import('@tresjs/core').WithMathProps<import('three').Group<import('three').Object3DEventMap>> & import('@tresjs/core').VueProps & Partial<import('@tresjs/core').EventHandlers>>>, Omit<import('@tresjs/core').InstanceProps<import('three').Group<import('three').Object3DEventMap>, typeof import('three').Group>, "object">>>>, {}, {}, import('vue').ComputedOptions, import('vue').MethodOptions, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
101
+ P: {};
102
+ B: {};
103
+ D: {};
104
+ C: {};
105
+ M: {};
106
+ Defaults: {};
107
+ }, Readonly<import('@tresjs/core').Mutable<import('@tresjs/core').Overwrite<Partial<import('@tresjs/core').Overwrite<import('three').Group<import('three').Object3DEventMap>, import('@tresjs/core').WithMathProps<import('three').Group<import('three').Object3DEventMap>> & import('@tresjs/core').VueProps & Partial<import('@tresjs/core').EventHandlers>>>, Omit<import('@tresjs/core').InstanceProps<import('three').Group<import('three').Object3DEventMap>, typeof import('three').Group>, "object">>>>, {}, {}, import('vue').ComputedOptions, import('vue').MethodOptions, {}> | null;
108
+ }, any>;
100
109
  export default _default;
@@ -1,8 +1,11 @@
1
1
  import { default as SVG } from './SVG/component.vue';
2
2
  import { default as FBXModel } from './useFBX/component.vue';
3
3
  import { default as GLTFModel } from './useGLTF/component.vue';
4
+ import { default as UseTexture } from './useTexture/component.vue';
4
5
  import { useProgress } from './useProgress';
5
6
  import { useVideoTexture } from './useVideoTexture';
6
7
  export * from './useFBX';
7
8
  export * from './useGLTF';
8
- export { FBXModel, GLTFModel, SVG, useProgress, useVideoTexture };
9
+ export * from './useTexture';
10
+ export * from './useTextures';
11
+ export { FBXModel, GLTFModel, SVG, useProgress, UseTexture, useVideoTexture };
@@ -50,21 +50,14 @@ export interface GLTFModelProps {
50
50
  */
51
51
  decoderPath?: string;
52
52
  }
53
- declare const _default: import('vue').DefineComponent<{
53
+ type __VLS_Props = {
54
54
  path: string;
55
55
  draco?: boolean;
56
56
  decoderPath?: string;
57
57
  castShadow?: boolean;
58
58
  receiveShadow?: boolean;
59
- }, {
60
- instance: import('vue').Ref<any, any>;
61
- }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{
62
- path: string;
63
- draco?: boolean;
64
- decoderPath?: string;
65
- castShadow?: boolean;
66
- receiveShadow?: boolean;
67
- }> & Readonly<{}>, {
59
+ };
60
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
68
61
  castShadow: boolean;
69
62
  receiveShadow: boolean;
70
63
  draco: boolean;
@@ -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
+ };