t3d-ez.gl 0.0.1 → 0.0.3
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/core/Addons/RaycasterAide.cjs.js +1 -0
- package/dist/core/Addons/RaycasterAide.esm.js +1 -0
- package/dist/core/Controls/TTControls/TTControls.cjs.js +1 -0
- package/dist/core/Controls/TTControls/TTControls.esm.js +1 -0
- package/dist/core/Controls/index.cjs.js +1 -1
- package/dist/core/Controls/index.esm.js +1 -1
- package/dist/core/Map/index.cjs.js +1 -1
- package/dist/core/Map/index.esm.js +1 -1
- package/dist/core/MarkerHtmlUI/index.cjs.js +1 -1
- package/dist/core/MarkerHtmlUI/index.esm.js +1 -1
- package/dist/core/Meshes/Builders/CapsuleBuilder.cjs.js +1 -0
- package/dist/core/Meshes/Builders/CapsuleBuilder.esm.js +1 -0
- package/dist/core/Meshes/index.cjs.js +1 -1
- package/dist/core/Meshes/index.esm.js +1 -1
- package/dist/core/Resource/loaders.cjs.js +1 -1
- package/dist/core/Resource/loaders.esm.js +1 -1
- package/dist/core/WebGLEngine/index.cjs.js +1 -1
- package/dist/core/WebGLEngine/index.esm.js +1 -1
- package/dist/helpers/AxesAddHelper.cjs.js +1 -0
- package/dist/helpers/AxesAddHelper.esm.js +1 -0
- package/dist/helpers/InfiniteGridHelper.cjs.js +1 -1
- package/dist/helpers/InfiniteGridHelper.esm.js +1 -1
- package/dist/helpers/T3DEzViewportGizmo.cjs.js +1 -0
- package/dist/helpers/T3DEzViewportGizmo.esm.js +1 -0
- package/dist/node_modules/.pnpm/three@0.182.0/node_modules/three/build/three.core.cjs.js +1 -1
- package/dist/node_modules/.pnpm/three@0.182.0/node_modules/three/build/three.core.esm.js +1 -1
- package/dist/node_modules/.pnpm/three@0.182.0/node_modules/three/build/three.module.cjs.js +1 -1
- package/dist/node_modules/.pnpm/three@0.182.0/node_modules/three/build/three.module.esm.js +1 -1
- package/dist/node_modules/.pnpm/three@0.182.0/node_modules/three/examples/jsm/lines/Line2.cjs.js +1 -0
- package/dist/node_modules/.pnpm/three@0.182.0/node_modules/three/examples/jsm/lines/Line2.esm.js +1 -0
- package/dist/node_modules/.pnpm/three@0.182.0/node_modules/three/examples/jsm/lines/LineGeometry.cjs.js +1 -0
- package/dist/node_modules/.pnpm/three@0.182.0/node_modules/three/examples/jsm/lines/LineGeometry.esm.js +1 -0
- package/dist/node_modules/.pnpm/three@0.182.0/node_modules/three/examples/jsm/lines/LineMaterial.cjs.js +1 -0
- package/dist/node_modules/.pnpm/three@0.182.0/node_modules/three/examples/jsm/lines/LineMaterial.esm.js +1 -0
- package/dist/node_modules/.pnpm/three@0.182.0/node_modules/three/examples/jsm/lines/LineSegments2.cjs.js +1 -0
- package/dist/node_modules/.pnpm/three@0.182.0/node_modules/three/examples/jsm/lines/LineSegments2.esm.js +1 -0
- package/dist/node_modules/.pnpm/three@0.182.0/node_modules/three/examples/jsm/lines/LineSegmentsGeometry.cjs.js +1 -0
- package/dist/node_modules/.pnpm/three@0.182.0/node_modules/three/examples/jsm/lines/LineSegmentsGeometry.esm.js +1 -0
- package/dist/node_modules/.pnpm/three@0.182.0/node_modules/three/examples/jsm/utils/BufferGeometryUtils.cjs.js +1 -1
- package/dist/node_modules/.pnpm/three@0.182.0/node_modules/three/examples/jsm/utils/BufferGeometryUtils.esm.js +1 -1
- package/dist/node_modules/.pnpm/three@0.182.0/node_modules/three/src/math/MathUtils.cjs.js +1 -0
- package/dist/node_modules/.pnpm/three@0.182.0/node_modules/three/src/math/MathUtils.esm.js +1 -0
- package/dist/package.json +4 -1
- package/dist/t3d-ez.gl.cjs.js +1 -1
- package/dist/t3d-ez.gl.esm.js +1 -1
- package/dist/types/core/Addons/RaycasterAide.d.ts +12 -0
- package/dist/types/core/Addons/index.d.ts +1 -0
- package/dist/types/core/Controls/TTControls/TTControls.d.ts +332 -0
- package/dist/types/core/Controls/index.d.ts +3 -2
- package/dist/types/core/Meshes/Builders/CapsuleBuilder.d.ts +19 -0
- package/dist/types/core/Meshes/Builders/index.d.ts +1 -0
- package/dist/types/core/Meshes/index.d.ts +3 -1
- package/dist/types/core/PostProcessor/index.d.ts +3 -3
- package/dist/types/core/Resource/ResourceManager.d.ts +1 -1
- package/dist/types/core/Resource/loaders.d.ts +2 -2
- package/dist/types/core/WebGLEngine/index.d.ts +2 -2
- package/dist/types/core/index.d.ts +1 -1
- package/dist/types/helpers/AxesAddHelper.d.ts +6 -0
- package/dist/types/helpers/T3DEzViewportGizmo.d.ts +271 -0
- package/dist/types/helpers/index.d.ts +2 -0
- package/dist/types/utils/index.d.ts +9 -0
- package/package.json +4 -1
- package/dist/node_modules/.pnpm/three@0.182.0/node_modules/three/examples/jsm/loaders/RGBELoader.cjs.js +0 -1
- package/dist/node_modules/.pnpm/three@0.182.0/node_modules/three/examples/jsm/loaders/RGBELoader.esm.js +0 -1
- package/dist/node_modules/.pnpm/three@0.182.0/node_modules/three/examples/jsm/physics/AmmoPhysics.cjs.js +0 -1
- package/dist/node_modules/.pnpm/three@0.182.0/node_modules/three/examples/jsm/physics/AmmoPhysics.esm.js +0 -1
- package/dist/types/core/Physics/index.d.ts +0 -1
- /package/dist/core/Map/{extrudeMap.cjs.js → ExtrudeMap.cjs.js} +0 -0
- /package/dist/core/Map/{extrudeMap.esm.js → ExtrudeMap.esm.js} +0 -0
- /package/dist/types/core/Map/{extrudeMap.d.ts → ExtrudeMap.d.ts} +0 -0
|
@@ -8,7 +8,7 @@ type rsManagerType = {
|
|
|
8
8
|
export declare class ResourceManager {
|
|
9
9
|
type: string;
|
|
10
10
|
engine: IPotatoEngine;
|
|
11
|
-
LoaderMaps: Map<string, import("three/examples/jsm/loaders/GLTFLoader").GLTFLoader | import("three/examples/jsm/loaders/
|
|
11
|
+
LoaderMaps: Map<string, import("three/examples/jsm/loaders/GLTFLoader").GLTFLoader | import("three/examples/jsm/loaders/HDRLoader").HDRLoader | import("three").TextureLoader>;
|
|
12
12
|
RESOURCE_TYPE: Readonly<{
|
|
13
13
|
GLTF: "GLTF_MODEL";
|
|
14
14
|
HDR: "HDR";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TextureLoader } from 'three';
|
|
2
2
|
import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader.js';
|
|
3
|
-
import {
|
|
3
|
+
import { HDRLoader } from 'three/examples/jsm/loaders/HDRLoader.js';
|
|
4
4
|
export { GLTFLoader };
|
|
5
|
-
type loadType = GLTFLoader |
|
|
5
|
+
type loadType = GLTFLoader | HDRLoader | TextureLoader;
|
|
6
6
|
export declare const LoaderMaps: Map<string, loadType>;
|
|
@@ -2,9 +2,9 @@ import { Scene, PerspectiveCamera, WebGLRenderer, Camera, OrthographicCamera } f
|
|
|
2
2
|
import { IPotatoEngineParameters, IPotatoEngine } from "./types/index";
|
|
3
3
|
import { ControlsManager, CONTROL_TYPE } from "../Controls/index";
|
|
4
4
|
import { ResourceManager } from "../Resource/ResourceManager";
|
|
5
|
-
import { PostProcessor } from "../PostProcessor";
|
|
5
|
+
import { PostProcessor } from "../PostProcessor/index";
|
|
6
6
|
import { OrbitControls } from "three/examples/jsm/controls/OrbitControls.js";
|
|
7
|
-
import { MarkerHtmlUI } from "../MarkerHtmlUI";
|
|
7
|
+
import { MarkerHtmlUI } from "../MarkerHtmlUI/index";
|
|
8
8
|
type TrunParams = (params: {
|
|
9
9
|
sceneGraph: Scene;
|
|
10
10
|
camera: Camera;
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
import { Vector3, Vector2, Object3D, Quaternion, Clock, Scene } from 'three';
|
|
2
|
+
/**
|
|
3
|
+
* ViewportGizmo is a 3D camera orientation controller that provides a visual interface
|
|
4
|
+
* for changing the camera's viewing angle. It creates a widget that shows the current
|
|
5
|
+
* camera orientation and allows direct manipulation of the view through clicking or dragging.
|
|
6
|
+
*
|
|
7
|
+
* @fires ViewportGizmo#start - Fired when a view change interaction begins
|
|
8
|
+
* @fires ViewportGizmo#change - Fired during view changes
|
|
9
|
+
* @fires ViewportGizmo#end - Fired when a view change interaction ends
|
|
10
|
+
*
|
|
11
|
+
* @extends Object3D
|
|
12
|
+
*/
|
|
13
|
+
declare class T3DEzViewportGizmo extends Object3D {
|
|
14
|
+
/** Whether the gizmo is currently active and responding to user input */
|
|
15
|
+
enabled: boolean;
|
|
16
|
+
/** The camera being controlled by this gizmo */
|
|
17
|
+
camera: any;
|
|
18
|
+
/** The WebGLRenderer rendering the gizmo */
|
|
19
|
+
renderer: any;
|
|
20
|
+
/** The configuration options */
|
|
21
|
+
options: any;
|
|
22
|
+
/** The point around which the camera rotates */
|
|
23
|
+
target: Vector3;
|
|
24
|
+
/** Whether view changes should be animated */
|
|
25
|
+
animated: boolean;
|
|
26
|
+
/** The speed of view change animations. Higher values result in faster animations */
|
|
27
|
+
speed: number;
|
|
28
|
+
/**
|
|
29
|
+
* Indicates whether the gizmo is currently being animated or not,
|
|
30
|
+
* Useful when interacting with other camera controllers
|
|
31
|
+
*
|
|
32
|
+
* @readonly This value is set internally.
|
|
33
|
+
**/
|
|
34
|
+
animating: boolean;
|
|
35
|
+
_options: any;
|
|
36
|
+
_intersections: any;
|
|
37
|
+
_background: null;
|
|
38
|
+
_viewport: number[];
|
|
39
|
+
_originalViewport: number[];
|
|
40
|
+
_originalScissor: number[];
|
|
41
|
+
_scene: Scene<import("three").Object3DEventMap>;
|
|
42
|
+
_camera: any;
|
|
43
|
+
_container: any;
|
|
44
|
+
_domElement: any;
|
|
45
|
+
_domRect: any;
|
|
46
|
+
_dragging: boolean;
|
|
47
|
+
calc_distance: number;
|
|
48
|
+
_clock: Clock;
|
|
49
|
+
_targetQuaternion: Quaternion;
|
|
50
|
+
_quaternionStart: Quaternion;
|
|
51
|
+
_quaternionEnd: Quaternion;
|
|
52
|
+
_pointerStart: Vector2;
|
|
53
|
+
_focus: null;
|
|
54
|
+
_placement: any;
|
|
55
|
+
_controls: any;
|
|
56
|
+
_controlsListeners: any;
|
|
57
|
+
/**
|
|
58
|
+
* Creates a new ViewportGizmo instance.
|
|
59
|
+
*
|
|
60
|
+
* @param camera - The camera to be controlled by this gizmo
|
|
61
|
+
* @param renderer - The WebGL renderer used to render the scene
|
|
62
|
+
* @param options - {@link GizmoOptions}, Configuration options for the gizmo.
|
|
63
|
+
* @param options.container - Parent element for the gizmo. Can be an HTMLElement or a CSS selector string
|
|
64
|
+
* @param options.type - The gizmo configuration type. Either 'sphere' or 'cube', defaults to 'sphere'
|
|
65
|
+
* @param options.size - Size of the gizmo widget in pixels. Defaults to 128
|
|
66
|
+
* @param options.placement - Position of the gizmo in the viewport
|
|
67
|
+
* Options include:
|
|
68
|
+
* - `"top-left"`
|
|
69
|
+
* - `"top-center"`
|
|
70
|
+
* - `"top-right"`
|
|
71
|
+
* - `"center-left"`
|
|
72
|
+
* - `"center-center"`
|
|
73
|
+
* - `"center-right"`
|
|
74
|
+
* - `"bottom-left"`
|
|
75
|
+
* - `"bottom-center"`
|
|
76
|
+
* - `"bottom-right"`
|
|
77
|
+
* @param options.offset - Offset of the gizmo from container edges in pixels
|
|
78
|
+
* @param options.offset.left - Offset from the left edge
|
|
79
|
+
* @param options.offset.top - Offset from the top edge
|
|
80
|
+
* @param options.offset.right - Offset from the right edge
|
|
81
|
+
* @param options.offset.bottom - Offset from the bottom edge
|
|
82
|
+
* @param options.animated - Whether view changes should be animated. Defaults to true
|
|
83
|
+
* @param options.speed - Animation speed multiplier. Defaults to 1
|
|
84
|
+
* @param options.resolution - Texture resolution. Defaults to 64 for sphere, 128 for cube
|
|
85
|
+
* @param options.lineWidth - Width of the axes lines in pixels
|
|
86
|
+
* @param options.id - HTML `id` attribute for the gizmo container
|
|
87
|
+
* @param options.className - HTML `class` attribute for the gizmo container
|
|
88
|
+
* @param options.font - Font configuration for axis labels
|
|
89
|
+
* @param options.font.family - Font family for axis labels
|
|
90
|
+
* @param options.font.weight - Font weight for axis labels
|
|
91
|
+
* @param options.background - Configuration for the background sphere/cube
|
|
92
|
+
* @param options.background.enabled - Whether to display the background
|
|
93
|
+
* @param options.background.color - Color of the background in normal state
|
|
94
|
+
* @param options.background.opacity - Opacity of the background in normal state
|
|
95
|
+
* @param options.background.hover.color - Color of the background when hovered
|
|
96
|
+
* @param options.background.hover.opacity - Opacity of the background when hovered
|
|
97
|
+
* @param options.corners - Configuration for corner indicators
|
|
98
|
+
* @param options.corners.enabled - Whether to display corner indicators
|
|
99
|
+
* @param options.corners.color - Base color of corner indicators
|
|
100
|
+
* @param options.corners.opacity - Opacity of corner indicators
|
|
101
|
+
* @param options.corners.scale - Scale multiplier for corner indicators
|
|
102
|
+
* @param options.corners.radius - Radius of corner indicators
|
|
103
|
+
* @param options.corners.smoothness - Smoothness of corner indicators
|
|
104
|
+
* @param options.corners.hover.color - Color of corner indicators when hovered
|
|
105
|
+
* @param options.corners.hover.opacity - Opacity of corner indicators when hovered
|
|
106
|
+
* @param options.corners.hover.scale - Scale of corner indicators when hovered
|
|
107
|
+
* @param options.edges - Configuration for edge indicators
|
|
108
|
+
* @param options.edges.enabled - Whether to display edge indicators
|
|
109
|
+
* @param options.edges.color - Base color of edge indicators
|
|
110
|
+
* @param options.edges.opacity - Opacity of edge indicators
|
|
111
|
+
* @param options.edges.scale - Scale multiplier for edge indicators
|
|
112
|
+
* @param options.edges.radius - Radius of edge indicators
|
|
113
|
+
* @param options.edges.smoothness - Smoothness of edge indicators
|
|
114
|
+
* @param options.edges.hover.color - Color of edge indicators when hovered
|
|
115
|
+
* @param options.edges.hover.opacity - Opacity of edge indicators when hovered
|
|
116
|
+
* @param options.edges.hover.scale - Scale of edge indicators when hovered
|
|
117
|
+
* @param options.x - Configuration for positive X axis/face
|
|
118
|
+
* @param options.y - Configuration for positive Y axis/face
|
|
119
|
+
* @param options.z - Configuration for positive Z axis/face
|
|
120
|
+
* @param options.nx - Configuration for negative X axis/face
|
|
121
|
+
* @param options.ny - Configuration for negative Y axis/face
|
|
122
|
+
* @param options.nz - Configuration for negative Z axis/face
|
|
123
|
+
*
|
|
124
|
+
* @remarks Axis-specific configuration can also use alias names for cube mode:
|
|
125
|
+
* - `right` (same as `x`)
|
|
126
|
+
* - `left` (same as `nx`)
|
|
127
|
+
* - `top` (same as `y`)
|
|
128
|
+
* - `bottom` (same as `ny`)
|
|
129
|
+
* - `front` (same as `z`)
|
|
130
|
+
* - `back` (same as `nz`)
|
|
131
|
+
*
|
|
132
|
+
* For each axis/face configuration, the following options are available:
|
|
133
|
+
* @param options.AXIS.enabled - Whether to draw the axis
|
|
134
|
+
* @param options.AXIS.label - Custom text label for the axis
|
|
135
|
+
* @param options.AXIS.opacity - Axis opacity
|
|
136
|
+
* @param options.AXIS.scale - Scale multiplier for indicator size
|
|
137
|
+
* @param options.AXIS.line - Whether to draw the axis line
|
|
138
|
+
* @param options.AXIS.color - Axis indicator background color
|
|
139
|
+
* @param options.AXIS.labelColor - Axis label color
|
|
140
|
+
* @param options.AXIS.border.size - Border size around the axis indicator
|
|
141
|
+
* @param options.AXIS.border.color - Border color around the axis indicator
|
|
142
|
+
* @param options.AXIS.hover.color - Fill color on hover
|
|
143
|
+
* @param options.AXIS.hover.labelColor - Label text color on hover
|
|
144
|
+
* @param options.AXIS.hover.opacity - Opacity when hovered
|
|
145
|
+
* @param options.AXIS.hover.scale - Indicator scale when hovered
|
|
146
|
+
* @param options.AXIS.hover.border.size - Hover border size
|
|
147
|
+
* @param options.AXIS.hover.border.color - Hover border color
|
|
148
|
+
*/
|
|
149
|
+
constructor(camera: any, renderer: any, options?: {});
|
|
150
|
+
/** Gets the current placement of the gizmo relative to its container. */
|
|
151
|
+
get placement(): any;
|
|
152
|
+
/**
|
|
153
|
+
* Sets and update the placement of the gizmo relative to its container.
|
|
154
|
+
*
|
|
155
|
+
* @param placement - The new placement position
|
|
156
|
+
*/
|
|
157
|
+
set placement(placement: any);
|
|
158
|
+
/**
|
|
159
|
+
* Regenerates the gizmo with the new options.
|
|
160
|
+
*
|
|
161
|
+
* @remarks
|
|
162
|
+
* - Not recommended for use in real-time rendering or animation loops
|
|
163
|
+
* - Provides a way to completely rebuild the gizmo with new options
|
|
164
|
+
* - Can be computationally expensive, so use sparingly
|
|
165
|
+
*/
|
|
166
|
+
set(options?: {}): this;
|
|
167
|
+
/**
|
|
168
|
+
* Renders the gizmo to the screen.
|
|
169
|
+
* This method handles viewport and scissor management to ensure the gizmo
|
|
170
|
+
* renders correctly without affecting the main scene rendering.
|
|
171
|
+
*
|
|
172
|
+
* @returns The gizmo instance for method chaining
|
|
173
|
+
*/
|
|
174
|
+
render(): this;
|
|
175
|
+
/**
|
|
176
|
+
* Updates the gizmo's DOM-related properties based on its current position
|
|
177
|
+
* and size in the document.
|
|
178
|
+
*
|
|
179
|
+
* @returns The gizmo instance for method chaining
|
|
180
|
+
*/
|
|
181
|
+
domUpdate(): this;
|
|
182
|
+
/**
|
|
183
|
+
* Updates the gizmo's orientation to match the current camera orientation.
|
|
184
|
+
*
|
|
185
|
+
* @returns The gizmo instance for method chaining
|
|
186
|
+
*/
|
|
187
|
+
cameraUpdate(): this;
|
|
188
|
+
/**
|
|
189
|
+
* Performs a complete update of the gizmo, including both DOM and camera-related updates.
|
|
190
|
+
*
|
|
191
|
+
* @param controls - Internal. Set to `false` if the update event comes from the attached controls.
|
|
192
|
+
*
|
|
193
|
+
* @returns The gizmo instance for method chaining
|
|
194
|
+
*/
|
|
195
|
+
update(controls?: boolean): this;
|
|
196
|
+
/**
|
|
197
|
+
* Connects OrbitControls with the gizmo, handling interaction states and updates.
|
|
198
|
+
* Automatically detaches any previously attached controls.
|
|
199
|
+
*
|
|
200
|
+
* @param controls - The scene's {@link https://threejs.org/docs/#examples/en/controls/OrbitControls OrbitControls}
|
|
201
|
+
*/
|
|
202
|
+
attachControls(controls: any): this;
|
|
203
|
+
/** Removes all control event listeners and references. Safe to call multiple times. */
|
|
204
|
+
detachControls(): this | undefined;
|
|
205
|
+
/** Cleans up all resources including geometries, materials, textures, and event listeners. */
|
|
206
|
+
dispose(): void;
|
|
207
|
+
/**
|
|
208
|
+
* Updates the gizmo's orientation either based on the camera or internal state.
|
|
209
|
+
*
|
|
210
|
+
* @private
|
|
211
|
+
* @param fromCamera - Whether to update based on camera orientation (true) or internal state (false)
|
|
212
|
+
*/
|
|
213
|
+
_updateOrientation(fromCamera?: boolean): void;
|
|
214
|
+
/**
|
|
215
|
+
* Handles the animation of camera position and orientation changes.
|
|
216
|
+
*
|
|
217
|
+
* @private
|
|
218
|
+
*/
|
|
219
|
+
_animate(): void;
|
|
220
|
+
/**
|
|
221
|
+
* Sets the camera orientation to look at the target from a specific axis.
|
|
222
|
+
*
|
|
223
|
+
* @private
|
|
224
|
+
* @param position - The axis point position
|
|
225
|
+
*/
|
|
226
|
+
setOrientation(position: any): void;
|
|
227
|
+
/**
|
|
228
|
+
* Handles the pointer down event for starting drag operations.
|
|
229
|
+
*
|
|
230
|
+
* @private
|
|
231
|
+
* @param e - The pointer event
|
|
232
|
+
*/
|
|
233
|
+
_onPointerDown(e: any): void;
|
|
234
|
+
/**
|
|
235
|
+
* Converts the input-coordinates from the standard Y-axis up to what is set in Object3D.DEFAULT_UP.
|
|
236
|
+
*
|
|
237
|
+
* @private
|
|
238
|
+
* @param target - The target Vector3 to be converted
|
|
239
|
+
* @param isSpherical - Whether or not the coordinates are for a sphere
|
|
240
|
+
* @returns The converted coordinates
|
|
241
|
+
*/
|
|
242
|
+
coordinateConversion(target: any, isSpherical?: boolean): any;
|
|
243
|
+
/**
|
|
244
|
+
* Handles pointer move events for hover effects and drag operations.
|
|
245
|
+
*
|
|
246
|
+
* @private
|
|
247
|
+
* @param e - The pointer event
|
|
248
|
+
*/
|
|
249
|
+
_onPointerMove(e: any): void;
|
|
250
|
+
/**
|
|
251
|
+
* Handles pointer leave events to reset hover states.
|
|
252
|
+
*
|
|
253
|
+
* @private
|
|
254
|
+
*/
|
|
255
|
+
_onPointerLeave(): void;
|
|
256
|
+
/**
|
|
257
|
+
* Handles click events for axis selection.
|
|
258
|
+
*
|
|
259
|
+
* @private
|
|
260
|
+
* @param e - The pointer event
|
|
261
|
+
*/
|
|
262
|
+
_handleClick(e: any): void;
|
|
263
|
+
/**
|
|
264
|
+
* Handles hover effects for interactive elements.
|
|
265
|
+
*
|
|
266
|
+
* @private
|
|
267
|
+
* @param e - The pointer event
|
|
268
|
+
*/
|
|
269
|
+
_handleHover(e: any): void;
|
|
270
|
+
}
|
|
271
|
+
export { T3DEzViewportGizmo };
|
|
@@ -29,6 +29,15 @@ export declare function getContainerElement(cube: HTMLElement | string): HTMLEle
|
|
|
29
29
|
* @param comleteCallback
|
|
30
30
|
*/
|
|
31
31
|
export declare function flyTo(engine: PotatoEngine, position?: THREE.Vector3, target?: THREE.Vector3, index?: number, ease?: string, startCallback?: () => void, comleteCallback?: () => void): void;
|
|
32
|
+
/**
|
|
33
|
+
* 相机移动动画
|
|
34
|
+
* @param position
|
|
35
|
+
* @param target
|
|
36
|
+
* @param index
|
|
37
|
+
* @param ease
|
|
38
|
+
* @param startCallback
|
|
39
|
+
* @param comleteCallback
|
|
40
|
+
*/
|
|
32
41
|
/**
|
|
33
42
|
* 聚焦到具体模型位置函数
|
|
34
43
|
* @param target
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "t3d-ez.gl",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/t3d-ez.gl.cjs.js",
|
|
6
6
|
"module": "./dist/t3d-ez.gl.esm.js",
|
|
@@ -32,5 +32,8 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"d3-geo": "^3.1.1"
|
|
35
|
+
},
|
|
36
|
+
"peerDependencies": {
|
|
37
|
+
"three": ">=0.150.0"
|
|
35
38
|
}
|
|
36
39
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var r=require("./HDRLoader.cjs.js");class e extends r.HDRLoader{constructor(r){super(r)}}exports.RGBELoader=e;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{HDRLoader as r}from"./HDRLoader.esm.js";class s extends r{constructor(r){super(r)}}export{s as RGBELoader};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";function t(t,e,n,o){const i=e.x(),s=e.y(),r=e.z(),a=e.w(),c=i+i,d=s+s,u=r+r,l=i*c,w=i*d,f=i*u,y=s*d,g=s*u,h=r*u,b=a*c,m=a*d,p=a*u;n[o+0]=1-(y+h),n[o+1]=w+p,n[o+2]=f-m,n[o+3]=0,n[o+4]=w-p,n[o+5]=1-(l+h),n[o+6]=g+b,n[o+7]=0,n[o+8]=f+m,n[o+9]=g-b,n[o+10]=1-(l+y),n[o+11]=0,n[o+12]=t.x(),n[o+13]=t.y(),n[o+14]=t.z(),n[o+15]=1}exports.AmmoPhysics=async function(){if("Ammo"in window==!1)return;const e=await Ammo(),n=new e.btDefaultCollisionConfiguration,o=new e.btCollisionDispatcher(n),i=new e.btDbvtBroadphase,s=new e.btSequentialImpulseConstraintSolver,r=new e.btDiscreteDynamicsWorld(o,i,s,n);r.setGravity(new e.btVector3(0,-9.8,0));const a=new e.btTransform,c=[],d=new WeakMap;function u(t,n=0,o=0){const i=function(t){const n=t.parameters;if("BoxGeometry"===t.type){const t=void 0!==n.width?n.width/2:.5,o=void 0!==n.height?n.height/2:.5,i=void 0!==n.depth?n.depth/2:.5,s=new e.btBoxShape(new e.btVector3(t,o,i));return s.setMargin(.05),s}if("SphereGeometry"===t.type||"IcosahedronGeometry"===t.type){const t=void 0!==n.radius?n.radius:1,o=new e.btSphereShape(t);return o.setMargin(.05),o}return null}(t.geometry);null!==i&&(t.isInstancedMesh?function(t,n,o,i){const s=t.instanceMatrix.array,a=[];for(let c=0;c<t.count;c++){const t=16*c,d=new e.btTransform;d.setFromOpenGLMatrix(s.slice(t,t+16));const u=new e.btDefaultMotionState(d),l=new e.btVector3(0,0,0);n.calculateLocalInertia(o,l);const w=new e.btRigidBodyConstructionInfo(o,u,n,l);w.set_m_restitution(i);const f=new e.btRigidBody(w);r.addRigidBody(f),a.push(f)}o>0&&(c.push(t),d.set(t,a))}(t,i,n,o):t.isMesh&&function(t,n,o,i){const s=t.position,a=t.quaternion,u=new e.btTransform;u.setIdentity(),u.setOrigin(new e.btVector3(s.x,s.y,s.z)),u.setRotation(new e.btQuaternion(a.x,a.y,a.z,a.w));const l=new e.btDefaultMotionState(u),w=new e.btVector3(0,0,0);n.calculateLocalInertia(o,w);const f=new e.btRigidBodyConstructionInfo(o,l,n,w);f.set_m_restitution(i);const y=new e.btRigidBody(f);r.addRigidBody(y),o>0&&(c.push(t),d.set(t,y))}(t,i,n,o))}let l=0;return setInterval(function(){const e=performance.now();if(l>0){const n=(e-l)/1e3;r.stepSimulation(n,10);for(let e=0,n=c.length;e<n;e++){const n=c[e];if(n.isInstancedMesh){const e=n.instanceMatrix.array,o=d.get(n);for(let n=0;n<o.length;n++){o[n].getMotionState().getWorldTransform(a);t(a.getOrigin(),a.getRotation(),e,16*n)}n.instanceMatrix.needsUpdate=!0,n.computeBoundingSphere()}else if(n.isMesh){d.get(n).getMotionState().getWorldTransform(a);const t=a.getOrigin(),e=a.getRotation();n.position.set(t.x(),t.y(),t.z()),n.quaternion.set(e.x(),e.y(),e.z(),e.w())}}}l=e},1e3/60),{addScene:function(t){t.traverse(function(t){if(t.isMesh){const e=t.userData.physics;e&&u(t,e.mass,e.restitution)}})},addMesh:u,setMeshPosition:function(t,n,o=0){if(t.isInstancedMesh){const i=d.get(t)[o];i.setAngularVelocity(new e.btVector3(0,0,0)),i.setLinearVelocity(new e.btVector3(0,0,0)),a.setIdentity(),a.setOrigin(new e.btVector3(n.x,n.y,n.z)),i.setWorldTransform(a)}else if(t.isMesh){const o=d.get(t);o.setAngularVelocity(new e.btVector3(0,0,0)),o.setLinearVelocity(new e.btVector3(0,0,0)),a.setIdentity(),a.setOrigin(new e.btVector3(n.x,n.y,n.z)),o.setWorldTransform(a)}}}};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
async function t(){if("Ammo"in window==!1)return;const t=await Ammo(),n=new t.btDefaultCollisionConfiguration,o=new t.btCollisionDispatcher(n),i=new t.btDbvtBroadphase,s=new t.btSequentialImpulseConstraintSolver,r=new t.btDiscreteDynamicsWorld(o,i,s,n);r.setGravity(new t.btVector3(0,-9.8,0));const a=new t.btTransform;const c=[],d=new WeakMap;function u(e,n=0,o=0){const i=function(e){const n=e.parameters;if("BoxGeometry"===e.type){const e=void 0!==n.width?n.width/2:.5,o=void 0!==n.height?n.height/2:.5,i=void 0!==n.depth?n.depth/2:.5,s=new t.btBoxShape(new t.btVector3(e,o,i));return s.setMargin(.05),s}if("SphereGeometry"===e.type||"IcosahedronGeometry"===e.type){const e=void 0!==n.radius?n.radius:1,o=new t.btSphereShape(e);return o.setMargin(.05),o}return null}(e.geometry);null!==i&&(e.isInstancedMesh?function(e,n,o,i){const s=e.instanceMatrix.array,a=[];for(let c=0;c<e.count;c++){const e=16*c,d=new t.btTransform;d.setFromOpenGLMatrix(s.slice(e,e+16));const u=new t.btDefaultMotionState(d),l=new t.btVector3(0,0,0);n.calculateLocalInertia(o,l);const w=new t.btRigidBodyConstructionInfo(o,u,n,l);w.set_m_restitution(i);const f=new t.btRigidBody(w);r.addRigidBody(f),a.push(f)}o>0&&(c.push(e),d.set(e,a))}(e,i,n,o):e.isMesh&&function(e,n,o,i){const s=e.position,a=e.quaternion,u=new t.btTransform;u.setIdentity(),u.setOrigin(new t.btVector3(s.x,s.y,s.z)),u.setRotation(new t.btQuaternion(a.x,a.y,a.z,a.w));const l=new t.btDefaultMotionState(u),w=new t.btVector3(0,0,0);n.calculateLocalInertia(o,w);const f=new t.btRigidBodyConstructionInfo(o,l,n,w);f.set_m_restitution(i);const g=new t.btRigidBody(f);r.addRigidBody(g),o>0&&(c.push(e),d.set(e,g))}(e,i,n,o))}let l=0;return setInterval(function(){const t=performance.now();if(l>0){const n=(t-l)/1e3;r.stepSimulation(n,10);for(let t=0,n=c.length;t<n;t++){const n=c[t];if(n.isInstancedMesh){const t=n.instanceMatrix.array,o=d.get(n);for(let n=0;n<o.length;n++){o[n].getMotionState().getWorldTransform(a);e(a.getOrigin(),a.getRotation(),t,16*n)}n.instanceMatrix.needsUpdate=!0,n.computeBoundingSphere()}else if(n.isMesh){d.get(n).getMotionState().getWorldTransform(a);const t=a.getOrigin(),e=a.getRotation();n.position.set(t.x(),t.y(),t.z()),n.quaternion.set(e.x(),e.y(),e.z(),e.w())}}}l=t},1e3/60),{addScene:function(t){t.traverse(function(t){if(t.isMesh){const e=t.userData.physics;e&&u(t,e.mass,e.restitution)}})},addMesh:u,setMeshPosition:function(e,n,o=0){if(e.isInstancedMesh){const i=d.get(e)[o];i.setAngularVelocity(new t.btVector3(0,0,0)),i.setLinearVelocity(new t.btVector3(0,0,0)),a.setIdentity(),a.setOrigin(new t.btVector3(n.x,n.y,n.z)),i.setWorldTransform(a)}else if(e.isMesh){const o=d.get(e);o.setAngularVelocity(new t.btVector3(0,0,0)),o.setLinearVelocity(new t.btVector3(0,0,0)),a.setIdentity(),a.setOrigin(new t.btVector3(n.x,n.y,n.z)),o.setWorldTransform(a)}}}}function e(t,e,n,o){const i=e.x(),s=e.y(),r=e.z(),a=e.w(),c=i+i,d=s+s,u=r+r,l=i*c,w=i*d,f=i*u,g=s*d,y=s*u,h=r*u,b=a*c,p=a*d,m=a*u;n[o+0]=1-(g+h),n[o+1]=w+m,n[o+2]=f-p,n[o+3]=0,n[o+4]=w-m,n[o+5]=1-(l+h),n[o+6]=y+b,n[o+7]=0,n[o+8]=f+p,n[o+9]=y-b,n[o+10]=1-(l+g),n[o+11]=0,n[o+12]=t.x(),n[o+13]=t.y(),n[o+14]=t.z(),n[o+15]=1}export{t as AmmoPhysics};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "three/examples/jsm/physics/AmmoPhysics.js";
|
|
File without changes
|
|
File without changes
|
|
File without changes
|