@tresjs/cientos 1.7.0 → 2.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/README.md +44 -0
- package/dist/core/Box.vue.d.ts +20 -1
- package/dist/core/Circle.vue.d.ts +19 -1
- package/dist/core/Cone.vue.d.ts +24 -6
- package/dist/core/Dodecahedron.vue.d.ts +19 -1
- package/dist/core/Icosahedron.vue.d.ts +19 -1
- package/dist/core/Octahedron.vue.d.ts +19 -1
- package/dist/core/OrbitControls.vue.d.ts +44 -0
- package/dist/core/Plane.vue.d.ts +19 -1
- package/dist/core/Ring.vue.d.ts +19 -1
- package/dist/core/Sphere.vue.d.ts +20 -1
- package/dist/core/Tetrahedron.vue.d.ts +19 -1
- package/dist/core/Text3D.vue.d.ts +93 -2
- package/dist/core/Torus.vue.d.ts +19 -1
- package/dist/core/TorusKnot.vue.d.ts +19 -1
- package/dist/core/Tube.vue.d.ts +21 -3
- package/dist/core/useAnimations.d.ts +9 -0
- package/dist/core/useCientos.d.ts +6 -0
- package/dist/core/useEnvironment/component.d.ts +2 -36
- package/dist/core/useEnvironment/const.d.ts +34 -0
- package/dist/core/useEnvironment/index.d.ts +14 -0
- package/dist/core/useFBX/component.d.ts +11 -11
- package/dist/core/useFBX/index.d.ts +7 -0
- package/dist/core/useGLTF/component.d.ts +33 -11
- package/dist/core/useGLTF/index.d.ts +23 -0
- package/dist/core/usePamCameraMouse/component.d.ts +19 -0
- package/dist/core/usePamCameraMouse/index.d.ts +2 -0
- package/dist/index.d.ts +3 -1
- package/dist/trescientos.js +3539 -3420
- package/dist/trescientos.umd.cjs +10 -10
- package/dist/utils/index.d.ts +18 -0
- package/package.json +26 -17
- package/dist/vite-env.d.ts +0 -3
|
@@ -1,10 +1,44 @@
|
|
|
1
1
|
import { TextureEncoding } from 'three';
|
|
2
2
|
export type EnvironmentOptions = {
|
|
3
|
+
/**
|
|
4
|
+
* If true, the environment will be set as the scene's background.
|
|
5
|
+
*
|
|
6
|
+
* @type {boolean}
|
|
7
|
+
* @default false
|
|
8
|
+
*/
|
|
3
9
|
background?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* The blur radius of the environment.
|
|
12
|
+
*
|
|
13
|
+
* @type {number}
|
|
14
|
+
* @default 0
|
|
15
|
+
*/
|
|
4
16
|
blur?: number;
|
|
17
|
+
/**
|
|
18
|
+
* The files to load. If a string is provided, it will be loaded as an equirectangular texture.
|
|
19
|
+
* If an array is provided, it will be loaded as a cube texture.
|
|
20
|
+
*
|
|
21
|
+
* @type {(string | string[])}
|
|
22
|
+
*/
|
|
5
23
|
files?: string | string[];
|
|
24
|
+
/**
|
|
25
|
+
* The path to the files.
|
|
26
|
+
*
|
|
27
|
+
* @type {string}
|
|
28
|
+
* @default '/'
|
|
29
|
+
*/
|
|
6
30
|
path?: string;
|
|
31
|
+
/**
|
|
32
|
+
* The preset to use. If provided, the files and path props will be ignored.
|
|
33
|
+
*
|
|
34
|
+
* @type {EnvironmentPresetsType}
|
|
35
|
+
*/
|
|
7
36
|
preset?: EnvironmentPresetsType;
|
|
37
|
+
/**
|
|
38
|
+
* The encoding of the environment.
|
|
39
|
+
*
|
|
40
|
+
* @type {TextureEncoding}
|
|
41
|
+
*/
|
|
8
42
|
encoding?: TextureEncoding;
|
|
9
43
|
};
|
|
10
44
|
export declare const environmentPresets: {
|
|
@@ -1,3 +1,17 @@
|
|
|
1
1
|
import { CubeTexture, Texture } from 'three';
|
|
2
2
|
import { EnvironmentOptions } from './const';
|
|
3
|
+
/**
|
|
4
|
+
* Component that loads an environment map and sets it as the scene's background and environment.
|
|
5
|
+
*
|
|
6
|
+
* @export
|
|
7
|
+
* @param {Partial<EnvironmentOptions>} {
|
|
8
|
+
* files = ['/px.png', '/nx.png', '/py.png', '/ny.png', '/pz.png', '/nz.png'],
|
|
9
|
+
* blur = 0,
|
|
10
|
+
* background = false,
|
|
11
|
+
* path = undefined,
|
|
12
|
+
* preset = undefined,
|
|
13
|
+
* encoding = undefined,
|
|
14
|
+
* }
|
|
15
|
+
* @return {*} {(Promise<Texture | CubeTexture>)}
|
|
16
|
+
*/
|
|
3
17
|
export declare function useEnvironment({ files, blur, background, path, preset, encoding, }: Partial<EnvironmentOptions>): Promise<Texture | CubeTexture>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
1
|
+
export interface FBXModelProps {
|
|
2
|
+
/**
|
|
3
|
+
* Path to the FBX file.
|
|
4
|
+
*
|
|
5
|
+
* @type {string}
|
|
6
|
+
* @memberof FBXModelProps
|
|
7
|
+
* @required
|
|
8
|
+
*/
|
|
9
|
+
path: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const FBXModel: import("vue").DefineComponent<FBXModelProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<FBXModelProps>, {}>;
|
|
@@ -1,2 +1,9 @@
|
|
|
1
1
|
import { Object3D } from 'three';
|
|
2
|
+
/**
|
|
3
|
+
* Loads an FBX file and returns a THREE.Object3D.
|
|
4
|
+
*
|
|
5
|
+
* @export
|
|
6
|
+
* @param {(string | string[])} path
|
|
7
|
+
* @return {*} {Promise<Object3D>}
|
|
8
|
+
*/
|
|
2
9
|
export declare function useFBX(path: string | string[]): Promise<Object3D>;
|
|
@@ -1,11 +1,33 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
export interface GLTFModelProps {
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* The path to the GLTF file.
|
|
5
|
+
*
|
|
6
|
+
* @type {string}
|
|
7
|
+
* @required
|
|
8
|
+
* @memberof GLTFModelProps
|
|
9
|
+
*
|
|
10
|
+
**/
|
|
11
|
+
path: string;
|
|
12
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* Whether to use Draco compression.
|
|
15
|
+
*
|
|
16
|
+
* @type {boolean}
|
|
17
|
+
* @default false
|
|
18
|
+
* @memberof GLTFModelProps
|
|
19
|
+
*
|
|
20
|
+
**/
|
|
21
|
+
draco?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* The path to the Draco decoder.
|
|
25
|
+
*
|
|
26
|
+
* @type {string}
|
|
27
|
+
* @default 'https://www.gstatic.com/draco/versioned/decoders/1.4.1/'
|
|
28
|
+
* @memberof GLTFModelProps
|
|
29
|
+
*
|
|
30
|
+
**/
|
|
31
|
+
decoderPath?: string;
|
|
32
|
+
}
|
|
33
|
+
export declare const GLTFModel: import("vue").DefineComponent<GLTFModelProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<GLTFModelProps>, {}>;
|
|
@@ -1,7 +1,19 @@
|
|
|
1
1
|
import { GLTFLoader } from 'three-stdlib';
|
|
2
2
|
import { Object3D } from 'three';
|
|
3
3
|
export interface GLTFLoaderOptions {
|
|
4
|
+
/**
|
|
5
|
+
* Whether to use Draco compression.
|
|
6
|
+
*
|
|
7
|
+
* @type {boolean}
|
|
8
|
+
* @memberof GLTFLoaderOptions
|
|
9
|
+
*/
|
|
4
10
|
draco?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* The path to the Draco decoder.
|
|
13
|
+
*
|
|
14
|
+
* @type {string}
|
|
15
|
+
* @memberof GLTFLoaderOptions
|
|
16
|
+
*/
|
|
5
17
|
decoderPath?: string;
|
|
6
18
|
}
|
|
7
19
|
export interface GLTFResult {
|
|
@@ -10,4 +22,15 @@ export interface GLTFResult {
|
|
|
10
22
|
materials: Array<THREE.Material>;
|
|
11
23
|
scene: THREE.Scene;
|
|
12
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* Loads a GLTF file and returns a THREE.Object3D.
|
|
27
|
+
*
|
|
28
|
+
* @export
|
|
29
|
+
* @param {(string | string[])} path
|
|
30
|
+
* @param {GLTFLoaderOptions} [options={
|
|
31
|
+
* draco: false,
|
|
32
|
+
* }]
|
|
33
|
+
* @param {(loader: GLTFLoader) => void} [extendLoader]
|
|
34
|
+
* @return {*} {Promise<GLTFResult>}
|
|
35
|
+
*/
|
|
13
36
|
export declare function useGLTF(path: string | string[], options?: GLTFLoaderOptions, extendLoader?: (loader: GLTFLoader) => void): Promise<GLTFResult>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface PamCameraMouseProps {
|
|
2
|
+
/**
|
|
3
|
+
* Whether to disable the mouse controls.
|
|
4
|
+
* @type {boolean}
|
|
5
|
+
* @default false
|
|
6
|
+
* @memberof PamCameraMouseProps
|
|
7
|
+
*
|
|
8
|
+
*/
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* The factor to multiply the mouse movement by.
|
|
12
|
+
* @type {number}
|
|
13
|
+
* @default 5
|
|
14
|
+
* @memberof PamCameraMouseProps
|
|
15
|
+
*
|
|
16
|
+
**/
|
|
17
|
+
factor?: number;
|
|
18
|
+
}
|
|
19
|
+
export declare const PamCameraMouse: import("vue").DefineComponent<PamCameraMouseProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<PamCameraMouseProps>, {}>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import OrbitControls from './core/OrbitControls.vue';
|
|
2
2
|
import TransformControls from './core/TransformControls.vue';
|
|
3
|
+
import { PamCameraMouse } from './core/usePamCameraMouse/component';
|
|
3
4
|
import { useTweakPane } from './core/useTweakPane';
|
|
4
5
|
import { useAnimations } from './core/useAnimations';
|
|
5
6
|
import { GLTFModel } from './core/useGLTF/component';
|
|
@@ -22,4 +23,5 @@ import { Environment } from './core/useEnvironment/component';
|
|
|
22
23
|
export * from './core/useGLTF';
|
|
23
24
|
export * from './core/useFBX';
|
|
24
25
|
export * from './core/useEnvironment';
|
|
25
|
-
export
|
|
26
|
+
export * from './core/usePamCameraMouse';
|
|
27
|
+
export { OrbitControls, TransformControls, useTweakPane, GLTFModel, FBXModel, Text3D, Plane, Box, Sphere, Torus, TorusKnot, Circle, Cone, Tube, Ring, Tetrahedron, Icosahedron, Octahedron, Dodecahedron, useAnimations, Environment, PamCameraMouse, };
|