@zephyr3d/scene 0.9.6 → 0.9.8
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/animation/animationset.js +52 -55
- package/dist/animation/animationset.js.map +1 -1
- package/dist/animation/joint_dynamics/controller.js +92 -32
- package/dist/animation/joint_dynamics/controller.js.map +1 -1
- package/dist/animation/joint_dynamics/convex_collider.js +320 -0
- package/dist/animation/joint_dynamics/convex_collider.js.map +1 -0
- package/dist/animation/joint_dynamics/joint_dynamics_system.js +57 -19
- package/dist/animation/joint_dynamics/joint_dynamics_system.js.map +1 -1
- package/dist/animation/joint_dynamics/solver.js +71 -27
- package/dist/animation/joint_dynamics/solver.js.map +1 -1
- package/dist/animation/joint_dynamics_modifier.js +4 -3
- package/dist/animation/joint_dynamics_modifier.js.map +1 -1
- package/dist/animation/skeleton.js +7 -10
- package/dist/animation/skeleton.js.map +1 -1
- package/dist/app/engine.js +3 -9
- package/dist/app/engine.js.map +1 -1
- package/dist/app/scriptregistry.js +47 -16
- package/dist/app/scriptregistry.js.map +1 -1
- package/dist/asset/assetmanager.js +3 -1
- package/dist/asset/assetmanager.js.map +1 -1
- package/dist/asset/model.js +346 -7
- package/dist/asset/model.js.map +1 -1
- package/dist/avatar/wardrobe.js +7 -3
- package/dist/avatar/wardrobe.js.map +1 -1
- package/dist/camera/camera.js +240 -34
- package/dist/camera/camera.js.map +1 -1
- package/dist/index.d.ts +1350 -622
- package/dist/index.js +6 -11
- package/dist/index.js.map +1 -1
- package/dist/material/blinn.js +1 -1
- package/dist/material/blinn.js.map +1 -1
- package/dist/material/lambert.js +1 -1
- package/dist/material/lambert.js.map +1 -1
- package/dist/material/material.js +23 -1
- package/dist/material/material.js.map +1 -1
- package/dist/material/meshmaterial.js +178 -23
- package/dist/material/meshmaterial.js.map +1 -1
- package/dist/material/mixins/albedocolor.js +4 -4
- package/dist/material/mixins/albedocolor.js.map +1 -1
- package/dist/material/mixins/lightmodel/blinnphong.js +2 -1
- package/dist/material/mixins/lightmodel/blinnphong.js.map +1 -1
- package/dist/material/mixins/lightmodel/lambert.js +2 -1
- package/dist/material/mixins/lightmodel/lambert.js.map +1 -1
- package/dist/material/mixins/lightmodel/pbrblueprintmixin.js +63 -16
- package/dist/material/mixins/lightmodel/pbrblueprintmixin.js.map +1 -1
- package/dist/material/mixins/lightmodel/pbrmetallicroughness.js +100 -27
- package/dist/material/mixins/lightmodel/pbrmetallicroughness.js.map +1 -1
- package/dist/material/mixins/lightmodel/pbrspecularglossness.js +16 -6
- package/dist/material/mixins/lightmodel/pbrspecularglossness.js.map +1 -1
- package/dist/material/mixins/lit.js +1 -1
- package/dist/material/mixins/lit.js.map +1 -1
- package/dist/material/mixins/pbr/common.js +276 -65
- package/dist/material/mixins/pbr/common.js.map +1 -1
- package/dist/material/mixins/texture.js +3 -3
- package/dist/material/mixins/texture.js.map +1 -1
- package/dist/material/mixins/vertexcolor.js +2 -2
- package/dist/material/mixins/vertexcolor.js.map +1 -1
- package/dist/material/mtoon.js +574 -0
- package/dist/material/mtoon.js.map +1 -0
- package/dist/material/pbrblueprint.js +494 -331
- package/dist/material/pbrblueprint.js.map +1 -1
- package/dist/material/pbrmr.js +118 -100
- package/dist/material/pbrmr.js.map +1 -1
- package/dist/material/pbrsg.js +1 -1
- package/dist/material/pbrsg.js.map +1 -1
- package/dist/material/shader/helper.js +45 -15
- package/dist/material/shader/helper.js.map +1 -1
- package/dist/material/subsurfaceprofile.js +812 -0
- package/dist/material/subsurfaceprofile.js.map +1 -0
- package/dist/material/unlit.js +1 -1
- package/dist/material/unlit.js.map +1 -1
- package/dist/posteffect/compositor.js +46 -11
- package/dist/posteffect/compositor.js.map +1 -1
- package/dist/posteffect/ssr.js +413 -87
- package/dist/posteffect/ssr.js.map +1 -1
- package/dist/posteffect/sss.js +1053 -0
- package/dist/posteffect/sss.js.map +1 -0
- package/dist/posteffect/taa.js +61 -60
- package/dist/posteffect/taa.js.map +1 -1
- package/dist/render/abuffer_oit.js +63 -12
- package/dist/render/abuffer_oit.js.map +1 -1
- package/dist/render/cluster_light.js +6 -5
- package/dist/render/cluster_light.js.map +1 -1
- package/dist/render/drawable.js +1 -5
- package/dist/render/drawable.js.map +1 -1
- package/dist/render/drawable_mixin.js +2 -1
- package/dist/render/drawable_mixin.js.map +1 -1
- package/dist/render/fbm_wavegenerator.js +2 -1
- package/dist/render/fbm_wavegenerator.js.map +1 -1
- package/dist/render/gerstner_wavegenerator.js +2 -1
- package/dist/render/gerstner_wavegenerator.js.map +1 -1
- package/dist/render/globalbindgroup_allocator.js +2 -1
- package/dist/render/globalbindgroup_allocator.js.map +1 -1
- package/dist/render/lightpass.js +105 -18
- package/dist/render/lightpass.js.map +1 -1
- package/dist/render/render_queue.js +51 -8
- package/dist/render/render_queue.js.map +1 -1
- package/dist/render/renderer.js +73 -59
- package/dist/render/renderer.js.map +1 -1
- package/dist/render/rendergraph/device_pool_allocator.js +8 -0
- package/dist/render/rendergraph/device_pool_allocator.js.map +1 -1
- package/dist/render/rendergraph/forward_plus_builder.js +481 -95
- package/dist/render/rendergraph/forward_plus_builder.js.map +1 -1
- package/dist/render/rendergraph/history_resource_manager.js +55 -0
- package/dist/render/rendergraph/history_resource_manager.js.map +1 -1
- package/dist/render/rendergraph/history_resources.js +3 -1
- package/dist/render/rendergraph/history_resources.js.map +1 -1
- package/dist/render/rendergraph/types.js.map +1 -1
- package/dist/render/renderpass.js +10 -4
- package/dist/render/renderpass.js.map +1 -1
- package/dist/render/sky.js +31 -1
- package/dist/render/sky.js.map +1 -1
- package/dist/render/weightedblended_oit.js +23 -5
- package/dist/render/weightedblended_oit.js.map +1 -1
- package/dist/scene/basesprite.js +4 -2
- package/dist/scene/basesprite.js.map +1 -1
- package/dist/scene/batchgroup.js +3 -1
- package/dist/scene/batchgroup.js.map +1 -1
- package/dist/scene/environment.js +11 -1
- package/dist/scene/environment.js.map +1 -1
- package/dist/scene/light.js +21 -3
- package/dist/scene/light.js.map +1 -1
- package/dist/scene/mesh.js +29 -14
- package/dist/scene/mesh.js.map +1 -1
- package/dist/scene/meshdrawable.js +6 -0
- package/dist/scene/meshdrawable.js.map +1 -1
- package/dist/scene/msdftext.js +5 -2
- package/dist/scene/msdftext.js.map +1 -1
- package/dist/scene/msdftextsprite.js +5 -3
- package/dist/scene/msdftextsprite.js.map +1 -1
- package/dist/scene/particlesys.js +3 -1
- package/dist/scene/particlesys.js.map +1 -1
- package/dist/scene/scene.js +6 -5
- package/dist/scene/scene.js.map +1 -1
- package/dist/scene/terrain-cm/grass.js +4 -2
- package/dist/scene/terrain-cm/grass.js.map +1 -1
- package/dist/scene/terrain-cm/grassmaterial.js +2 -1
- package/dist/scene/terrain-cm/grassmaterial.js.map +1 -1
- package/dist/scene/terrain-cm/terrain-cm.js +4 -2
- package/dist/scene/terrain-cm/terrain-cm.js.map +1 -1
- package/dist/scene/water.js +4 -2
- package/dist/scene/water.js.map +1 -1
- package/dist/shaders/shadow.js +26 -393
- package/dist/shaders/shadow.js.map +1 -1
- package/dist/shadow/esm.js +112 -12
- package/dist/shadow/esm.js.map +1 -1
- package/dist/shadow/pcf_opt.js +2 -2
- package/dist/shadow/pcf_opt.js.map +1 -1
- package/dist/shadow/pcf_pd.js +19 -10
- package/dist/shadow/pcf_pd.js.map +1 -1
- package/dist/shadow/shader.js +58 -7
- package/dist/shadow/shader.js.map +1 -1
- package/dist/shadow/shadow_impl.js +6 -0
- package/dist/shadow/shadow_impl.js.map +1 -1
- package/dist/shadow/shadow_region.js +229 -0
- package/dist/shadow/shadow_region.js.map +1 -0
- package/dist/shadow/shadowmapper.js +67 -59
- package/dist/shadow/shadowmapper.js.map +1 -1
- package/dist/shadow/vsm.js +45 -19
- package/dist/shadow/vsm.js.map +1 -1
- package/dist/utility/blueprint/common/constants.js +8 -8
- package/dist/utility/blueprint/common/constants.js.map +1 -1
- package/dist/utility/blueprint/material/pbr.js +31 -4
- package/dist/utility/blueprint/material/pbr.js.map +1 -1
- package/dist/utility/blueprint/material/texture.js +1 -17
- package/dist/utility/blueprint/material/texture.js.map +1 -1
- package/dist/utility/serialization/manager.js +66 -98
- package/dist/utility/serialization/manager.js.map +1 -1
- package/dist/utility/serialization/scene/animation.js +5 -2
- package/dist/utility/serialization/scene/animation.js.map +1 -1
- package/dist/utility/serialization/scene/batch.js +4 -1
- package/dist/utility/serialization/scene/batch.js.map +1 -1
- package/dist/utility/serialization/scene/camera.js +249 -54
- package/dist/utility/serialization/scene/camera.js.map +1 -1
- package/dist/utility/serialization/scene/common.js +37 -1
- package/dist/utility/serialization/scene/common.js.map +1 -1
- package/dist/utility/serialization/scene/light.js +42 -3
- package/dist/utility/serialization/scene/light.js.map +1 -1
- package/dist/utility/serialization/scene/material.js +1112 -646
- package/dist/utility/serialization/scene/material.js.map +1 -1
- package/dist/utility/serialization/scene/mesh.js +7 -4
- package/dist/utility/serialization/scene/mesh.js.map +1 -1
- package/dist/utility/serialization/scene/node.js +31 -12
- package/dist/utility/serialization/scene/node.js.map +1 -1
- package/dist/utility/serialization/scene/particle.js +4 -1
- package/dist/utility/serialization/scene/particle.js.map +1 -1
- package/dist/utility/serialization/scene/primitive.js +3 -1
- package/dist/utility/serialization/scene/primitive.js.map +1 -1
- package/dist/utility/serialization/scene/scene.js +18 -0
- package/dist/utility/serialization/scene/scene.js.map +1 -1
- package/dist/utility/serialization/scene/sprite.js +6 -3
- package/dist/utility/serialization/scene/sprite.js.map +1 -1
- package/dist/utility/serialization/scene/terrain.js +5 -2
- package/dist/utility/serialization/scene/terrain.js.map +1 -1
- package/dist/utility/serialization/scene/text.js +3 -1
- package/dist/utility/serialization/scene/text.js.map +1 -1
- package/dist/utility/serialization/scene/water.js +4 -1
- package/dist/utility/serialization/scene/water.js.map +1 -1
- package/dist/utility/textures/ltcdata.js +6 -0
- package/dist/utility/textures/ltcdata.js.map +1 -0
- package/dist/utility/textures/ltclut.js +61 -0
- package/dist/utility/textures/ltclut.js.map +1 -0
- package/dist/values.js +9 -1
- package/dist/values.js.map +1 -1
- package/package.json +3 -3
|
@@ -3,16 +3,16 @@ import { getAABBClass } from './scene/misc.js';
|
|
|
3
3
|
import { getSceneNodeClass, getGraphNodeClass } from './scene/node.js';
|
|
4
4
|
import { getBatchGroupClass } from './scene/batch.js';
|
|
5
5
|
import { getCameraClass, getPerspectiveCameraClass, getOrthoCameraClass } from './scene/camera.js';
|
|
6
|
-
import { getPunctualLightClass, getDirectionalLightClass, getSpotLightClass,
|
|
7
|
-
import { getMeshMaterialClass, getPBRBluePrintMaterialClass, getSpriteBlueprintMaterialClass, getUnlitMaterialClass, getLambertMaterialClass, getBlinnMaterialClass, getPBRMetallicRoughnessMaterialClass, getPBRSpecularGlossinessMaterialClass, getParticleMaterialClass, getSpriteMaterialClass, getStandardSpriteMaterialClass } from './scene/material.js';
|
|
6
|
+
import { getPunctualLightClass, getDirectionalLightClass, getSpotLightClass, getPointLightClass, getRectLightClass } from './scene/light.js';
|
|
7
|
+
import { getSubsurfaceProfileClass, getMeshMaterialClass, getPBRBluePrintMaterialClass, getSpriteBlueprintMaterialClass, getUnlitMaterialClass, getMToonMaterialClass, getLambertMaterialClass, getBlinnMaterialClass, getPBRMetallicRoughnessMaterialClass, getPBRSpecularGlossinessMaterialClass, getParticleMaterialClass, getSpriteMaterialClass, getStandardSpriteMaterialClass } from './scene/material.js';
|
|
8
8
|
import { getMeshClass } from './scene/mesh.js';
|
|
9
9
|
import { getParticleNodeClass } from './scene/particle.js';
|
|
10
|
-
import { getBoxShapeClass, getBoxFrameShapeClass, getSphereShapeClass, getTorusShapeClass, getCylinderShapeClass, getPlaneShapeClass, getTetrahedronShapeClass
|
|
10
|
+
import { getBoxShapeClass, getBoxFrameShapeClass, getCapsuleShapeClass, getSphereShapeClass, getTorusShapeClass, getCylinderShapeClass, getPlaneShapeClass, getTetrahedronShapeClass } from './scene/primitive.js';
|
|
11
11
|
import { getSceneClass } from './scene/scene.js';
|
|
12
|
-
import { getScriptAttachmentClass } from './scene/script.js';
|
|
13
12
|
import { getTerrainClass } from './scene/terrain.js';
|
|
14
13
|
import { getWaterClass, getFFTWaveGeneratorClass, getFBMWaveGeneratorClass } from './scene/water.js';
|
|
15
|
-
import {
|
|
14
|
+
import { getTextSpriteClass, getMSDFTextSpriteClass, getMSDFTextClass } from './scene/text.js';
|
|
15
|
+
import { getInterpolatorClass, getSkeletonClass, getSkeletonRigClass, getSkinBindingClass, getJointDynamicsModifierClass, getAnimationClass, getPropTrackClass, getNodeRotationTrackClass, getNodeScaleTrackClass, getNodeTranslationTrackClass, getNodeEulerRotationTrackClass, getFixedGeometryCacheTrackClass, getPCAGeometryCacheTrackClass, getMorphTrackClass } from './scene/animation.js';
|
|
16
16
|
import '../../scene/scene.js';
|
|
17
17
|
import '../../values.js';
|
|
18
18
|
import '../../render/render_queue.js';
|
|
@@ -23,22 +23,24 @@ import '../../material/lambert.js';
|
|
|
23
23
|
import '../../material/blinn.js';
|
|
24
24
|
import '../../material/unlit.js';
|
|
25
25
|
import '../../material/particle.js';
|
|
26
|
+
import '../../material/subsurfaceprofile.js';
|
|
26
27
|
import '../../material/meshmaterial.js';
|
|
27
28
|
import '../../material/grassmaterial.js';
|
|
28
29
|
import '../../material/terrain-cm.js';
|
|
29
30
|
import '../../material/pbrmr.js';
|
|
30
31
|
import '../../material/pbrsg.js';
|
|
32
|
+
import '../../material/mtoon.js';
|
|
31
33
|
import '../../material/pbrblueprint.js';
|
|
32
34
|
import '../../material/sprite.js';
|
|
33
35
|
import '../../material/sprite_std.js';
|
|
34
|
-
import '../../material/msdf_text.js';
|
|
35
36
|
import { PBRBlockNode, SpriteBlockNode, VertexBlockNode } from '../blueprint/material/pbr.js';
|
|
36
37
|
import { ConstantScalarNode, ConstantVec2Node, ConstantVec3Node, ConstantVec4Node, ConstantBooleanNode, ConstantBVec2Node, ConstantBVec3Node, ConstantBVec4Node } from '../blueprint/common/constants.js';
|
|
37
38
|
import { ConstantTexture2DNode, ConstantTexture2DArrayNode, ConstantTextureCubeNode, PannerNode, TextureSampleNode } from '../blueprint/material/texture.js';
|
|
38
39
|
import { MakeVectorNode, SwizzleNode, EqualNode, NotEqualNode, LogicallyAndNode, LogicallyOrNode, CompComparisonNode, AnyConditionNode, AllConditionNode, SelectionNode, Degrees2RadiansNode, Radians2DegreesNode, SinNode, CosNode, TanNode, ArcSinNode, ArcCosNode, ArcTanNode, ArcTan2Node, SinHNode, CosHNode, TanHNode, ArcsineHNode, ArccosineHNode, ArctangentHNode, ExpNode, Exp2Node, LogNode, Log2Node, SqrtNode, InvSqrtNode, AbsNode, SignNode, FloorNode, CeilNode, FractNode, DDXNode, DDYNode, FWidthNode, CompAddNode, CompSubNode, CompMulNode, CompDivNode, ModNode, MinNode, MaxNode, PowNode, StepNode, SmoothStepNode, FmaNode, ClampNode, SaturateNode, MixNode, NormalizeNode, TransformNode, RotateAboutAxisNode, FaceForwardNode, ReflectNode, RefractNode, LengthNode, DistanceNode, DotProductNode, CrossProductNode, Hash1Node, Hash2Node, Hash3Node, SimplexNoise2DNode, PerlinNoise2DNode } from '../blueprint/common/math.js';
|
|
39
|
-
import {
|
|
40
|
+
import { VertexColorNode, VertexUVNode, VertexPositionNode, PixelWorldPositionNode, VertexNormalNode, PixelNormalNode, VertexTangentNode, VertexBinormalNode, ViewMatrixNode, ProjectionMatrixNode, ViewProjMatrixNode, InvProjMatrixNode, InvViewProjMatrixNode, BillboardMatrixNode, CameraPositionNode, CameraVectorNode, CameraNearFarNode, SkyEnvTextureNode, ElapsedTimeNode, ResolveVertexPositionNode, ResolveVertexTangentNode, ResolveVertexNormalNode, VertexOutputNode, VertexIndexNode, InstanceIndexNode } from '../blueprint/material/inputs.js';
|
|
40
41
|
import { FunctionInputNode, FunctionOutputNode, FunctionCallNode } from '../blueprint/material/func.js';
|
|
41
42
|
import '../../render/rendergraph/forward_plus_builder.js';
|
|
43
|
+
import '../../render/lightpass.js';
|
|
42
44
|
import '../../render/sky.js';
|
|
43
45
|
import '../../render/clipmap.js';
|
|
44
46
|
import '../../shaders/atmosphere.js';
|
|
@@ -47,6 +49,7 @@ import '../../shadow/shadowmapper.js';
|
|
|
47
49
|
import '../../scene/mesh.js';
|
|
48
50
|
import '../../scene/basesprite.js';
|
|
49
51
|
import '../../scene/meshdrawable.js';
|
|
52
|
+
import '../../material/msdf_text.js';
|
|
50
53
|
import '../../scene/water.js';
|
|
51
54
|
import '../../scene/particlesys.js';
|
|
52
55
|
import '../../scene/batchgroup.js';
|
|
@@ -60,8 +63,8 @@ import '../../animation/joint_dynamics/collision.js';
|
|
|
60
63
|
import '../../animation/joint_dynamics/solver.js';
|
|
61
64
|
import '../../animation/joint_dynamics/joint_dynamics_system.js';
|
|
62
65
|
import { getJSONPropClass, getJSONNumberClass, getJSONStringClass, getJSONBoolClass, getJSONObjectClass, getJSONArrayClass } from './json.js';
|
|
66
|
+
import { getScriptAttachmentClass } from './scene/script.js';
|
|
63
67
|
import { getSpriteClass } from './scene/sprite.js';
|
|
64
|
-
import { getTextSpriteClass, getMSDFTextSpriteClass, getMSDFTextClass } from './scene/text.js';
|
|
65
68
|
|
|
66
69
|
const defaultValues = {
|
|
67
70
|
bool: false,
|
|
@@ -168,9 +171,9 @@ const defaultValues = {
|
|
|
168
171
|
getScriptAttachmentClass(),
|
|
169
172
|
getAABBClass(),
|
|
170
173
|
getInterpolatorClass(),
|
|
174
|
+
getSkeletonClass(),
|
|
171
175
|
getSkeletonRigClass(),
|
|
172
176
|
getSkinBindingClass(),
|
|
173
|
-
getSkeletonClass(),
|
|
174
177
|
getJointDynamicsModifierClass(),
|
|
175
178
|
getAnimationClass(this),
|
|
176
179
|
getPropTrackClass(this),
|
|
@@ -196,17 +199,19 @@ const defaultValues = {
|
|
|
196
199
|
getPunctualLightClass(),
|
|
197
200
|
getDirectionalLightClass(),
|
|
198
201
|
getSpotLightClass(),
|
|
199
|
-
getRectLightClass(),
|
|
200
202
|
getPointLightClass(),
|
|
203
|
+
getRectLightClass(),
|
|
201
204
|
getCameraClass(),
|
|
202
205
|
getPerspectiveCameraClass(),
|
|
203
206
|
getOrthoCameraClass(),
|
|
204
207
|
getBatchGroupClass(),
|
|
205
208
|
getSceneClass(this),
|
|
209
|
+
getSubsurfaceProfileClass(),
|
|
206
210
|
...getMeshMaterialClass(),
|
|
207
211
|
...getPBRBluePrintMaterialClass(),
|
|
208
212
|
...getSpriteBlueprintMaterialClass(),
|
|
209
213
|
...getUnlitMaterialClass(this),
|
|
214
|
+
...getMToonMaterialClass(this),
|
|
210
215
|
...getLambertMaterialClass(this),
|
|
211
216
|
...getBlinnMaterialClass(this),
|
|
212
217
|
...getPBRMetallicRoughnessMaterialClass(this),
|
|
@@ -216,12 +221,12 @@ const defaultValues = {
|
|
|
216
221
|
...getStandardSpriteMaterialClass(this),
|
|
217
222
|
getBoxShapeClass(),
|
|
218
223
|
getBoxFrameShapeClass(),
|
|
224
|
+
getCapsuleShapeClass(),
|
|
219
225
|
getSphereShapeClass(),
|
|
220
226
|
getTorusShapeClass(),
|
|
221
227
|
getCylinderShapeClass(),
|
|
222
228
|
getPlaneShapeClass(),
|
|
223
229
|
getTetrahedronShapeClass(),
|
|
224
|
-
getCapsuleShapeClass(),
|
|
225
230
|
ConstantScalarNode.getSerializationCls(),
|
|
226
231
|
ConstantVec2Node.getSerializationCls(),
|
|
227
232
|
ConstantVec3Node.getSerializationCls(),
|
|
@@ -301,9 +306,6 @@ const defaultValues = {
|
|
|
301
306
|
Hash3Node.getSerializationCls(),
|
|
302
307
|
SimplexNoise2DNode.getSerializationCls(),
|
|
303
308
|
PerlinNoise2DNode.getSerializationCls(),
|
|
304
|
-
VertexOutputNode.getSerializationCls(),
|
|
305
|
-
VertexIndexNode.getSerializationCls(),
|
|
306
|
-
InstanceIndexNode.getSerializationCls(),
|
|
307
309
|
VertexColorNode.getSerializationCls(),
|
|
308
310
|
VertexUVNode.getSerializationCls(),
|
|
309
311
|
VertexPositionNode.getSerializationCls(),
|
|
@@ -333,7 +335,10 @@ const defaultValues = {
|
|
|
333
335
|
FunctionOutputNode.getSerializationCls(),
|
|
334
336
|
FunctionCallNode.getSerializationCls(this),
|
|
335
337
|
PannerNode.getSerializationCls(),
|
|
336
|
-
TextureSampleNode.getSerializationCls()
|
|
338
|
+
TextureSampleNode.getSerializationCls(),
|
|
339
|
+
VertexOutputNode.getSerializationCls(),
|
|
340
|
+
VertexIndexNode.getSerializationCls(),
|
|
341
|
+
InstanceIndexNode.getSerializationCls()
|
|
337
342
|
].map((val)=>[
|
|
338
343
|
val.ctor,
|
|
339
344
|
val
|
|
@@ -386,15 +391,7 @@ const defaultValues = {
|
|
|
386
391
|
*
|
|
387
392
|
* @returns The `SerializableClass` metadata, or `null` if not found.
|
|
388
393
|
*/ getClassByConstructor(ctor) {
|
|
389
|
-
|
|
390
|
-
while(typeof current === 'function' && current !== Function.prototype){
|
|
391
|
-
const cls = this._classMap.get(current);
|
|
392
|
-
if (cls) {
|
|
393
|
-
return cls;
|
|
394
|
-
}
|
|
395
|
-
current = Object.getPrototypeOf(current);
|
|
396
|
-
}
|
|
397
|
-
return null;
|
|
394
|
+
return this._classMap.get(ctor) ?? null;
|
|
398
395
|
}
|
|
399
396
|
/**
|
|
400
397
|
* Get serialization metadata by an object instance.
|
|
@@ -443,27 +440,15 @@ const defaultValues = {
|
|
|
443
440
|
return this._clsPropMap.get(cls) ?? null;
|
|
444
441
|
}
|
|
445
442
|
/**
|
|
446
|
-
* Get all properties declared on a
|
|
447
|
-
*
|
|
448
|
-
* @param cls - Serializable class metadata.
|
|
449
|
-
*
|
|
450
|
-
* @returns An array of `PropertyAccessor` entries, or `null` if none.
|
|
443
|
+
* Get all properties declared on a class, including inherited serializable properties.
|
|
451
444
|
*/ getAllPropertiesByClass(cls) {
|
|
452
|
-
const props =
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
if (!props.has(prop.name)) {
|
|
458
|
-
props.set(prop.name, prop);
|
|
459
|
-
}
|
|
460
|
-
}
|
|
461
|
-
}
|
|
462
|
-
cls = this.getClassByConstructor(cls.parent);
|
|
445
|
+
const props = [];
|
|
446
|
+
let current = cls;
|
|
447
|
+
while(current){
|
|
448
|
+
props.unshift(...this.getPropertiesByClass(current) ?? []);
|
|
449
|
+
current = current.parent ? this.getClassByConstructor(current.parent) : null;
|
|
463
450
|
}
|
|
464
|
-
return
|
|
465
|
-
...props.values()
|
|
466
|
-
];
|
|
451
|
+
return props;
|
|
467
452
|
}
|
|
468
453
|
/**
|
|
469
454
|
* Get a property accessor by class and property name.
|
|
@@ -541,62 +526,23 @@ const defaultValues = {
|
|
|
541
526
|
}
|
|
542
527
|
}
|
|
543
528
|
/**
|
|
544
|
-
* Register a model loader.
|
|
545
|
-
*
|
|
546
|
-
* @param mimeType - What MIME type of files this loader can load
|
|
547
|
-
* @param loader - A concrete model loader implementation.
|
|
548
|
-
*/ setModelLoader(mimeType, loader) {
|
|
549
|
-
this._assetManager.setModelLoader(mimeType, loader);
|
|
550
|
-
}
|
|
551
|
-
/**
|
|
552
529
|
* Fetch a binary asset by ID via the asset manager.
|
|
553
530
|
*
|
|
554
531
|
* @remarks
|
|
555
532
|
* - Associates the returned data with the given ID for future reverse lookup.
|
|
556
533
|
* - The ID is typically a VFS path or locator.
|
|
557
534
|
*
|
|
558
|
-
* @param
|
|
535
|
+
* @param id - Asset identifier or path.
|
|
559
536
|
*
|
|
560
537
|
* @returns A Promise that resolves to the binary content, or `null` if not found.
|
|
561
|
-
*/ async fetchBinary(
|
|
562
|
-
const
|
|
563
|
-
const data = await this._assetManager.fetchBinaryData(id, null, null, options);
|
|
538
|
+
*/ async fetchBinary(id) {
|
|
539
|
+
const data = await this._assetManager.fetchBinaryData(id);
|
|
564
540
|
if (data) {
|
|
565
541
|
this._allocated.set(data, id);
|
|
566
542
|
}
|
|
567
543
|
return data;
|
|
568
544
|
}
|
|
569
545
|
/**
|
|
570
|
-
* Fetch a text asset by ID via the asset manager.
|
|
571
|
-
*
|
|
572
|
-
* @param path - VFS path of TTF/OTF file.
|
|
573
|
-
* @returns A Promise that resolves to the font asset, or `null` if not found.
|
|
574
|
-
*/ async fetchFontAsset(path, options) {
|
|
575
|
-
const id = this.VFS.normalizePath(path);
|
|
576
|
-
const fontAsset = await this._assetManager.fetchFontAsset(id, options);
|
|
577
|
-
if (fontAsset) {
|
|
578
|
-
this._allocated.set(fontAsset, id);
|
|
579
|
-
}
|
|
580
|
-
return fontAsset;
|
|
581
|
-
}
|
|
582
|
-
/**
|
|
583
|
-
* Get a cached font asset by ID if already loaded.
|
|
584
|
-
*
|
|
585
|
-
* @param path - VFS path of TTF/OTF file.
|
|
586
|
-
* @returns The cached FontAsset if it exists and is loaded, or null if not cached or still loading.
|
|
587
|
-
*/ getFontAsset(path) {
|
|
588
|
-
return this._assetManager.getFontAsset(this.VFS.normalizePath(path));
|
|
589
|
-
}
|
|
590
|
-
/**
|
|
591
|
-
* Removes a cached font asset entry by asset instance or asset ID.
|
|
592
|
-
*
|
|
593
|
-
* @param asset - Loaded font asset instance or its asset ID/path.
|
|
594
|
-
* @returns `true` if a cache entry existed and was removed.
|
|
595
|
-
*/ releaseFontAsset(asset) {
|
|
596
|
-
const path = typeof asset === 'string' ? asset : this.getAssetId(asset);
|
|
597
|
-
return path ? this._assetManager.releaseFontAsset(this.VFS.normalizePath(path)) : false;
|
|
598
|
-
}
|
|
599
|
-
/**
|
|
600
546
|
* Serialize an object to a JSON structure using registered class metadata.
|
|
601
547
|
*
|
|
602
548
|
* @remarks
|
|
@@ -723,7 +669,7 @@ const defaultValues = {
|
|
|
723
669
|
/**
|
|
724
670
|
* Load a model by ID and track the allocation for reverse lookup.
|
|
725
671
|
*
|
|
726
|
-
* @param
|
|
672
|
+
* @param id - Model identifier or path.
|
|
727
673
|
* @param scene - Scene into which the model is loaded.
|
|
728
674
|
* @param options - Optional model fetch options.
|
|
729
675
|
*
|
|
@@ -756,12 +702,11 @@ const defaultValues = {
|
|
|
756
702
|
/**
|
|
757
703
|
* Load a texture by ID and track the allocation for reverse lookup.
|
|
758
704
|
*
|
|
759
|
-
* @param
|
|
705
|
+
* @param id - Texture identifier or path.
|
|
760
706
|
* @param options - Optional texture fetch options.
|
|
761
707
|
*
|
|
762
708
|
* @returns A Promise resolving to the loaded texture, or `null` if failed.
|
|
763
|
-
*/ async fetchTexture(
|
|
764
|
-
const id = this.VFS.normalizePath(path);
|
|
709
|
+
*/ async fetchTexture(id, options) {
|
|
765
710
|
const texture = await this._assetManager.fetchTexture(id, options);
|
|
766
711
|
if (texture) {
|
|
767
712
|
this._allocated.set(texture, id);
|
|
@@ -771,11 +716,10 @@ const defaultValues = {
|
|
|
771
716
|
/**
|
|
772
717
|
* Load a material by ID and track the allocation for reverse lookup.
|
|
773
718
|
*
|
|
774
|
-
* @param
|
|
719
|
+
* @param id - Material identifier or path.
|
|
775
720
|
*
|
|
776
721
|
* @returns A Promise resolving to the loaded material, or `null` if failed.
|
|
777
|
-
*/ async fetchMaterial(
|
|
778
|
-
const id = this.VFS.normalizePath(path);
|
|
722
|
+
*/ async fetchMaterial(id, options) {
|
|
779
723
|
const material = await this._assetManager.fetchMaterial(id, options);
|
|
780
724
|
if (material) {
|
|
781
725
|
this._allocated.set(material, id);
|
|
@@ -797,13 +741,17 @@ const defaultValues = {
|
|
|
797
741
|
this._assetManager.invalidateBluePrint(path);
|
|
798
742
|
}
|
|
799
743
|
/**
|
|
744
|
+
* Register a model loader by MIME type.
|
|
745
|
+
*/ setModelLoader(mimeType, loader) {
|
|
746
|
+
this._assetManager.setModelLoader(mimeType, loader);
|
|
747
|
+
}
|
|
748
|
+
/**
|
|
800
749
|
* Load a primitive by ID and track the allocation for reverse lookup.
|
|
801
750
|
*
|
|
802
|
-
* @param
|
|
751
|
+
* @param id - Primitive identifier or path.
|
|
803
752
|
*
|
|
804
753
|
* @returns A Promise resolving to the loaded primitive, or `null` if failed.
|
|
805
|
-
*/ async fetchPrimitive(
|
|
806
|
-
const id = this.VFS.normalizePath(path);
|
|
754
|
+
*/ async fetchPrimitive(id, options) {
|
|
807
755
|
const primitive = await this._assetManager.fetchPrimitive(id, options);
|
|
808
756
|
if (primitive) {
|
|
809
757
|
this._allocated.set(primitive, id);
|
|
@@ -811,6 +759,27 @@ const defaultValues = {
|
|
|
811
759
|
return primitive;
|
|
812
760
|
}
|
|
813
761
|
/**
|
|
762
|
+
* Load a font asset by path and track the allocation for reverse lookup.
|
|
763
|
+
*/ async fetchFontAsset(path, options) {
|
|
764
|
+
const id = this.VFS.normalizePath(path);
|
|
765
|
+
const fontAsset = await this._assetManager.fetchFontAsset(id, options);
|
|
766
|
+
if (fontAsset) {
|
|
767
|
+
this._allocated.set(fontAsset, id);
|
|
768
|
+
}
|
|
769
|
+
return fontAsset;
|
|
770
|
+
}
|
|
771
|
+
/**
|
|
772
|
+
* Returns the cached font asset if it is already loaded.
|
|
773
|
+
*/ getFontAsset(path) {
|
|
774
|
+
return this._assetManager.getFontAsset(this.VFS.normalizePath(path));
|
|
775
|
+
}
|
|
776
|
+
/**
|
|
777
|
+
* Releases a cached font asset.
|
|
778
|
+
*/ releaseFontAsset(asset) {
|
|
779
|
+
const path = typeof asset === 'string' ? asset : this.getAssetId(asset);
|
|
780
|
+
return path ? this._assetManager.releaseFontAsset(this.VFS.normalizePath(path)) : false;
|
|
781
|
+
}
|
|
782
|
+
/**
|
|
814
783
|
* Load a prefab content.
|
|
815
784
|
* @param path - Path to the prefab JSON file in VFS.
|
|
816
785
|
* @returns A Promise resolving to the prefab json object, or `null` on failure.
|
|
@@ -842,7 +811,6 @@ const defaultValues = {
|
|
|
842
811
|
node.prefabId = tmpNode.get().prefabId;
|
|
843
812
|
node.parent = parent;
|
|
844
813
|
node.persistentId = randomUUID();
|
|
845
|
-
node.animationSet.resetSkeletonModifiers();
|
|
846
814
|
tmpNode.dispose();
|
|
847
815
|
return node;
|
|
848
816
|
} catch (err) {
|
|
@@ -925,7 +893,7 @@ const defaultValues = {
|
|
|
925
893
|
const u = q.shift();
|
|
926
894
|
const ins = gs.incoming[u] || [];
|
|
927
895
|
for (const conn of ins){
|
|
928
|
-
const v = conn.targetNodeId; //
|
|
896
|
+
const v = conn.targetNodeId; // 前驱
|
|
929
897
|
if (!reachable.has(v)) {
|
|
930
898
|
reachable.add(v);
|
|
931
899
|
q.push(v);
|
|
@@ -965,7 +933,7 @@ const defaultValues = {
|
|
|
965
933
|
for (const u of currentLevel){
|
|
966
934
|
const ins = gs.incoming[u] || [];
|
|
967
935
|
for (const conn of ins){
|
|
968
|
-
const v = conn.targetNodeId; //
|
|
936
|
+
const v = conn.targetNodeId; // 前驱
|
|
969
937
|
if (!sub.has(v)) {
|
|
970
938
|
continue;
|
|
971
939
|
}
|