@jdultra/threedtiles 14.0.18 → 14.0.20
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/simulation/ColliderShape.d.ts +112 -0
- package/dist/simulation/physics.d.ts +157 -0
- package/dist/simulation/physicsRapier.worker.d.ts +1 -0
- package/dist/threedtiles.cjs.js +54 -56
- package/dist/threedtiles.cjs.js.map +1 -1
- package/dist/threedtiles.es.js +4222 -4108
- package/dist/threedtiles.es.js.map +1 -1
- package/dist/threedtiles.umd.js +54 -56
- package/dist/threedtiles.umd.js.map +1 -1
- package/dist/tileset/OGC3DTile.d.ts +23 -0
- package/package.json +5 -2
- package/dist/geometry/obb copy.d.ts +0 -16
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
export function createBall(radius: any): {
|
|
2
|
+
kind: string;
|
|
3
|
+
params: {
|
|
4
|
+
radius: number;
|
|
5
|
+
};
|
|
6
|
+
};
|
|
7
|
+
export function createCuboid(hx: any, hy: any, hz: any): {
|
|
8
|
+
kind: string;
|
|
9
|
+
params: {
|
|
10
|
+
hx: number;
|
|
11
|
+
hy: number;
|
|
12
|
+
hz: number;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export function createBox(hx: any, hy: any, hz: any): {
|
|
16
|
+
kind: string;
|
|
17
|
+
params: {
|
|
18
|
+
hx: number;
|
|
19
|
+
hy: number;
|
|
20
|
+
hz: number;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export function createRoundCuboid(hx: any, hy: any, hz: any, radius: any): {
|
|
24
|
+
kind: string;
|
|
25
|
+
params: {
|
|
26
|
+
hx: number;
|
|
27
|
+
hy: number;
|
|
28
|
+
hz: number;
|
|
29
|
+
radius: number;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
export function createCapsule(halfHeight: any, radius: any): {
|
|
33
|
+
kind: string;
|
|
34
|
+
params: {
|
|
35
|
+
halfHeight: number;
|
|
36
|
+
radius: number;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
export function createCone(halfHeight: any, radius: any): {
|
|
40
|
+
kind: string;
|
|
41
|
+
params: {
|
|
42
|
+
halfHeight: number;
|
|
43
|
+
radius: number;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
export function createCylinder(halfHeight: any, radius: any): {
|
|
47
|
+
kind: string;
|
|
48
|
+
params: {
|
|
49
|
+
halfHeight: number;
|
|
50
|
+
radius: number;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
export function createSegment(a: any, b: any): {
|
|
54
|
+
kind: string;
|
|
55
|
+
params: {
|
|
56
|
+
a: any;
|
|
57
|
+
b: any;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
export function createTriangle(a: any, b: any, c: any): {
|
|
61
|
+
kind: string;
|
|
62
|
+
params: {
|
|
63
|
+
a: any;
|
|
64
|
+
b: any;
|
|
65
|
+
c: any;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
export function createPolyline(vertices: any, indices: any): {
|
|
69
|
+
kind: string;
|
|
70
|
+
params: {
|
|
71
|
+
vertices: any;
|
|
72
|
+
indices: any;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
export function createConvexHull(vertices: any): {
|
|
76
|
+
kind: string;
|
|
77
|
+
params: {
|
|
78
|
+
vertices: any;
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
export function createHeightfield(rows: any, cols: any, heights: any, scale?: {
|
|
82
|
+
x: number;
|
|
83
|
+
y: number;
|
|
84
|
+
z: number;
|
|
85
|
+
}): {
|
|
86
|
+
kind: string;
|
|
87
|
+
params: {
|
|
88
|
+
rows: number;
|
|
89
|
+
cols: number;
|
|
90
|
+
heights: any;
|
|
91
|
+
scale: {
|
|
92
|
+
x: number;
|
|
93
|
+
y: number;
|
|
94
|
+
z: number;
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
export default ColliderShape;
|
|
99
|
+
declare namespace ColliderShape {
|
|
100
|
+
export { createBall };
|
|
101
|
+
export { createCuboid };
|
|
102
|
+
export { createBox };
|
|
103
|
+
export { createRoundCuboid };
|
|
104
|
+
export { createCapsule };
|
|
105
|
+
export { createCone };
|
|
106
|
+
export { createCylinder };
|
|
107
|
+
export { createSegment };
|
|
108
|
+
export { createTriangle };
|
|
109
|
+
export { createPolyline };
|
|
110
|
+
export { createConvexHull };
|
|
111
|
+
export { createHeightfield };
|
|
112
|
+
}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
export class Physics {
|
|
2
|
+
/**
|
|
3
|
+
* constructor(options)
|
|
4
|
+
* - updateIntervalMs: number (default 16). setTimeout tick period on the main thread
|
|
5
|
+
* - fixedDt: number seconds per physics step (default: updateIntervalMs/1000)
|
|
6
|
+
* - gravity: [x,y,z] OR { mode:'vector', vector:[x,y,z] } OR { mode:'geocentric', planetCenter:[x,y,z], intensity:number }
|
|
7
|
+
* - autoStart: boolean (default true)
|
|
8
|
+
*/
|
|
9
|
+
constructor(options?: {});
|
|
10
|
+
updateIntervalMs: any;
|
|
11
|
+
fixedDt: any;
|
|
12
|
+
gravity: {
|
|
13
|
+
mode: string;
|
|
14
|
+
vector: any[];
|
|
15
|
+
planetCenter?: undefined;
|
|
16
|
+
intensity?: undefined;
|
|
17
|
+
} | {
|
|
18
|
+
mode: string;
|
|
19
|
+
planetCenter: any[];
|
|
20
|
+
intensity: any;
|
|
21
|
+
vector?: undefined;
|
|
22
|
+
};
|
|
23
|
+
autoStart: boolean;
|
|
24
|
+
sharedMemorySupported: boolean;
|
|
25
|
+
worker: Worker;
|
|
26
|
+
_msgId: number;
|
|
27
|
+
_pending: Map<any, any>;
|
|
28
|
+
_onWorkerMessage(ev: any): void;
|
|
29
|
+
_paused: boolean;
|
|
30
|
+
_lastTickTime: number;
|
|
31
|
+
_lastState: any;
|
|
32
|
+
_currentState: any;
|
|
33
|
+
_interpolationMax: number;
|
|
34
|
+
_nextBodyId: number;
|
|
35
|
+
_nextColliderId: number;
|
|
36
|
+
rigidBodies: Map<any, any>;
|
|
37
|
+
bodyToColliders: Map<any, any>;
|
|
38
|
+
colliderToBody: Map<any, any>;
|
|
39
|
+
_listeners: Map<any, any>;
|
|
40
|
+
_initPromise: Promise<any>;
|
|
41
|
+
/**
|
|
42
|
+
* addObject({ object, type, mass, position, rotation, velocity, angularVelocity })
|
|
43
|
+
* - object: THREE.Object3D (e.g., OGC3DTile or any Object3D)
|
|
44
|
+
* - type: 'dynamic' | 'kinematic' | 'fixed' (default 'dynamic')
|
|
45
|
+
* - mass: number (default 1)
|
|
46
|
+
* - position: array|Vector3
|
|
47
|
+
* - rotation: Euler|Quaternion|[x,y,z,w]
|
|
48
|
+
* - velocity: array|Vector3 (optional)
|
|
49
|
+
* - angularVelocity: array|Vector3 (optional)
|
|
50
|
+
*/
|
|
51
|
+
addObject(options?: {}): string;
|
|
52
|
+
/**
|
|
53
|
+
* attachTrimeshCollider({ bodyId, geometry?, positions?, indices?, localPosition?, localRotation?, localScale? }) => Promise<string colliderId>
|
|
54
|
+
* Creates a TRIMESH collider with baked non-uniform scale and attaches it to the body.
|
|
55
|
+
* Positions/indices are always duplicated on the main thread and their ArrayBuffers are transferred.
|
|
56
|
+
*/
|
|
57
|
+
attachTrimeshCollider({ bodyId, geometry, positions, indices, localPosition, localRotation, localScale }: {
|
|
58
|
+
bodyId: any;
|
|
59
|
+
geometry: any;
|
|
60
|
+
positions: any;
|
|
61
|
+
indices: any;
|
|
62
|
+
localPosition: any;
|
|
63
|
+
localRotation: any;
|
|
64
|
+
localScale: any;
|
|
65
|
+
}): Promise<null> | Promise<string>;
|
|
66
|
+
/**
|
|
67
|
+
* attachShapeCollider({ bodyId, shape, localPosition?, localRotation? }) => Promise<string colliderId>
|
|
68
|
+
* Creates a primitive/analytic collider (via engine-agnostic shape descriptor) and attaches it to the body.
|
|
69
|
+
* Note: Any scale must be baked into the shape's parameters; no scale is applied at runtime.
|
|
70
|
+
*/
|
|
71
|
+
attachShapeCollider({ bodyId, shape, localPosition, localRotation }: {
|
|
72
|
+
bodyId: any;
|
|
73
|
+
shape: any;
|
|
74
|
+
localPosition: any;
|
|
75
|
+
localRotation: any;
|
|
76
|
+
}): string | Promise<null>;
|
|
77
|
+
/**
|
|
78
|
+
* detachCollider({ colliderId })
|
|
79
|
+
*/
|
|
80
|
+
detachCollider({ colliderId }: {
|
|
81
|
+
colliderId: any;
|
|
82
|
+
}): void;
|
|
83
|
+
/**
|
|
84
|
+
* removeObject({ bodyId })
|
|
85
|
+
*/
|
|
86
|
+
removeObject({ bodyId }: {
|
|
87
|
+
bodyId: any;
|
|
88
|
+
}): void;
|
|
89
|
+
/**
|
|
90
|
+
* applyForce({ bodyId, force, worldPoint?, wake = true, impulse = false })
|
|
91
|
+
*/
|
|
92
|
+
applyForce({ bodyId, force, worldPoint, wake, impulse }: {
|
|
93
|
+
bodyId: any;
|
|
94
|
+
force: any;
|
|
95
|
+
worldPoint: any;
|
|
96
|
+
wake?: boolean | undefined;
|
|
97
|
+
impulse?: boolean | undefined;
|
|
98
|
+
}): void;
|
|
99
|
+
/**
|
|
100
|
+
* setGravity(gravityOptions)
|
|
101
|
+
*/
|
|
102
|
+
setGravity(gravityOptions: any): void;
|
|
103
|
+
/**
|
|
104
|
+
* setPose({ bodyId, position?, rotation?, wake = true })
|
|
105
|
+
* Teleport a rigid body to a new pose immediately.
|
|
106
|
+
* - position: [x,y,z] or THREE.Vector3 (optional)
|
|
107
|
+
* - rotation: [x,y,z,w] or THREE.Quaternion/Euler (optional)
|
|
108
|
+
* - wake: boolean (default true)
|
|
109
|
+
*/
|
|
110
|
+
setPose({ bodyId, position, rotation, wake }: {
|
|
111
|
+
bodyId: any;
|
|
112
|
+
position: any;
|
|
113
|
+
rotation: any;
|
|
114
|
+
wake?: boolean | undefined;
|
|
115
|
+
}): void;
|
|
116
|
+
/**
|
|
117
|
+
* raycast({ origin, direction, maxToi = 1e6, filter? }) => Promise<hits[]>
|
|
118
|
+
*/
|
|
119
|
+
raycast({ origin, direction, maxToi, filter }: {
|
|
120
|
+
origin: any;
|
|
121
|
+
direction: any;
|
|
122
|
+
maxToi?: number | undefined;
|
|
123
|
+
filter: any;
|
|
124
|
+
}): Promise<any>;
|
|
125
|
+
/**
|
|
126
|
+
* pause / resume
|
|
127
|
+
*/
|
|
128
|
+
pause(): void;
|
|
129
|
+
resume(): void;
|
|
130
|
+
/**
|
|
131
|
+
* setUpdateInterval(ms: number)
|
|
132
|
+
*/
|
|
133
|
+
setUpdateInterval(ms: any): void;
|
|
134
|
+
/**
|
|
135
|
+
* stepOnce(dtSeconds?: number)
|
|
136
|
+
* Requests a single physics integration step on worker.
|
|
137
|
+
*/
|
|
138
|
+
stepOnce(dtSeconds: any): Promise<any>;
|
|
139
|
+
/**
|
|
140
|
+
* update()
|
|
141
|
+
* Interpolates between the last two physics snapshots and applies transforms to linked THREE.Object3D.
|
|
142
|
+
* This is automatically called on a setTimeout loop by the constructor, but can also be called manually.
|
|
143
|
+
*/
|
|
144
|
+
update(): void;
|
|
145
|
+
/**
|
|
146
|
+
* dispose()
|
|
147
|
+
* Terminates the worker and clears all registries.
|
|
148
|
+
*/
|
|
149
|
+
dispose(): void;
|
|
150
|
+
_scheduleNextTick(): void;
|
|
151
|
+
_onTick(): void;
|
|
152
|
+
_post(msg: any, transfer?: any[]): Promise<any>;
|
|
153
|
+
on(type: any, fn: any): () => void;
|
|
154
|
+
off(type: any, fn: any): void;
|
|
155
|
+
_emit(type: any, payload: any): void;
|
|
156
|
+
}
|
|
157
|
+
export default Physics;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|