@tresjs/cientos 1.7.0 → 1.8.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/composables/useLogger.d.ts +8 -0
- package/dist/core/useAnimations.d.ts +9 -0
- package/dist/core/useCientos.d.ts +6 -0
- package/dist/core/useEnvironment/const.d.ts +31 -0
- package/dist/core/useEnvironment/index.d.ts +14 -0
- package/dist/core/useFBX/index.d.ts +7 -0
- package/dist/core/useGLTF/component.d.ts +24 -0
- package/dist/core/useGLTF/index.d.ts +23 -0
- package/dist/core/usePamCameraMouse/component.d.ts +26 -0
- package/dist/core/usePamCameraMouse/index.d.ts +2 -0
- package/dist/index.d.ts +3 -1
- package/dist/trescientos.js +2243 -2065
- package/dist/trescientos.umd.cjs +10 -10
- package/dist/utils/index.d.ts +18 -0
- package/package.json +3 -3
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const isProd: boolean;
|
|
2
|
+
interface LoggerComposition {
|
|
3
|
+
logError: (message: string, error?: Error | ErrorEvent) => void;
|
|
4
|
+
logWarning: (message: string) => void;
|
|
5
|
+
logMessage: (name: string, value: any) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function useLogger(): LoggerComposition;
|
|
8
|
+
export {};
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import { AnimationAction, AnimationClip, AnimationMixer, Object3D, Scene } from 'three';
|
|
2
2
|
import { Ref } from 'vue';
|
|
3
|
+
/**
|
|
4
|
+
* Creates an AnimationMixer and returns it.
|
|
5
|
+
*
|
|
6
|
+
* @export
|
|
7
|
+
* @template T
|
|
8
|
+
* @param {T[]} animations
|
|
9
|
+
* @param {(Scene | Ref<Object3D | undefined | null>)} [modelRef]
|
|
10
|
+
* @return {*}
|
|
11
|
+
*/
|
|
3
12
|
export declare function useAnimations<T extends AnimationClip>(animations: T[], modelRef?: Scene | Ref<Object3D | undefined | null>): {
|
|
4
13
|
actions: import("vue").ShallowReactive<{
|
|
5
14
|
[key: string]: AnimationAction;
|
|
@@ -1,10 +1,41 @@
|
|
|
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
|
+
*/
|
|
3
8
|
background?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* The blur radius of the environment.
|
|
11
|
+
*
|
|
12
|
+
* @type {number}
|
|
13
|
+
*/
|
|
4
14
|
blur?: number;
|
|
15
|
+
/**
|
|
16
|
+
* The files to load. If a string is provided, it will be loaded as an equirectangular texture.
|
|
17
|
+
* If an array is provided, it will be loaded as a cube texture.
|
|
18
|
+
*
|
|
19
|
+
* @type {(string | string[])}
|
|
20
|
+
*/
|
|
5
21
|
files?: string | string[];
|
|
22
|
+
/**
|
|
23
|
+
* The path to the files.
|
|
24
|
+
*
|
|
25
|
+
* @type {string}
|
|
26
|
+
*/
|
|
6
27
|
path?: string;
|
|
28
|
+
/**
|
|
29
|
+
* The preset to use. If provided, the files and path props will be ignored.
|
|
30
|
+
*
|
|
31
|
+
* @type {EnvironmentPresetsType}
|
|
32
|
+
*/
|
|
7
33
|
preset?: EnvironmentPresetsType;
|
|
34
|
+
/**
|
|
35
|
+
* The encoding of the environment.
|
|
36
|
+
*
|
|
37
|
+
* @type {TextureEncoding}
|
|
38
|
+
*/
|
|
8
39
|
encoding?: TextureEncoding;
|
|
9
40
|
};
|
|
10
41
|
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,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,10 +1,34 @@
|
|
|
1
1
|
export declare const GLTFModel: import("vue").DefineComponent<{
|
|
2
|
+
/**
|
|
3
|
+
* The path to the GLTF file.
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
2
6
|
path: StringConstructor;
|
|
7
|
+
/**
|
|
8
|
+
* Whether to use Draco compression.
|
|
9
|
+
*
|
|
10
|
+
*/
|
|
3
11
|
draco: BooleanConstructor;
|
|
12
|
+
/**
|
|
13
|
+
* The path to the Draco decoder.
|
|
14
|
+
*
|
|
15
|
+
*/
|
|
4
16
|
decoderPath: StringConstructor;
|
|
5
17
|
}, () => void, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
18
|
+
/**
|
|
19
|
+
* The path to the GLTF file.
|
|
20
|
+
*
|
|
21
|
+
*/
|
|
6
22
|
path: StringConstructor;
|
|
23
|
+
/**
|
|
24
|
+
* Whether to use Draco compression.
|
|
25
|
+
*
|
|
26
|
+
*/
|
|
7
27
|
draco: BooleanConstructor;
|
|
28
|
+
/**
|
|
29
|
+
* The path to the Draco decoder.
|
|
30
|
+
*
|
|
31
|
+
*/
|
|
8
32
|
decoderPath: StringConstructor;
|
|
9
33
|
}>>, {
|
|
10
34
|
draco: boolean;
|
|
@@ -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,26 @@
|
|
|
1
|
+
export declare const PamCameraMouse: import("vue").DefineComponent<{
|
|
2
|
+
disabled: {
|
|
3
|
+
type: BooleanConstructor;
|
|
4
|
+
required: false;
|
|
5
|
+
default: boolean;
|
|
6
|
+
};
|
|
7
|
+
factor: {
|
|
8
|
+
type: NumberConstructor;
|
|
9
|
+
required: false;
|
|
10
|
+
default: number;
|
|
11
|
+
};
|
|
12
|
+
}, () => void, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
13
|
+
disabled: {
|
|
14
|
+
type: BooleanConstructor;
|
|
15
|
+
required: false;
|
|
16
|
+
default: boolean;
|
|
17
|
+
};
|
|
18
|
+
factor: {
|
|
19
|
+
type: NumberConstructor;
|
|
20
|
+
required: false;
|
|
21
|
+
default: number;
|
|
22
|
+
};
|
|
23
|
+
}>>, {
|
|
24
|
+
disabled: boolean;
|
|
25
|
+
factor: number;
|
|
26
|
+
}>;
|
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, };
|