@tresjs/cientos 4.3.0 → 5.0.0-alpha.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.
- package/dist/core/abstractions/AnimatedSprite/component.vue.d.ts +14 -4
- package/dist/core/abstractions/Billboard.vue.d.ts +24 -6
- package/dist/core/abstractions/CubeCamera/component.vue.d.ts +14 -4
- package/dist/core/abstractions/CubeCamera/useCubeCamera.d.ts +3 -2
- package/dist/core/abstractions/Edges.vue.d.ts +15 -5
- package/dist/core/abstractions/GradientTexture.vue.d.ts +14 -1
- package/dist/core/abstractions/Image/ImageMaterial.vue.d.ts +3 -1
- package/dist/core/abstractions/Image/component.vue.d.ts +3 -9
- package/dist/core/abstractions/Lensflare/LensflareImpl.d.ts +23 -0
- package/dist/core/abstractions/Lensflare/component.vue.d.ts +12 -3
- package/dist/core/abstractions/Levioso.vue.d.ts +22 -16
- package/dist/core/abstractions/MarchingCubes/MarchingCube.vue.d.ts +22 -0
- package/dist/core/abstractions/MarchingCubes/MarchingCubes.vue.d.ts +35 -0
- package/dist/core/abstractions/MarchingCubes/MarchingPlane.vue.d.ts +20 -0
- package/dist/core/abstractions/MarchingCubes/const.d.ts +2 -0
- package/dist/core/abstractions/Mask/component.vue.d.ts +15 -5
- package/dist/core/abstractions/MouseParallax.vue.d.ts +11 -1
- package/dist/core/abstractions/Outline/component.vue.d.ts +12 -2
- package/dist/core/abstractions/PositionalAudio.vue.d.ts +11 -2
- package/dist/core/abstractions/Reflector.vue.d.ts +5 -2
- package/dist/core/abstractions/ScreenSizer.vue.d.ts +24 -6
- package/dist/core/abstractions/ScreenSpace.vue.d.ts +14 -4
- package/dist/core/abstractions/Text3D.vue.d.ts +14 -4
- package/dist/core/abstractions/index.d.ts +4 -1
- package/dist/core/abstractions/useAnimations.d.ts +4 -4
- package/dist/core/abstractions/useSurfaceSampler/component.vue.d.ts +14 -4
- package/dist/core/abstractions/useSurfaceSampler/index.d.ts +3 -2
- package/dist/core/controls/CameraControls.vue.d.ts +4 -2
- package/dist/core/controls/Helper/component.vue.d.ts +16 -0
- package/dist/core/controls/Helper/useHelper.d.ts +10 -0
- package/dist/core/controls/MapControls.vue.d.ts +3 -1
- package/dist/core/controls/OrbitControls.vue.d.ts +3 -1
- package/dist/core/controls/PointerLockControls.vue.d.ts +3 -1
- package/dist/core/controls/ScrollControls.vue.d.ts +23 -18
- package/dist/core/controls/TransformControls.vue.d.ts +3 -1
- package/dist/core/controls/index.d.ts +2 -1
- package/dist/core/loaders/index.d.ts +6 -2
- package/dist/core/loaders/useFBX/component.vue.d.ts +4 -11
- package/dist/core/loaders/useFBX/index.d.ts +28 -5
- package/dist/core/loaders/useGLTF/component.vue.d.ts +3 -15
- package/dist/core/loaders/useGLTF/index.d.ts +31 -27
- package/dist/core/loaders/{SVG → useSVG}/component.vue.d.ts +2 -1
- package/dist/core/loaders/useSVG/index.d.ts +65 -0
- package/dist/core/loaders/useTexture/component.vue.d.ts +5134 -0
- package/dist/core/loaders/useTexture/index.d.ts +3 -0
- package/dist/core/loaders/useTextures/index.d.ts +13 -0
- package/dist/core/materials/customShaderMaterial/index.vue.d.ts +3 -1
- package/dist/core/materials/holographicMaterial/index.vue.d.ts +7 -16
- package/dist/core/materials/index.d.ts +2 -1
- package/dist/core/materials/meshDiscardMaterial/index.vue.d.ts +3 -1
- package/dist/core/materials/meshGlassMaterial/index.vue.d.ts +3 -1
- package/dist/core/materials/meshGlassMaterial/material.d.ts +11 -2
- package/dist/core/materials/meshReflectionMaterial/index.vue.d.ts +7 -5
- package/dist/core/materials/meshWobbleMaterial/index.vue.d.ts +7 -7
- package/dist/core/materials/pointMaterial/component.vue.d.ts +8 -0
- package/dist/core/materials/pointMaterial/material.d.ts +4 -0
- package/dist/core/misc/LOD.vue.d.ts +52 -0
- package/dist/core/misc/html/HTML.vue.d.ts +25 -7
- package/dist/core/misc/index.d.ts +3 -1
- package/dist/core/misc/useIntersect.d.ts +9 -0
- package/dist/core/shapes/Box.vue.d.ts +14 -4
- package/dist/core/shapes/Circle.vue.d.ts +15 -5
- package/dist/core/shapes/Cone.vue.d.ts +14 -4
- package/dist/core/shapes/CubicBezierLine.vue.d.ts +49 -0
- package/dist/core/shapes/Cylinder.vue.d.ts +14 -4
- package/dist/core/shapes/Dodecahedron.vue.d.ts +14 -4
- package/dist/core/shapes/Icosahedron.vue.d.ts +14 -4
- package/dist/core/shapes/Line2.vue.d.ts +2 -2
- package/dist/core/shapes/Octahedron.vue.d.ts +14 -4
- package/dist/core/shapes/Plane.vue.d.ts +15 -5
- package/dist/core/shapes/QuadraticBezierLine.vue.d.ts +48 -0
- package/dist/core/shapes/Ring.vue.d.ts +14 -4
- package/dist/core/shapes/RoundedBox.vue.d.ts +14 -4
- package/dist/core/shapes/ScreenQuad.vue.d.ts +38 -0
- package/dist/core/shapes/Sphere.vue.d.ts +14 -4
- package/dist/core/shapes/Superformula.vue.d.ts +14 -4
- package/dist/core/shapes/Tetrahedron.vue.d.ts +14 -4
- package/dist/core/shapes/Torus.vue.d.ts +14 -4
- package/dist/core/shapes/TorusKnot.vue.d.ts +14 -4
- package/dist/core/shapes/Tube.vue.d.ts +14 -4
- package/dist/core/shapes/index.d.ts +4 -1
- package/dist/core/staging/AccumulativeShadows/ProgressiveLightMap.d.ts +35 -0
- package/dist/core/staging/AccumulativeShadows/SoftShadowMaterial.d.ts +10 -0
- package/dist/core/staging/AccumulativeShadows/component.vue.d.ts +115 -0
- package/dist/core/staging/Align.vue.d.ts +46 -16
- package/dist/core/staging/Backdrop.vue.d.ts +23 -5
- package/dist/core/staging/Bounds/Bounds.d.ts +73 -0
- package/dist/core/staging/Bounds/component.vue.d.ts +60 -0
- package/dist/core/staging/CircleShadow.vue.d.ts +27 -0
- package/dist/core/staging/ContactShadows.vue.d.ts +2 -2
- package/dist/core/staging/Fit.vue.d.ts +35 -9
- package/dist/core/staging/Grid.vue.d.ts +11 -2
- package/dist/core/staging/Ocean.vue.d.ts +5 -2
- package/dist/core/staging/Precipitation.vue.d.ts +18 -1
- package/dist/core/staging/RandomizedLights/RandomizedLights.d.ts +29 -0
- package/dist/core/staging/RandomizedLights/component.vue.d.ts +43 -0
- package/dist/core/staging/Sky.vue.d.ts +1 -1
- package/dist/core/staging/Smoke.vue.d.ts +18 -1
- package/dist/core/staging/Sparkles/component.vue.d.ts +1 -1
- package/dist/core/staging/Stage.vue.d.ts +677 -0
- package/dist/core/staging/Stars.vue.d.ts +10 -1
- package/dist/core/staging/index.d.ts +6 -1
- package/dist/core/staging/useEnvironment/component.vue.d.ts +7 -4
- package/dist/core/staging/useEnvironment/lightformer/index.vue.d.ts +24 -13
- package/dist/trescientos.js +52469 -11173
- package/package.json +29 -27
- package/dist/composables/useLogger.d.ts +0 -8
- package/dist/trescientos.umd.cjs +0 -1721
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Group } from 'three';
|
|
1
2
|
export interface FBXModelProps {
|
|
2
3
|
/**
|
|
3
4
|
* Path to the FBX file.
|
|
@@ -28,17 +29,9 @@ export interface FBXModelProps {
|
|
|
28
29
|
*/
|
|
29
30
|
receiveShadow?: boolean;
|
|
30
31
|
}
|
|
31
|
-
declare const _default: import('vue').DefineComponent<{
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
receiveShadow?: boolean;
|
|
35
|
-
}, {
|
|
36
|
-
instance: import('vue').Ref<any, any>;
|
|
37
|
-
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{
|
|
38
|
-
path: string;
|
|
39
|
-
castShadow?: boolean;
|
|
40
|
-
receiveShadow?: boolean;
|
|
41
|
-
}> & Readonly<{}>, {
|
|
32
|
+
declare const _default: import('vue').DefineComponent<FBXModelProps, {
|
|
33
|
+
instance: import('vue').Ref<Group<import('three').Object3DEventMap> | null, Group<import('three').Object3DEventMap> | null>;
|
|
34
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<FBXModelProps> & Readonly<{}>, {
|
|
42
35
|
castShadow: boolean;
|
|
43
36
|
receiveShadow: boolean;
|
|
44
37
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
@@ -1,9 +1,32 @@
|
|
|
1
|
+
import { TresObject } from '@tresjs/core';
|
|
2
|
+
import { ComputedRef, MaybeRef, Ref } from 'vue';
|
|
1
3
|
import { Group } from 'three';
|
|
4
|
+
export interface UseFBXOptions {
|
|
5
|
+
/**
|
|
6
|
+
* A traverse function applied to the scene upon loading the model.
|
|
7
|
+
* @type {Function}
|
|
8
|
+
*/
|
|
9
|
+
traverse?: (child: TresObject) => void;
|
|
10
|
+
}
|
|
2
11
|
/**
|
|
3
|
-
*
|
|
12
|
+
* Vue composable for loading FBX models in TresJS
|
|
4
13
|
*
|
|
5
|
-
* @
|
|
6
|
-
*
|
|
7
|
-
*
|
|
14
|
+
* @remarks
|
|
15
|
+
* This composable uses Three.js FBXLoader under the hood to load FBX 3D models.
|
|
16
|
+
* The loaded model is automatically parsed and made available as a reactive state.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* const { state: model } = useFBX('/path/to/model.fbx')
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* @param {MaybeRef<string>} path - Path to the FBX model file
|
|
24
|
+
* @returns {{ state: Group, isLoading: boolean, execute: () => Promise<void>, nodes: object, materials: object }} Object containing the model state, loading state, reload function, and parsed nodes/materials
|
|
8
25
|
*/
|
|
9
|
-
export declare function useFBX
|
|
26
|
+
export declare function useFBX(path: MaybeRef<string>, options?: UseFBXOptions): {
|
|
27
|
+
state: Ref<Group | null>;
|
|
28
|
+
isLoading: Ref<boolean>;
|
|
29
|
+
execute: (delay?: number, ...args: any[]) => Promise<Group>;
|
|
30
|
+
nodes: ComputedRef<Record<string, any>>;
|
|
31
|
+
materials: ComputedRef<Record<string, any>>;
|
|
32
|
+
};
|
|
@@ -50,21 +50,9 @@ export interface GLTFModelProps {
|
|
|
50
50
|
*/
|
|
51
51
|
decoderPath?: string;
|
|
52
52
|
}
|
|
53
|
-
declare const _default: import('vue').DefineComponent<{
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
decoderPath?: string;
|
|
57
|
-
castShadow?: boolean;
|
|
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<{}>, {
|
|
53
|
+
declare const _default: import('vue').DefineComponent<GLTFModelProps, {
|
|
54
|
+
instance: import('vue').Ref<import('three-stdlib').GLTF | null, import('three-stdlib').GLTF | null>;
|
|
55
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<GLTFModelProps> & Readonly<{}>, {
|
|
68
56
|
castShadow: boolean;
|
|
69
57
|
receiveShadow: boolean;
|
|
70
58
|
draco: boolean;
|
|
@@ -1,39 +1,43 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
export interface
|
|
1
|
+
import { TresObject } from '@tresjs/core';
|
|
2
|
+
import { ComputedRef, MaybeRef, Ref } from 'vue';
|
|
3
|
+
import { GLTF } from 'three-stdlib';
|
|
4
|
+
export interface UseGLTFOptions {
|
|
5
5
|
/**
|
|
6
|
-
* Whether to use
|
|
7
|
-
*
|
|
6
|
+
* Whether to use DRACO compression for loading the model
|
|
8
7
|
* @type {boolean}
|
|
9
|
-
* @memberof GLTFLoaderOptions
|
|
10
8
|
*/
|
|
11
9
|
draco?: boolean;
|
|
12
10
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
11
|
+
* Path to the DRACO decoder. Defaults to https://www.gstatic.com/draco/versioned/decoders/1.5.6/
|
|
15
12
|
* @type {string}
|
|
16
|
-
* @memberof GLTFLoaderOptions
|
|
17
13
|
*/
|
|
18
14
|
decoderPath?: string;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
scene: Scene;
|
|
25
|
-
}
|
|
26
|
-
export interface TresGLTFLoaderType extends TresLoader<GLTF> {
|
|
27
|
-
setDRACOLoader?: (dracoLoader: DRACOLoader) => void;
|
|
15
|
+
/**
|
|
16
|
+
* A traverse function applied to the scene upon loading the model.
|
|
17
|
+
* @type {Function}
|
|
18
|
+
*/
|
|
19
|
+
traverse?: (child: TresObject) => void;
|
|
28
20
|
}
|
|
29
21
|
/**
|
|
30
|
-
*
|
|
22
|
+
* Vue composable for loading GLTF models in TresJS
|
|
23
|
+
*
|
|
24
|
+
* @remarks
|
|
25
|
+
* This composable uses Three.js GLTFLoader under the hood and supports DRACO compression.
|
|
26
|
+
* When DRACO compression is enabled, it will use the specified decoder path or fallback to Google's CDN.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```ts
|
|
30
|
+
* const { state: model } = useGLTF('/path/to/model.glb', { draco: true })
|
|
31
|
+
* ```
|
|
31
32
|
*
|
|
32
|
-
* @
|
|
33
|
-
* @
|
|
34
|
-
* @
|
|
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)
|
|
33
|
+
* @param {MaybeRef<string>} path - Path to the GLTF model file
|
|
34
|
+
* @param {UseGLTFOptions} options - Options for loading the model
|
|
35
|
+
* @returns {{ state: GLTF, isLoading: boolean, execute: () => Promise<void> }} Object containing the model state, loading state and reload function
|
|
38
36
|
*/
|
|
39
|
-
export declare function useGLTF
|
|
37
|
+
export declare function useGLTF(path: MaybeRef<string>, options?: UseGLTFOptions): {
|
|
38
|
+
state: Ref<GLTF | null>;
|
|
39
|
+
isLoading: Ref<boolean>;
|
|
40
|
+
execute: (delay?: number, ...args: any[]) => Promise<GLTF>;
|
|
41
|
+
nodes: ComputedRef<Record<string, any>>;
|
|
42
|
+
materials: ComputedRef<Record<string, any>>;
|
|
43
|
+
};
|
|
@@ -91,7 +91,8 @@ interface SVGProps {
|
|
|
91
91
|
depth?: 'renderOrder' | 'flat' | 'offsetZ' | number;
|
|
92
92
|
}
|
|
93
93
|
declare const _default: import('vue').DefineComponent<SVGProps, {
|
|
94
|
-
instance: import('vue').
|
|
94
|
+
instance: import('vue').Ref<import('three-stdlib').SVGResult | null, import('three-stdlib').SVGResult | null>;
|
|
95
|
+
layers: import('vue').ComputedRef<import('.').SVGLayer[]>;
|
|
95
96
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<SVGProps> & Readonly<{}>, {
|
|
96
97
|
depth: "renderOrder" | "flat" | "offsetZ" | number;
|
|
97
98
|
skipStrokes: boolean;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { ComputedRef, MaybeRef, Ref } from 'vue';
|
|
2
|
+
import { BufferGeometry, MeshBasicMaterialParameters } from 'three';
|
|
3
|
+
import { SVGResult } from 'three-stdlib';
|
|
4
|
+
export interface UseSVGOptions {
|
|
5
|
+
/**
|
|
6
|
+
* Whether to skip rendering strokes
|
|
7
|
+
* @type {boolean}
|
|
8
|
+
* @default false
|
|
9
|
+
*/
|
|
10
|
+
skipStrokes?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Whether to skip rendering fills
|
|
13
|
+
* @type {boolean}
|
|
14
|
+
* @default false
|
|
15
|
+
*/
|
|
16
|
+
skipFills?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Fill material properties
|
|
19
|
+
* @type {MeshBasicMaterialParameters}
|
|
20
|
+
*/
|
|
21
|
+
fillMaterial?: MeshBasicMaterialParameters;
|
|
22
|
+
/**
|
|
23
|
+
* Stroke material properties
|
|
24
|
+
* @type {MeshBasicMaterialParameters}
|
|
25
|
+
*/
|
|
26
|
+
strokeMaterial?: MeshBasicMaterialParameters;
|
|
27
|
+
/**
|
|
28
|
+
* Depth type - how should the resulting meshes be rendered?
|
|
29
|
+
* 'renderOrder' disables depthWrite and sets renderOrder of each layer
|
|
30
|
+
* 'flat' disables depthWrite on materials
|
|
31
|
+
* 'offsetZ' enables depthWrite and inserts small distance between layers
|
|
32
|
+
* number is treated same as 'offsetZ' using the number as distance
|
|
33
|
+
* @type {'renderOrder' | 'flat' | 'offsetZ' | number}
|
|
34
|
+
* @default 'renderOrder'
|
|
35
|
+
*/
|
|
36
|
+
depth?: 'renderOrder' | 'flat' | 'offsetZ' | number;
|
|
37
|
+
}
|
|
38
|
+
export interface SVGLayer {
|
|
39
|
+
geometry: BufferGeometry;
|
|
40
|
+
material: MeshBasicMaterialParameters;
|
|
41
|
+
isStroke: boolean;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Vue composable for loading SVG files in TresJS
|
|
45
|
+
*
|
|
46
|
+
* @remarks
|
|
47
|
+
* This composable uses Three.js SVGLoader under the hood to load and process SVG files
|
|
48
|
+
* into geometries and materials that can be rendered in a 3D scene.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```ts
|
|
52
|
+
* const { state: svg, layers } = useSVG('/path/to/file.svg', { skipStrokes: false })
|
|
53
|
+
* ```
|
|
54
|
+
*
|
|
55
|
+
* @param {MaybeRef<string>} path - Path to the SVG file or SVG data string
|
|
56
|
+
* @param {UseSVGOptions} options - Options for processing the SVG
|
|
57
|
+
* @returns Object containing the SVG state, loading state, processed layers and disposal function
|
|
58
|
+
*/
|
|
59
|
+
export declare function useSVG(path: MaybeRef<string>, options?: UseSVGOptions): {
|
|
60
|
+
state: Ref<SVGResult | null>;
|
|
61
|
+
isLoading: Ref<boolean>;
|
|
62
|
+
execute: (delay?: number, ...args: any[]) => Promise<SVGResult>;
|
|
63
|
+
layers: ComputedRef<SVGLayer[]>;
|
|
64
|
+
dispose: () => void;
|
|
65
|
+
};
|