@tresjs/core 3.6.0 → 3.6.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.
- package/README.md +6 -6
- package/dist/index.d.ts +3 -17
- package/dist/{components → src/components}/TresCanvas.vue.d.ts +5 -4
- package/dist/{composables → src/composables}/useCamera/index.d.ts +12 -12
- package/dist/{composables → src/composables}/useRenderer/index.d.ts +1 -1
- package/dist/src/index.d.ts +17 -0
- package/dist/{types → src/types}/index.d.ts +1 -1
- package/dist/tres.js +509 -386
- package/dist/tres.umd.cjs +3 -3
- package/package.json +1 -1
- /package/dist/{components → src/components}/index.d.ts +0 -0
- /package/dist/{composables → src/composables}/index.d.ts +0 -0
- /package/dist/{composables → src/composables}/useLoader/index.d.ts +0 -0
- /package/dist/{composables → src/composables}/useLogger.d.ts +0 -0
- /package/dist/{composables → src/composables}/usePointerEventHandler/index.d.ts +0 -0
- /package/dist/{composables → src/composables}/useRaycaster/index.d.ts +0 -0
- /package/dist/{composables → src/composables}/useRenderLoop/index.d.ts +0 -0
- /package/dist/{composables → src/composables}/useRenderer/const.d.ts +0 -0
- /package/dist/{composables → src/composables}/useSeek/index.d.ts +0 -0
- /package/dist/{composables → src/composables}/useTexture/index.d.ts +0 -0
- /package/dist/{composables → src/composables}/useTresContextProvider/index.d.ts +0 -0
- /package/dist/{core → src/core}/catalogue.d.ts +0 -0
- /package/dist/{core → src/core}/nodeOps.d.ts +0 -0
- /package/dist/{core → src/core}/renderer.d.ts +0 -0
- /package/dist/{core → src/core}/revision.d.ts +0 -0
- /package/dist/{utils → src/utils}/index.d.ts +0 -0
- /package/dist/{utils → src/utils}/normalize.d.ts +0 -0
- /package/dist/{utils → src/utils}/perf.d.ts +0 -0
- /package/dist/{utils → src/utils}/template-compiler-options.d.ts +0 -0
- /package/dist/{utils → src/utils}/test-utils.d.ts +0 -0
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@ Tres (Spanish word for "three", pronounced `/tres/` ) is a way of creating Three
|
|
|
19
19
|
|
|
20
20
|
It's build on-top of a [Vue Custom Renderer](https://vuejs.org/api/custom-renderer.html#createrenderer) and it's powered by Vite.
|
|
21
21
|
|
|
22
|
-
The goal is to provide the Vue's community an easy way of building 3D scenes with Vue, always up to date with the latest ThreeJS features and with 0-to-none
|
|
22
|
+
The goal is to provide the Vue's community an easy way of building 3D scenes with Vue, always up to date with the latest ThreeJS features and with 0-to-none maintenance.
|
|
23
23
|
|
|
24
24
|
## Installation
|
|
25
25
|
|
|
@@ -39,11 +39,11 @@ Checkout the [docs](https://tresjs.org)
|
|
|
39
39
|
|
|
40
40
|
| Package | Version |
|
|
41
41
|
| --------------------------- | :------------------------------------------------------------------------------------------------- |
|
|
42
|
-
| [Tres](
|
|
43
|
-
| [Cientos](
|
|
44
|
-
| [Post-processing](
|
|
45
|
-
| [Nuxt](
|
|
46
|
-
| [TresLeches 🍰](
|
|
42
|
+
| [Tres](https://github.com/TresJS/tres) |  |
|
|
43
|
+
| [Cientos](https://github.com/TresJS/cientos) |  |
|
|
44
|
+
| [Post-processing](https://github.com/TresJS/post-processing) |  |
|
|
45
|
+
| [Nuxt](https://github.com/TresJS/nuxt) |  |
|
|
46
|
+
| [TresLeches 🍰](https://github.com/TresJS/leches) |  |
|
|
47
47
|
|
|
48
48
|
## Contribution
|
|
49
49
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,17 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
export * from './composables';
|
|
5
|
-
export * from './core/catalogue';
|
|
6
|
-
export * from './components';
|
|
7
|
-
export * from './types';
|
|
8
|
-
export interface TresOptions {
|
|
9
|
-
extends?: Record<string, unknown>;
|
|
10
|
-
}
|
|
11
|
-
export interface TresPlugin {
|
|
12
|
-
[key: string]: any;
|
|
13
|
-
install: (app: App, options?: TresOptions) => void;
|
|
14
|
-
}
|
|
15
|
-
declare const plugin: TresPlugin;
|
|
16
|
-
export default plugin;
|
|
17
|
-
export { normalizeColor, normalizeVectorFlexibleParam, templateCompilerOptions, };
|
|
1
|
+
export * from './src/index'
|
|
2
|
+
import Tres from './src/index'
|
|
3
|
+
export default Tres
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { WebGLRendererParameters, ColorSpace, ShadowMapType, ToneMapping } from 'three';
|
|
2
|
-
import type { Ref } from 'vue';
|
|
3
2
|
import { type TresContext } from '../composables';
|
|
4
3
|
import type { RendererPresetsType } from '../composables/useRenderer/const';
|
|
5
4
|
import type { TresCamera } from '../types/';
|
|
@@ -29,9 +28,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
29
28
|
logarithmicDepthBuffer: undefined;
|
|
30
29
|
failIfMajorPerformanceCaveat: undefined;
|
|
31
30
|
}>, {
|
|
32
|
-
context:
|
|
31
|
+
context: import("vue").ShallowRef<TresContext | null>;
|
|
33
32
|
dispose: () => void;
|
|
34
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").
|
|
33
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<TresCanvasProps>, {
|
|
35
34
|
alpha: undefined;
|
|
36
35
|
depth: undefined;
|
|
37
36
|
shadows: undefined;
|
|
@@ -57,7 +56,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
57
56
|
disableRender: boolean;
|
|
58
57
|
}, {}>, Readonly<{
|
|
59
58
|
default(): any;
|
|
60
|
-
}
|
|
59
|
+
}> & {
|
|
60
|
+
default(): any;
|
|
61
|
+
}>;
|
|
61
62
|
export default _default;
|
|
62
63
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
63
64
|
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
@@ -1054,6 +1054,7 @@ export declare const useCamera: ({ sizes, scene }: Pick<TresContext, "sizes"> &
|
|
|
1054
1054
|
}[];
|
|
1055
1055
|
userData: Record<string, any>;
|
|
1056
1056
|
customDepthMaterial?: {
|
|
1057
|
+
readonly isMaterial: true;
|
|
1057
1058
|
alphaHash: boolean;
|
|
1058
1059
|
alphaTest: number;
|
|
1059
1060
|
alphaToCoverage: boolean;
|
|
@@ -1238,7 +1239,6 @@ export declare const useCamera: ({ sizes, scene }: Pick<TresContext, "sizes"> &
|
|
|
1238
1239
|
stencilFail: import("three").StencilOp;
|
|
1239
1240
|
stencilZFail: import("three").StencilOp;
|
|
1240
1241
|
stencilZPass: import("three").StencilOp;
|
|
1241
|
-
readonly isMaterial: true;
|
|
1242
1242
|
name: string;
|
|
1243
1243
|
needsUpdate: boolean;
|
|
1244
1244
|
opacity: number;
|
|
@@ -1262,7 +1262,7 @@ export declare const useCamera: ({ sizes, scene }: Pick<TresContext, "sizes"> &
|
|
|
1262
1262
|
clone: () => import("three").Material;
|
|
1263
1263
|
copy: (material: import("three").Material) => import("three").Material;
|
|
1264
1264
|
dispose: () => void;
|
|
1265
|
-
onBeforeCompile: (
|
|
1265
|
+
onBeforeCompile: (parameters: import("three").WebGLProgramParametersWithUniforms, renderer: import("three").WebGLRenderer) => void;
|
|
1266
1266
|
customProgramCacheKey: () => string;
|
|
1267
1267
|
setValues: (values: import("three").MaterialParameters) => void;
|
|
1268
1268
|
toJSON: (meta?: any) => any;
|
|
@@ -1289,6 +1289,7 @@ export declare const useCamera: ({ sizes, scene }: Pick<TresContext, "sizes"> &
|
|
|
1289
1289
|
}[T_6]) => void;
|
|
1290
1290
|
} | undefined;
|
|
1291
1291
|
customDistanceMaterial?: {
|
|
1292
|
+
readonly isMaterial: true;
|
|
1292
1293
|
alphaHash: boolean;
|
|
1293
1294
|
alphaTest: number;
|
|
1294
1295
|
alphaToCoverage: boolean;
|
|
@@ -1473,7 +1474,6 @@ export declare const useCamera: ({ sizes, scene }: Pick<TresContext, "sizes"> &
|
|
|
1473
1474
|
stencilFail: import("three").StencilOp;
|
|
1474
1475
|
stencilZFail: import("three").StencilOp;
|
|
1475
1476
|
stencilZPass: import("three").StencilOp;
|
|
1476
|
-
readonly isMaterial: true;
|
|
1477
1477
|
name: string;
|
|
1478
1478
|
needsUpdate: boolean;
|
|
1479
1479
|
opacity: number;
|
|
@@ -1497,7 +1497,7 @@ export declare const useCamera: ({ sizes, scene }: Pick<TresContext, "sizes"> &
|
|
|
1497
1497
|
clone: () => import("three").Material;
|
|
1498
1498
|
copy: (material: import("three").Material) => import("three").Material;
|
|
1499
1499
|
dispose: () => void;
|
|
1500
|
-
onBeforeCompile: (
|
|
1500
|
+
onBeforeCompile: (parameters: import("three").WebGLProgramParametersWithUniforms, renderer: import("three").WebGLRenderer) => void;
|
|
1501
1501
|
customProgramCacheKey: () => string;
|
|
1502
1502
|
setValues: (values: import("three").MaterialParameters) => void;
|
|
1503
1503
|
toJSON: (meta?: any) => any;
|
|
@@ -2442,6 +2442,7 @@ export declare const useCamera: ({ sizes, scene }: Pick<TresContext, "sizes"> &
|
|
|
2442
2442
|
}[];
|
|
2443
2443
|
userData: Record<string, any>;
|
|
2444
2444
|
customDepthMaterial?: {
|
|
2445
|
+
readonly isMaterial: true;
|
|
2445
2446
|
alphaHash: boolean;
|
|
2446
2447
|
alphaTest: number;
|
|
2447
2448
|
alphaToCoverage: boolean;
|
|
@@ -2626,7 +2627,6 @@ export declare const useCamera: ({ sizes, scene }: Pick<TresContext, "sizes"> &
|
|
|
2626
2627
|
stencilFail: import("three").StencilOp;
|
|
2627
2628
|
stencilZFail: import("three").StencilOp;
|
|
2628
2629
|
stencilZPass: import("three").StencilOp;
|
|
2629
|
-
readonly isMaterial: true;
|
|
2630
2630
|
name: string;
|
|
2631
2631
|
needsUpdate: boolean;
|
|
2632
2632
|
opacity: number;
|
|
@@ -2650,7 +2650,7 @@ export declare const useCamera: ({ sizes, scene }: Pick<TresContext, "sizes"> &
|
|
|
2650
2650
|
clone: () => import("three").Material;
|
|
2651
2651
|
copy: (material: import("three").Material) => import("three").Material;
|
|
2652
2652
|
dispose: () => void;
|
|
2653
|
-
onBeforeCompile: (
|
|
2653
|
+
onBeforeCompile: (parameters: import("three").WebGLProgramParametersWithUniforms, renderer: import("three").WebGLRenderer) => void;
|
|
2654
2654
|
customProgramCacheKey: () => string;
|
|
2655
2655
|
setValues: (values: import("three").MaterialParameters) => void;
|
|
2656
2656
|
toJSON: (meta?: any) => any;
|
|
@@ -2677,6 +2677,7 @@ export declare const useCamera: ({ sizes, scene }: Pick<TresContext, "sizes"> &
|
|
|
2677
2677
|
}[T_6]) => void;
|
|
2678
2678
|
} | undefined;
|
|
2679
2679
|
customDistanceMaterial?: {
|
|
2680
|
+
readonly isMaterial: true;
|
|
2680
2681
|
alphaHash: boolean;
|
|
2681
2682
|
alphaTest: number;
|
|
2682
2683
|
alphaToCoverage: boolean;
|
|
@@ -2861,7 +2862,6 @@ export declare const useCamera: ({ sizes, scene }: Pick<TresContext, "sizes"> &
|
|
|
2861
2862
|
stencilFail: import("three").StencilOp;
|
|
2862
2863
|
stencilZFail: import("three").StencilOp;
|
|
2863
2864
|
stencilZPass: import("three").StencilOp;
|
|
2864
|
-
readonly isMaterial: true;
|
|
2865
2865
|
name: string;
|
|
2866
2866
|
needsUpdate: boolean;
|
|
2867
2867
|
opacity: number;
|
|
@@ -2885,7 +2885,7 @@ export declare const useCamera: ({ sizes, scene }: Pick<TresContext, "sizes"> &
|
|
|
2885
2885
|
clone: () => import("three").Material;
|
|
2886
2886
|
copy: (material: import("three").Material) => import("three").Material;
|
|
2887
2887
|
dispose: () => void;
|
|
2888
|
-
onBeforeCompile: (
|
|
2888
|
+
onBeforeCompile: (parameters: import("three").WebGLProgramParametersWithUniforms, renderer: import("three").WebGLRenderer) => void;
|
|
2889
2889
|
customProgramCacheKey: () => string;
|
|
2890
2890
|
setValues: (values: import("three").MaterialParameters) => void;
|
|
2891
2891
|
toJSON: (meta?: any) => any;
|
|
@@ -3811,6 +3811,7 @@ export declare const useCamera: ({ sizes, scene }: Pick<TresContext, "sizes"> &
|
|
|
3811
3811
|
}[];
|
|
3812
3812
|
userData: Record<string, any>;
|
|
3813
3813
|
customDepthMaterial?: {
|
|
3814
|
+
readonly isMaterial: true;
|
|
3814
3815
|
alphaHash: boolean;
|
|
3815
3816
|
alphaTest: number;
|
|
3816
3817
|
alphaToCoverage: boolean;
|
|
@@ -3995,7 +3996,6 @@ export declare const useCamera: ({ sizes, scene }: Pick<TresContext, "sizes"> &
|
|
|
3995
3996
|
stencilFail: import("three").StencilOp;
|
|
3996
3997
|
stencilZFail: import("three").StencilOp;
|
|
3997
3998
|
stencilZPass: import("three").StencilOp;
|
|
3998
|
-
readonly isMaterial: true;
|
|
3999
3999
|
name: string;
|
|
4000
4000
|
needsUpdate: boolean;
|
|
4001
4001
|
opacity: number;
|
|
@@ -4019,7 +4019,7 @@ export declare const useCamera: ({ sizes, scene }: Pick<TresContext, "sizes"> &
|
|
|
4019
4019
|
clone: () => import("three").Material;
|
|
4020
4020
|
copy: (material: import("three").Material) => import("three").Material;
|
|
4021
4021
|
dispose: () => void;
|
|
4022
|
-
onBeforeCompile: (
|
|
4022
|
+
onBeforeCompile: (parameters: import("three").WebGLProgramParametersWithUniforms, renderer: import("three").WebGLRenderer) => void;
|
|
4023
4023
|
customProgramCacheKey: () => string;
|
|
4024
4024
|
setValues: (values: import("three").MaterialParameters) => void;
|
|
4025
4025
|
toJSON: (meta?: any) => any;
|
|
@@ -4046,6 +4046,7 @@ export declare const useCamera: ({ sizes, scene }: Pick<TresContext, "sizes"> &
|
|
|
4046
4046
|
}[T_6]) => void;
|
|
4047
4047
|
} | undefined;
|
|
4048
4048
|
customDistanceMaterial?: {
|
|
4049
|
+
readonly isMaterial: true;
|
|
4049
4050
|
alphaHash: boolean;
|
|
4050
4051
|
alphaTest: number;
|
|
4051
4052
|
alphaToCoverage: boolean;
|
|
@@ -4230,7 +4231,6 @@ export declare const useCamera: ({ sizes, scene }: Pick<TresContext, "sizes"> &
|
|
|
4230
4231
|
stencilFail: import("three").StencilOp;
|
|
4231
4232
|
stencilZFail: import("three").StencilOp;
|
|
4232
4233
|
stencilZPass: import("three").StencilOp;
|
|
4233
|
-
readonly isMaterial: true;
|
|
4234
4234
|
name: string;
|
|
4235
4235
|
needsUpdate: boolean;
|
|
4236
4236
|
opacity: number;
|
|
@@ -4254,7 +4254,7 @@ export declare const useCamera: ({ sizes, scene }: Pick<TresContext, "sizes"> &
|
|
|
4254
4254
|
clone: () => import("three").Material;
|
|
4255
4255
|
copy: (material: import("three").Material) => import("three").Material;
|
|
4256
4256
|
dispose: () => void;
|
|
4257
|
-
onBeforeCompile: (
|
|
4257
|
+
onBeforeCompile: (parameters: import("three").WebGLProgramParametersWithUniforms, renderer: import("three").WebGLRenderer) => void;
|
|
4258
4258
|
customProgramCacheKey: () => string;
|
|
4259
4259
|
setValues: (values: import("three").MaterialParameters) => void;
|
|
4260
4260
|
toJSON: (meta?: any) => any;
|
|
@@ -83,7 +83,7 @@ export declare function useRenderer({ scene, canvas, options, disableRender, con
|
|
|
83
83
|
contextParts: Pick<TresContext, 'sizes' | 'camera'>;
|
|
84
84
|
disableRender: MaybeRefOrGetter<boolean>;
|
|
85
85
|
}): {
|
|
86
|
-
renderer: import("vue").
|
|
86
|
+
renderer: import("vue").ShallowRef<WebGLRenderer>;
|
|
87
87
|
};
|
|
88
88
|
export type UseRendererReturn = ReturnType<typeof useRenderer>;
|
|
89
89
|
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { App } from 'vue';
|
|
2
|
+
import { normalizeColor, normalizeVectorFlexibleParam } from './utils/normalize';
|
|
3
|
+
import templateCompilerOptions from './utils/template-compiler-options';
|
|
4
|
+
export * from './composables';
|
|
5
|
+
export * from './core/catalogue';
|
|
6
|
+
export * from './components';
|
|
7
|
+
export * from './types';
|
|
8
|
+
export interface TresOptions {
|
|
9
|
+
extends?: Record<string, unknown>;
|
|
10
|
+
}
|
|
11
|
+
export interface TresPlugin {
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
install: (app: App, options?: TresOptions) => void;
|
|
14
|
+
}
|
|
15
|
+
declare const plugin: TresPlugin;
|
|
16
|
+
export default plugin;
|
|
17
|
+
export { normalizeColor, normalizeVectorFlexibleParam, templateCompilerOptions, };
|
|
@@ -107,7 +107,7 @@ export interface EventHandlers {
|
|
|
107
107
|
onWheel?: (event: ThreeEvent<WheelEvent>) => void;
|
|
108
108
|
}
|
|
109
109
|
interface MathRepresentation {
|
|
110
|
-
set(...args: number[]): any;
|
|
110
|
+
set(...args: number[] | [THREE.ColorRepresentation]): any;
|
|
111
111
|
}
|
|
112
112
|
interface VectorRepresentation extends MathRepresentation {
|
|
113
113
|
setScalar(s: number): any;
|