@hology/core 0.0.20
Sign up to get free protection for your applications and to get access to all the features.
- package/LICENSE.md +15 -0
- package/README.md +3 -0
- package/dist/config/project-config.d.ts +10 -0
- package/dist/config/project-config.js +5 -0
- package/dist/controllers/base-game-controller.d.ts +3 -0
- package/dist/controllers/base-game-controller.js +5 -0
- package/dist/csm.d.ts +7 -0
- package/dist/csm.js +5 -0
- package/dist/effects/particles/examples.d.ts +271 -0
- package/dist/effects/particles/examples.js +5 -0
- package/dist/effects/particles/particle-system-config.d.ts +85 -0
- package/dist/effects/particles/particle-system-config.js +5 -0
- package/dist/game-component/component-decorators.d.ts +5 -0
- package/dist/game-component/component-decorators.js +5 -0
- package/dist/game-component/game-component.d.ts +8 -0
- package/dist/game-component/game-component.js +5 -0
- package/dist/gameplay/actors/actor.d.ts +37 -0
- package/dist/gameplay/actors/actor.js +5 -0
- package/dist/gameplay/actors/builtin/camera-actor.d.ts +11 -0
- package/dist/gameplay/actors/builtin/camera-actor.js +5 -0
- package/dist/gameplay/actors/builtin/components/character/character-animation.d.ts +67 -0
- package/dist/gameplay/actors/builtin/components/character/character-animation.js +5 -0
- package/dist/gameplay/actors/builtin/components/character/character-movement copy.d.ts +37 -0
- package/dist/gameplay/actors/builtin/components/character/character-movement copy.js +5 -0
- package/dist/gameplay/actors/builtin/components/character/character-movement.d.ts +51 -0
- package/dist/gameplay/actors/builtin/components/character/character-movement.js +5 -0
- package/dist/gameplay/actors/builtin/components/character/modes.d.ts +18 -0
- package/dist/gameplay/actors/builtin/components/character/modes.js +5 -0
- package/dist/gameplay/actors/builtin/components/mesh-component.d.ts +20 -0
- package/dist/gameplay/actors/builtin/components/mesh-component.js +5 -0
- package/dist/gameplay/actors/builtin/components/scene-component.d.ts +7 -0
- package/dist/gameplay/actors/builtin/components/scene-component.js +5 -0
- package/dist/gameplay/actors/builtin/index.d.ts +11 -0
- package/dist/gameplay/actors/builtin/index.js +5 -0
- package/dist/gameplay/actors/builtin/positional-audio-actor.d.ts +19 -0
- package/dist/gameplay/actors/builtin/positional-audio-actor.js +5 -0
- package/dist/gameplay/actors/builtin/spawn-point.d.ts +11 -0
- package/dist/gameplay/actors/builtin/spawn-point.js +5 -0
- package/dist/gameplay/actors/builtin/trigger-volume.d.ts +23 -0
- package/dist/gameplay/actors/builtin/trigger-volume.js +5 -0
- package/dist/gameplay/actors/camera/camera-component.d.ts +13 -0
- package/dist/gameplay/actors/camera/camera-component.js +5 -0
- package/dist/gameplay/actors/camera/third-party-camera-component.d.ts +43 -0
- package/dist/gameplay/actors/camera/third-party-camera-component.js +5 -0
- package/dist/gameplay/actors/component.d.ts +41 -0
- package/dist/gameplay/actors/component.js +5 -0
- package/dist/gameplay/actors/factory.d.ts +12 -0
- package/dist/gameplay/actors/factory.js +5 -0
- package/dist/gameplay/actors/index.d.ts +10 -0
- package/dist/gameplay/actors/index.js +5 -0
- package/dist/gameplay/actors/internal/component-init.d.ts +3 -0
- package/dist/gameplay/actors/internal/component-init.js +5 -0
- package/dist/gameplay/actors/internal/container-map.d.ts +6 -0
- package/dist/gameplay/actors/internal/container-map.js +5 -0
- package/dist/gameplay/animation/anim-sm.d.ts +38 -0
- package/dist/gameplay/animation/anim-sm.js +5 -0
- package/dist/gameplay/animation/root-motion.d.ts +31 -0
- package/dist/gameplay/animation/root-motion.js +5 -0
- package/dist/gameplay/env.d.ts +3 -0
- package/dist/gameplay/env.js +5 -0
- package/dist/gameplay/index.d.ts +14 -0
- package/dist/gameplay/index.js +5 -0
- package/dist/gameplay/initiate.d.ts +51 -0
- package/dist/gameplay/initiate.js +5 -0
- package/dist/gameplay/inject.d.ts +3 -0
- package/dist/gameplay/inject.js +5 -0
- package/dist/gameplay/input/index.d.ts +3 -0
- package/dist/gameplay/input/index.js +5 -0
- package/dist/gameplay/input/input-service.d.ts +33 -0
- package/dist/gameplay/input/input-service.js +5 -0
- package/dist/gameplay/input/input.d.ts +41 -0
- package/dist/gameplay/input/input.js +5 -0
- package/dist/gameplay/input/keybind.d.ts +23 -0
- package/dist/gameplay/input/keybind.js +5 -0
- package/dist/gameplay/services/asset-loader.d.ts +34 -0
- package/dist/gameplay/services/asset-loader.js +5 -0
- package/dist/gameplay/services/physics/collision-contact.d.ts +2 -0
- package/dist/gameplay/services/physics/collision-contact.js +5 -0
- package/dist/gameplay/services/physics/physics-system.d.ts +145 -0
- package/dist/gameplay/services/physics/physics-system.js +5 -0
- package/dist/gameplay/services/render.d.ts +19 -0
- package/dist/gameplay/services/render.js +5 -0
- package/dist/gameplay/services/world.d.ts +15 -0
- package/dist/gameplay/services/world.js +5 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +5 -0
- package/dist/rendering/shader-override.d.ts +2 -0
- package/dist/rendering/shader-override.js +5 -0
- package/dist/rendering.d.ts +53 -0
- package/dist/rendering.js +5 -0
- package/dist/scene/asset-resource-loader.d.ts +32 -0
- package/dist/scene/asset-resource-loader.js +5 -0
- package/dist/scene/assets-provider.d.ts +9 -0
- package/dist/scene/assets-provider.js +5 -0
- package/dist/scene/bootstrap.d.ts +21 -0
- package/dist/scene/bootstrap.js +5 -0
- package/dist/scene/collision/collision-shape-import.d.ts +4 -0
- package/dist/scene/collision/collision-shape-import.js +5 -0
- package/dist/scene/collision/collision-shape.d.ts +59 -0
- package/dist/scene/collision/collision-shape.js +5 -0
- package/dist/scene/landscape/landscape-manager.d.ts +43 -0
- package/dist/scene/landscape/landscape-manager.js +5 -0
- package/dist/scene/landscape/landscape.d.ts +20 -0
- package/dist/scene/landscape/landscape.js +5 -0
- package/dist/scene/landscape/utils.d.ts +9 -0
- package/dist/scene/landscape/utils.js +5 -0
- package/dist/scene/materializer.d.ts +245 -0
- package/dist/scene/materializer.js +5 -0
- package/dist/scene/materials/grass-foliage.d.ts +8 -0
- package/dist/scene/materials/grass-foliage.js +5 -0
- package/dist/scene/materials/grass.d.ts +4 -0
- package/dist/scene/materials/grass.js +5 -0
- package/dist/scene/materials/utils/material-painting.d.ts +2 -0
- package/dist/scene/materials/utils/material-painting.js +5 -0
- package/dist/scene/materials/utils/noise.glsl.d.ts +1 -0
- package/dist/scene/materials/utils/noise.glsl.js +5 -0
- package/dist/scene/materials/water.d.ts +3 -0
- package/dist/scene/materials/water.js +5 -0
- package/dist/scene/model.d.ts +96 -0
- package/dist/scene/model.js +5 -0
- package/dist/scene/objects/ramp-geometry.d.ts +2 -0
- package/dist/scene/objects/ramp-geometry.js +5 -0
- package/dist/scene/objects/shapes.d.ts +121 -0
- package/dist/scene/objects/shapes.js +5 -0
- package/dist/scene/runtime-asset-service.d.ts +14 -0
- package/dist/scene/runtime-asset-service.js +5 -0
- package/dist/scene/runtime-backend-service.d.ts +12 -0
- package/dist/scene/runtime-backend-service.js +5 -0
- package/dist/scene/scene-data-service.d.ts +33 -0
- package/dist/scene/scene-data-service.js +5 -0
- package/dist/scene/sky.d.ts +3 -0
- package/dist/scene/sky.js +5 -0
- package/dist/scene/storage/storage.d.ts +39 -0
- package/dist/scene/storage/storage.js +5 -0
- package/dist/shader/builtin/index.d.ts +2 -0
- package/dist/shader/builtin/index.js +5 -0
- package/dist/shader/builtin/lambert-shader.d.ts +19 -0
- package/dist/shader/builtin/lambert-shader.js +5 -0
- package/dist/shader/builtin/standard-shader.d.ts +29 -0
- package/dist/shader/builtin/standard-shader.js +5 -0
- package/dist/shader/index.d.ts +2 -0
- package/dist/shader/index.js +5 -0
- package/dist/shader/parameter.d.ts +23 -0
- package/dist/shader/parameter.js +5 -0
- package/dist/shader/shader.d.ts +25 -0
- package/dist/shader/shader.js +5 -0
- package/dist/shader-nodes/depth.d.ts +10 -0
- package/dist/shader-nodes/depth.js +5 -0
- package/dist/shader-nodes/index.d.ts +5 -0
- package/dist/shader-nodes/index.js +5 -0
- package/dist/shader-nodes/landscape.d.ts +5 -0
- package/dist/shader-nodes/landscape.js +5 -0
- package/dist/shader-nodes/layers.d.ts +14 -0
- package/dist/shader-nodes/layers.js +5 -0
- package/dist/shader-nodes/time.d.ts +4 -0
- package/dist/shader-nodes/time.js +5 -0
- package/dist/test/injection.test.d.ts +1 -0
- package/dist/test/injection.test.js +5 -0
- package/dist/utils/async.d.ts +5 -0
- package/dist/utils/async.js +5 -0
- package/dist/utils/cannon/CannonUtils.d.ts +17 -0
- package/dist/utils/cannon/CannonUtils.js +5 -0
- package/dist/utils/cannon/three-to-cannon/ConvexHull.d.ts +47 -0
- package/dist/utils/cannon/three-to-cannon/ConvexHull.js +5 -0
- package/dist/utils/cannon/three-to-cannon/index.d.ts +63 -0
- package/dist/utils/cannon/three-to-cannon/index.js +5 -0
- package/dist/utils/cannon/three-to-cannon/utils.d.ts +9 -0
- package/dist/utils/cannon/three-to-cannon/utils.js +5 -0
- package/dist/utils/collections.d.ts +26 -0
- package/dist/utils/collections.js +5 -0
- package/dist/utils/files.d.ts +1 -0
- package/dist/utils/files.js +5 -0
- package/dist/utils/math.d.ts +24 -0
- package/dist/utils/math.js +5 -0
- package/dist/utils/mesh.d.ts +6 -0
- package/dist/utils/mesh.js +5 -0
- package/dist/utils/polyfill.d.ts +1 -0
- package/dist/utils/polyfill.js +5 -0
- package/dist/utils/three/depth-pass.d.ts +13 -0
- package/dist/utils/three/depth-pass.js +5 -0
- package/dist/utils/three/line-sphere.d.ts +2 -0
- package/dist/utils/three/line-sphere.js +5 -0
- package/dist/utils/three/outline-pass.d.ts +61 -0
- package/dist/utils/three/outline-pass.js +5 -0
- package/dist/utils/three/positional-audio-helper.d.ts +11 -0
- package/dist/utils/three/positional-audio-helper.js +5 -0
- package/dist/utils/three/stats.d.ts +12 -0
- package/dist/utils/three/stats.js +5 -0
- package/dist/utils/three/transform-controls.d.ts +73 -0
- package/dist/utils/three/transform-controls.js +5 -0
- package/dist/utils/three/traverse.d.ts +13 -0
- package/dist/utils/three/traverse.js +5 -0
- package/dist/utils/type.d.ts +4 -0
- package/dist/utils/type.js +5 -0
- package/dist/utils/uuid.d.ts +1 -0
- package/dist/utils/uuid.js +5 -0
- package/package.json +114 -0
- package/tsconfig.tsbuildinfo +1 -0
package/LICENSE.md
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
# Hology Engine Limited License
|
2
|
+
|
3
|
+
This software package, including all associated files and documentation (the "Software"), is licensed to you (the "Licensee") by Hology Engine for use exclusively with the product "Hology Engine."
|
4
|
+
|
5
|
+
By using, copying, modifying, or distributing the Software, Licensee agrees to be bound by the terms of this license.
|
6
|
+
|
7
|
+
1. License Grant: Hology Engine grants Licensee a limited, non-exclusive, non-transferable license to use the Software solely for the purpose of developing and running software developed with "Hology Engine."
|
8
|
+
|
9
|
+
2. Restrictions: Licensee may not use, copy, modify, or distribute the Software for any other purpose, including but not limited to the creation of derivative works, standalone applications, or any products not directly associated with "Hology Engine."
|
10
|
+
|
11
|
+
3. Ownership: Hology Engine retains all intellectual property rights to the Software. This license does not transfer ownership of the Software to Licensee.
|
12
|
+
|
13
|
+
4. Warranty Disclaimer: THE SOFTWARE IS PROVIDED "AS IS," WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL THE CREATOR OF THIS PACKAGE BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION WITH THE SOFTWARE.
|
14
|
+
|
15
|
+
6. Contact: For any inquiries regarding this license, please email hello@hology.app
|
package/README.md
ADDED
package/dist/csm.d.ts
ADDED
package/dist/csm.js
ADDED
@@ -0,0 +1,5 @@
|
|
1
|
+
import*as e from"three";const a=e.Object3D.prototype.add,n=new WeakMap,t=new WeakMap;export const CSMUtil={renderingView:null,onBeforeCompile(e,a){e.defines=e.defines||{},e.defines.USE_CSM=1,e.defines.CSM_CASCADES=this.renderingView.csm.cascades;const n=Math.min(this.renderingView.camera.far,this.renderingView.csm.maxFar),t=[];this.renderingView.csm.getExtendedBreaks(t),a.uniforms.CSM_cascades={value:t},a.uniforms.cameraNear={value:this.renderingView.camera.near},a.uniforms.shadowFar={value:n}},patchThreeAdd(){const r=this.renderingView;n.set(r.scene,r.csm),e.Object3D.prototype.add=function(...r){let i=this;for(;null!=i.parent;)i=i.parent;const s=i,d=n.get(s);if(null==d)return a.apply(this,arguments),this;t.has(s)||t.set(s,new WeakSet);const o=t.get(s);return r.forEach((a=>null==a?void 0:a.traverse((a=>{(a instanceof e.Mesh||a instanceof e.SkinnedMesh)&&a.material&&!o.has(a.material)&&(o.add(a.material),null==d||d.setupMaterial(a.material))})))),a.apply(this,arguments),this}}};
|
2
|
+
/*
|
3
|
+
* Copyright (©) 2023. All rights reserved.
|
4
|
+
* See the LICENSE.md file for details.
|
5
|
+
*/
|
@@ -0,0 +1,271 @@
|
|
1
|
+
export declare const testParticleSystem: {
|
2
|
+
preParticles: number;
|
3
|
+
integrationType: string;
|
4
|
+
emitters: {
|
5
|
+
id: string;
|
6
|
+
totalEmitTimes: any;
|
7
|
+
life: any;
|
8
|
+
cache: {
|
9
|
+
totalEmitTimes: any;
|
10
|
+
life: any;
|
11
|
+
};
|
12
|
+
rate: {
|
13
|
+
particlesMin: number;
|
14
|
+
particlesMax: number;
|
15
|
+
perSecondMin: number;
|
16
|
+
perSecondMax: number;
|
17
|
+
};
|
18
|
+
position: {
|
19
|
+
x: number;
|
20
|
+
y: number;
|
21
|
+
z: number;
|
22
|
+
};
|
23
|
+
rotation: {
|
24
|
+
x: number;
|
25
|
+
y: number;
|
26
|
+
z: number;
|
27
|
+
};
|
28
|
+
initializers: ({
|
29
|
+
id: string;
|
30
|
+
type: string;
|
31
|
+
properties: {
|
32
|
+
min: number;
|
33
|
+
max: number;
|
34
|
+
isEnabled: boolean;
|
35
|
+
texture?: undefined;
|
36
|
+
width?: undefined;
|
37
|
+
height?: undefined;
|
38
|
+
radius?: undefined;
|
39
|
+
x?: undefined;
|
40
|
+
y?: undefined;
|
41
|
+
z?: undefined;
|
42
|
+
theta?: undefined;
|
43
|
+
};
|
44
|
+
} | {
|
45
|
+
id: string;
|
46
|
+
type: string;
|
47
|
+
properties: {
|
48
|
+
texture: string;
|
49
|
+
isEnabled: boolean;
|
50
|
+
min?: undefined;
|
51
|
+
max?: undefined;
|
52
|
+
width?: undefined;
|
53
|
+
height?: undefined;
|
54
|
+
radius?: undefined;
|
55
|
+
x?: undefined;
|
56
|
+
y?: undefined;
|
57
|
+
z?: undefined;
|
58
|
+
theta?: undefined;
|
59
|
+
};
|
60
|
+
} | {
|
61
|
+
id: string;
|
62
|
+
type: string;
|
63
|
+
properties: {
|
64
|
+
width: number;
|
65
|
+
height: number;
|
66
|
+
isEnabled: boolean;
|
67
|
+
min?: undefined;
|
68
|
+
max?: undefined;
|
69
|
+
texture?: undefined;
|
70
|
+
radius?: undefined;
|
71
|
+
x?: undefined;
|
72
|
+
y?: undefined;
|
73
|
+
z?: undefined;
|
74
|
+
theta?: undefined;
|
75
|
+
};
|
76
|
+
} | {
|
77
|
+
id: string;
|
78
|
+
type: string;
|
79
|
+
properties: {
|
80
|
+
radius: number;
|
81
|
+
x: number;
|
82
|
+
y: number;
|
83
|
+
z: number;
|
84
|
+
theta: number;
|
85
|
+
isEnabled: boolean;
|
86
|
+
min?: undefined;
|
87
|
+
max?: undefined;
|
88
|
+
texture?: undefined;
|
89
|
+
width?: undefined;
|
90
|
+
height?: undefined;
|
91
|
+
};
|
92
|
+
})[];
|
93
|
+
behaviours: ({
|
94
|
+
id: string;
|
95
|
+
type: string;
|
96
|
+
properties: {
|
97
|
+
alphaA: number;
|
98
|
+
alphaB: number;
|
99
|
+
life: any;
|
100
|
+
easing: string;
|
101
|
+
colorA?: undefined;
|
102
|
+
colorB?: undefined;
|
103
|
+
scaleA?: undefined;
|
104
|
+
scaleB?: undefined;
|
105
|
+
fx?: undefined;
|
106
|
+
fy?: undefined;
|
107
|
+
fz?: undefined;
|
108
|
+
x?: undefined;
|
109
|
+
y?: undefined;
|
110
|
+
z?: undefined;
|
111
|
+
driftX?: undefined;
|
112
|
+
driftY?: undefined;
|
113
|
+
driftZ?: undefined;
|
114
|
+
delay?: undefined;
|
115
|
+
spring?: undefined;
|
116
|
+
friction?: undefined;
|
117
|
+
};
|
118
|
+
} | {
|
119
|
+
id: string;
|
120
|
+
type: string;
|
121
|
+
properties: {
|
122
|
+
colorA: string;
|
123
|
+
colorB: string;
|
124
|
+
life: any;
|
125
|
+
easing: string;
|
126
|
+
alphaA?: undefined;
|
127
|
+
alphaB?: undefined;
|
128
|
+
scaleA?: undefined;
|
129
|
+
scaleB?: undefined;
|
130
|
+
fx?: undefined;
|
131
|
+
fy?: undefined;
|
132
|
+
fz?: undefined;
|
133
|
+
x?: undefined;
|
134
|
+
y?: undefined;
|
135
|
+
z?: undefined;
|
136
|
+
driftX?: undefined;
|
137
|
+
driftY?: undefined;
|
138
|
+
driftZ?: undefined;
|
139
|
+
delay?: undefined;
|
140
|
+
spring?: undefined;
|
141
|
+
friction?: undefined;
|
142
|
+
};
|
143
|
+
} | {
|
144
|
+
id: string;
|
145
|
+
type: string;
|
146
|
+
properties: {
|
147
|
+
scaleA: number;
|
148
|
+
scaleB: number;
|
149
|
+
life: any;
|
150
|
+
easing: string;
|
151
|
+
alphaA?: undefined;
|
152
|
+
alphaB?: undefined;
|
153
|
+
colorA?: undefined;
|
154
|
+
colorB?: undefined;
|
155
|
+
fx?: undefined;
|
156
|
+
fy?: undefined;
|
157
|
+
fz?: undefined;
|
158
|
+
x?: undefined;
|
159
|
+
y?: undefined;
|
160
|
+
z?: undefined;
|
161
|
+
driftX?: undefined;
|
162
|
+
driftY?: undefined;
|
163
|
+
driftZ?: undefined;
|
164
|
+
delay?: undefined;
|
165
|
+
spring?: undefined;
|
166
|
+
friction?: undefined;
|
167
|
+
};
|
168
|
+
} | {
|
169
|
+
id: string;
|
170
|
+
type: string;
|
171
|
+
properties: {
|
172
|
+
fx: number;
|
173
|
+
fy: number;
|
174
|
+
fz: number;
|
175
|
+
life: any;
|
176
|
+
easing: string;
|
177
|
+
alphaA?: undefined;
|
178
|
+
alphaB?: undefined;
|
179
|
+
colorA?: undefined;
|
180
|
+
colorB?: undefined;
|
181
|
+
scaleA?: undefined;
|
182
|
+
scaleB?: undefined;
|
183
|
+
x?: undefined;
|
184
|
+
y?: undefined;
|
185
|
+
z?: undefined;
|
186
|
+
driftX?: undefined;
|
187
|
+
driftY?: undefined;
|
188
|
+
driftZ?: undefined;
|
189
|
+
delay?: undefined;
|
190
|
+
spring?: undefined;
|
191
|
+
friction?: undefined;
|
192
|
+
};
|
193
|
+
} | {
|
194
|
+
id: string;
|
195
|
+
type: string;
|
196
|
+
properties: {
|
197
|
+
x: number;
|
198
|
+
y: number;
|
199
|
+
z: number;
|
200
|
+
life: any;
|
201
|
+
easing: string;
|
202
|
+
alphaA?: undefined;
|
203
|
+
alphaB?: undefined;
|
204
|
+
colorA?: undefined;
|
205
|
+
colorB?: undefined;
|
206
|
+
scaleA?: undefined;
|
207
|
+
scaleB?: undefined;
|
208
|
+
fx?: undefined;
|
209
|
+
fy?: undefined;
|
210
|
+
fz?: undefined;
|
211
|
+
driftX?: undefined;
|
212
|
+
driftY?: undefined;
|
213
|
+
driftZ?: undefined;
|
214
|
+
delay?: undefined;
|
215
|
+
spring?: undefined;
|
216
|
+
friction?: undefined;
|
217
|
+
};
|
218
|
+
} | {
|
219
|
+
id: string;
|
220
|
+
type: string;
|
221
|
+
properties: {
|
222
|
+
driftX: number;
|
223
|
+
driftY: number;
|
224
|
+
driftZ: number;
|
225
|
+
delay: number;
|
226
|
+
life: any;
|
227
|
+
easing: string;
|
228
|
+
alphaA?: undefined;
|
229
|
+
alphaB?: undefined;
|
230
|
+
colorA?: undefined;
|
231
|
+
colorB?: undefined;
|
232
|
+
scaleA?: undefined;
|
233
|
+
scaleB?: undefined;
|
234
|
+
fx?: undefined;
|
235
|
+
fy?: undefined;
|
236
|
+
fz?: undefined;
|
237
|
+
x?: undefined;
|
238
|
+
y?: undefined;
|
239
|
+
z?: undefined;
|
240
|
+
spring?: undefined;
|
241
|
+
friction?: undefined;
|
242
|
+
};
|
243
|
+
} | {
|
244
|
+
id: string;
|
245
|
+
type: string;
|
246
|
+
properties: {
|
247
|
+
x: number;
|
248
|
+
y: number;
|
249
|
+
z: number;
|
250
|
+
spring: number;
|
251
|
+
friction: number;
|
252
|
+
life: any;
|
253
|
+
easing: string;
|
254
|
+
alphaA?: undefined;
|
255
|
+
alphaB?: undefined;
|
256
|
+
colorA?: undefined;
|
257
|
+
colorB?: undefined;
|
258
|
+
scaleA?: undefined;
|
259
|
+
scaleB?: undefined;
|
260
|
+
fx?: undefined;
|
261
|
+
fy?: undefined;
|
262
|
+
fz?: undefined;
|
263
|
+
driftX?: undefined;
|
264
|
+
driftY?: undefined;
|
265
|
+
driftZ?: undefined;
|
266
|
+
delay?: undefined;
|
267
|
+
};
|
268
|
+
})[];
|
269
|
+
emitterBehaviours: any[];
|
270
|
+
}[];
|
271
|
+
};
|
@@ -0,0 +1,5 @@
|
|
1
|
+
export const testParticleSystem={preParticles:500,integrationType:"EULER",emitters:[{id:"51ca9450-3d8b-11e9-a1e8-4785d9606b75",totalEmitTimes:null,life:null,cache:{totalEmitTimes:null,life:null},rate:{particlesMin:1,particlesMax:4,perSecondMin:.01,perSecondMax:.02},position:{x:0,y:0,z:0},rotation:{x:0,y:0,z:0},initializers:[{id:"51ca9451-3d8b-11e9-a1e8-4785d9606b75",type:"Mass",properties:{min:30,max:10,isEnabled:!0}},{id:"51ca9452-3d8b-11e9-a1e8-4785d9606b75",type:"Life",properties:{min:2,max:4,isEnabled:!0}},{id:"51ca9453-3d8b-11e9-a1e8-4785d9606b75",type:"BodySprite",properties:{texture:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAJkSURBVHjaxJeJbusgEEW94S1L//83X18M2MSuLd2pbqc4wZGqRLrKBsyZhQHny7Jk73xVL8xpVhWrcmiB5lX+6GJ5YgQ2owbAm8oIwH1VgKZUmGcRqKGGPgtEQQAzGR8hQ59fAmhJHSAagigJ4E7GPWRXOYC6owAd1JM6wDQPADyMWUqZRMqmAojHp1Vn6EQQEgUNMJLnUjMyJsM49wygBkAPw9dVFwXRkncCIIW3GRgoTQUZn6HxCMAFEFd8TwEQ78X4rHbILoAUmeT+RFG4UhQ6MiIAE4W/UsYFjuVjAIa2nIY4q1R0GFtQWG3E84lqw2GO2QOoCKBVu0BAPgDSU0eUDjjQenNkV/AW/pWChhpMTelo1a64AOKM30vk18GzTHXCNtI/Knz3DFBgsUqBGIjTInXRY1yA9xkVoqW5tVq3pDR9A0hfF5BSARmVnh7RMDCaIdcNgbPBkgzn1Bu+SfIEFSpSBmkxyrMicb0fAEuCZrWnN89veA/4XcakrPcjBWzkTuLjlbfTQPOlBhz+HwkqqPXmPQDdrQItxE1moGof1S74j/8txk8EHhTQrAE8qlwfqS5yukm1x/rAJ9Jiaa6nyATqD78aUVBhFo8b1V4DdTXdCW+IxA1zB4JhiOhZMEWO1HqnvdoHZ4FAMIhV9REF8FiUm0jsYPEJx/Fm/N8OhH90HI9YRHesWbXXZwAShU8qThe7H8YAuJmw5yOd989uRINKRTJAhoF8jbqrHKfeCYdIISZfSq26bk/K+yO3YvfKrVgiwQBHnwt8ynPB25+M8hceTt/ybPhnryJ78+tLgAEAuCFyiQgQB30AAAAASUVORK5CYII=",isEnabled:!0}},{id:"51ca9454-3d8b-11e9-a1e8-4785d9606b75",type:"Radius",properties:{width:12,height:4,isEnabled:!0}},{id:"51ca9455-3d8b-11e9-a1e8-4785d9606b75",type:"RadialVelocity",properties:{radius:10,x:0,y:5,z:0,theta:900,isEnabled:!0}}],behaviours:[{id:"51ca9456-3d8b-11e9-a1e8-4785d9606b75",type:"Alpha",properties:{alphaA:1,alphaB:0,life:null,easing:"easeLinear"}},{id:"51ca9457-3d8b-11e9-a1e8-4785d9606b75",type:"Color",properties:{colorA:"#002a4f",colorB:"#0029FF",life:null,easing:"easeOutCubic"}},{id:"51ca9458-3d8b-11e9-a1e8-4785d9606b75",type:"Scale",properties:{scaleA:1,scaleB:.5,life:null,easing:"easeLinear"}},{id:"51ca9459-3d8b-11e9-a1e8-4785d9606b75",type:"Force",properties:{fx:0,fy:5,fz:0,life:null,easing:"easeLinear"}},{id:"51ca945a-3d8b-11e9-a1e8-4785d9606b75",type:"Rotate",properties:{x:1,y:0,z:0,life:null,easing:"easeLinear"}},{id:"51ca945b-3d8b-11e9-a1e8-4785d9606b75",type:"RandomDrift",properties:{driftX:1,driftY:23,driftZ:4,delay:1,life:null,easing:"easeLinear"}},{id:"51ca945c-3d8b-11e9-a1e8-4785d9606b75",type:"Spring",properties:{x:1,y:5,z:0,spring:.01,friction:1,life:null,easing:"easeLinear"}}],emitterBehaviours:[]}]};
|
2
|
+
/*
|
3
|
+
* Copyright (©) 2023. All rights reserved.
|
4
|
+
* See the LICENSE.md file for details.
|
5
|
+
*/
|
@@ -0,0 +1,85 @@
|
|
1
|
+
export interface Cache {
|
2
|
+
totalEmitTimes?: number;
|
3
|
+
life?: number;
|
4
|
+
}
|
5
|
+
export interface Rate {
|
6
|
+
particlesMin: number;
|
7
|
+
particlesMax: number;
|
8
|
+
perSecondMin: number;
|
9
|
+
perSecondMax: number;
|
10
|
+
}
|
11
|
+
export interface Position {
|
12
|
+
x: number;
|
13
|
+
y: number;
|
14
|
+
z: number;
|
15
|
+
}
|
16
|
+
export interface Rotation {
|
17
|
+
x: number;
|
18
|
+
y: number;
|
19
|
+
z: number;
|
20
|
+
}
|
21
|
+
export interface InitializerProperties {
|
22
|
+
min?: number;
|
23
|
+
max?: number;
|
24
|
+
isEnabled?: boolean;
|
25
|
+
texture?: string;
|
26
|
+
width?: number;
|
27
|
+
height?: number;
|
28
|
+
radius?: number;
|
29
|
+
x?: number;
|
30
|
+
y?: number;
|
31
|
+
z?: number;
|
32
|
+
theta?: number;
|
33
|
+
}
|
34
|
+
export interface Initializer {
|
35
|
+
id?: string;
|
36
|
+
type: InitializerType | string;
|
37
|
+
properties: InitializerProperties;
|
38
|
+
}
|
39
|
+
export interface BehaviourProperties {
|
40
|
+
alphaA?: number;
|
41
|
+
alphaB?: number;
|
42
|
+
life?: number;
|
43
|
+
easing?: Easing | string;
|
44
|
+
colorA?: string;
|
45
|
+
colorB?: string;
|
46
|
+
scaleA?: number;
|
47
|
+
scaleB?: number;
|
48
|
+
fx?: number;
|
49
|
+
fy?: number;
|
50
|
+
fz?: number;
|
51
|
+
x?: number;
|
52
|
+
y?: number;
|
53
|
+
z?: number;
|
54
|
+
driftX?: number;
|
55
|
+
driftY?: number;
|
56
|
+
driftZ?: number;
|
57
|
+
delay?: number;
|
58
|
+
spring?: number;
|
59
|
+
friction?: number;
|
60
|
+
}
|
61
|
+
export interface Behaviour {
|
62
|
+
id: string;
|
63
|
+
type: BehaviourType | string;
|
64
|
+
properties: BehaviourProperties;
|
65
|
+
}
|
66
|
+
export interface Emitter {
|
67
|
+
id: string;
|
68
|
+
totalEmitTimes?: number;
|
69
|
+
life?: number;
|
70
|
+
cache: Cache;
|
71
|
+
rate: Rate;
|
72
|
+
position: Position;
|
73
|
+
rotation: Rotation;
|
74
|
+
initializers: Initializer[];
|
75
|
+
behaviours: Behaviour[];
|
76
|
+
emitterBehaviours: Behaviour[];
|
77
|
+
}
|
78
|
+
export interface ParticleSystemConfig {
|
79
|
+
preParticles: number;
|
80
|
+
integrationType: string;
|
81
|
+
emitters: Emitter[];
|
82
|
+
}
|
83
|
+
export type InitializerType = 'Body' | 'BodySprite' | 'Life' | 'Mass' | 'Position' | 'Radius' | 'RadialVelocity' | 'Rate' | 'Texture';
|
84
|
+
export type BehaviourType = 'Alpha' | 'Attraction' | 'Collision' | 'Color' | 'CrossZone' | 'Force' | 'Gravity' | 'RandomDrift' | 'Repulsion' | 'Rotate' | 'Scale' | 'Spring';
|
85
|
+
export type Easing = 'easeLinear' | 'easeInQuad' | 'easeOutQuad' | 'easeInOutQuad' | 'easeInCubic' | 'easeOutCubic' | 'easeInOutCubic' | 'easeInQuart' | 'easeOutQuart' | 'easeInOutQuart' | 'easeInSine' | 'easeOutSine' | 'easeInOutSine' | 'easeInExpo' | 'easeOutExpo' | 'easeInOutExpo' | 'easeInCirc' | 'easeOutCirc' | 'easeInOutCirc' | 'easeInBack' | 'easeOutBack' | 'easeInOutBack';
|
@@ -0,0 +1,37 @@
|
|
1
|
+
import { Subject } from "rxjs";
|
2
|
+
import { Group } from "three";
|
3
|
+
import { Constructable } from "typedi";
|
4
|
+
import { ActorComponent, ComponentAttachProps } from "./component";
|
5
|
+
export declare function Actor(): (targetConstructor: any) => void;
|
6
|
+
export type ActorId = number;
|
7
|
+
/**
|
8
|
+
* An actor needs to inherit from the Base actor class to be able to be added to a scene.
|
9
|
+
*/
|
10
|
+
export declare abstract class BaseActor {
|
11
|
+
readonly id: ActorId;
|
12
|
+
__isInitialised: boolean;
|
13
|
+
readonly container: Group;
|
14
|
+
readonly disposed: Subject<true>;
|
15
|
+
get position(): import("three").Vector3;
|
16
|
+
get quaternion(): import("three").Quaternion;
|
17
|
+
get rotation(): import("three").Euler;
|
18
|
+
onInit(): Promise<void> | void;
|
19
|
+
onBeginPlay(): void;
|
20
|
+
onEndPlay(): void;
|
21
|
+
/**
|
22
|
+
* Code that has to run before every rendered frame. This will run after the
|
23
|
+
* actor's onInit method has run.
|
24
|
+
* @param deltaTime The amount of time in seconds since the last frame
|
25
|
+
*/
|
26
|
+
onUpdate(deltaTime: number): void;
|
27
|
+
/**
|
28
|
+
* Code that has to run before every rendered frame but after the update method has been
|
29
|
+
* called on all actors.
|
30
|
+
* @param deltaTime The amount of time in seconds since the last frame
|
31
|
+
*/
|
32
|
+
onLateUpdate(deltaTime: number): void;
|
33
|
+
constructor();
|
34
|
+
attach<T extends ActorComponent>(type: Constructable<T>, props?: ComponentAttachProps<T>): T;
|
35
|
+
getComponent<T extends ActorComponent>(type: Constructable<T>): T;
|
36
|
+
}
|
37
|
+
export declare function _setupActorUpdateEventHandlers(): void;
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import{__decorate as t,__metadata as e}from"tslib";import o,{ignore as i}from"@plumier/reflect";import{Subject as n,skipWhile as r}from"rxjs";import{Group as s}from"three";import a,{Service as p}from"typedi";import{ActorComponent as d}from"./component";import{initComponents as c}from"./internal/component-init";import{activeContainerInstance as l,containerRefMap as u}from"./internal/container-map";import{randomString as m}from"../../utils/math";import{inject as h}from"../inject";import{ViewController as f}from"../services/render";export function Actor(){const t=p({transient:!0});return function(e){e.__isActor=!0,t(e),o.noop()(e),o.parameterProperties()(e)}}let v=0;export class BaseActor{get position(){var t;return null===(t=this.container)||void 0===t?void 0:t.position}get quaternion(){var t;return null===(t=this.container)||void 0===t?void 0:t.quaternion}get rotation(){var t;return null===(t=this.container)||void 0===t?void 0:t.rotation}onInit(){}onBeginPlay(){}onEndPlay(){}onUpdate(t){}onLateUpdate(t){}constructor(){this.id=++v,this.__isInitialised=!1,this.container=new s,this.disposed=new n,this.onUpdate!==BaseActor.prototype.onUpdate&&h(f).onUpdate(this).pipe(r((()=>!this.__isInitialised))).subscribe((t=>this.onUpdate(t))),this.onLateUpdate!==BaseActor.prototype.onLateUpdate&&h(f).onLateUpdate(this).pipe(r((()=>!this.__isInitialised))).subscribe((t=>this.onLateUpdate(t)))}attach(t,e){var o,i;const n=l.value,r=null!==(i=null!==(o=u.get(this))&&void 0!==o?o:l.value)&&void 0!==i?i:a.of("default");l.value=r;const s=m();r.set({id:s,type:t,transient:!0});const p=r.get(s);if(l.value=n,null!=e)for(const t of Object.keys(e))p[t]=e[t];return this.__isInitialised&&(p.actor=this,p.onInit(),c(p,this)),p}getComponent(t){for(const e of Object.values(this))if(e instanceof t)return e}}t([i(),e("design:type",Object),e("design:paramtypes",[])],BaseActor.prototype,"position",null),t([i(),e("design:type",Object),e("design:paramtypes",[])],BaseActor.prototype,"quaternion",null),t([i(),e("design:type",Object),e("design:paramtypes",[])],BaseActor.prototype,"rotation",null);export function _setupActorUpdateEventHandlers(){this.onUpdate!==d.prototype.onUpdate&&h(f).onUpdate(this.actor).pipe(r((()=>!this.actor.__isInitialised))).subscribe((t=>this.onUpdate(t))),this.onLateUpdate!==d.prototype.onLateUpdate&&h(f).onLateUpdate(this.actor).pipe(r((()=>!this.actor.__isInitialised))).subscribe((t=>this.onLateUpdate(t)))}
|
2
|
+
/*
|
3
|
+
* Copyright (©) 2023. All rights reserved.
|
4
|
+
* See the LICENSE.md file for details.
|
5
|
+
*/
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { BaseActor } from "../actor";
|
2
|
+
import { CameraComponent } from "../camera/camera-component";
|
3
|
+
import { ActorComponent } from "../component";
|
4
|
+
export declare class CameraMesh extends ActorComponent {
|
5
|
+
private arrowColor;
|
6
|
+
onInit(): void | Promise<void>;
|
7
|
+
}
|
8
|
+
export declare class CameraActor extends BaseActor {
|
9
|
+
camera: CameraComponent;
|
10
|
+
mesh: CameraMesh;
|
11
|
+
}
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import{__decorate as e,__metadata as o}from"tslib";import{ArrowHelper as r,ConeGeometry as t,EdgesGeometry as a,LineBasicMaterial as n,LineSegments as s,MeshStandardMaterial as l,Vector3 as i}from"three";import{Actor as c,BaseActor as m}from"../actor";import{CameraComponent as p}from"../camera/camera-component";import{ActorComponent as d,Attach as w,Component as y}from"../component";let h=class extends d{constructor(){super(...arguments),this.arrowColor=16101442}onInit(){const e=new t(1,1,4);e.rotateX(Math.PI/2),e.rotateZ(Math.PI/4),e.scale(1,9/16,1);const o=new a(e),c=(new l({color:3355443}),new s(o,new n({color:16777215}))),m=new r(new i(0,0,-1),new i(0,0,0),1.2,this.arrowColor,.15,.2);c.add(m),m.layers.disableAll(),m.layers.enable(19),m.traverse((e=>{e.layers.disableAll(),e.layers.enable(19)})),this.actor.container.add(c)}};h=e([y({inEditor:!0,editorOnly:!0})],h);export{h as CameraMesh};let b=class extends m{};e([w(),o("design:type",p)],b.prototype,"camera",void 0),e([w(),o("design:type",h)],b.prototype,"mesh",void 0),b=e([c()],b);export{b as CameraActor};
|
2
|
+
/*
|
3
|
+
* Copyright (©) 2023. All rights reserved.
|
4
|
+
* See the LICENSE.md file for details.
|
5
|
+
*/
|
@@ -0,0 +1,67 @@
|
|
1
|
+
import { ActorComponent } from "../../../component";
|
2
|
+
import { AnimationStateMachine } from "../../../../animation/anim-sm";
|
3
|
+
import { BoneLayer } from "../../../../animation/root-motion";
|
4
|
+
import { AnimationAction, AnimationClip, Bone, Object3D } from "three";
|
5
|
+
export declare class CharacterAnimationComponent extends ActorComponent {
|
6
|
+
private viewController;
|
7
|
+
private mixer;
|
8
|
+
private stateMachines;
|
9
|
+
private upperStateMachines;
|
10
|
+
private fadeTime;
|
11
|
+
movementSpeed: any;
|
12
|
+
private fullBodyAction;
|
13
|
+
private upperBodyAction;
|
14
|
+
private fullBodyClip;
|
15
|
+
private fullBodyMask;
|
16
|
+
private upperBodyMask;
|
17
|
+
private upperBodyTimer;
|
18
|
+
private upperBodyOverride;
|
19
|
+
private fullBodyTimer;
|
20
|
+
private currentFullBodyPriority;
|
21
|
+
private currentUpperBodyPriority;
|
22
|
+
onInit(): void | Promise<void>;
|
23
|
+
getRootMotionAction(): AnimationAction;
|
24
|
+
/**
|
25
|
+
* @param root
|
26
|
+
* @param rootBone The bone should be configured on a skeletal mesh component.
|
27
|
+
*/
|
28
|
+
setup(root: Object3D, upperBodyMask?: Bone[], rootBone?: Bone): void;
|
29
|
+
/**
|
30
|
+
* This class should take care of current actions, one stack of actions per subtree.
|
31
|
+
*/
|
32
|
+
private updateStateMachines;
|
33
|
+
private updateInternal;
|
34
|
+
private syncMovementSpeed;
|
35
|
+
playStateMachine(sm: AnimationStateMachine): void;
|
36
|
+
playUpperStateMachine(sm: AnimationStateMachine): void;
|
37
|
+
removeStateMachine(sm: AnimationStateMachine): void;
|
38
|
+
removeUpperStateMachine(sm: AnimationStateMachine): void;
|
39
|
+
playUpper(clip: AnimationClip, options?: PlayOptions): void;
|
40
|
+
private getFullBodyClip;
|
41
|
+
private getUpperBodyClip;
|
42
|
+
/**
|
43
|
+
* The clip should be replaced with something more complex which has information about looping, masks,
|
44
|
+
*
|
45
|
+
*
|
46
|
+
* Have one play method meant for representing movement like walking etc,
|
47
|
+
*
|
48
|
+
* Have one method for driving the entire character's animation. It should basically just stup any upper body animation
|
49
|
+
* and then trigger the full body animation.
|
50
|
+
*/
|
51
|
+
play(clip: AnimationClip, options?: PlayOptions): void;
|
52
|
+
private onActionDone;
|
53
|
+
/**
|
54
|
+
*
|
55
|
+
* @param currentAction The action that should be transitioned from.
|
56
|
+
* @param clip
|
57
|
+
* @param inplace
|
58
|
+
* @returns
|
59
|
+
*/
|
60
|
+
transition(currentAction: AnimationAction, clip: AnimationClip, options?: PlayOptions): AnimationAction;
|
61
|
+
}
|
62
|
+
export type PlayOptions = Partial<{
|
63
|
+
inPlace: boolean;
|
64
|
+
loop: boolean;
|
65
|
+
layer: BoneLayer;
|
66
|
+
priority: number;
|
67
|
+
}>;
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import{__decorate as t}from"tslib";import{ActorComponent as i,Component as e}from"../../../component";import{RootMotionClip as r}from"../../../../animation/root-motion";import{inject as o}from"../../../../inject";import{ViewController as s}from"../../../../services/render";import{AnimationMixer as n,Bone as p,LoopOnce as l}from"three";let u=class extends i{constructor(){super(...arguments),this.viewController=o(s),this.stateMachines=[],this.upperStateMachines=[],this.fadeTime=.2,this.movementSpeed=null,this.upperBodyTimer=0,this.upperBodyOverride=!1,this.fullBodyTimer=0,this.currentFullBodyPriority=-1,this.currentUpperBodyPriority=-1,this.getFullBodyClip=c((t=>t.uuid),(t=>h(this.fullBodyMask,t))),this.getUpperBodyClip=c((t=>t.uuid),(t=>h(this.upperBodyMask,t)))}onInit(){this.viewController.onUpdate(this.actor).subscribe((t=>this.updateInternal(t)))}getRootMotionAction(){if(this.fullBodyAction.getClip()instanceof r)return this.fullBodyAction}setup(t,i,e){null!=i&&(this.upperBodyMask=a(i),this.fullBodyMask=function(t,i){const e=new Set(a(i).map((t=>t.uuid))),r=[];return t.traverse((t=>{(t instanceof p||t.isBone)&&!e.has(t.uuid)&&r.push(t)})),r}(function(t){let i;return t.traverse((t=>{(t instanceof p||t.isBone)&&null==i&&(i=t)})),i}(t),i)),null!=this.mixer&&this.mixer.stopAllAction(),this.mixer=new n(t)}updateStateMachines(t){this.stateMachines.forEach((i=>{i.step(t);const e=i.current.clip;null!=e&&this.play(e,{priority:0})})),this.upperStateMachines.forEach((i=>{i.step(t);const e=i.current.clip;null!=e?this.playUpper(e,{priority:0}):this.play(this.fullBodyClip)}))}updateInternal(t){null!=this.mixer&&(this.upperBodyTimer+=t,this.fullBodyTimer+=t,this.upperBodyAction&&this.upperBodyOverride&&this.upperBodyAction.getClip().duration-2*this.fadeTime<this.upperBodyTimer&&(this.upperBodyOverride=!1,null!=this.fullBodyClip&&this.transition(this.upperBodyAction,this.getUpperBodyClip(this.fullBodyClip))),this.fullBodyAction&&this.fullBodyAction.loop===l&&this.fullBodyAction.getClip().duration-2*this.fadeTime<this.fullBodyTimer&&(this.currentFullBodyPriority=-1),this.updateStateMachines(t),this.syncMovementSpeed(this.fullBodyAction),this.upperBodyOverride||this.syncMovementSpeed(this.upperBodyAction),this.mixer.update(t))}syncMovementSpeed(t){if(null!=t){const i=t.getClip();i instanceof r&&i.fixedInPlace&&null!=this.movementSpeed&&(t.timeScale=i.duration/i.displacement*this.movementSpeed)}}playStateMachine(t){this.stateMachines.push(t)}playUpperStateMachine(t){this.upperStateMachines.push(t)}removeStateMachine(t){this.stateMachines.splice(this.stateMachines.indexOf(t))}removeUpperStateMachine(t){this.upperStateMachines.splice(this.upperStateMachines.indexOf(t))}playUpper(t,i={}){var e;const r=null!==(e=null==i?void 0:i.priority)&&void 0!==e?e:1;r<this.currentUpperBodyPriority||(this.currentUpperBodyPriority=r,this.upperBodyAction=this.transition(this.upperBodyAction,this.getUpperBodyClip(t),i),this.upperBodyTimer=0,this.upperBodyOverride=!0)}play(t,i={}){var e;!function(t,i){if(!1===t||"function"==typeof t&&!1===t())throw new Error(i)}(null!=this.mixer,"Can't play animation before setup is called");const r=null!==(e=i.priority)&&void 0!==e?e:1;r<this.currentFullBodyPriority||(this.currentFullBodyPriority=r,this.fullBodyTimer=0,this.upperBodyOverride||(this.upperBodyAction=this.transition(this.upperBodyAction,this.getUpperBodyClip(t),i)),this.fullBodyClip=t,this.fullBodyAction=this.transition(this.fullBodyAction,this.getFullBodyClip(t),i),this.fullBodyAction.getClip().uuid==this.upperBodyAction.getClip().uuid&&this.upperBodyAction.syncWith(this.fullBodyAction))}onActionDone(t){return new Promise((i=>{const e=r=>{r.target===t&&(i(r.target),this.mixer.removeEventListener("finished",e))};this.mixer.addEventListener("finished",e)}))}transition(t,i,e={}){if(null!=t&&t.getClip().uuid===i.uuid)return t;if(t){const e=t,r=t=this.mixer.clipAction(i);r.play(),r.enabled=!0,r.setEffectiveTimeScale(1),r.setEffectiveWeight(1),r.time=0,e.crossFadeTo(r,this.fadeTime,!0)}else null==(t=this.mixer.clipAction(i))||t.fadeIn(.3),null==t||t.play();return!1===e.loop&&(t.setLoop(l,1),t.clampWhenFinished=!0,t.reset()),t}};u=t([e()],u);export{u as CharacterAnimationComponent};function h(t,i){if(null==t)return i;const e=i.clone(),r=new Set(t.map((t=>t.name)));return e.tracks=e.tracks.filter((t=>r.has(t.name.split(".")[0]))),e}function a(t){return t.flatMap((t=>function(t){const i=[];return t.traverse((t=>{i.push(t)})),i}(t))).filter((t=>t instanceof p))}function c(t,i){const e=new Map;return(r,...o)=>{const s=t(r);return e.has(s)||e.set(s,i(r,...o)),e.get(s)}}
|
2
|
+
/*
|
3
|
+
* Copyright (©) 2023. All rights reserved.
|
4
|
+
* See the LICENSE.md file for details.
|
5
|
+
*/
|
@@ -0,0 +1,37 @@
|
|
1
|
+
import { ActionInput, AxisInput, RotationInput } from "../../../../../gameplay/input";
|
2
|
+
import { PhysicsSystem } from "../../../../../gameplay/services/physics/physics-system";
|
3
|
+
import { Vector3 } from "three";
|
4
|
+
import { ActorComponent } from "../../../component";
|
5
|
+
import { CharacterMovementMode } from "./modes";
|
6
|
+
export declare class CharacterMovementComponent extends ActorComponent {
|
7
|
+
private physicsSystem;
|
8
|
+
readonly directionInput: AxisInput;
|
9
|
+
readonly jumpInput: ActionInput;
|
10
|
+
readonly sprintInput: ActionInput;
|
11
|
+
readonly rotationInput: RotationInput;
|
12
|
+
horizontalSpeed: number;
|
13
|
+
maxSpeed: number;
|
14
|
+
maxSpeedBackwards: number;
|
15
|
+
maxSpeedSprint: number;
|
16
|
+
maxWalkingSlopeAngle: number;
|
17
|
+
jumpVelocity: number;
|
18
|
+
fallingMovementControl: number;
|
19
|
+
fallingReorientation: boolean;
|
20
|
+
gravityOverride: number;
|
21
|
+
colliderHeight: number;
|
22
|
+
colliderRadius: number;
|
23
|
+
readonly velocity: Vector3;
|
24
|
+
mode: CharacterMovementMode;
|
25
|
+
isSprinting: boolean;
|
26
|
+
pressedJump: boolean;
|
27
|
+
private rayTestResult;
|
28
|
+
constructor(physicsSystem: PhysicsSystem);
|
29
|
+
onInit(): void | Promise<void>;
|
30
|
+
private getWallDirection;
|
31
|
+
private moveTo;
|
32
|
+
getEffectiveGravity(): number;
|
33
|
+
get isGrounded(): boolean;
|
34
|
+
private createCollisionShape;
|
35
|
+
private step;
|
36
|
+
private performMovement;
|
37
|
+
}
|