@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
package/README.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+

|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
<a href="https://www.npmjs.com/package/@tresjs/core"><img src="https://img.shields.io/npm/v/@tresjs/core?color=%2382DBCA" alt="npm package"></a>
|
|
5
|
+
<a href="https://nodejs.org/en/about/releases/"><img src="https://img.shields.io/node/v/@tresjs/core.svg" alt="node compatibility"></a>
|
|
6
|
+
<a href="https://discord.gg/tfY9aSNT"><img src="https://img.shields.io/badge/chat-discord-purple?style=flat&logo=discord" alt="discord chat"></a>
|
|
7
|
+
</p>
|
|
8
|
+
<br/>
|
|
9
|
+
|
|
10
|
+
# Cientos
|
|
11
|
+
|
|
12
|
+
> Collection of useful helpers and fully functional, ready-made abstractions for Tres
|
|
13
|
+
|
|
14
|
+
- 💡 Build a 3D scene working only with Vue components.
|
|
15
|
+
- ⚡️ Powered by Vite
|
|
16
|
+
- 🥰 It brings all the updated features of ThreeJS right awayregardless the version
|
|
17
|
+
- 🦾 Fully Typed
|
|
18
|
+
|
|
19
|
+
Cientos (Spanish word for "hundreds", pronounced /θjentos/ ) is is a collection of useful ready-to-go helpers and components that are not part of the core package. The name uses the word uses in spanish to multiply by 100, to refer to the potential reach of the package to hold a amazing abstractions.
|
|
20
|
+
|
|
21
|
+
The cientos package uses three-stdlib module under the hood instead of the three/examples/jsm module. This means that you don't need to extend the catalogue of components using the extend method of the useCatalogue composable, cientos does it for you.
|
|
22
|
+
|
|
23
|
+
It just works. 💯
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
## Docs
|
|
27
|
+
|
|
28
|
+
Checkout the [docs](https://tresjs.org/cientos/)
|
|
29
|
+
|
|
30
|
+
## Demos
|
|
31
|
+
|
|
32
|
+
- [Stackblitz Collection](https://stackblitz.com/@alvarosabu/collections/tresjs)
|
|
33
|
+
|
|
34
|
+
## Contribution
|
|
35
|
+
|
|
36
|
+
We are open to contributions, please read the [contributing guide](/CONTRIBUTING.md) to get started.
|
|
37
|
+
|
|
38
|
+
## License
|
|
39
|
+
|
|
40
|
+
[MIT](/LICENSE)
|
|
41
|
+
|
|
42
|
+
## Sponsors
|
|
43
|
+
|
|
44
|
+
Be the first to support this project [here](https://github.com/sponsors/alvarosabu) ☺️
|
package/dist/core/Box.vue.d.ts
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
import type { PropType as __PropType } from 'vue';
|
|
2
|
-
import { TresColor } from '@tresjs/core
|
|
2
|
+
import { TresColor, TresObject } from '@tresjs/core';
|
|
3
|
+
export interface BoxProps extends TresObject {
|
|
4
|
+
/**
|
|
5
|
+
* The width, height and depth of the box.
|
|
6
|
+
* @default [1, 1, 1]
|
|
7
|
+
* @type {number[]}
|
|
8
|
+
* @memberof BoxProps
|
|
9
|
+
* @see https://threejs.org/docs/#api/en/geometries/BoxGeometry
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
args?: number[];
|
|
13
|
+
/**
|
|
14
|
+
* The color of the box.
|
|
15
|
+
* @default 0xffffff
|
|
16
|
+
* @type {TresColor}
|
|
17
|
+
* @memberof BoxProps
|
|
18
|
+
* @see https://threejs.org/docs/#api/en/materials/MeshBasicMaterial
|
|
19
|
+
*/
|
|
20
|
+
color?: TresColor;
|
|
21
|
+
}
|
|
3
22
|
declare const _sfc_main: import("vue").DefineComponent<{
|
|
4
23
|
args: {
|
|
5
24
|
type: __PropType<number[] | undefined>;
|
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
import type { PropType as __PropType } from 'vue';
|
|
2
|
-
import { TresColor } from '@tresjs/core
|
|
2
|
+
import { TresColor, TresObject } from '@tresjs/core';
|
|
3
|
+
export interface CircleProps extends TresObject {
|
|
4
|
+
/**
|
|
5
|
+
* The radius, segment, thetaStart, thetaLength of the circle.
|
|
6
|
+
* @default [1, 32, 0, Math.PI * 2]
|
|
7
|
+
* @type {number[]}
|
|
8
|
+
* @memberof CircleProps
|
|
9
|
+
* @see https://threejs.org/docs/#api/en/geometries/CircleGeometry
|
|
10
|
+
*/
|
|
11
|
+
args?: number[];
|
|
12
|
+
/**
|
|
13
|
+
* The color of the circle.
|
|
14
|
+
* @default 0xffffff
|
|
15
|
+
* @type {TresColor}
|
|
16
|
+
* @memberof CircleProps
|
|
17
|
+
* @see https://threejs.org/docs/#api/en/materials/MeshBasicMaterial
|
|
18
|
+
*/
|
|
19
|
+
color?: TresColor;
|
|
20
|
+
}
|
|
3
21
|
declare const _sfc_main: import("vue").DefineComponent<{
|
|
4
22
|
args: {
|
|
5
23
|
type: __PropType<number[] | undefined>;
|
package/dist/core/Cone.vue.d.ts
CHANGED
|
@@ -1,10 +1,28 @@
|
|
|
1
1
|
import type { PropType as __PropType } from 'vue';
|
|
2
|
-
import { TresColor } from '@tresjs/core
|
|
2
|
+
import { TresColor, TresObject } from '@tresjs/core';
|
|
3
|
+
export interface ConeProps extends TresObject {
|
|
4
|
+
/**
|
|
5
|
+
* The radius, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength of the cone.
|
|
6
|
+
* @default [1, 1, 12, false, 0, Math.PI * 2]
|
|
7
|
+
* @type {any[]}
|
|
8
|
+
* @memberof ConeProps
|
|
9
|
+
* @see https://threejs.org/docs/#api/en/geometries/ConeGeometry
|
|
10
|
+
*/
|
|
11
|
+
args?: [number, number, number, boolean?, number?, number?];
|
|
12
|
+
/**
|
|
13
|
+
* The color of the cone.
|
|
14
|
+
* @default 0xffffff
|
|
15
|
+
* @type {TresColor}
|
|
16
|
+
* @memberof ConeProps
|
|
17
|
+
* @see https://threejs.org/docs/#api/en/materials/MeshBasicMaterial
|
|
18
|
+
*/
|
|
19
|
+
color?: TresColor;
|
|
20
|
+
}
|
|
3
21
|
declare const _sfc_main: import("vue").DefineComponent<{
|
|
4
22
|
args: {
|
|
5
|
-
type: __PropType<number
|
|
23
|
+
type: __PropType<[number, number, number, (boolean | undefined)?, (number | undefined)?, (number | undefined)?] | undefined>;
|
|
6
24
|
required: false;
|
|
7
|
-
default: () => number[];
|
|
25
|
+
default: () => (number | boolean)[];
|
|
8
26
|
};
|
|
9
27
|
color: {
|
|
10
28
|
type: __PropType<TresColor | undefined>;
|
|
@@ -15,9 +33,9 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
15
33
|
value: import("vue").ShallowRef<any>;
|
|
16
34
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
17
35
|
args: {
|
|
18
|
-
type: __PropType<number
|
|
36
|
+
type: __PropType<[number, number, number, (boolean | undefined)?, (number | undefined)?, (number | undefined)?] | undefined>;
|
|
19
37
|
required: false;
|
|
20
|
-
default: () => number[];
|
|
38
|
+
default: () => (number | boolean)[];
|
|
21
39
|
};
|
|
22
40
|
color: {
|
|
23
41
|
type: __PropType<TresColor | undefined>;
|
|
@@ -25,7 +43,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
25
43
|
default: string;
|
|
26
44
|
};
|
|
27
45
|
}>>, {
|
|
28
|
-
args: number
|
|
46
|
+
args: [number, number, number, (boolean | undefined)?, (number | undefined)?, (number | undefined)?] | undefined;
|
|
29
47
|
color: TresColor | undefined;
|
|
30
48
|
}>;
|
|
31
49
|
export default _sfc_main;
|
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
import type { PropType as __PropType } from 'vue';
|
|
2
|
-
import { TresColor } from '@tresjs/core
|
|
2
|
+
import { TresColor, TresObject } from '@tresjs/core';
|
|
3
|
+
export interface DodecahedronProps extends TresObject {
|
|
4
|
+
/**
|
|
5
|
+
* The radius and detail of the dodecahedron.
|
|
6
|
+
* @default [1, 0]
|
|
7
|
+
* @type {number[]}
|
|
8
|
+
* @memberof DodecahedronProps
|
|
9
|
+
* @see https://threejs.org/docs/#api/en/geometries/DodecahedronGeometry
|
|
10
|
+
*/
|
|
11
|
+
args?: number[];
|
|
12
|
+
/**
|
|
13
|
+
* The color of the dodecahedron.
|
|
14
|
+
* @default 0xffffff
|
|
15
|
+
* @type {TresColor}
|
|
16
|
+
* @memberof DodecahedronProps
|
|
17
|
+
* @see https://threejs.org/docs/#api/en/materials/MeshBasicMaterial
|
|
18
|
+
*/
|
|
19
|
+
color?: TresColor;
|
|
20
|
+
}
|
|
3
21
|
declare const _sfc_main: import("vue").DefineComponent<{
|
|
4
22
|
args: {
|
|
5
23
|
type: __PropType<number[] | undefined>;
|
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
import type { PropType as __PropType } from 'vue';
|
|
2
|
-
import { TresColor } from '@tresjs/core
|
|
2
|
+
import { TresColor, TresObject } from '@tresjs/core';
|
|
3
|
+
export interface IcosahedronProps extends TresObject {
|
|
4
|
+
/**
|
|
5
|
+
* The radius and detail of the icosahedron.
|
|
6
|
+
* @default [1, 0]
|
|
7
|
+
* @type {number[]}
|
|
8
|
+
* @memberof IcosahedronProps
|
|
9
|
+
* @see https://threejs.org/docs/#api/en/geometries/IcosahedronGeometry
|
|
10
|
+
*/
|
|
11
|
+
args?: number[];
|
|
12
|
+
/**
|
|
13
|
+
* The color of the icosahedron.
|
|
14
|
+
* @default 0xffffff
|
|
15
|
+
* @type {TresColor}
|
|
16
|
+
* @memberof IcosahedronProps
|
|
17
|
+
* @see https://threejs.org/docs/#api/en/materials/MeshBasicMaterial
|
|
18
|
+
*/
|
|
19
|
+
color?: TresColor;
|
|
20
|
+
}
|
|
3
21
|
declare const _sfc_main: import("vue").DefineComponent<{
|
|
4
22
|
args: {
|
|
5
23
|
type: __PropType<number[] | undefined>;
|
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
import type { PropType as __PropType } from 'vue';
|
|
2
|
-
import { TresColor } from '@tresjs/core
|
|
2
|
+
import { TresColor, TresObject } from '@tresjs/core';
|
|
3
|
+
export interface OctahedronProps extends TresObject {
|
|
4
|
+
/**
|
|
5
|
+
* The radius and detail of the octahedron.
|
|
6
|
+
* @default [1, 0]
|
|
7
|
+
* @type {number[]}
|
|
8
|
+
* @memberof OctahedronProps
|
|
9
|
+
* @see https://threejs.org/docs/#api/en/geometries/OctahedronGeometry
|
|
10
|
+
*/
|
|
11
|
+
args?: number[];
|
|
12
|
+
/**
|
|
13
|
+
* The color of the octahedron.
|
|
14
|
+
* @default 0xffffff
|
|
15
|
+
* @type {TresColor}
|
|
16
|
+
* @memberof OctahedronProps
|
|
17
|
+
* @see https://threejs.org/docs/#api/en/materials/MeshBasicMaterial
|
|
18
|
+
*/
|
|
19
|
+
color?: TresColor;
|
|
20
|
+
}
|
|
3
21
|
declare const _sfc_main: import("vue").DefineComponent<{
|
|
4
22
|
args: {
|
|
5
23
|
type: __PropType<number[] | undefined>;
|
|
@@ -1,6 +1,50 @@
|
|
|
1
1
|
import type { PropType as __PropType } from 'vue';
|
|
2
2
|
import { Camera, Vector3 } from 'three';
|
|
3
3
|
import { type Ref } from 'vue';
|
|
4
|
+
export interface OrbitControlsProps {
|
|
5
|
+
/**
|
|
6
|
+
* Whether to make this the default controls.
|
|
7
|
+
*
|
|
8
|
+
* @default false
|
|
9
|
+
* @type {boolean}
|
|
10
|
+
* @memberof OrbitControlsProps
|
|
11
|
+
* @see https://threejs.org/docs/#examples/en/controls/OrbitControls
|
|
12
|
+
*/
|
|
13
|
+
makeDefault?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* The camera to control.
|
|
16
|
+
*
|
|
17
|
+
* @type {Camera}
|
|
18
|
+
* @memberof OrbitControlsProps
|
|
19
|
+
* @see https://threejs.org/docs/#examples/en/controls/OrbitControls
|
|
20
|
+
*/
|
|
21
|
+
camera?: Camera;
|
|
22
|
+
/**
|
|
23
|
+
* The dom element to listen to.
|
|
24
|
+
*
|
|
25
|
+
* @type {HTMLElement}
|
|
26
|
+
* @memberof OrbitControlsProps
|
|
27
|
+
* @see https://threejs.org/docs/#examples/en/controls/OrbitControls
|
|
28
|
+
*/
|
|
29
|
+
domElement?: HTMLElement;
|
|
30
|
+
/**
|
|
31
|
+
* The target to orbit around.
|
|
32
|
+
*
|
|
33
|
+
* @type {Ref<Vector3>}
|
|
34
|
+
* @memberof OrbitControlsProps
|
|
35
|
+
* @see https://threejs.org/docs/#examples/en/controls/OrbitControls
|
|
36
|
+
*/
|
|
37
|
+
target?: Ref<Vector3>;
|
|
38
|
+
/**
|
|
39
|
+
* Whether to enable damping.
|
|
40
|
+
*
|
|
41
|
+
* @default false
|
|
42
|
+
* @type {boolean}
|
|
43
|
+
* @memberof OrbitControlsProps
|
|
44
|
+
* @see https://threejs.org/docs/#examples/en/controls/OrbitControls
|
|
45
|
+
*/
|
|
46
|
+
enableDamping?: boolean;
|
|
47
|
+
}
|
|
4
48
|
declare const _sfc_main: import("vue").DefineComponent<{
|
|
5
49
|
makeDefault: {
|
|
6
50
|
type: __PropType<boolean | undefined>;
|
package/dist/core/Plane.vue.d.ts
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
import type { PropType as __PropType } from 'vue';
|
|
2
|
-
import { TresColor } from '@tresjs/core
|
|
2
|
+
import { TresColor, TresObject } from '@tresjs/core';
|
|
3
|
+
export interface PlaneProps extends TresObject {
|
|
4
|
+
/**
|
|
5
|
+
* The width and height, widthSegments, heightSegments of the plane.
|
|
6
|
+
* @default [1, 1, 1, 1]
|
|
7
|
+
* @type {number[]}
|
|
8
|
+
* @memberof PlaneProps
|
|
9
|
+
* @see https://threejs.org/docs/#api/en/geometries/PlaneGeometry
|
|
10
|
+
*/
|
|
11
|
+
args?: number[];
|
|
12
|
+
/**
|
|
13
|
+
* The color of the plane.
|
|
14
|
+
* @default 0xffffff
|
|
15
|
+
* @type {TresColor}
|
|
16
|
+
* @memberof PlaneProps
|
|
17
|
+
* @see https://threejs.org/docs/#api/en/materials/MeshBasicMaterial
|
|
18
|
+
*/
|
|
19
|
+
color?: TresColor;
|
|
20
|
+
}
|
|
3
21
|
declare const _sfc_main: import("vue").DefineComponent<{
|
|
4
22
|
args: {
|
|
5
23
|
type: __PropType<number[] | undefined>;
|
package/dist/core/Ring.vue.d.ts
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
import type { PropType as __PropType } from 'vue';
|
|
2
|
-
import { TresColor } from '@tresjs/core
|
|
2
|
+
import { TresColor, TresObject } from '@tresjs/core';
|
|
3
|
+
export interface RingProps extends TresObject {
|
|
4
|
+
/**
|
|
5
|
+
* The innerRadius, outerRadius, thetaSegments, phiSegments, tethaStart, thetaLength of the ring.
|
|
6
|
+
* @default [0.5, 1, 32, 1, 0, Math.PI * 2]
|
|
7
|
+
* @type {number[]}
|
|
8
|
+
* @memberof RingProps
|
|
9
|
+
* @see https://threejs.org/docs/#api/en/geometries/RingGeometry
|
|
10
|
+
*/
|
|
11
|
+
args?: number[];
|
|
12
|
+
/**
|
|
13
|
+
* The color of the ring.
|
|
14
|
+
* @default 0xffffff
|
|
15
|
+
* @type {TresColor}
|
|
16
|
+
* @memberof RingProps
|
|
17
|
+
* @see https://threejs.org/docs/#api/en/materials/MeshBasicMaterial
|
|
18
|
+
*/
|
|
19
|
+
color?: TresColor;
|
|
20
|
+
}
|
|
3
21
|
declare const _sfc_main: import("vue").DefineComponent<{
|
|
4
22
|
args: {
|
|
5
23
|
type: __PropType<number[] | undefined>;
|
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
import type { PropType as __PropType } from 'vue';
|
|
2
|
-
import { TresColor } from '@tresjs/core
|
|
2
|
+
import { TresColor, TresObject } from '@tresjs/core';
|
|
3
|
+
export interface SphereProps extends TresObject {
|
|
4
|
+
/**
|
|
5
|
+
* The radius, widthSegments, heightSegments, phiStart phiLength,
|
|
6
|
+
* thetaStart and thetaLength of the sphere.
|
|
7
|
+
* @default [2, 32, 16, 0, Math.PI * 2, 0, Math.PI]
|
|
8
|
+
* @type {number[]}
|
|
9
|
+
* @memberof SphereProps
|
|
10
|
+
* @see https://threejs.org/docs/#api/en/geometries/SphereGeometry
|
|
11
|
+
*/
|
|
12
|
+
args?: number[];
|
|
13
|
+
/**
|
|
14
|
+
* The color of the sphere.
|
|
15
|
+
* @default 0xffffff
|
|
16
|
+
* @type {TresColor}
|
|
17
|
+
* @memberof SphereProps
|
|
18
|
+
* @see https://threejs.org/docs/#api/en/materials/MeshBasicMaterial
|
|
19
|
+
*/
|
|
20
|
+
color?: TresColor;
|
|
21
|
+
}
|
|
3
22
|
declare const _sfc_main: import("vue").DefineComponent<{
|
|
4
23
|
args: {
|
|
5
24
|
type: __PropType<number[] | undefined>;
|
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
import type { PropType as __PropType } from 'vue';
|
|
2
|
-
import { TresColor } from '@tresjs/core
|
|
2
|
+
import { TresColor, TresObject } from '@tresjs/core';
|
|
3
|
+
export interface TetrahedronProps extends TresObject {
|
|
4
|
+
/**
|
|
5
|
+
* The radius and detail of the tetrahedron.
|
|
6
|
+
* @default [1, 0]
|
|
7
|
+
* @type {number[]}
|
|
8
|
+
* @memberof TetrahedronProps
|
|
9
|
+
* @see https://threejs.org/docs/#api/en/geometries/TetrahedronGeometry
|
|
10
|
+
*/
|
|
11
|
+
args?: number[];
|
|
12
|
+
/**
|
|
13
|
+
* The color of the tetrahedron.
|
|
14
|
+
* @default 0xffffff
|
|
15
|
+
* @type {TresColor}
|
|
16
|
+
* @memberof TetrahedronProps
|
|
17
|
+
* @see https://threejs.org/docs/#api/en/materials/MeshBasicMaterial
|
|
18
|
+
*/
|
|
19
|
+
color?: TresColor;
|
|
20
|
+
}
|
|
3
21
|
declare const _sfc_main: import("vue").DefineComponent<{
|
|
4
22
|
args: {
|
|
5
23
|
type: __PropType<number[] | undefined>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { PropType as __PropType } from 'vue';
|
|
2
|
-
type Glyph = {
|
|
2
|
+
export type Glyph = {
|
|
3
3
|
_cachedOutline: string[];
|
|
4
4
|
ha: number;
|
|
5
5
|
o: string;
|
|
6
6
|
};
|
|
7
|
-
type FontData = {
|
|
7
|
+
export type FontData = {
|
|
8
8
|
boundingBox: {
|
|
9
9
|
yMax: number;
|
|
10
10
|
yMin: number;
|
|
@@ -16,6 +16,97 @@ type FontData = {
|
|
|
16
16
|
resolution: number;
|
|
17
17
|
underlineThickness: number;
|
|
18
18
|
};
|
|
19
|
+
export interface Text3DProps {
|
|
20
|
+
/**
|
|
21
|
+
*
|
|
22
|
+
* The JSON font to use for the text.
|
|
23
|
+
* Text3D requires fonts in JSON format generated through [typeface.json](http://gero3.github.io/facetype.js)
|
|
24
|
+
*
|
|
25
|
+
* @type {(FontData | string)}
|
|
26
|
+
* @memberof Text3DProps
|
|
27
|
+
* @see https://threejs.org/docs/index.html?q=TEXT#examples/en/geometries/TextGeometry
|
|
28
|
+
*/
|
|
29
|
+
font: FontData | string;
|
|
30
|
+
/**
|
|
31
|
+
* The text to display.
|
|
32
|
+
*
|
|
33
|
+
* @type {string}
|
|
34
|
+
* @memberof Text3DProps
|
|
35
|
+
*/
|
|
36
|
+
text?: string;
|
|
37
|
+
/**
|
|
38
|
+
* The size of the text.
|
|
39
|
+
*
|
|
40
|
+
* @type {number}
|
|
41
|
+
* @memberof Text3DProps
|
|
42
|
+
* @default 0.5
|
|
43
|
+
*/
|
|
44
|
+
size?: number;
|
|
45
|
+
/**
|
|
46
|
+
* The height of the text.
|
|
47
|
+
*
|
|
48
|
+
* @type {number}
|
|
49
|
+
* @memberof Text3DProps
|
|
50
|
+
* @default 0.2
|
|
51
|
+
*/
|
|
52
|
+
height?: number;
|
|
53
|
+
/**
|
|
54
|
+
* The curve segments of the text.
|
|
55
|
+
*
|
|
56
|
+
* @type {number}
|
|
57
|
+
* @memberof Text3DProps
|
|
58
|
+
* @default 5
|
|
59
|
+
*/
|
|
60
|
+
curveSegments?: number;
|
|
61
|
+
/**
|
|
62
|
+
* Turn on bevel
|
|
63
|
+
*
|
|
64
|
+
* @type {boolean}
|
|
65
|
+
* @memberof Text3DProps
|
|
66
|
+
* @default true
|
|
67
|
+
*/
|
|
68
|
+
bevelEnabled?: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* How deep into text bevel goes.
|
|
71
|
+
*
|
|
72
|
+
* @type {number}
|
|
73
|
+
* @memberof Text3DProps
|
|
74
|
+
* @default 0.05
|
|
75
|
+
*/
|
|
76
|
+
bevelThickness?: number;
|
|
77
|
+
/**
|
|
78
|
+
* How far from text outline is bevel.
|
|
79
|
+
*
|
|
80
|
+
* @type {number}
|
|
81
|
+
* @memberof Text3DProps
|
|
82
|
+
* @default 0.02
|
|
83
|
+
*/
|
|
84
|
+
bevelSize?: number;
|
|
85
|
+
/**
|
|
86
|
+
* How far from text outline is bevel.
|
|
87
|
+
*
|
|
88
|
+
* @type {number}
|
|
89
|
+
* @memberof Text3DProps
|
|
90
|
+
* @default 0
|
|
91
|
+
*/
|
|
92
|
+
bevelOffset?: number;
|
|
93
|
+
/**
|
|
94
|
+
* How many bevel segments.
|
|
95
|
+
*
|
|
96
|
+
* @type {number}
|
|
97
|
+
* @memberof Text3DProps
|
|
98
|
+
* @default 4
|
|
99
|
+
*/
|
|
100
|
+
bevelSegments?: number;
|
|
101
|
+
/**
|
|
102
|
+
* Whether to center the text.
|
|
103
|
+
*
|
|
104
|
+
* @type {boolean}
|
|
105
|
+
* @memberof Text3DProps
|
|
106
|
+
* @default false
|
|
107
|
+
*/
|
|
108
|
+
center?: boolean;
|
|
109
|
+
}
|
|
19
110
|
declare const _sfc_main: import("vue").DefineComponent<{
|
|
20
111
|
font: {
|
|
21
112
|
type: __PropType<string | FontData>;
|
package/dist/core/Torus.vue.d.ts
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
import type { PropType as __PropType } from 'vue';
|
|
2
|
-
import { TresColor } from '@tresjs/core
|
|
2
|
+
import { TresColor, TresObject } from '@tresjs/core';
|
|
3
|
+
export interface TorusProps extends TresObject {
|
|
4
|
+
/**
|
|
5
|
+
* The radius, tube, radialSegments, tubularSegments, arc of the torus.
|
|
6
|
+
* @default [1, 1, 16, 80, Math.PI * 2]
|
|
7
|
+
* @type {number[]}
|
|
8
|
+
* @memberof TorusProps
|
|
9
|
+
* @see https://threejs.org/docs/#api/en/geometries/TorusGeometry
|
|
10
|
+
*/
|
|
11
|
+
args?: number[];
|
|
12
|
+
/**
|
|
13
|
+
* The color of the torus.
|
|
14
|
+
* @default 0xffffff
|
|
15
|
+
* @type {TresColor}
|
|
16
|
+
* @memberof TorusProps
|
|
17
|
+
* @see https://threejs.org/docs/#api/en/materials/MeshBasicMaterial
|
|
18
|
+
*/
|
|
19
|
+
color?: TresColor;
|
|
20
|
+
}
|
|
3
21
|
declare const _sfc_main: import("vue").DefineComponent<{
|
|
4
22
|
args: {
|
|
5
23
|
type: __PropType<number[] | undefined>;
|
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
import type { PropType as __PropType } from 'vue';
|
|
2
|
-
import { TresColor } from '@tresjs/core
|
|
2
|
+
import { TresColor, TresObject } from '@tresjs/core';
|
|
3
|
+
export interface TorusKnotProps extends TresObject {
|
|
4
|
+
/**
|
|
5
|
+
* The radius, tube, radialSegments, tubularSegments and p, q of the torus knot.
|
|
6
|
+
* @default [1, 0.4, 64, 8, 2, 3]
|
|
7
|
+
* @type {number[]}
|
|
8
|
+
* @memberof TorusKnotProps
|
|
9
|
+
* @see https://threejs.org/docs/#api/en/geometries/TorusKnotGeometry
|
|
10
|
+
*/
|
|
11
|
+
args?: number[];
|
|
12
|
+
/**
|
|
13
|
+
* The color of the torus knot.
|
|
14
|
+
* @default 0xffffff
|
|
15
|
+
* @type {TresColor}
|
|
16
|
+
* @memberof TorusKnotProps
|
|
17
|
+
* @see https://threejs.org/docs/#api/en/materials/MeshBasicMaterial
|
|
18
|
+
*/
|
|
19
|
+
color?: TresColor;
|
|
20
|
+
}
|
|
3
21
|
declare const _sfc_main: import("vue").DefineComponent<{
|
|
4
22
|
args: {
|
|
5
23
|
type: __PropType<number[] | undefined>;
|
package/dist/core/Tube.vue.d.ts
CHANGED
|
@@ -1,8 +1,26 @@
|
|
|
1
1
|
import type { PropType as __PropType } from 'vue';
|
|
2
|
-
import { TresColor } from '@tresjs/core
|
|
2
|
+
import { TresColor, TresObject } from '@tresjs/core';
|
|
3
3
|
import { CatmullRomCurve3, CubicBezierCurve3, LineCurve3, QuadraticBezierCurve3 } from 'three';
|
|
4
|
-
type CurveType = QuadraticBezierCurve3 | CubicBezierCurve3 | CatmullRomCurve3 | LineCurve3;
|
|
5
|
-
type TubeGeometryParams = [CurveType, number, number, number, boolean];
|
|
4
|
+
export type CurveType = QuadraticBezierCurve3 | CubicBezierCurve3 | CatmullRomCurve3 | LineCurve3;
|
|
5
|
+
export type TubeGeometryParams = [CurveType, number, number, number, boolean];
|
|
6
|
+
export interface TubeProps extends TresObject {
|
|
7
|
+
/**
|
|
8
|
+
* The curve, segments, radius, radialSegments, closed.
|
|
9
|
+
* @default [new QuadraticBezierCurve3(new Vector3(-1, 0, 0), new Vector3(0, 1, 0), new Vector3(1, 0, 0)), 20, 0.2, 8, false]
|
|
10
|
+
* @type {TubeGeometryParams}
|
|
11
|
+
* @memberof TubeProps
|
|
12
|
+
* @see https://threejs.org/docs/#api/en/geometries/TubeGeometry
|
|
13
|
+
*/
|
|
14
|
+
args?: TubeGeometryParams;
|
|
15
|
+
/**
|
|
16
|
+
* The color of the tube.
|
|
17
|
+
* @default 0xffffff
|
|
18
|
+
* @type {TresColor}
|
|
19
|
+
* @memberof TubeProps
|
|
20
|
+
* @see https://threejs.org/docs/#api/en/materials/MeshBasicMaterial
|
|
21
|
+
*/
|
|
22
|
+
color?: TresColor;
|
|
23
|
+
}
|
|
6
24
|
declare const _sfc_main: import("vue").DefineComponent<{
|
|
7
25
|
args: {
|
|
8
26
|
type: __PropType<TubeGeometryParams | undefined>;
|
|
@@ -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,36 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export declare const Environment: import("vue").DefineComponent<{
|
|
4
|
-
background: {
|
|
5
|
-
type: BooleanConstructor;
|
|
6
|
-
default: boolean;
|
|
7
|
-
};
|
|
8
|
-
blur: {
|
|
9
|
-
type: NumberConstructor;
|
|
10
|
-
default: number;
|
|
11
|
-
};
|
|
12
|
-
files: {
|
|
13
|
-
type: (StringConstructor | ArrayConstructor)[];
|
|
14
|
-
};
|
|
15
|
-
encoding: PropType<TextureEncoding>;
|
|
16
|
-
path: StringConstructor;
|
|
17
|
-
preset: PropType<"sunset">;
|
|
18
|
-
}, () => void, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
19
|
-
background: {
|
|
20
|
-
type: BooleanConstructor;
|
|
21
|
-
default: boolean;
|
|
22
|
-
};
|
|
23
|
-
blur: {
|
|
24
|
-
type: NumberConstructor;
|
|
25
|
-
default: number;
|
|
26
|
-
};
|
|
27
|
-
files: {
|
|
28
|
-
type: (StringConstructor | ArrayConstructor)[];
|
|
29
|
-
};
|
|
30
|
-
encoding: PropType<TextureEncoding>;
|
|
31
|
-
path: StringConstructor;
|
|
32
|
-
preset: PropType<"sunset">;
|
|
33
|
-
}>>, {
|
|
34
|
-
background: boolean;
|
|
35
|
-
blur: number;
|
|
36
|
-
}>;
|
|
1
|
+
import { EnvironmentOptions } from './const';
|
|
2
|
+
export declare const Environment: import("vue").DefineComponent<EnvironmentOptions, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<EnvironmentOptions>, {}>;
|