@operato/scene-visualizer 10.0.0-beta.1 → 10.0.0-beta.2
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/package.json +2 -2
- package/dist/banner.d.ts +0 -244
- package/dist/banner.js +0 -75
- package/dist/banner.js.map +0 -1
- package/dist/camera.d.ts +0 -249
- package/dist/camera.js +0 -107
- package/dist/camera.js.map +0 -1
- package/dist/cube.d.ts +0 -241
- package/dist/cube.js +0 -37
- package/dist/cube.js.map +0 -1
- package/dist/cylinder.d.ts +0 -9
- package/dist/cylinder.js +0 -37
- package/dist/cylinder.js.map +0 -1
- package/dist/ellipse.d.ts +0 -5
- package/dist/ellipse.js +0 -20
- package/dist/ellipse.js.map +0 -1
- package/dist/gltf-object.d.ts +0 -249
- package/dist/gltf-object.js +0 -103
- package/dist/gltf-object.js.map +0 -1
- package/dist/html-overlay-element.d.ts +0 -1
- package/dist/html-overlay-element.js +0 -8
- package/dist/html-overlay-element.js.map +0 -1
- package/dist/light.d.ts +0 -14
- package/dist/light.js +0 -134
- package/dist/light.js.map +0 -1
- package/dist/polygon.d.ts +0 -17
- package/dist/polygon.js +0 -62
- package/dist/polygon.js.map +0 -1
- package/dist/rect.d.ts +0 -5
- package/dist/rect.js +0 -34
- package/dist/rect.js.map +0 -1
- package/dist/scene/component.d.ts +0 -1
- package/dist/scene/component.js +0 -29
- package/dist/scene/component.js.map +0 -1
- package/dist/sphere.d.ts +0 -9
- package/dist/sphere.js +0 -37
- package/dist/sphere.js.map +0 -1
- package/dist/sprite.d.ts +0 -238
- package/dist/sprite.js +0 -27
- package/dist/sprite.js.map +0 -1
- package/dist/text.d.ts +0 -1
- package/dist/text.js +0 -7
- package/dist/text.js.map +0 -1
- package/dist/three-container-editor.d.ts +0 -22
- package/dist/three-container-editor.js +0 -132
- package/dist/three-container-editor.js.map +0 -1
- package/dist/three-container.d.ts +0 -61
- package/dist/three-container.js +0 -371
- package/dist/three-container.js.map +0 -1
- package/dist/three-controls.d.ts +0 -111
- package/dist/three-controls.js +0 -414
- package/dist/three-controls.js.map +0 -1
- package/dist/three-layout.d.ts +0 -8
- package/dist/three-layout.js +0 -20
- package/dist/three-layout.js.map +0 -1
- package/dist/three-space.d.ts +0 -8
- package/dist/three-space.js +0 -58
- package/dist/three-space.js.map +0 -1
- package/dist/threed/common.d.ts +0 -22
- package/dist/threed/common.js +0 -19
- package/dist/threed/common.js.map +0 -1
- package/dist/threed/floor/floor.d.ts +0 -3
- package/dist/threed/floor/floor.js +0 -51
- package/dist/threed/floor/floor.js.map +0 -1
- package/dist/threed/html/elements.d.ts +0 -2
- package/dist/threed/html/elements.js +0 -21
- package/dist/threed/html/elements.js.map +0 -1
- package/dist/threed/index.d.ts +0 -16
- package/dist/threed/index.js +0 -17
- package/dist/threed/index.js.map +0 -1
- package/dist/threed/interfaces.d.ts +0 -15
- package/dist/threed/interfaces.js +0 -5
- package/dist/threed/interfaces.js.map +0 -1
- package/dist/threed/managers/camera-manager.d.ts +0 -14
- package/dist/threed/managers/camera-manager.js +0 -60
- package/dist/threed/managers/camera-manager.js.map +0 -1
- package/dist/threed/managers/controls-manager.d.ts +0 -50
- package/dist/threed/managers/controls-manager.js +0 -249
- package/dist/threed/managers/controls-manager.js.map +0 -1
- package/dist/threed/managers/event-manager3d.d.ts +0 -19
- package/dist/threed/managers/event-manager3d.js +0 -76
- package/dist/threed/managers/event-manager3d.js.map +0 -1
- package/dist/threed/managers/index.d.ts +0 -7
- package/dist/threed/managers/index.js +0 -7
- package/dist/threed/managers/index.js.map +0 -1
- package/dist/threed/managers/light-manager.d.ts +0 -7
- package/dist/threed/managers/light-manager.js +0 -37
- package/dist/threed/managers/light-manager.js.map +0 -1
- package/dist/threed/managers/renderer-manager.d.ts +0 -30
- package/dist/threed/managers/renderer-manager.js +0 -120
- package/dist/threed/managers/renderer-manager.js.map +0 -1
- package/dist/threed/managers/scene-manager.d.ts +0 -15
- package/dist/threed/managers/scene-manager.js +0 -48
- package/dist/threed/managers/scene-manager.js.map +0 -1
- package/dist/threed/managers/types.d.ts +0 -36
- package/dist/threed/managers/types.js +0 -2
- package/dist/threed/managers/types.js.map +0 -1
- package/dist/threed/real-object-camera-meshed.d.ts +0 -12
- package/dist/threed/real-object-camera-meshed.js +0 -49
- package/dist/threed/real-object-camera-meshed.js.map +0 -1
- package/dist/threed/real-object-camera.d.ts +0 -9
- package/dist/threed/real-object-camera.js +0 -31
- package/dist/threed/real-object-camera.js.map +0 -1
- package/dist/threed/real-object-dom-element.d.ts +0 -9
- package/dist/threed/real-object-dom-element.js +0 -48
- package/dist/threed/real-object-dom-element.js.map +0 -1
- package/dist/threed/real-object-dummy.d.ts +0 -6
- package/dist/threed/real-object-dummy.js +0 -11
- package/dist/threed/real-object-dummy.js.map +0 -1
- package/dist/threed/real-object-extrude.d.ts +0 -22
- package/dist/threed/real-object-extrude.js +0 -180
- package/dist/threed/real-object-extrude.js.map +0 -1
- package/dist/threed/real-object-gltf.d.ts +0 -16
- package/dist/threed/real-object-gltf.js +0 -105
- package/dist/threed/real-object-gltf.js.map +0 -1
- package/dist/threed/real-object-group.d.ts +0 -5
- package/dist/threed/real-object-group.js +0 -11
- package/dist/threed/real-object-group.js.map +0 -1
- package/dist/threed/real-object-mesh.d.ts +0 -13
- package/dist/threed/real-object-mesh.js +0 -73
- package/dist/threed/real-object-mesh.js.map +0 -1
- package/dist/threed/real-object-plane.d.ts +0 -5
- package/dist/threed/real-object-plane.js +0 -22
- package/dist/threed/real-object-plane.js.map +0 -1
- package/dist/threed/real-object-registry.d.ts +0 -7
- package/dist/threed/real-object-registry.js +0 -32
- package/dist/threed/real-object-registry.js.map +0 -1
- package/dist/threed/real-object-scene.d.ts +0 -21
- package/dist/threed/real-object-scene.js +0 -72
- package/dist/threed/real-object-scene.js.map +0 -1
- package/dist/threed/real-object-sprite-2d.d.ts +0 -14
- package/dist/threed/real-object-sprite-2d.js +0 -45
- package/dist/threed/real-object-sprite-2d.js.map +0 -1
- package/dist/threed/real-object-sprite.d.ts +0 -11
- package/dist/threed/real-object-sprite.js +0 -52
- package/dist/threed/real-object-sprite.js.map +0 -1
- package/dist/threed/real-object-text.d.ts +0 -15
- package/dist/threed/real-object-text.js +0 -66
- package/dist/threed/real-object-text.js.map +0 -1
- package/dist/threed/real-object.d.ts +0 -65
- package/dist/threed/real-object.js +0 -251
- package/dist/threed/real-object.js.map +0 -1
- package/dist/threed/texture/canvas-texture.d.ts +0 -4
- package/dist/threed/texture/canvas-texture.js +0 -49
- package/dist/threed/texture/canvas-texture.js.map +0 -1
- package/dist/threed/texture/text-texture.d.ts +0 -8
- package/dist/threed/texture/text-texture.js +0 -79
- package/dist/threed/texture/text-texture.js.map +0 -1
- package/dist/threed/three-dimensional-container.d.ts +0 -7
- package/dist/threed/three-dimensional-container.js +0 -2
- package/dist/threed/three-dimensional-container.js.map +0 -1
- package/dist/threed/utils/bound-uv-generator.d.ts +0 -16
- package/dist/threed/utils/bound-uv-generator.js +0 -42
- package/dist/threed/utils/bound-uv-generator.js.map +0 -1
- package/dist/threed/utils/dispose.d.ts +0 -2
- package/dist/threed/utils/dispose.js +0 -32
- package/dist/threed/utils/dispose.js.map +0 -1
- package/dist/wall.d.ts +0 -241
- package/dist/wall.js +0 -44
- package/dist/wall.js.map +0 -1
package/dist/gltf-object.d.ts
DELETED
|
@@ -1,249 +0,0 @@
|
|
|
1
|
-
import { Component, ComponentNature, Control, Shape, RealObject } from '@hatiolab/things-scene';
|
|
2
|
-
declare const GLTFObject_base: (new (...args: any[]) => {
|
|
3
|
-
contains(x: any, y: any): boolean;
|
|
4
|
-
get path(): {
|
|
5
|
-
x: any;
|
|
6
|
-
y: any;
|
|
7
|
-
}[];
|
|
8
|
-
set path(path: {
|
|
9
|
-
x: any;
|
|
10
|
-
y: any;
|
|
11
|
-
}[]): any;
|
|
12
|
-
get anchors(): {
|
|
13
|
-
name: string;
|
|
14
|
-
position: {
|
|
15
|
-
x: any;
|
|
16
|
-
y: any;
|
|
17
|
-
};
|
|
18
|
-
}[];
|
|
19
|
-
get bounds(): any;
|
|
20
|
-
set bounds(bounds: any): any;
|
|
21
|
-
render(ctx: any): void;
|
|
22
|
-
_app: any;
|
|
23
|
-
_model: any;
|
|
24
|
-
_state: any;
|
|
25
|
-
_delta: any;
|
|
26
|
-
_animation: any;
|
|
27
|
-
_animate: any;
|
|
28
|
-
_parent: any;
|
|
29
|
-
_disposed: any;
|
|
30
|
-
_textHidden: any;
|
|
31
|
-
_text_substitutor: any;
|
|
32
|
-
_value_substitutor: any;
|
|
33
|
-
_mappings: any;
|
|
34
|
-
_realObject: import("@hatiolab/things-scene").IRealObject | undefined;
|
|
35
|
-
_cachedState: any;
|
|
36
|
-
updatedAt: any;
|
|
37
|
-
fontSize: any;
|
|
38
|
-
__cache__: any;
|
|
39
|
-
created(): void;
|
|
40
|
-
added(parent: any): void;
|
|
41
|
-
removed(parent: any): void;
|
|
42
|
-
ready(): Promise<void>;
|
|
43
|
-
touch(): void;
|
|
44
|
-
clearCache(...attrs: any[]): void;
|
|
45
|
-
removeSelf(completely: any): void;
|
|
46
|
-
resetAnimation(): void;
|
|
47
|
-
dispose(): void;
|
|
48
|
-
get nature(): import("@hatiolab/things-scene").ComponentNature;
|
|
49
|
-
get disposed(): boolean;
|
|
50
|
-
isLayer(): boolean;
|
|
51
|
-
isGroup(): boolean;
|
|
52
|
-
isContainer(): this is import("@hatiolab/things-scene/dist-types/types/component").Container;
|
|
53
|
-
isLine(): boolean;
|
|
54
|
-
isRoot(): boolean;
|
|
55
|
-
isRootModel(): boolean;
|
|
56
|
-
is3dish(): boolean;
|
|
57
|
-
isIn3DSpace(): boolean;
|
|
58
|
-
isTemplate(): boolean;
|
|
59
|
-
isHTMLElement(): boolean;
|
|
60
|
-
isConnectable(): boolean;
|
|
61
|
-
isIdentifiable(): boolean;
|
|
62
|
-
isPositionable(): boolean;
|
|
63
|
-
replaceRefids(replaceMap: any): void;
|
|
64
|
-
get(property: any): any;
|
|
65
|
-
set(props: any, propval?: any): any;
|
|
66
|
-
getState(property: any): any;
|
|
67
|
-
setState(props: any, propval?: any): any;
|
|
68
|
-
get model(): any;
|
|
69
|
-
get state(): any;
|
|
70
|
-
get hierarchy(): any;
|
|
71
|
-
get volatile(): never[];
|
|
72
|
-
_applyProps(target: any, props: any, options: any): any;
|
|
73
|
-
move(offset: {
|
|
74
|
-
x: number;
|
|
75
|
-
y: number;
|
|
76
|
-
}, ...args: boolean[]): void;
|
|
77
|
-
symmetryX(x?: number): void;
|
|
78
|
-
symmetryY(y: number): void;
|
|
79
|
-
adjustResize(bounds: import("@hatiolab/things-scene").BOUNDS, origin_bounds: import("@hatiolab/things-scene").BOUNDS, diagonal: boolean): any;
|
|
80
|
-
adjustRotation(rotation: number, step: boolean): any;
|
|
81
|
-
outline(progress: number): any;
|
|
82
|
-
get center(): import("@hatiolab/things-scene").POINT;
|
|
83
|
-
set center(p: import("@hatiolab/things-scene").POINT): any;
|
|
84
|
-
get location(): import("@hatiolab/things-scene").POINT;
|
|
85
|
-
set location(l: import("@hatiolab/things-scene").POINT): any;
|
|
86
|
-
get rotate(): import("@hatiolab/things-scene").POINT;
|
|
87
|
-
set rotate(r: import("@hatiolab/things-scene").POINT): any;
|
|
88
|
-
get dimension(): import("@hatiolab/things-scene").DIMENSION;
|
|
89
|
-
set dimension(d: import("@hatiolab/things-scene").DIMENSION): any;
|
|
90
|
-
get drawPath(): import("@hatiolab/things-scene").POINT[];
|
|
91
|
-
get rotatePoint(): import("@hatiolab/things-scene").POINT;
|
|
92
|
-
get mutable(): boolean;
|
|
93
|
-
get resizable(): boolean;
|
|
94
|
-
get rotatable(): boolean;
|
|
95
|
-
buildRealObject(): import("@hatiolab/things-scene").IRealObject | undefined;
|
|
96
|
-
get realObject(): import("@hatiolab/things-scene").IRealObject | undefined;
|
|
97
|
-
draw(context?: import("@hatiolab/things-scene").SceneRenderContext): void;
|
|
98
|
-
prerender(context: import("@hatiolab/things-scene").SceneRenderContext): void;
|
|
99
|
-
postrender(context: import("@hatiolab/things-scene").SceneRenderContext): void;
|
|
100
|
-
prepare(resolve: (component: Component) => void, reject: (reason: any) => void): void;
|
|
101
|
-
prepareIf(condition: boolean): void;
|
|
102
|
-
drawText(context: import("@hatiolab/things-scene").SceneRenderContext): void;
|
|
103
|
-
drawStroke(context: import("@hatiolab/things-scene").SceneRenderContext, override?: Record<string, unknown>): void;
|
|
104
|
-
drawFill(context: import("@hatiolab/things-scene").SceneRenderContext, override?: Record<string, unknown>): void;
|
|
105
|
-
get strokeStyle(): any;
|
|
106
|
-
set strokeStyle(v: any): any;
|
|
107
|
-
get fillStyle(): any;
|
|
108
|
-
set fillStyle(v: any): any;
|
|
109
|
-
get fontColor(): string;
|
|
110
|
-
set fontColor(v: string): any;
|
|
111
|
-
get rotation(): number;
|
|
112
|
-
set rotation(v: number): any;
|
|
113
|
-
get decorators(): string[];
|
|
114
|
-
get decotag(): string;
|
|
115
|
-
get hidden(): boolean;
|
|
116
|
-
set hidden(v: boolean): any;
|
|
117
|
-
get tag(): string;
|
|
118
|
-
set tag(v: string): any;
|
|
119
|
-
get appendum(): any;
|
|
120
|
-
set appendum(v: any): any;
|
|
121
|
-
defaultTextSubstitutor(): any;
|
|
122
|
-
textLines(context?: import("@hatiolab/things-scene").SceneRenderContext): any;
|
|
123
|
-
get font(): string;
|
|
124
|
-
get lineHeight(): number;
|
|
125
|
-
get textSubstitutor(): () => string;
|
|
126
|
-
get text(): string;
|
|
127
|
-
set text(v: string): any;
|
|
128
|
-
get textBounds(): import("@hatiolab/things-scene").BOUNDS;
|
|
129
|
-
get textRotation(): number;
|
|
130
|
-
get textHidden(): boolean;
|
|
131
|
-
set textHidden(v: boolean): any;
|
|
132
|
-
get hasTextProperty(): boolean;
|
|
133
|
-
animate(opts: import("@hatiolab/things-scene/dist-types/animation/interfaces").AnimationConfig): any;
|
|
134
|
-
effect(context: import("@hatiolab/things-scene").SceneRenderContext, model: any): any;
|
|
135
|
-
serialize(...others: any[]): any;
|
|
136
|
-
trim(): void;
|
|
137
|
-
closeScene(data: any): void;
|
|
138
|
-
delta(attr?: string | object, value?: any): any;
|
|
139
|
-
invalidate(): void;
|
|
140
|
-
get value(): any;
|
|
141
|
-
set value(v: any): any;
|
|
142
|
-
get data(): any;
|
|
143
|
-
set data(v: any): any;
|
|
144
|
-
set tap(v: any): any;
|
|
145
|
-
get mappings(): any[];
|
|
146
|
-
get retention(): number;
|
|
147
|
-
get animation(): import("@hatiolab/things-scene/dist-types/animation/interfaces").AnimationController | undefined;
|
|
148
|
-
get started(): boolean;
|
|
149
|
-
set started(v: boolean): any;
|
|
150
|
-
get controls(): import("@hatiolab/things-scene").Control[] | undefined;
|
|
151
|
-
findFirst(finder: string | ((c: Component) => boolean), ...others: any[]): any;
|
|
152
|
-
findAll(s: string | ((c: Component) => boolean), ...others: any[]): any;
|
|
153
|
-
capture(x: number, y: number, except?: (c: Component) => boolean): any;
|
|
154
|
-
findAnchor(name: string): any;
|
|
155
|
-
isDescendible(container: Component): any;
|
|
156
|
-
getContext(component?: unknown): any;
|
|
157
|
-
get root(): Component;
|
|
158
|
-
get rootModel(): Component;
|
|
159
|
-
get parent(): Component;
|
|
160
|
-
set parent(v: Component): any;
|
|
161
|
-
get scalable(): boolean;
|
|
162
|
-
get stuck(): boolean;
|
|
163
|
-
get capturable(): boolean;
|
|
164
|
-
get position(): string;
|
|
165
|
-
get origin(): string;
|
|
166
|
-
get offset(): import("@hatiolab/things-scene").POINT;
|
|
167
|
-
get app(): import("@hatiolab/things-scene").ApplicationContext;
|
|
168
|
-
drawEffect(context: import("@hatiolab/things-scene").SceneRenderContext): void;
|
|
169
|
-
prepareFill(resolve: Function, reject: Function): void;
|
|
170
|
-
prepareFillIf(condition: boolean): void;
|
|
171
|
-
onchangeFill(after: Record<string, any>, before: Record<string, any>): void;
|
|
172
|
-
drawImage(context: import("@hatiolab/things-scene").SceneRenderContext, image: HTMLImageElement, left: number, top: number, width: number, height: number): void;
|
|
173
|
-
mutateBounds(logic: ((bounds: import("@hatiolab/things-scene").BOUNDS) => import("@hatiolab/things-scene").BOUNDS | void) | null, context?: any): void;
|
|
174
|
-
mutatePath(beforeLogic: ((path: import("@hatiolab/things-scene").POINT[]) => import("@hatiolab/things-scene").POINT[] | void) | null, afterLogic: ((path: import("@hatiolab/things-scene").POINT[]) => import("@hatiolab/things-scene").POINT[] | void) | null, context?: any): void;
|
|
175
|
-
access(accessor: string, data: any): any;
|
|
176
|
-
substitute(template: string, data: any): any;
|
|
177
|
-
onchangeMappings(after: Record<string, any>, before: Record<string, any>): void;
|
|
178
|
-
onchangeData(after: Record<string, any>, before: Record<string, any>): void;
|
|
179
|
-
buildMappings(): void;
|
|
180
|
-
executeMappings(force?: boolean): void;
|
|
181
|
-
disposeMappings(): void;
|
|
182
|
-
ondropfile(transfered: FileList, files: string[]): void;
|
|
183
|
-
transcoordS2P(x: number, y: number, rp?: import("@hatiolab/things-scene").POINT): import("@hatiolab/things-scene").POINT;
|
|
184
|
-
transcoordP2S(x: number, y: number, rp?: import("@hatiolab/things-scene").POINT): import("@hatiolab/things-scene").POINT;
|
|
185
|
-
transcoordS2T(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
186
|
-
transcoordT2P(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
187
|
-
transcoordT2S(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
188
|
-
transcoordS2TR(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
189
|
-
transcoordS2O(x: number, y: number, target: Component): import("@hatiolab/things-scene").POINT;
|
|
190
|
-
transcoordC2S(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
191
|
-
transcoordS2C(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
192
|
-
toParent(x: number, y: number, rp?: import("@hatiolab/things-scene").POINT): import("@hatiolab/things-scene").POINT;
|
|
193
|
-
fromParent(x: number, y: number, rp?: import("@hatiolab/things-scene").POINT): import("@hatiolab/things-scene").POINT;
|
|
194
|
-
toScene(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
195
|
-
fromScene(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
196
|
-
toLocal(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
197
|
-
toGlobal(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
198
|
-
toOther(x: number, y: number, target: Component): import("@hatiolab/things-scene").POINT;
|
|
199
|
-
on(name: string | object, callback: Function, context?: any): any;
|
|
200
|
-
off(name?: string | object, callback?: Function, context?: any): any;
|
|
201
|
-
once(name: string | object, callback: Function, context?: any): any;
|
|
202
|
-
trigger(name: string, ...args: any[]): any;
|
|
203
|
-
delegate_on(delegator: any): any;
|
|
204
|
-
delegate_off(delegator: any): any;
|
|
205
|
-
onchange(after: Record<string, any>, before: Record<string, any>): void;
|
|
206
|
-
calculateBounds?(): void;
|
|
207
|
-
oncreate_element?(element: HTMLElement): void;
|
|
208
|
-
removeComponent(component: Component, ghost?: boolean): void;
|
|
209
|
-
addComponent(component: Component, ghost?: boolean): void;
|
|
210
|
-
insertComponentAt(component: Component, index: number, ghost?: boolean): void;
|
|
211
|
-
getOverlay(component: Component): HTMLElement | undefined;
|
|
212
|
-
findById(id: string): Component | undefined;
|
|
213
|
-
findByRefid(ref: string | number): Component | undefined;
|
|
214
|
-
findAllById(id: string): Component[];
|
|
215
|
-
resize(): void;
|
|
216
|
-
fit(type?: string): void;
|
|
217
|
-
get components(): Component[] | undefined;
|
|
218
|
-
get layout(): any;
|
|
219
|
-
get auxOverlay(): HTMLElement | undefined;
|
|
220
|
-
get isReady(): boolean;
|
|
221
|
-
get unitScale(): number;
|
|
222
|
-
get selected(): Component[];
|
|
223
|
-
set selected(_v: Component[]): any;
|
|
224
|
-
get focused(): Component | null;
|
|
225
|
-
set focused(_v: Component | null): any;
|
|
226
|
-
get hasSameParentForAllSelected(): boolean;
|
|
227
|
-
set hasSameParentForAllSelected(_v: boolean): any;
|
|
228
|
-
get fitMode(): string | undefined;
|
|
229
|
-
set fitMode(_v: string | undefined): any;
|
|
230
|
-
get element(): HTMLElement | null;
|
|
231
|
-
set element(_v: HTMLElement | null): any;
|
|
232
|
-
}) & typeof Shape;
|
|
233
|
-
export declare class GLTFObject extends GLTFObject_base {
|
|
234
|
-
static _image: HTMLImageElement;
|
|
235
|
-
is3dish(): boolean;
|
|
236
|
-
static get image(): HTMLImageElement;
|
|
237
|
-
get controls(): Array<Control> | undefined;
|
|
238
|
-
render(context: CanvasRenderingContext2D): void;
|
|
239
|
-
buildRealObject(): RealObject | undefined;
|
|
240
|
-
get nature(): ComponentNature;
|
|
241
|
-
get source(): any;
|
|
242
|
-
set source(source: any);
|
|
243
|
-
set dimension(dimension: {
|
|
244
|
-
width: number;
|
|
245
|
-
height: number;
|
|
246
|
-
depth: number;
|
|
247
|
-
});
|
|
248
|
-
}
|
|
249
|
-
export {};
|
package/dist/gltf-object.js
DELETED
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright © HatioLab Inc. All rights reserved.
|
|
3
|
-
*/
|
|
4
|
-
var GLTFObject_1;
|
|
5
|
-
import { __decorate } from "tslib";
|
|
6
|
-
import { RectPath, Shape, sceneComponent, RealObjectGLTF } from '@hatiolab/things-scene';
|
|
7
|
-
const BASE_URL_ALIAS = '$base_url';
|
|
8
|
-
const NATURE = {
|
|
9
|
-
mutable: false,
|
|
10
|
-
resizable: true,
|
|
11
|
-
rotatable: true,
|
|
12
|
-
properties: [
|
|
13
|
-
{
|
|
14
|
-
type: 'gltf-selector',
|
|
15
|
-
label: 'url',
|
|
16
|
-
name: 'src',
|
|
17
|
-
property: {
|
|
18
|
-
displayField: 'id',
|
|
19
|
-
displayFullUrl: true,
|
|
20
|
-
baseUrlAlias: BASE_URL_ALIAS,
|
|
21
|
-
defaultStorage: '3d-model',
|
|
22
|
-
storageFilters: {
|
|
23
|
-
type: Array,
|
|
24
|
-
value: [
|
|
25
|
-
{
|
|
26
|
-
name: 'category',
|
|
27
|
-
value: 'image'
|
|
28
|
-
}
|
|
29
|
-
]
|
|
30
|
-
},
|
|
31
|
-
useUpload: true,
|
|
32
|
-
category: 'application'
|
|
33
|
-
},
|
|
34
|
-
observe: function (src) {
|
|
35
|
-
const info = this.parentNode.querySelector('[name=gltfInfo]');
|
|
36
|
-
info.src = src;
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
type: 'gltf-info',
|
|
41
|
-
label: '',
|
|
42
|
-
name: 'gltfInfo',
|
|
43
|
-
readonly: true,
|
|
44
|
-
property: {
|
|
45
|
-
action: (component, options) => {
|
|
46
|
-
component.set(options);
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
editor: {
|
|
50
|
-
fullwidth: true
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
],
|
|
54
|
-
'value-property': 'source',
|
|
55
|
-
help: 'scene/component/gltf-object'
|
|
56
|
-
};
|
|
57
|
-
let GLTFObject = GLTFObject_1 = class GLTFObject extends RectPath(Shape) {
|
|
58
|
-
is3dish() {
|
|
59
|
-
return true;
|
|
60
|
-
}
|
|
61
|
-
static get image() {
|
|
62
|
-
if (!GLTFObject_1._image) {
|
|
63
|
-
GLTFObject_1._image = new Image();
|
|
64
|
-
GLTFObject_1._image.src = new URL('../icons/canvasicon-gltf.png', import.meta.url).href;
|
|
65
|
-
}
|
|
66
|
-
return GLTFObject_1._image;
|
|
67
|
-
}
|
|
68
|
-
get controls() {
|
|
69
|
-
return [];
|
|
70
|
-
}
|
|
71
|
-
render(context) {
|
|
72
|
-
var { left, top, width, height } = this.bounds;
|
|
73
|
-
context.beginPath();
|
|
74
|
-
this.drawImage(context, GLTFObject_1.image, left, top, width, height);
|
|
75
|
-
}
|
|
76
|
-
buildRealObject() {
|
|
77
|
-
return new RealObjectGLTF(this);
|
|
78
|
-
}
|
|
79
|
-
get nature() {
|
|
80
|
-
return NATURE;
|
|
81
|
-
}
|
|
82
|
-
get source() {
|
|
83
|
-
return this.getState('src');
|
|
84
|
-
}
|
|
85
|
-
set source(source) {
|
|
86
|
-
this.setState('src', source);
|
|
87
|
-
}
|
|
88
|
-
set dimension(dimension) {
|
|
89
|
-
var _a;
|
|
90
|
-
const { width = 1, height = 1, depth = 1 } = dimension;
|
|
91
|
-
this.setState({
|
|
92
|
-
width,
|
|
93
|
-
height,
|
|
94
|
-
depth
|
|
95
|
-
});
|
|
96
|
-
(_a = this.realObject) === null || _a === void 0 ? void 0 : _a.updateDimension();
|
|
97
|
-
}
|
|
98
|
-
};
|
|
99
|
-
GLTFObject = GLTFObject_1 = __decorate([
|
|
100
|
-
sceneComponent('gltf-object')
|
|
101
|
-
], GLTFObject);
|
|
102
|
-
export { GLTFObject };
|
|
103
|
-
//# sourceMappingURL=gltf-object.js.map
|
package/dist/gltf-object.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gltf-object.js","sourceRoot":"","sources":["../src/gltf-object.ts"],"names":[],"mappings":"AAAA;;GAEG;;;AAEH,OAAO,EAAuC,QAAQ,EAAE,KAAK,EAAE,cAAc,EAAc,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAEzI,MAAM,cAAc,GAAG,WAAW,CAAA;AAElC,MAAM,MAAM,GAAoB;IAC9B,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,IAAI;IACf,UAAU,EAAE;QACV;YACE,IAAI,EAAE,eAAe;YACrB,KAAK,EAAE,KAAK;YACZ,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE;gBACR,YAAY,EAAE,IAAI;gBAClB,cAAc,EAAE,IAAI;gBACpB,YAAY,EAAE,cAAc;gBAC5B,cAAc,EAAE,UAAU;gBAC1B,cAAc,EAAE;oBACd,IAAI,EAAE,KAAK;oBACX,KAAK,EAAE;wBACL;4BACE,IAAI,EAAE,UAAU;4BAChB,KAAK,E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C,OAAO,CAAC,SAAS,EAAE,CAAA;QACnB,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,YAAU,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,CAAC,CAAA;IACrE,CAAC;IAED,eAAe;QACb,OAAO,IAAI,cAAc,CAAC,IAAW,CAAC,CAAA;IACxC,CAAC;IAED,IAAI,MAAM;QACR,OAAO,MAAM,CAAA;IACf,CAAC;IAED,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;IAC7B,CAAC;IAED,IAAI,MAAM,CAAC,MAAM;QACf,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,CAAA;IAC9B,CAAC;IAED,IAAI,SAAS,CAAC,SAA2D;;QACvE,MAAM,EAAE,KAAK,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC,EAAE,GAAG,SAAS,CAAA;QACtD,IAAI,CAAC,QAAQ,CAAC;YACZ,KAAK;YACL,MAAM;YACN,KAAK;SACN,CAAC,CAAA;QAEF,MAAA,IAAI,CAAC,UAAU,0CAAE,eAAe,EAAE,CAAA;IACpC,CAAC;CACF,CAAA;AArDY,UAAU;IADtB,cAAc,CAAC,aAAa,CAAC;GACjB,UAAU,CAqDtB","sourcesContent":["/*\n * Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport { Component, ComponentNature, Control, RectPath, Shape, sceneComponent, RealObject, RealObjectGLTF } from '@hatiolab/things-scene'\n\nconst BASE_URL_ALIAS = '$base_url'\n\nconst NATURE: ComponentNature = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [\n {\n type: 'gltf-selector',\n label: 'url',\n name: 'src',\n property: {\n displayField: 'id',\n displayFullUrl: true,\n baseUrlAlias: BASE_URL_ALIAS,\n defaultStorage: '3d-model',\n storageFilters: {\n type: Array,\n value: [\n {\n name: 'category',\n value: 'image'\n }\n ]\n },\n useUpload: true,\n category: 'application'\n },\n observe: function (this: HTMLElement, src: string) {\n const info: any = this.parentNode!.querySelector('[name=gltfInfo]')\n info.src = src\n }\n },\n {\n type: 'gltf-info',\n label: '',\n name: 'gltfInfo',\n readonly: true,\n property: {\n action: (component: GLTFObject, options: any) => {\n component.set(options)\n }\n },\n editor: {\n fullwidth: true\n }\n }\n ],\n 'value-property': 'source',\n help: 'scene/component/gltf-object'\n}\n\n@sceneComponent('gltf-object')\nexport class GLTFObject extends RectPath(Shape) {\n static _image: HTMLImageElement\n\n is3dish() {\n return true\n }\n\n static get image() {\n if (!GLTFObject._image) {\n GLTFObject._image = new Image()\n GLTFObject._image.src = new URL('../icons/canvasicon-gltf.png', import.meta.url).href\n }\n\n return GLTFObject._image\n }\n\n get controls(): Array<Control> | undefined {\n return []\n }\n\n render(context: CanvasRenderingContext2D) {\n var { left, top, width, height } = this.bounds\n\n context.beginPath()\n this.drawImage(context, GLTFObject.image, left, top, width, height)\n }\n\n buildRealObject(): RealObject | undefined {\n return new RealObjectGLTF(this as any)\n }\n\n get nature() {\n return NATURE\n }\n\n get source() {\n return this.getState('src')\n }\n\n set source(source) {\n this.setState('src', source)\n }\n\n set dimension(dimension: { width: number; height: number; depth: number }) {\n const { width = 1, height = 1, depth = 1 } = dimension\n this.setState({\n width,\n height,\n depth\n })\n\n this.realObject?.updateDimension()\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright © HatioLab Inc. All rights reserved.
|
|
3
|
-
*/
|
|
4
|
-
import { registerRealObjectFactory } from './threed/real-object-registry.js';
|
|
5
|
-
import { RealObjectDomElement } from './threed/real-object-dom-element.js';
|
|
6
|
-
registerRealObjectFactory('html-overlay-element', (component) => new RealObjectDomElement(component));
|
|
7
|
-
registerRealObjectFactory('html-overlay-container', (component) => new RealObjectDomElement(component));
|
|
8
|
-
//# sourceMappingURL=html-overlay-element.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"html-overlay-element.js","sourceRoot":"","sources":["../src/html-overlay-element.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAA;AAC5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAA;AAE1E,yBAAyB,CAAC,sBAAsB,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,IAAI,oBAAoB,CAAC,SAAS,CAAC,CAAC,CAAA;AACrG,yBAAyB,CAAC,wBAAwB,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,IAAI,oBAAoB,CAAC,SAAS,CAAC,CAAC,CAAA","sourcesContent":["/*\n * Copyright © HatioLab Inc. All rights reserved.\n */\nimport { registerRealObjectFactory } from './threed/real-object-registry.js'\nimport { RealObjectDomElement } from './threed/real-object-dom-element.js'\n\nregisterRealObjectFactory('html-overlay-element', (component) => new RealObjectDomElement(component))\nregisterRealObjectFactory('html-overlay-container', (component) => new RealObjectDomElement(component))\n"]}
|
package/dist/light.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Anchor, ComponentNature, Ellipse, RealObject } from '@hatiolab/things-scene';
|
|
2
|
-
import * as THREE from 'three';
|
|
3
|
-
export declare class LightObject extends RealObject<THREE.Light> {
|
|
4
|
-
helper?: THREE.CameraHelper;
|
|
5
|
-
updatePointLight(): void;
|
|
6
|
-
protected getObject3dInstance(): THREE.Light;
|
|
7
|
-
update(): void;
|
|
8
|
-
}
|
|
9
|
-
export declare class PointLight extends Ellipse {
|
|
10
|
-
is3dish(): boolean;
|
|
11
|
-
buildRealObject(): RealObject | undefined;
|
|
12
|
-
get anchors(): Array<Anchor>;
|
|
13
|
-
get nature(): ComponentNature;
|
|
14
|
-
}
|
package/dist/light.js
DELETED
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
/*
|
|
3
|
-
* Copyright © HatioLab Inc. All rights reserved.
|
|
4
|
-
*/
|
|
5
|
-
import { Ellipse, sceneComponent, RealObject } from '@hatiolab/things-scene';
|
|
6
|
-
import * as THREE from 'three';
|
|
7
|
-
const NATURE = {
|
|
8
|
-
mutable: false,
|
|
9
|
-
resizable: true,
|
|
10
|
-
rotatable: true,
|
|
11
|
-
properties: [
|
|
12
|
-
{
|
|
13
|
-
type: 'select',
|
|
14
|
-
label: 'light-type',
|
|
15
|
-
name: 'lightType',
|
|
16
|
-
property: {
|
|
17
|
-
options: ['', 'point', 'directional']
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
type: 'number',
|
|
22
|
-
label: 'intensity',
|
|
23
|
-
name: 'intensity'
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
type: 'number',
|
|
27
|
-
label: 'distance',
|
|
28
|
-
name: 'distance'
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
type: 'number',
|
|
32
|
-
label: 'decay',
|
|
33
|
-
name: 'decay'
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
type: 'checkbox',
|
|
37
|
-
label: 'cast-shadow',
|
|
38
|
-
name: 'castShadow'
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
type: 'number',
|
|
42
|
-
label: 'near',
|
|
43
|
-
name: 'near',
|
|
44
|
-
placeholder: '0.5'
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
type: 'number',
|
|
48
|
-
label: 'far',
|
|
49
|
-
name: 'far',
|
|
50
|
-
placeholder: '1000'
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
type: 'number',
|
|
54
|
-
label: 'fov',
|
|
55
|
-
name: 'fov',
|
|
56
|
-
placeholder: '90'
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
type: 'number',
|
|
60
|
-
label: 'zoom',
|
|
61
|
-
name: 'zoom',
|
|
62
|
-
placeholder: '1'
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
type: 'checkbox',
|
|
66
|
-
label: 'show-helper',
|
|
67
|
-
name: 'showHelper'
|
|
68
|
-
}
|
|
69
|
-
],
|
|
70
|
-
help: 'scene/component/light'
|
|
71
|
-
};
|
|
72
|
-
export class LightObject extends RealObject {
|
|
73
|
-
updatePointLight() {
|
|
74
|
-
var _a, _b;
|
|
75
|
-
var { lightType = 'point', distance = 0, // unlimited
|
|
76
|
-
intensity = 10, decay = 1, fillStyle: color = 'white', castShadow, near = 0.5, far = 1000, fov = 90, zoom = 1, showHelper } = this.component.state;
|
|
77
|
-
this.object3d.color = new THREE.Color(color);
|
|
78
|
-
if (lightType == 'point') {
|
|
79
|
-
;
|
|
80
|
-
this.object3d.distance = distance;
|
|
81
|
-
this.object3d.decay = decay;
|
|
82
|
-
}
|
|
83
|
-
this.object3d.intensity = intensity;
|
|
84
|
-
this.object3d.castShadow = castShadow;
|
|
85
|
-
if (castShadow) {
|
|
86
|
-
const camera = (_a = this.object3d.shadow) === null || _a === void 0 ? void 0 : _a.camera;
|
|
87
|
-
camera.far = far;
|
|
88
|
-
camera.near = near;
|
|
89
|
-
camera.fov = fov;
|
|
90
|
-
camera.zoom = zoom;
|
|
91
|
-
}
|
|
92
|
-
if (showHelper) {
|
|
93
|
-
const camera = (_b = this.object3d.shadow) === null || _b === void 0 ? void 0 : _b.camera;
|
|
94
|
-
if (!this.helper) {
|
|
95
|
-
this.helper = new THREE.CameraHelper(camera);
|
|
96
|
-
this.object3d.add(this.helper);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
else if (this.helper) {
|
|
100
|
-
this.object3d.remove(this.helper);
|
|
101
|
-
delete this.helper;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
getObject3dInstance() {
|
|
105
|
-
var { lightType = 'point' } = this.component.state;
|
|
106
|
-
return lightType == 'point' ? new THREE.PointLight() : new THREE.DirectionalLight();
|
|
107
|
-
}
|
|
108
|
-
update() {
|
|
109
|
-
this.clear();
|
|
110
|
-
this.build();
|
|
111
|
-
this.updateDimension();
|
|
112
|
-
this.updateHidden();
|
|
113
|
-
this.updatePointLight();
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
let PointLight = class PointLight extends Ellipse {
|
|
117
|
-
is3dish() {
|
|
118
|
-
return true;
|
|
119
|
-
}
|
|
120
|
-
buildRealObject() {
|
|
121
|
-
return new LightObject(this);
|
|
122
|
-
}
|
|
123
|
-
get anchors() {
|
|
124
|
-
return [];
|
|
125
|
-
}
|
|
126
|
-
get nature() {
|
|
127
|
-
return NATURE;
|
|
128
|
-
}
|
|
129
|
-
};
|
|
130
|
-
PointLight = __decorate([
|
|
131
|
-
sceneComponent('light')
|
|
132
|
-
], PointLight);
|
|
133
|
-
export { PointLight };
|
|
134
|
-
//# sourceMappingURL=light.js.map
|
package/dist/light.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"light.js","sourceRoot":"","sources":["../src/light.ts"],"names":[],"mappings":";AAAA;;GAEG;AACH,OAAO,EAAsC,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAChH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,MAAM,MAAM,GAAoB;IAC9B,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,IAAI;IACf,UAAU,EAAE;QACV;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,YAAY;YACnB,IAAI,EAAE,WAAW;YACjB,QAAQ,EAAE;gBACR,OAAO,EAAE,CAAC,EAAE,EAAE,OAAO,EAAE,aAAa,CAAC;aACtC;SACF;QACD;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,WAAW;YAClB,IAAI,EAAE,WAAW;SAClB;QACD;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,UAAU;YACjB,IAAI,EAAE,UAAU;SACjB;QACD;YACE,IAAI,EAAE,QAA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rF,CAAC;IAED,MAAM;QACJ,IAAI,CAAC,KAAK,EAAE,CAAA;QACZ,IAAI,CAAC,KAAK,EAAE,CAAA;QAEZ,IAAI,CAAC,eAAe,EAAE,CAAA;QACtB,IAAI,CAAC,YAAY,EAAE,CAAA;QAEnB,IAAI,CAAC,gBAAgB,EAAE,CAAA;IACzB,CAAC;CACF;AAGM,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,OAAO;IACrC,OAAO;QACL,OAAO,IAAI,CAAA;IACb,CAAC;IAED,eAAe;QACb,OAAO,IAAI,WAAW,CAAC,IAAW,CAAC,CAAA;IACrC,CAAC;IAED,IAAI,OAAO;QACT,OAAO,EAAE,CAAA;IACX,CAAC;IAED,IAAI,MAAM;QACR,OAAO,MAAM,CAAA;IACf,CAAC;CACF,CAAA;AAhBY,UAAU;IADtB,cAAc,CAAC,OAAO,CAAC;GACX,UAAU,CAgBtB","sourcesContent":["/*\n * Copyright © HatioLab Inc. All rights reserved.\n */\nimport { Anchor, Component, ComponentNature, Ellipse, sceneComponent, RealObject } from '@hatiolab/things-scene'\nimport * as THREE from 'three'\n\nconst NATURE: ComponentNature = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [\n {\n type: 'select',\n label: 'light-type',\n name: 'lightType',\n property: {\n options: ['', 'point', 'directional']\n }\n },\n {\n type: 'number',\n label: 'intensity',\n name: 'intensity'\n },\n {\n type: 'number',\n label: 'distance',\n name: 'distance'\n },\n {\n type: 'number',\n label: 'decay',\n name: 'decay'\n },\n {\n type: 'checkbox',\n label: 'cast-shadow',\n name: 'castShadow'\n },\n {\n type: 'number',\n label: 'near',\n name: 'near',\n placeholder: '0.5'\n },\n {\n type: 'number',\n label: 'far',\n name: 'far',\n placeholder: '1000'\n },\n {\n type: 'number',\n label: 'fov',\n name: 'fov',\n placeholder: '90'\n },\n {\n type: 'number',\n label: 'zoom',\n name: 'zoom',\n placeholder: '1'\n },\n {\n type: 'checkbox',\n label: 'show-helper',\n name: 'showHelper'\n }\n ],\n help: 'scene/component/light'\n}\n\nexport class LightObject extends RealObject<THREE.Light> {\n helper?: THREE.CameraHelper\n\n updatePointLight() {\n var {\n lightType = 'point',\n distance = 0, // unlimited\n intensity = 10,\n decay = 1,\n fillStyle: color = 'white',\n castShadow,\n near = 0.5,\n far = 1000,\n fov = 90,\n zoom = 1,\n showHelper\n } = this.component.state\n\n this.object3d!.color = new THREE.Color(color)\n if (lightType == 'point') {\n ;(this.object3d as THREE.PointLight)!.distance = distance\n ;(this.object3d as THREE.PointLight)!.decay = decay\n }\n this.object3d!.intensity = intensity\n this.object3d!.castShadow = castShadow\n if (castShadow) {\n const camera = this.object3d!.shadow?.camera as THREE.PerspectiveCamera\n camera.far = far\n camera.near = near\n camera.fov = fov\n camera.zoom = zoom\n }\n\n if (showHelper) {\n const camera = this.object3d!.shadow?.camera as THREE.PerspectiveCamera\n\n if (!this.helper) {\n this.helper = new THREE.CameraHelper(camera!)\n this.object3d.add(this.helper)\n }\n } else if (this.helper) {\n this.object3d.remove(this.helper)\n delete this.helper\n }\n }\n\n protected getObject3dInstance(): THREE.Light {\n var { lightType = 'point' } = this.component.state\n\n return lightType == 'point' ? new THREE.PointLight() : new THREE.DirectionalLight()\n }\n\n update() {\n this.clear()\n this.build()\n\n this.updateDimension()\n this.updateHidden()\n\n this.updatePointLight()\n }\n}\n\n@sceneComponent('light')\nexport class PointLight extends Ellipse {\n is3dish() {\n return true\n }\n\n buildRealObject(): RealObject | undefined {\n return new LightObject(this as any)\n }\n\n get anchors(): Array<Anchor> {\n return []\n }\n\n get nature(): ComponentNature {\n return NATURE\n }\n}\n"]}
|
package/dist/polygon.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import * as THREE from 'three';
|
|
2
|
-
import { RealObjectExtrude } from './threed/real-object-extrude.js';
|
|
3
|
-
export declare class PolygonExtrude extends RealObjectExtrude {
|
|
4
|
-
_minMax?: {
|
|
5
|
-
minX?: number;
|
|
6
|
-
minY?: number;
|
|
7
|
-
maxX?: number;
|
|
8
|
-
maxY?: number;
|
|
9
|
-
};
|
|
10
|
-
get shape(): THREE.Shape;
|
|
11
|
-
get minMax(): {
|
|
12
|
-
minX?: number;
|
|
13
|
-
minY?: number;
|
|
14
|
-
maxX?: number;
|
|
15
|
-
maxY?: number;
|
|
16
|
-
};
|
|
17
|
-
}
|
package/dist/polygon.js
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright © HatioLab Inc. All rights reserved.
|
|
3
|
-
*/
|
|
4
|
-
import * as THREE from 'three';
|
|
5
|
-
import { RealObjectExtrude } from './threed/real-object-extrude.js';
|
|
6
|
-
import { registerRealObjectFactory } from './threed/real-object-registry.js';
|
|
7
|
-
export class PolygonExtrude extends RealObjectExtrude {
|
|
8
|
-
get shape() {
|
|
9
|
-
var { path = [], round = 0 } = this.component.state;
|
|
10
|
-
var shape = new THREE.Shape();
|
|
11
|
-
for (var i = 0; i < path.length; i++) {
|
|
12
|
-
const prev = path[(i - 1 + path.length) % path.length];
|
|
13
|
-
const cursor = path[(i + path.length) % path.length];
|
|
14
|
-
const next = path[(i + 1) % path.length];
|
|
15
|
-
if (prev.x === cursor.x && prev.y === cursor.y) {
|
|
16
|
-
continue;
|
|
17
|
-
}
|
|
18
|
-
var length = Math.sqrt((prev.x - cursor.x) * (prev.x - cursor.x) + (prev.y - cursor.y) * (prev.y - cursor.y));
|
|
19
|
-
var theta = length !== 0 ? Math.atan2(prev.x - cursor.x, prev.y - cursor.y) : 0;
|
|
20
|
-
var x = Math.sin(theta) * Math.min(round, length / 2) + cursor.x;
|
|
21
|
-
var y = Math.cos(theta) * Math.min(round, length / 2) + cursor.y;
|
|
22
|
-
const p1 = round > 0 || length !== 0 ? { x, y } : cursor;
|
|
23
|
-
var length = Math.sqrt((next.x - cursor.x) * (next.x - cursor.x) + (next.y - cursor.y) * (next.y - cursor.y));
|
|
24
|
-
theta = length !== 0 ? Math.atan2(next.x - cursor.x, next.y - cursor.y) : 0;
|
|
25
|
-
x = Math.sin(theta) * Math.min(round, length / 2) + cursor.x;
|
|
26
|
-
y = Math.cos(theta) * Math.min(round, length / 2) + cursor.y;
|
|
27
|
-
const p2 = round > 0 || length !== 0 ? { x, y } : cursor;
|
|
28
|
-
i == 0 ? shape.moveTo(p1.x, p1.y) : shape.lineTo(p1.x, p1.y);
|
|
29
|
-
round > 0 && shape.quadraticCurveTo(cursor.x, cursor.y, p2.x, p2.y);
|
|
30
|
-
}
|
|
31
|
-
return shape;
|
|
32
|
-
}
|
|
33
|
-
get minMax() {
|
|
34
|
-
if (!this._minMax) {
|
|
35
|
-
var { path } = this.component.state;
|
|
36
|
-
var minX;
|
|
37
|
-
var minY;
|
|
38
|
-
var maxX;
|
|
39
|
-
var maxY;
|
|
40
|
-
path.forEach((p, i) => {
|
|
41
|
-
if (i == 0) {
|
|
42
|
-
minX = maxX = p.x;
|
|
43
|
-
minY = maxY = p.y;
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
minX = Math.min(minX, p.x);
|
|
47
|
-
maxX = Math.max(maxX, p.x);
|
|
48
|
-
minY = Math.min(minY, p.y);
|
|
49
|
-
maxY = Math.max(maxY, p.y);
|
|
50
|
-
});
|
|
51
|
-
this._minMax = {
|
|
52
|
-
minX,
|
|
53
|
-
minY,
|
|
54
|
-
maxX,
|
|
55
|
-
maxY
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
return this._minMax;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
registerRealObjectFactory('polygon', (component) => new PolygonExtrude(component));
|
|
62
|
-
//# sourceMappingURL=polygon.js.map
|
package/dist/polygon.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"polygon.js","sourceRoot":"","sources":["../src/polygon.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,iBAAiB,EAAE,MAAM,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CAAC;gBAED,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,IAAK,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;gBAC3B,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,IAAK,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;gBAC3B,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,IAAK,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;gBAC3B,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,IAAK,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;YAC7B,CAAC,CAAC,CAAA;YAEF,IAAI,CAAC,OAAO,GAAG;gBACb,IAAI;gBACJ,IAAI;gBACJ,IAAI;gBACJ,IAAI;aACL,CAAA;QACH,CAAC;QAED,OAAO,IAAI,CAAC,OAAO,CAAA;IACrB,CAAC;CACF;AAED,yBAAyB,CAAC,SAAS,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,IAAI,cAAc,CAAC,SAAS,CAAC,CAAC,CAAA","sourcesContent":["/*\n * Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport { POINT } from '@hatiolab/things-scene'\nimport * as THREE from 'three'\nimport { RealObjectExtrude } from './threed/real-object-extrude.js'\nimport { registerRealObjectFactory } from './threed/real-object-registry.js'\n\nexport class PolygonExtrude extends RealObjectExtrude {\n _minMax?: {\n minX?: number\n minY?: number\n maxX?: number\n maxY?: number\n }\n\n get shape() {\n var { path = [], round = 0 } = this.component.state\n\n var shape = new THREE.Shape()\n\n for (var i = 0; i < path.length; i++) {\n const prev = path[(i - 1 + path.length) % path.length]\n const cursor = path[(i + path.length) % path.length]\n const next = path[(i + 1) % path.length]\n\n if (prev.x === cursor.x && prev.y === cursor.y) {\n continue\n }\n\n var length = Math.sqrt((prev.x - cursor.x) * (prev.x - cursor.x) + (prev.y - cursor.y) * (prev.y - cursor.y))\n var theta = length !== 0 ? Math.atan2(prev.x - cursor.x, prev.y - cursor.y) : 0\n var x = Math.sin(theta) * Math.min(round, length / 2) + cursor.x\n var y = Math.cos(theta) * Math.min(round, length / 2) + cursor.y\n\n const p1 = round > 0 || length !== 0 ? { x, y } : cursor\n\n var length = Math.sqrt((next.x - cursor.x) * (next.x - cursor.x) + (next.y - cursor.y) * (next.y - cursor.y))\n theta = length !== 0 ? Math.atan2(next.x - cursor.x, next.y - cursor.y) : 0\n x = Math.sin(theta) * Math.min(round, length / 2) + cursor.x\n y = Math.cos(theta) * Math.min(round, length / 2) + cursor.y\n\n const p2 = round > 0 || length !== 0 ? { x, y } : cursor\n\n i == 0 ? shape.moveTo(p1.x, p1.y) : shape.lineTo(p1.x, p1.y)\n round > 0 && shape.quadraticCurveTo(cursor.x, cursor.y, p2.x, p2.y)\n }\n\n return shape\n }\n\n get minMax() {\n if (!this._minMax) {\n var { path } = this.component.state\n\n var minX: number | undefined\n var minY: number | undefined\n var maxX: number | undefined\n var maxY: number | undefined\n\n path.forEach((p: POINT, i: number) => {\n if (i == 0) {\n minX = maxX = p.x\n minY = maxY = p.y\n return\n }\n\n minX = Math.min(minX!, p.x)\n maxX = Math.max(maxX!, p.x)\n minY = Math.min(minY!, p.y)\n maxY = Math.max(maxY!, p.y)\n })\n\n this._minMax = {\n minX,\n minY,\n maxX,\n maxY\n }\n }\n\n return this._minMax\n }\n}\n\nregisterRealObjectFactory('polygon', (component) => new PolygonExtrude(component))\n"]}
|