@anov/3d 0.0.4-alpha.1 → 0.0.4-alpha13
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/README.md +1 -144
- package/dist/applicationApi.d.ts +34 -0
- package/dist/{core/cssRenderer.js → applicationApi.js} +53 -21
- package/dist/environment/index.d.ts +27 -0
- package/dist/environment/index.js +84 -0
- package/dist/environment/time/index.d.ts +12 -0
- package/dist/environment/time/index.js +27 -0
- package/dist/environment/weather/type.d.ts +15 -0
- package/dist/environment/weather/type.js +27 -0
- package/dist/hooksManager.d.ts +2 -0
- package/dist/hooksManager.js +15 -0
- package/dist/index.d.ts +15 -3
- package/dist/index.js +38 -5
- package/dist/messageStatus.d.ts +49 -0
- package/dist/messageStatus.js +50 -0
- package/dist/utils/index.d.ts +11 -50
- package/dist/utils/index.js +29 -92
- package/dist/utils/messageFn.d.ts +12 -0
- package/dist/utils/messageFn.js +33 -0
- package/package.json +8 -24
- package/dist/commonEnu.d.ts +0 -5
- package/dist/commonEnu.js +0 -6
- package/dist/core/camera.d.ts +0 -32
- package/dist/core/camera.js +0 -74
- package/dist/core/control/transformControls.d.ts +0 -12
- package/dist/core/control/transformControls.js +0 -72
- package/dist/core/cssRenderer.d.ts +0 -17
- package/dist/core/events.d.ts +0 -16
- package/dist/core/events.js +0 -38
- package/dist/core/global/global.d.ts +0 -27
- package/dist/core/global/global.js +0 -72
- package/dist/core/global/globalControl.d.ts +0 -17
- package/dist/core/global/globalControl.js +0 -62
- package/dist/core/group.d.ts +0 -57
- package/dist/core/group.js +0 -157
- package/dist/core/line.d.ts +0 -13
- package/dist/core/line.js +0 -83
- package/dist/core/mesh.d.ts +0 -59
- package/dist/core/mesh.js +0 -180
- package/dist/core/model.d.ts +0 -30
- package/dist/core/model.js +0 -109
- package/dist/core/scene.d.ts +0 -175
- package/dist/core/scene.js +0 -381
- package/dist/core/use/useScene.d.ts +0 -10
- package/dist/core/use/useScene.js +0 -14
- package/dist/core/use/useframe.d.ts +0 -6
- package/dist/core/use/useframe.js +0 -11
- package/dist/export.d.ts +0 -40
- package/dist/export.js +0 -36
- package/dist/threeCell.d.ts +0 -8
- package/dist/threeCell.js +0 -16
- package/dist/type.d.ts +0 -3
- package/dist/type.js +0 -1
- package/dist/utils/createElement.d.ts +0 -103
- package/dist/utils/createElement.js +0 -145
- package/dist/utils/createLabel.d.ts +0 -2
- package/dist/utils/createLabel.js +0 -4
- package/dist/utils/line.d.ts +0 -0
- package/dist/utils/line.js +0 -0
- package/dist/utils/move.d.ts +0 -48
- package/dist/utils/move.js +0 -149
- package/examples/fonts/LICENSE +0 -13
- package/examples/fonts/README.md +0 -11
- package/examples/fonts/droid/NOTICE +0 -190
- package/examples/fonts/droid/README.txt +0 -18
- package/examples/fonts/droid/droid_sans_bold.typeface.json +0 -1
- package/examples/fonts/droid/droid_sans_mono_regular.typeface.json +0 -1
- package/examples/fonts/droid/droid_sans_regular.typeface.json +0 -1
- package/examples/fonts/droid/droid_serif_bold.typeface.json +0 -1
- package/examples/fonts/droid/droid_serif_regular.typeface.json +0 -1
- package/examples/fonts/gentilis_bold.typeface.json +0 -1
- package/examples/fonts/gentilis_regular.typeface.json +0 -1
- package/examples/fonts/helvetiker_bold.typeface.json +0 -1
- package/examples/fonts/helvetiker_regular.typeface.json +0 -1
- package/examples/fonts/optimer_bold.typeface.json +0 -1
- package/examples/fonts/optimer_regular.typeface.json +0 -1
- package/examples/fonts/ttf/README.md +0 -9
- package/examples/fonts/ttf/kenpixel.ttf +0 -0
- package/examples/jsm/animation/AnimationClipCreator.js +0 -116
- package/examples/jsm/animation/CCDIKSolver.js +0 -482
- package/examples/jsm/animation/MMDAnimationHelper.js +0 -1207
- package/examples/jsm/animation/MMDPhysics.js +0 -1406
- package/examples/jsm/cameras/CinematicCamera.js +0 -208
- package/examples/jsm/capabilities/WebGL.js +0 -91
- package/examples/jsm/capabilities/WebGPU.js +0 -53
- package/examples/jsm/controls/ArcballControls.js +0 -3224
- package/examples/jsm/controls/DragControls.js +0 -220
- package/examples/jsm/controls/FirstPersonControls.js +0 -325
- package/examples/jsm/controls/FlyControls.js +0 -300
- package/examples/jsm/controls/MapControls.js +0 -28
- package/examples/jsm/controls/OrbitControls.js +0 -1388
- package/examples/jsm/controls/PointerLockControls.js +0 -162
- package/examples/jsm/controls/TrackballControls.js +0 -828
- package/examples/jsm/controls/TransformControls.js +0 -1557
- package/examples/jsm/csm/CSM.js +0 -384
- package/examples/jsm/csm/CSMFrustum.js +0 -152
- package/examples/jsm/csm/CSMHelper.js +0 -193
- package/examples/jsm/csm/CSMShader.js +0 -252
- package/examples/jsm/curves/CurveExtras.js +0 -422
- package/examples/jsm/curves/NURBSCurve.js +0 -80
- package/examples/jsm/curves/NURBSSurface.js +0 -52
- package/examples/jsm/curves/NURBSUtils.js +0 -487
- package/examples/jsm/effects/AnaglyphEffect.js +0 -154
- package/examples/jsm/effects/AsciiEffect.js +0 -263
- package/examples/jsm/effects/OutlineEffect.js +0 -539
- package/examples/jsm/effects/ParallaxBarrierEffect.js +0 -119
- package/examples/jsm/effects/PeppersGhostEffect.js +0 -153
- package/examples/jsm/effects/StereoEffect.js +0 -55
- package/examples/jsm/environments/DebugEnvironment.js +0 -52
- package/examples/jsm/environments/RoomEnvironment.js +0 -148
- package/examples/jsm/exporters/DRACOExporter.js +0 -267
- package/examples/jsm/exporters/EXRExporter.js +0 -501
- package/examples/jsm/exporters/GLTFExporter.js +0 -3161
- package/examples/jsm/exporters/KTX2Exporter.js +0 -292
- package/examples/jsm/exporters/MMDExporter.js +0 -217
- package/examples/jsm/exporters/OBJExporter.js +0 -284
- package/examples/jsm/exporters/PLYExporter.js +0 -528
- package/examples/jsm/exporters/STLExporter.js +0 -199
- package/examples/jsm/exporters/USDZExporter.js +0 -711
- package/examples/jsm/geometries/BoxLineGeometry.js +0 -69
- package/examples/jsm/geometries/ConvexGeometry.js +0 -53
- package/examples/jsm/geometries/DecalGeometry.js +0 -356
- package/examples/jsm/geometries/ParametricGeometries.js +0 -254
- package/examples/jsm/geometries/ParametricGeometry.js +0 -139
- package/examples/jsm/geometries/RoundedBoxGeometry.js +0 -155
- package/examples/jsm/geometries/TeapotGeometry.js +0 -704
- package/examples/jsm/geometries/TextGeometry.js +0 -57
- package/examples/jsm/helpers/LightProbeHelper.js +0 -130
- package/examples/jsm/helpers/OctreeHelper.js +0 -73
- package/examples/jsm/helpers/PositionalAudioHelper.js +0 -109
- package/examples/jsm/helpers/RectAreaLightHelper.js +0 -85
- package/examples/jsm/helpers/VertexNormalsHelper.js +0 -96
- package/examples/jsm/helpers/VertexTangentsHelper.js +0 -88
- package/examples/jsm/helpers/ViewHelper.js +0 -333
- package/examples/jsm/interactive/HTMLMesh.js +0 -565
- package/examples/jsm/interactive/InteractiveGroup.js +0 -116
- package/examples/jsm/interactive/SelectionBox.js +0 -227
- package/examples/jsm/interactive/SelectionHelper.js +0 -104
- package/examples/jsm/libs/ammo.wasm.js +0 -822
- package/examples/jsm/libs/ammo.wasm.wasm +0 -0
- package/examples/jsm/libs/basis/README.md +0 -46
- package/examples/jsm/libs/basis/basis_transcoder.js +0 -21
- package/examples/jsm/libs/basis/basis_transcoder.wasm +0 -0
- package/examples/jsm/libs/chevrotain.module.min.js +0 -141
- package/examples/jsm/libs/draco/README.md +0 -32
- package/examples/jsm/libs/draco/draco_decoder.js +0 -34
- package/examples/jsm/libs/draco/draco_decoder.wasm +0 -0
- package/examples/jsm/libs/draco/draco_encoder.js +0 -33
- package/examples/jsm/libs/draco/draco_wasm_wrapper.js +0 -117
- package/examples/jsm/libs/draco/gltf/draco_decoder.js +0 -33
- package/examples/jsm/libs/draco/gltf/draco_decoder.wasm +0 -0
- package/examples/jsm/libs/draco/gltf/draco_encoder.js +0 -33
- package/examples/jsm/libs/draco/gltf/draco_wasm_wrapper.js +0 -116
- package/examples/jsm/libs/ecsy.module.js +0 -1792
- package/examples/jsm/libs/fflate.module.js +0 -2474
- package/examples/jsm/libs/ktx-parse.module.js +0 -1
- package/examples/jsm/libs/lil-gui.module.min.js +0 -8
- package/examples/jsm/libs/lottie_canvas.module.js +0 -14844
- package/examples/jsm/libs/meshopt_decoder.module.js +0 -178
- package/examples/jsm/libs/mikktspace.module.js +0 -128
- package/examples/jsm/libs/mmdparser.module.js +0 -11530
- package/examples/jsm/libs/motion-controllers.module.js +0 -397
- package/examples/jsm/libs/opentype.module.js +0 -14568
- package/examples/jsm/libs/potpack.module.js +0 -125
- package/examples/jsm/libs/rhino3dm/rhino3dm.js +0 -21
- package/examples/jsm/libs/rhino3dm/rhino3dm.module.js +0 -16
- package/examples/jsm/libs/rhino3dm/rhino3dm.wasm +0 -0
- package/examples/jsm/libs/stats.module.js +0 -167
- package/examples/jsm/libs/tween.module.js +0 -803
- package/examples/jsm/libs/utif.module.js +0 -1579
- package/examples/jsm/libs/zstddec.module.js +0 -1
- package/examples/jsm/lights/IESSpotLight.js +0 -25
- package/examples/jsm/lights/LightProbeGenerator.js +0 -252
- package/examples/jsm/lights/RectAreaLightUniformsLib.js +0 -79
- package/examples/jsm/lines/Line2.js +0 -19
- package/examples/jsm/lines/LineGeometry.js +0 -79
- package/examples/jsm/lines/LineMaterial.js +0 -702
- package/examples/jsm/lines/LineSegments2.js +0 -361
- package/examples/jsm/lines/LineSegmentsGeometry.js +0 -241
- package/examples/jsm/lines/Wireframe.js +0 -56
- package/examples/jsm/lines/WireframeGeometry2.js +0 -24
- package/examples/jsm/loaders/3DMLoader.js +0 -1497
- package/examples/jsm/loaders/3MFLoader.js +0 -1478
- package/examples/jsm/loaders/AMFLoader.js +0 -521
- package/examples/jsm/loaders/BVHLoader.js +0 -437
- package/examples/jsm/loaders/ColladaLoader.js +0 -4122
- package/examples/jsm/loaders/DDSLoader.js +0 -274
- package/examples/jsm/loaders/DRACOLoader.js +0 -612
- package/examples/jsm/loaders/EXRLoader.js +0 -2309
- package/examples/jsm/loaders/FBXLoader.js +0 -4142
- package/examples/jsm/loaders/FontLoader.js +0 -183
- package/examples/jsm/loaders/GCodeLoader.js +0 -261
- package/examples/jsm/loaders/GLTFLoader.js +0 -4576
- package/examples/jsm/loaders/HDRCubeTextureLoader.js +0 -115
- package/examples/jsm/loaders/IESLoader.js +0 -337
- package/examples/jsm/loaders/KMZLoader.js +0 -130
- package/examples/jsm/loaders/KTX2Loader.js +0 -868
- package/examples/jsm/loaders/KTXLoader.js +0 -176
- package/examples/jsm/loaders/LDrawLoader.js +0 -2464
- package/examples/jsm/loaders/LUT3dlLoader.js +0 -151
- package/examples/jsm/loaders/LUTCubeLoader.js +0 -153
- package/examples/jsm/loaders/LWOLoader.js +0 -1052
- package/examples/jsm/loaders/LogLuvLoader.js +0 -606
- package/examples/jsm/loaders/LottieLoader.js +0 -77
- package/examples/jsm/loaders/MD2Loader.js +0 -399
- package/examples/jsm/loaders/MDDLoader.js +0 -102
- package/examples/jsm/loaders/MMDLoader.js +0 -2273
- package/examples/jsm/loaders/MTLLoader.js +0 -567
- package/examples/jsm/loaders/MaterialXLoader.js +0 -734
- package/examples/jsm/loaders/NRRDLoader.js +0 -699
- package/examples/jsm/loaders/OBJLoader.js +0 -905
- package/examples/jsm/loaders/PCDLoader.js +0 -467
- package/examples/jsm/loaders/PDBLoader.js +0 -232
- package/examples/jsm/loaders/PLYLoader.js +0 -771
- package/examples/jsm/loaders/PVRLoader.js +0 -251
- package/examples/jsm/loaders/RGBELoader.js +0 -468
- package/examples/jsm/loaders/RGBMLoader.js +0 -1065
- package/examples/jsm/loaders/STLLoader.js +0 -403
- package/examples/jsm/loaders/SVGLoader.js +0 -3172
- package/examples/jsm/loaders/TDSLoader.js +0 -1124
- package/examples/jsm/loaders/TGALoader.js +0 -517
- package/examples/jsm/loaders/TIFFLoader.js +0 -36
- package/examples/jsm/loaders/TTFLoader.js +0 -214
- package/examples/jsm/loaders/TiltLoader.js +0 -520
- package/examples/jsm/loaders/USDZLoader.js +0 -633
- package/examples/jsm/loaders/VOXLoader.js +0 -311
- package/examples/jsm/loaders/VRMLLoader.js +0 -3533
- package/examples/jsm/loaders/VTKLoader.js +0 -1163
- package/examples/jsm/loaders/XYZLoader.js +0 -106
- package/examples/jsm/loaders/lwo/IFFParser.js +0 -1218
- package/examples/jsm/loaders/lwo/LWO2Parser.js +0 -414
- package/examples/jsm/loaders/lwo/LWO3Parser.js +0 -373
- package/examples/jsm/materials/MeshGouraudMaterial.js +0 -420
- package/examples/jsm/math/Capsule.js +0 -137
- package/examples/jsm/math/ColorConverter.js +0 -36
- package/examples/jsm/math/ConvexHull.js +0 -1271
- package/examples/jsm/math/ImprovedNoise.js +0 -71
- package/examples/jsm/math/Lut.js +0 -204
- package/examples/jsm/math/MeshSurfaceSampler.js +0 -250
- package/examples/jsm/math/OBB.js +0 -423
- package/examples/jsm/math/Octree.js +0 -462
- package/examples/jsm/math/SimplexNoise.js +0 -444
- package/examples/jsm/misc/ConvexObjectBreaker.js +0 -519
- package/examples/jsm/misc/GPUComputationRenderer.js +0 -446
- package/examples/jsm/misc/Gyroscope.js +0 -66
- package/examples/jsm/misc/MD2Character.js +0 -276
- package/examples/jsm/misc/MD2CharacterComplex.js +0 -576
- package/examples/jsm/misc/MorphAnimMesh.js +0 -75
- package/examples/jsm/misc/MorphBlendMesh.js +0 -322
- package/examples/jsm/misc/ProgressiveLightMap.js +0 -323
- package/examples/jsm/misc/RollerCoaster.js +0 -566
- package/examples/jsm/misc/TubePainter.js +0 -205
- package/examples/jsm/misc/Volume.js +0 -473
- package/examples/jsm/misc/VolumeSlice.js +0 -229
- package/examples/jsm/modifiers/CurveModifier.js +0 -326
- package/examples/jsm/modifiers/EdgeSplitModifier.js +0 -279
- package/examples/jsm/modifiers/SimplifyModifier.js +0 -525
- package/examples/jsm/modifiers/TessellateModifier.js +0 -307
- package/examples/jsm/nodes/Nodes.js +0 -171
- package/examples/jsm/nodes/accessors/BitangentNode.js +0 -89
- package/examples/jsm/nodes/accessors/BufferAttributeNode.js +0 -99
- package/examples/jsm/nodes/accessors/BufferNode.js +0 -30
- package/examples/jsm/nodes/accessors/CameraNode.js +0 -98
- package/examples/jsm/nodes/accessors/CubeTextureNode.js +0 -103
- package/examples/jsm/nodes/accessors/ExtendedMaterialNode.js +0 -77
- package/examples/jsm/nodes/accessors/InstanceNode.js +0 -71
- package/examples/jsm/nodes/accessors/MaterialNode.js +0 -267
- package/examples/jsm/nodes/accessors/MaterialReferenceNode.js +0 -39
- package/examples/jsm/nodes/accessors/ModelNode.js +0 -34
- package/examples/jsm/nodes/accessors/ModelViewProjectionNode.js +0 -29
- package/examples/jsm/nodes/accessors/MorphNode.js +0 -70
- package/examples/jsm/nodes/accessors/NormalNode.js +0 -96
- package/examples/jsm/nodes/accessors/Object3DNode.js +0 -150
- package/examples/jsm/nodes/accessors/PointUVNode.js +0 -26
- package/examples/jsm/nodes/accessors/PositionNode.js +0 -104
- package/examples/jsm/nodes/accessors/ReferenceNode.js +0 -72
- package/examples/jsm/nodes/accessors/ReflectVectorNode.js +0 -35
- package/examples/jsm/nodes/accessors/SceneNode.js +0 -52
- package/examples/jsm/nodes/accessors/SkinningNode.js +0 -93
- package/examples/jsm/nodes/accessors/StorageBufferNode.js +0 -27
- package/examples/jsm/nodes/accessors/TangentNode.js +0 -103
- package/examples/jsm/nodes/accessors/TextureBicubicNode.js +0 -94
- package/examples/jsm/nodes/accessors/TextureNode.js +0 -271
- package/examples/jsm/nodes/accessors/TextureSizeNode.js +0 -35
- package/examples/jsm/nodes/accessors/UVNode.js +0 -47
- package/examples/jsm/nodes/accessors/UserDataNode.js +0 -29
- package/examples/jsm/nodes/code/CodeNode.js +0 -78
- package/examples/jsm/nodes/code/ExpressionNode.js +0 -37
- package/examples/jsm/nodes/code/FunctionCallNode.js +0 -96
- package/examples/jsm/nodes/code/FunctionNode.js +0 -127
- package/examples/jsm/nodes/code/ScriptableNode.js +0 -488
- package/examples/jsm/nodes/code/ScriptableValueNode.js +0 -167
- package/examples/jsm/nodes/core/ArrayUniformNode.js +0 -26
- package/examples/jsm/nodes/core/AttributeNode.js +0 -102
- package/examples/jsm/nodes/core/BypassNode.js +0 -45
- package/examples/jsm/nodes/core/CacheNode.js +0 -46
- package/examples/jsm/nodes/core/ConstNode.js +0 -32
- package/examples/jsm/nodes/core/ContextNode.js +0 -61
- package/examples/jsm/nodes/core/IndexNode.js +0 -66
- package/examples/jsm/nodes/core/InputNode.js +0 -83
- package/examples/jsm/nodes/core/LightingModel.js +0 -15
- package/examples/jsm/nodes/core/Node.js +0 -454
- package/examples/jsm/nodes/core/NodeAttribute.js +0 -15
- package/examples/jsm/nodes/core/NodeBuilder.js +0 -1016
- package/examples/jsm/nodes/core/NodeCache.js +0 -26
- package/examples/jsm/nodes/core/NodeCode.js +0 -15
- package/examples/jsm/nodes/core/NodeFrame.js +0 -110
- package/examples/jsm/nodes/core/NodeFunction.js +0 -22
- package/examples/jsm/nodes/core/NodeFunctionInput.js +0 -17
- package/examples/jsm/nodes/core/NodeKeywords.js +0 -80
- package/examples/jsm/nodes/core/NodeParser.js +0 -11
- package/examples/jsm/nodes/core/NodeUniform.js +0 -28
- package/examples/jsm/nodes/core/NodeUtils.js +0 -212
- package/examples/jsm/nodes/core/NodeVar.js +0 -14
- package/examples/jsm/nodes/core/NodeVarying.js +0 -17
- package/examples/jsm/nodes/core/PropertyNode.js +0 -61
- package/examples/jsm/nodes/core/StackNode.js +0 -99
- package/examples/jsm/nodes/core/TempNode.js +0 -58
- package/examples/jsm/nodes/core/UniformNode.js +0 -61
- package/examples/jsm/nodes/core/VarNode.js +0 -87
- package/examples/jsm/nodes/core/VaryingNode.js +0 -69
- package/examples/jsm/nodes/core/constants.js +0 -27
- package/examples/jsm/nodes/display/BlendModeNode.js +0 -99
- package/examples/jsm/nodes/display/BumpMapNode.js +0 -77
- package/examples/jsm/nodes/display/ColorAdjustmentNode.js +0 -100
- package/examples/jsm/nodes/display/ColorSpaceNode.js +0 -108
- package/examples/jsm/nodes/display/FrontFacingNode.js +0 -27
- package/examples/jsm/nodes/display/NormalMapNode.js +0 -106
- package/examples/jsm/nodes/display/PosterizeNode.js +0 -32
- package/examples/jsm/nodes/display/ToneMappingNode.js +0 -141
- package/examples/jsm/nodes/display/ViewportDepthNode.js +0 -69
- package/examples/jsm/nodes/display/ViewportDepthTextureNode.js +0 -34
- package/examples/jsm/nodes/display/ViewportNode.js +0 -115
- package/examples/jsm/nodes/display/ViewportSharedTextureNode.js +0 -31
- package/examples/jsm/nodes/display/ViewportTextureNode.js +0 -75
- package/examples/jsm/nodes/fog/FogExp2Node.js +0 -35
- package/examples/jsm/nodes/fog/FogNode.js +0 -37
- package/examples/jsm/nodes/fog/FogRangeNode.js +0 -34
- package/examples/jsm/nodes/functions/BSDF/BRDF_GGX.js +0 -40
- package/examples/jsm/nodes/functions/BSDF/BRDF_Lambert.js +0 -9
- package/examples/jsm/nodes/functions/BSDF/BRDF_Sheen.js +0 -43
- package/examples/jsm/nodes/functions/BSDF/DFGApprox.js +0 -29
- package/examples/jsm/nodes/functions/BSDF/D_GGX.js +0 -18
- package/examples/jsm/nodes/functions/BSDF/EnvironmentBRDF.js +0 -13
- package/examples/jsm/nodes/functions/BSDF/F_Schlick.js +0 -16
- package/examples/jsm/nodes/functions/BSDF/Schlick_to_F0.js +0 -13
- package/examples/jsm/nodes/functions/BSDF/V_GGX_SmithCorrelated.js +0 -20
- package/examples/jsm/nodes/functions/PhongLightingModel.js +0 -67
- package/examples/jsm/nodes/functions/PhysicalLightingModel.js +0 -343
- package/examples/jsm/nodes/functions/material/getGeometryRoughness.js +0 -13
- package/examples/jsm/nodes/functions/material/getRoughness.js +0 -18
- package/examples/jsm/nodes/geometry/RangeNode.js +0 -104
- package/examples/jsm/nodes/gpgpu/ComputeNode.js +0 -85
- package/examples/jsm/nodes/lighting/AONode.js +0 -27
- package/examples/jsm/nodes/lighting/AmbientLightNode.js +0 -27
- package/examples/jsm/nodes/lighting/AnalyticLightNode.js +0 -184
- package/examples/jsm/nodes/lighting/DirectionalLightNode.js +0 -40
- package/examples/jsm/nodes/lighting/EnvironmentNode.js +0 -191
- package/examples/jsm/nodes/lighting/HemisphereLightNode.js +0 -55
- package/examples/jsm/nodes/lighting/IESSpotLightNode.js +0 -39
- package/examples/jsm/nodes/lighting/LightNode.js +0 -57
- package/examples/jsm/nodes/lighting/LightUtils.js +0 -17
- package/examples/jsm/nodes/lighting/LightingContextNode.js +0 -102
- package/examples/jsm/nodes/lighting/LightingNode.js +0 -21
- package/examples/jsm/nodes/lighting/LightsNode.js +0 -128
- package/examples/jsm/nodes/lighting/PointLightNode.js +0 -68
- package/examples/jsm/nodes/lighting/SpotLightNode.js +0 -89
- package/examples/jsm/nodes/loaders/NodeLoader.js +0 -108
- package/examples/jsm/nodes/loaders/NodeMaterialLoader.js +0 -59
- package/examples/jsm/nodes/loaders/NodeObjectLoader.js +0 -70
- package/examples/jsm/nodes/materials/LineBasicNodeMaterial.js +0 -28
- package/examples/jsm/nodes/materials/Materials.js +0 -12
- package/examples/jsm/nodes/materials/MeshBasicNodeMaterial.js +0 -27
- package/examples/jsm/nodes/materials/MeshLambertNodeMaterial.js +0 -34
- package/examples/jsm/nodes/materials/MeshNormalNodeMaterial.js +0 -40
- package/examples/jsm/nodes/materials/MeshPhongNodeMaterial.js +0 -65
- package/examples/jsm/nodes/materials/MeshPhysicalNodeMaterial.js +0 -128
- package/examples/jsm/nodes/materials/MeshStandardNodeMaterial.js +0 -80
- package/examples/jsm/nodes/materials/NodeMaterial.js +0 -536
- package/examples/jsm/nodes/materials/PointsNodeMaterial.js +0 -49
- package/examples/jsm/nodes/materials/SpriteNodeMaterial.js +0 -103
- package/examples/jsm/nodes/materialx/DISCLAIMER.md +0 -199
- package/examples/jsm/nodes/materialx/MaterialXNodes.js +0 -68
- package/examples/jsm/nodes/materialx/lib/mx_hsv.js +0 -56
- package/examples/jsm/nodes/materialx/lib/mx_noise.js +0 -618
- package/examples/jsm/nodes/materialx/lib/mx_transform_color.js +0 -19
- package/examples/jsm/nodes/math/CondNode.js +0 -86
- package/examples/jsm/nodes/math/MathNode.js +0 -359
- package/examples/jsm/nodes/math/OperatorNode.js +0 -269
- package/examples/jsm/nodes/parsers/GLSLNodeFunction.js +0 -152
- package/examples/jsm/nodes/parsers/GLSLNodeParser.js +0 -14
- package/examples/jsm/nodes/procedural/CheckerNode.js +0 -42
- package/examples/jsm/nodes/shadernode/ShaderNode.js +0 -420
- package/examples/jsm/nodes/utils/ArrayElementNode.js +0 -33
- package/examples/jsm/nodes/utils/ConvertNode.js +0 -65
- package/examples/jsm/nodes/utils/DiscardNode.js +0 -26
- package/examples/jsm/nodes/utils/EquirectUVNode.js +0 -33
- package/examples/jsm/nodes/utils/JoinNode.js +0 -51
- package/examples/jsm/nodes/utils/LoopNode.js +0 -186
- package/examples/jsm/nodes/utils/MatcapUVNode.js +0 -30
- package/examples/jsm/nodes/utils/MaxMipLevelNode.js +0 -46
- package/examples/jsm/nodes/utils/OscNode.js +0 -81
- package/examples/jsm/nodes/utils/PackingNode.js +0 -55
- package/examples/jsm/nodes/utils/RemapNode.js +0 -42
- package/examples/jsm/nodes/utils/RotateUVNode.js +0 -43
- package/examples/jsm/nodes/utils/SpecularMIPLevelNode.js +0 -37
- package/examples/jsm/nodes/utils/SplitNode.js +0 -104
- package/examples/jsm/nodes/utils/SpriteSheetUVNode.js +0 -41
- package/examples/jsm/nodes/utils/TimerNode.js +0 -94
- package/examples/jsm/nodes/utils/TriplanarTexturesNode.js +0 -62
- package/examples/jsm/objects/GroundProjectedSkybox.js +0 -172
- package/examples/jsm/objects/Lensflare.js +0 -377
- package/examples/jsm/objects/MarchingCubes.js +0 -1176
- package/examples/jsm/objects/Reflector.js +0 -264
- package/examples/jsm/objects/ReflectorForSSRPass.js +0 -349
- package/examples/jsm/objects/Refractor.js +0 -324
- package/examples/jsm/objects/ShadowMesh.js +0 -80
- package/examples/jsm/objects/Sky.js +0 -219
- package/examples/jsm/objects/Water.js +0 -330
- package/examples/jsm/objects/Water2.js +0 -358
- package/examples/jsm/offscreen/jank.js +0 -45
- package/examples/jsm/offscreen/offscreen.js +0 -8
- package/examples/jsm/offscreen/scene.js +0 -86
- package/examples/jsm/physics/AmmoPhysics.js +0 -285
- package/examples/jsm/physics/RapierPhysics.js +0 -199
- package/examples/jsm/postprocessing/AfterimagePass.js +0 -104
- package/examples/jsm/postprocessing/BloomPass.js +0 -172
- package/examples/jsm/postprocessing/BokehPass.js +0 -140
- package/examples/jsm/postprocessing/ClearPass.js +0 -46
- package/examples/jsm/postprocessing/CubeTexturePass.js +0 -85
- package/examples/jsm/postprocessing/DotScreenPass.js +0 -65
- package/examples/jsm/postprocessing/EffectComposer.js +0 -231
- package/examples/jsm/postprocessing/FilmPass.js +0 -66
- package/examples/jsm/postprocessing/GlitchPass.js +0 -128
- package/examples/jsm/postprocessing/HalftonePass.js +0 -79
- package/examples/jsm/postprocessing/LUTPass.js +0 -173
- package/examples/jsm/postprocessing/MaskPass.js +0 -104
- package/examples/jsm/postprocessing/OutlinePass.js +0 -654
- package/examples/jsm/postprocessing/OutputPass.js +0 -91
- package/examples/jsm/postprocessing/Pass.js +0 -84
- package/examples/jsm/postprocessing/RenderPass.js +0 -81
- package/examples/jsm/postprocessing/RenderPixelatedPass.js +0 -235
- package/examples/jsm/postprocessing/SAOPass.js +0 -411
- package/examples/jsm/postprocessing/SMAAPass.js +0 -201
- package/examples/jsm/postprocessing/SSAARenderPass.js +0 -228
- package/examples/jsm/postprocessing/SSAOPass.js +0 -440
- package/examples/jsm/postprocessing/SSRPass.js +0 -641
- package/examples/jsm/postprocessing/SavePass.js +0 -79
- package/examples/jsm/postprocessing/ShaderPass.js +0 -77
- package/examples/jsm/postprocessing/TAARenderPass.js +0 -189
- package/examples/jsm/postprocessing/TexturePass.js +0 -67
- package/examples/jsm/postprocessing/UnrealBloomPass.js +0 -415
- package/examples/jsm/renderers/CSS2DRenderer.js +0 -215
- package/examples/jsm/renderers/CSS3DRenderer.js +0 -335
- package/examples/jsm/renderers/Projector.js +0 -918
- package/examples/jsm/renderers/SVGRenderer.js +0 -553
- package/examples/jsm/renderers/common/Animation.js +0 -58
- package/examples/jsm/renderers/common/Attributes.js +0 -75
- package/examples/jsm/renderers/common/Backend.js +0 -162
- package/examples/jsm/renderers/common/Background.js +0 -136
- package/examples/jsm/renderers/common/Binding.js +0 -19
- package/examples/jsm/renderers/common/Bindings.js +0 -165
- package/examples/jsm/renderers/common/Buffer.js +0 -38
- package/examples/jsm/renderers/common/BufferUtils.js +0 -33
- package/examples/jsm/renderers/common/ChainMap.js +0 -89
- package/examples/jsm/renderers/common/ComputePipeline.js +0 -17
- package/examples/jsm/renderers/common/Constants.js +0 -14
- package/examples/jsm/renderers/common/CubeRenderTarget.js +0 -65
- package/examples/jsm/renderers/common/DataMap.js +0 -54
- package/examples/jsm/renderers/common/Geometries.js +0 -215
- package/examples/jsm/renderers/common/Info.js +0 -73
- package/examples/jsm/renderers/common/Pipeline.js +0 -13
- package/examples/jsm/renderers/common/Pipelines.js +0 -370
- package/examples/jsm/renderers/common/ProgrammableStage.js +0 -18
- package/examples/jsm/renderers/common/RenderContext.js +0 -38
- package/examples/jsm/renderers/common/RenderContexts.js +0 -49
- package/examples/jsm/renderers/common/RenderList.js +0 -178
- package/examples/jsm/renderers/common/RenderLists.js +0 -38
- package/examples/jsm/renderers/common/RenderObject.js +0 -129
- package/examples/jsm/renderers/common/RenderObjects.js +0 -95
- package/examples/jsm/renderers/common/RenderPipeline.js +0 -16
- package/examples/jsm/renderers/common/Renderer.js +0 -895
- package/examples/jsm/renderers/common/SampledTexture.js +0 -80
- package/examples/jsm/renderers/common/Sampler.js +0 -18
- package/examples/jsm/renderers/common/StorageBuffer.js +0 -17
- package/examples/jsm/renderers/common/Textures.js +0 -218
- package/examples/jsm/renderers/common/Uniform.js +0 -140
- package/examples/jsm/renderers/common/UniformBuffer.js +0 -15
- package/examples/jsm/renderers/common/UniformsGroup.js +0 -299
- package/examples/jsm/renderers/common/nodes/NodeSampledTexture.js +0 -39
- package/examples/jsm/renderers/common/nodes/NodeSampler.js +0 -21
- package/examples/jsm/renderers/common/nodes/NodeUniform.js +0 -135
- package/examples/jsm/renderers/common/nodes/Nodes.js +0 -330
- package/examples/jsm/renderers/webgl/nodes/GLSLNodeBuilder.js +0 -340
- package/examples/jsm/renderers/webgl/nodes/SlotNode.js +0 -26
- package/examples/jsm/renderers/webgl/nodes/WebGLNodeBuilder.js +0 -764
- package/examples/jsm/renderers/webgl/nodes/WebGLNodes.js +0 -49
- package/examples/jsm/renderers/webgpu/WebGPUBackend.js +0 -844
- package/examples/jsm/renderers/webgpu/WebGPURenderer.js +0 -32
- package/examples/jsm/renderers/webgpu/nodes/WGSLNodeBuilder.js +0 -902
- package/examples/jsm/renderers/webgpu/nodes/WGSLNodeFunction.js +0 -104
- package/examples/jsm/renderers/webgpu/nodes/WGSLNodeParser.js +0 -14
- package/examples/jsm/renderers/webgpu/utils/WebGPUAttributeUtils.js +0 -274
- package/examples/jsm/renderers/webgpu/utils/WebGPUBindingUtils.js +0 -223
- package/examples/jsm/renderers/webgpu/utils/WebGPUConstants.js +0 -324
- package/examples/jsm/renderers/webgpu/utils/WebGPUPipelineUtils.js +0 -533
- package/examples/jsm/renderers/webgpu/utils/WebGPUTextureMipmapUtils.js +0 -163
- package/examples/jsm/renderers/webgpu/utils/WebGPUTextureUtils.js +0 -964
- package/examples/jsm/renderers/webgpu/utils/WebGPUUtils.js +0 -92
- package/examples/jsm/shaders/ACESFilmicToneMappingShader.js +0 -87
- package/examples/jsm/shaders/AfterimageShader.js +0 -56
- package/examples/jsm/shaders/BasicShader.js +0 -27
- package/examples/jsm/shaders/BleachBypassShader.js +0 -62
- package/examples/jsm/shaders/BlendShader.js +0 -47
- package/examples/jsm/shaders/BokehShader.js +0 -143
- package/examples/jsm/shaders/BokehShader2.js +0 -393
- package/examples/jsm/shaders/BrightnessContrastShader.js +0 -54
- package/examples/jsm/shaders/ColorCorrectionShader.js +0 -50
- package/examples/jsm/shaders/ColorifyShader.js +0 -51
- package/examples/jsm/shaders/ConvolutionShader.js +0 -103
- package/examples/jsm/shaders/CopyShader.js +0 -45
- package/examples/jsm/shaders/DOFMipMapShader.js +0 -54
- package/examples/jsm/shaders/DepthLimitedBlurShader.js +0 -166
- package/examples/jsm/shaders/DigitalGlitch.js +0 -101
- package/examples/jsm/shaders/DotScreenShader.js +0 -70
- package/examples/jsm/shaders/ExposureShader.js +0 -44
- package/examples/jsm/shaders/FXAAShader.js +0 -286
- package/examples/jsm/shaders/FilmShader.js +0 -102
- package/examples/jsm/shaders/FocusShader.js +0 -87
- package/examples/jsm/shaders/FreiChenShader.js +0 -94
- package/examples/jsm/shaders/GammaCorrectionShader.js +0 -43
- package/examples/jsm/shaders/GodRaysShader.js +0 -313
- package/examples/jsm/shaders/HalftoneShader.js +0 -310
- package/examples/jsm/shaders/HorizontalBlurShader.js +0 -59
- package/examples/jsm/shaders/HorizontalTiltShiftShader.js +0 -61
- package/examples/jsm/shaders/HueSaturationShader.js +0 -65
- package/examples/jsm/shaders/KaleidoShader.js +0 -56
- package/examples/jsm/shaders/LuminosityHighPassShader.js +0 -64
- package/examples/jsm/shaders/LuminosityShader.js +0 -46
- package/examples/jsm/shaders/MMDToonShader.js +0 -132
- package/examples/jsm/shaders/MirrorShader.js +0 -54
- package/examples/jsm/shaders/NormalMapShader.js +0 -53
- package/examples/jsm/shaders/OutputShader.js +0 -78
- package/examples/jsm/shaders/RGBShiftShader.js +0 -54
- package/examples/jsm/shaders/SAOShader.js +0 -188
- package/examples/jsm/shaders/SMAAShader.js +0 -460
- package/examples/jsm/shaders/SSAOShader.js +0 -288
- package/examples/jsm/shaders/SSRShader.js +0 -364
- package/examples/jsm/shaders/SepiaShader.js +0 -52
- package/examples/jsm/shaders/SobelOperatorShader.js +0 -90
- package/examples/jsm/shaders/SubsurfaceScatteringShader.js +0 -88
- package/examples/jsm/shaders/TechnicolorShader.js +0 -43
- package/examples/jsm/shaders/ToonShader.js +0 -326
- package/examples/jsm/shaders/TriangleBlurShader.js +0 -72
- package/examples/jsm/shaders/UnpackDepthRGBAShader.js +0 -45
- package/examples/jsm/shaders/VelocityShader.js +0 -128
- package/examples/jsm/shaders/VerticalBlurShader.js +0 -59
- package/examples/jsm/shaders/VerticalTiltShiftShader.js +0 -61
- package/examples/jsm/shaders/VignetteShader.js +0 -51
- package/examples/jsm/shaders/VolumeShader.js +0 -289
- package/examples/jsm/shaders/WaterRefractionShader.js +0 -93
- package/examples/jsm/textures/FlakesTexture.js +0 -40
- package/examples/jsm/utils/BufferGeometryUtils.js +0 -1373
- package/examples/jsm/utils/CameraUtils.js +0 -73
- package/examples/jsm/utils/GPUStatsPanel.js +0 -128
- package/examples/jsm/utils/GeometryCompressionUtils.js +0 -639
- package/examples/jsm/utils/GeometryUtils.js +0 -221
- package/examples/jsm/utils/LDrawUtils.js +0 -202
- package/examples/jsm/utils/PackedPhongMaterial.js +0 -178
- package/examples/jsm/utils/SceneUtils.js +0 -254
- package/examples/jsm/utils/ShadowMapViewer.js +0 -210
- package/examples/jsm/utils/SkeletonUtils.js +0 -413
- package/examples/jsm/utils/TextureUtils.js +0 -86
- package/examples/jsm/utils/UVsDebug.js +0 -165
- package/examples/jsm/utils/WorkerPool.js +0 -102
- package/examples/jsm/webxr/ARButton.js +0 -208
- package/examples/jsm/webxr/OculusHandModel.js +0 -109
- package/examples/jsm/webxr/OculusHandPointerModel.js +0 -413
- package/examples/jsm/webxr/Text2D.js +0 -38
- package/examples/jsm/webxr/VRButton.js +0 -200
- package/examples/jsm/webxr/XRButton.js +0 -198
- package/examples/jsm/webxr/XRControllerModelFactory.js +0 -299
- package/examples/jsm/webxr/XREstimatedLight.js +0 -223
- package/examples/jsm/webxr/XRHandMeshModel.js +0 -112
- package/examples/jsm/webxr/XRHandModelFactory.js +0 -105
- package/examples/jsm/webxr/XRHandPrimitiveModel.js +0 -103
- package/examples/jsm/webxr/XRPlanes.js +0 -100
- package/lib/3d.min.js +0 -1
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,57 +1,18 @@
|
|
|
1
|
-
import type
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
on: {
|
|
5
|
-
<Key extends import("mitt").EventType>(type: Key, handler: import("mitt").Handler<Record<import("mitt").EventType, unknown>[Key]>): void;
|
|
6
|
-
(type: "*", handler: import("mitt").WildcardHandler<Record<import("mitt").EventType, unknown>>): void;
|
|
7
|
-
};
|
|
8
|
-
off: {
|
|
9
|
-
<Key_1 extends import("mitt").EventType>(type: Key_1, handler?: import("mitt").Handler<Record<import("mitt").EventType, unknown>[Key_1]> | undefined): void;
|
|
10
|
-
(type: "*", handler: import("mitt").WildcardHandler<Record<import("mitt").EventType, unknown>>): void;
|
|
11
|
-
};
|
|
12
|
-
emit: {
|
|
13
|
-
<Key_2 extends import("mitt").EventType>(type: Key_2, event: Record<import("mitt").EventType, unknown>[Key_2]): void;
|
|
14
|
-
<Key_3 extends import("mitt").EventType>(type: undefined extends Record<import("mitt").EventType, unknown>[Key_3] ? Key_3 : never): void;
|
|
15
|
-
};
|
|
16
|
-
all: import("mitt").EventHandlerMap<Record<import("mitt").EventType, unknown>>;
|
|
17
|
-
};
|
|
18
|
-
interface Node {
|
|
19
|
-
children?: Node[];
|
|
20
|
-
[k: string]: any;
|
|
1
|
+
import type Anov3D from '..';
|
|
2
|
+
interface ObjectType {
|
|
3
|
+
[key: string]: any;
|
|
21
4
|
}
|
|
22
5
|
/**
|
|
23
|
-
* get
|
|
24
|
-
*
|
|
25
|
-
* @param
|
|
6
|
+
* get value by key
|
|
7
|
+
* notic: to mark proxy, so need take it layer by layer
|
|
8
|
+
* @param obj
|
|
26
9
|
* @param key
|
|
27
|
-
* @returns
|
|
28
10
|
*/
|
|
29
|
-
export declare const
|
|
11
|
+
export declare const getValueByKey: <T extends ObjectType>(obj: T, key: string) => T | undefined;
|
|
30
12
|
/**
|
|
31
|
-
*
|
|
32
|
-
* @param
|
|
33
|
-
* @
|
|
13
|
+
* getFnByFnkey
|
|
14
|
+
* @param iEngine
|
|
15
|
+
* @param fnkey
|
|
34
16
|
*/
|
|
35
|
-
export declare const
|
|
36
|
-
/**
|
|
37
|
-
* get all mesh children, maybe also need line, but not now
|
|
38
|
-
* @param object3d
|
|
39
|
-
* @returns
|
|
40
|
-
*/
|
|
41
|
-
export declare const getAllMeshChildren: (object3d: Object3D) => Object3D<import("three").Event>[];
|
|
42
|
-
/**
|
|
43
|
-
* handle small hump
|
|
44
|
-
* @param camelCaseString
|
|
45
|
-
* @returns
|
|
46
|
-
*/
|
|
47
|
-
export declare const handleCamelCaseString: (camelCaseString: string) => string;
|
|
48
|
-
/**
|
|
49
|
-
* mousePointTo3DPoint
|
|
50
|
-
* @param mouseX
|
|
51
|
-
* @param mouseY
|
|
52
|
-
* @param camera
|
|
53
|
-
* @param renderer
|
|
54
|
-
* @returns
|
|
55
|
-
*/
|
|
56
|
-
export declare const mousePointTo3DPoint: (mouseX: number, mouseY: number, camera: THREE.Camera, renderer: THREE.WebGLRenderer) => Vector3;
|
|
17
|
+
export declare const getFnByFnkey: (iEngine: Anov3D, fnkey: string) => any;
|
|
57
18
|
export {};
|
package/dist/utils/index.js
CHANGED
|
@@ -1,103 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
export var emitter = {
|
|
5
|
-
on: emitterHandle.on,
|
|
6
|
-
off: emitterHandle.off,
|
|
7
|
-
emit: emitterHandle.emit,
|
|
8
|
-
all: emitterHandle.all
|
|
9
|
-
};
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
import { messageStatus } from "../messageStatus";
|
|
3
|
+
import { MessageType, sendToMessage } from "./messageFn";
|
|
10
4
|
/**
|
|
11
|
-
* get
|
|
12
|
-
*
|
|
13
|
-
* @param
|
|
5
|
+
* get value by key
|
|
6
|
+
* notic: to mark proxy, so need take it layer by layer
|
|
7
|
+
* @param obj
|
|
14
8
|
* @param key
|
|
15
|
-
* @returns
|
|
16
9
|
*/
|
|
17
|
-
export var
|
|
18
|
-
|
|
19
|
-
var
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
if (
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
ancestorsNodes.push(currentAttr[i]);
|
|
28
|
-
return true;
|
|
29
|
-
}
|
|
30
|
-
run(currentAttr[i].children);
|
|
31
|
-
}
|
|
10
|
+
export var getValueByKey = function getValueByKey(obj, key) {
|
|
11
|
+
if (!key) return undefined;
|
|
12
|
+
var keys = key.split('.');
|
|
13
|
+
var middleObj = obj;
|
|
14
|
+
for (var index = 0; index < keys.length; index++) {
|
|
15
|
+
var currentKey = keys[index];
|
|
16
|
+
if (_typeof(middleObj) === 'object') {
|
|
17
|
+
if (!(currentKey in middleObj)) return undefined;else middleObj = middleObj[currentKey];
|
|
18
|
+
} else {
|
|
19
|
+
return undefined;
|
|
32
20
|
}
|
|
33
|
-
};
|
|
34
|
-
run(array);
|
|
35
|
-
return ancestorsNodes;
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* get object3d ancestors nodes
|
|
40
|
-
* @param object3d
|
|
41
|
-
* @returns
|
|
42
|
-
*/
|
|
43
|
-
export var getObject3dAncestorsNodes = function getObject3dAncestorsNodes(object3d, filter) {
|
|
44
|
-
var ancestorsNodes = [];
|
|
45
|
-
var currentObject3d = object3d;
|
|
46
|
-
while (currentObject3d.parent) {
|
|
47
|
-
if (filter) filter(currentObject3d.parent) && ancestorsNodes.push(currentObject3d.parent);else ancestorsNodes.push(currentObject3d.parent);
|
|
48
|
-
currentObject3d = currentObject3d.parent;
|
|
49
21
|
}
|
|
50
|
-
return
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* get all mesh children, maybe also need line, but not now
|
|
55
|
-
* @param object3d
|
|
56
|
-
* @returns
|
|
57
|
-
*/
|
|
58
|
-
export var getAllMeshChildren = function getAllMeshChildren(object3d) {
|
|
59
|
-
var children = [];
|
|
60
|
-
var run = function run(object3d) {
|
|
61
|
-
if (object3d.children.length === 0) return;
|
|
62
|
-
for (var i = 0; i < object3d.children.length; i++) {
|
|
63
|
-
var child = object3d.children[i];
|
|
64
|
-
if (child.type === 'Mesh') children.push(child);
|
|
65
|
-
run(child);
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
run(object3d);
|
|
69
|
-
return children;
|
|
22
|
+
return middleObj;
|
|
70
23
|
};
|
|
71
24
|
|
|
72
25
|
/**
|
|
73
|
-
*
|
|
74
|
-
* @param
|
|
75
|
-
* @
|
|
26
|
+
* getFnByFnkey
|
|
27
|
+
* @param iEngine
|
|
28
|
+
* @param fnkey
|
|
76
29
|
*/
|
|
77
|
-
export var
|
|
78
|
-
var
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
30
|
+
export var getFnByFnkey = function getFnByFnkey(iEngine, fnkey) {
|
|
31
|
+
var handleFunction = getValueByKey(iEngine, fnkey);
|
|
32
|
+
if (typeof handleFunction !== 'function') {
|
|
33
|
+
sendToMessage(MessageType.Api, fnkey, messageStatus.ModuleNotRegister.code);
|
|
34
|
+
throw new Error('this function is not exist');
|
|
82
35
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* mousePointTo3DPoint
|
|
89
|
-
* @param mouseX
|
|
90
|
-
* @param mouseY
|
|
91
|
-
* @param camera
|
|
92
|
-
* @param renderer
|
|
93
|
-
* @returns
|
|
94
|
-
*/
|
|
95
|
-
export var mousePointTo3DPoint = function mousePointTo3DPoint(mouseX, mouseY, camera, renderer) {
|
|
96
|
-
var vector = new Vector3();
|
|
97
|
-
vector.set(mouseX / renderer.domElement.clientWidth * 2 - 1, -(mouseY / renderer.domElement.clientHeight) * 2 + 1, 0.5);
|
|
98
|
-
vector.unproject(camera);
|
|
99
|
-
var dir = vector.sub(camera.position).normalize();
|
|
100
|
-
var distance = -camera.position.z / dir.z;
|
|
101
|
-
var pos = camera.position.clone().add(dir.multiplyScalar(distance));
|
|
102
|
-
return pos;
|
|
36
|
+
var fnkeyArrary = fnkey.split('.');
|
|
37
|
+
var context = iEngine;
|
|
38
|
+
if (fnkeyArrary.length > 1) context = getValueByKey(iEngine, fnkeyArrary.slice(0, fnkeyArrary.length - 1).join('.'));
|
|
39
|
+
return handleFunction.bind(context);
|
|
103
40
|
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare enum MessageType {
|
|
2
|
+
Event = 0,
|
|
3
|
+
Api = 1
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* sendToMessage
|
|
7
|
+
* @param messageName
|
|
8
|
+
* @param status
|
|
9
|
+
* @param res
|
|
10
|
+
* @returns
|
|
11
|
+
*/
|
|
12
|
+
export declare const sendToMessage: (messageType: MessageType, messageName: string, status: number, res?: unknown) => void;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
2
|
+
import { utils } from '@anov/3d-core';
|
|
3
|
+
export var MessageType;
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* sendToMessage
|
|
7
|
+
* @param messageName
|
|
8
|
+
* @param status
|
|
9
|
+
* @param res
|
|
10
|
+
* @returns
|
|
11
|
+
*/
|
|
12
|
+
(function (MessageType) {
|
|
13
|
+
MessageType[MessageType["Event"] = 0] = "Event";
|
|
14
|
+
MessageType[MessageType["Api"] = 1] = "Api";
|
|
15
|
+
})(MessageType || (MessageType = {}));
|
|
16
|
+
export var sendToMessage = function sendToMessage(messageType, messageName, status, res) {
|
|
17
|
+
var uid = uuidv4();
|
|
18
|
+
var response = {
|
|
19
|
+
id: uid,
|
|
20
|
+
// 业务无关,请求消息唯一标识
|
|
21
|
+
name: messageName,
|
|
22
|
+
code: status,
|
|
23
|
+
// 状态码,200 请求成功
|
|
24
|
+
msg: '',
|
|
25
|
+
// 错误描述
|
|
26
|
+
result: {
|
|
27
|
+
version: '0.0.4',
|
|
28
|
+
engineType: 'WEBGL',
|
|
29
|
+
engineVersion: '0.0.4'
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
if (messageType === MessageType.Api) utils.emitter.emit('message', response);
|
|
33
|
+
};
|
package/package.json
CHANGED
|
@@ -1,22 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anov/3d",
|
|
3
|
-
"version": "0.0.4-
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.0.4-alpha13",
|
|
4
|
+
"description": "",
|
|
5
5
|
"author": "",
|
|
6
6
|
"license": "MIT",
|
|
7
|
-
"keywords": [
|
|
8
|
-
"3d",
|
|
9
|
-
"webgl"
|
|
10
|
-
],
|
|
11
|
-
"exports": {
|
|
12
|
-
".": {
|
|
13
|
-
"import": "./dist/index.js"
|
|
14
|
-
},
|
|
15
|
-
"./examples/fonts/*": "./examples/fonts/*",
|
|
16
|
-
"./examples/jsm/*": "./examples/jsm/*",
|
|
17
|
-
"./addons/*": "./examples/jsm/*",
|
|
18
|
-
"./nodes": "./examples/jsm/nodes/Nodes.js"
|
|
19
|
-
},
|
|
7
|
+
"keywords": [],
|
|
20
8
|
"module": "dist/index.js",
|
|
21
9
|
"types": "dist/index.d.ts",
|
|
22
10
|
"publishConfig": {
|
|
@@ -24,23 +12,19 @@
|
|
|
24
12
|
},
|
|
25
13
|
"files": [
|
|
26
14
|
"dist",
|
|
27
|
-
"lib",
|
|
28
15
|
"readme.md",
|
|
29
|
-
"examples",
|
|
30
16
|
"package.json"
|
|
31
17
|
],
|
|
32
18
|
"dependencies": {
|
|
33
|
-
"
|
|
34
|
-
"@
|
|
35
|
-
"
|
|
36
|
-
"mitt": "^3.0.1",
|
|
37
|
-
"three": "^0.155.0"
|
|
19
|
+
"uuid": "^9.0.1",
|
|
20
|
+
"@anov/3d-core": "^0.0.4-alpha12",
|
|
21
|
+
"@anov/3d-utils": "^0.0.4-alpha0"
|
|
38
22
|
},
|
|
39
23
|
"devDependencies": {
|
|
40
|
-
"@types/
|
|
24
|
+
"@types/uuid": "^9.0.7"
|
|
41
25
|
},
|
|
42
26
|
"scripts": {
|
|
43
|
-
"build": "father build
|
|
27
|
+
"build": "father build",
|
|
44
28
|
"build:deps": "father prebundle",
|
|
45
29
|
"test": "jest --maxWorkers 2"
|
|
46
30
|
}
|
package/dist/commonEnu.d.ts
DELETED
package/dist/commonEnu.js
DELETED
package/dist/core/camera.d.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { Object3D, Vector3 } from 'three';
|
|
2
|
-
import { PerspectiveCamera as TPerspectiveCamera } from 'three';
|
|
3
|
-
declare class PerspectiveCamera extends TPerspectiveCamera {
|
|
4
|
-
constructor(fov: number, aspect: number, near: number, far: number);
|
|
5
|
-
/**
|
|
6
|
-
* 向目标物体推进
|
|
7
|
-
* @param targetObject3D
|
|
8
|
-
* @param distance
|
|
9
|
-
* @param duration
|
|
10
|
-
* @param animationMethod
|
|
11
|
-
*/
|
|
12
|
-
promote(targetObject3D: Object3D, distance: number, duration?: number, animationMethod?: string): import("@tweenjs/tween.js").Tween<Vector3>;
|
|
13
|
-
/**
|
|
14
|
-
* 向目标物体后退
|
|
15
|
-
* @param targetObject3D
|
|
16
|
-
* @param distance
|
|
17
|
-
* @param duration
|
|
18
|
-
* @param animationMethod
|
|
19
|
-
*/
|
|
20
|
-
demote: (targetObject3D: Object3D, distance: number, duration?: number, animationMethod?: string) => import("@tweenjs/tween.js").Tween<Vector3>;
|
|
21
|
-
/**
|
|
22
|
-
* 相机曲线漫游
|
|
23
|
-
* @param vec
|
|
24
|
-
* @param points
|
|
25
|
-
* @param linePoints
|
|
26
|
-
* @param helpLine
|
|
27
|
-
* @param lookat
|
|
28
|
-
* @returns
|
|
29
|
-
*/
|
|
30
|
-
surround: (vec: Vector3[], points?: number, linePoints?: number, helpLine?: boolean, lookat?: Vector3) => import("../utils/move").ControlsRetuenFuncType;
|
|
31
|
-
}
|
|
32
|
-
export { PerspectiveCamera };
|
package/dist/core/camera.js
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
3
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
5
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
6
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
7
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
8
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
9
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
10
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
11
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
12
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
13
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
14
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
15
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
16
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
17
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
18
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
19
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
20
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
21
|
-
import { BufferGeometry, CatmullRomCurve3, Line, LineBasicMaterial, PerspectiveCamera as TPerspectiveCamera } from 'three';
|
|
22
|
-
import { Direction, moveTo, moveWithLine } from "../utils/move";
|
|
23
|
-
import globalObjectManage from "./global/global";
|
|
24
|
-
var PerspectiveCamera = /*#__PURE__*/function (_TPerspectiveCamera) {
|
|
25
|
-
_inherits(PerspectiveCamera, _TPerspectiveCamera);
|
|
26
|
-
var _super = _createSuper(PerspectiveCamera);
|
|
27
|
-
function PerspectiveCamera(fov, aspect, near, far) {
|
|
28
|
-
var _this;
|
|
29
|
-
_classCallCheck(this, PerspectiveCamera);
|
|
30
|
-
_this = _super.call(this, fov, aspect, near, far);
|
|
31
|
-
_defineProperty(_assertThisInitialized(_this), "demote", function (targetObject3D, distance, duration, animationMethod) {
|
|
32
|
-
return moveTo(_assertThisInitialized(_this), targetObject3D, distance, Direction.minus, duration, animationMethod);
|
|
33
|
-
});
|
|
34
|
-
_defineProperty(_assertThisInitialized(_this), "surround", function (vec) {
|
|
35
|
-
var points = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 5;
|
|
36
|
-
var linePoints = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 500;
|
|
37
|
-
var helpLine = arguments.length > 3 ? arguments[3] : undefined;
|
|
38
|
-
var lookat = arguments.length > 4 ? arguments[4] : undefined;
|
|
39
|
-
var curve = new CatmullRomCurve3(_toConsumableArray(vec), true);
|
|
40
|
-
var geometry = new BufferGeometry().setFromPoints(curve.getPoints(points));
|
|
41
|
-
var material = new LineBasicMaterial({
|
|
42
|
-
color: '#fff'
|
|
43
|
-
});
|
|
44
|
-
var curveObject = new Line(geometry, material);
|
|
45
|
-
globalObjectManage.scene.add(curveObject);
|
|
46
|
-
return moveWithLine(_assertThisInitialized(_this), curve, linePoints, lookat);
|
|
47
|
-
});
|
|
48
|
-
return _this;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* 向目标物体推进
|
|
53
|
-
* @param targetObject3D
|
|
54
|
-
* @param distance
|
|
55
|
-
* @param duration
|
|
56
|
-
* @param animationMethod
|
|
57
|
-
*/
|
|
58
|
-
_createClass(PerspectiveCamera, [{
|
|
59
|
-
key: "promote",
|
|
60
|
-
value: function promote(targetObject3D, distance, duration, animationMethod) {
|
|
61
|
-
return moveTo(this, targetObject3D, distance, Direction.plus, duration, animationMethod);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* 向目标物体后退
|
|
66
|
-
* @param targetObject3D
|
|
67
|
-
* @param distance
|
|
68
|
-
* @param duration
|
|
69
|
-
* @param animationMethod
|
|
70
|
-
*/
|
|
71
|
-
}]);
|
|
72
|
-
return PerspectiveCamera;
|
|
73
|
-
}(TPerspectiveCamera);
|
|
74
|
-
export { PerspectiveCamera };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { TransformControls as TTransformControls } from 'three/examples/jsm/controls/TransformControls.js';
|
|
2
|
-
import type { Camera } from 'three';
|
|
3
|
-
export declare class TransformControls extends TTransformControls {
|
|
4
|
-
constructor(object: Camera, domElement?: HTMLElement);
|
|
5
|
-
dispose(): void;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* create TransformControls
|
|
9
|
-
* note: 不可使用await,否则会导致渲染器无法完成初始化
|
|
10
|
-
* @returns
|
|
11
|
-
*/
|
|
12
|
-
export declare const createTransformControls: (size?: number) => Promise<TransformControls>;
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
3
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
4
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
5
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
|
-
function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }
|
|
8
|
-
function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
|
|
9
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
10
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
11
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
12
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
13
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
14
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
15
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
16
|
-
import { TransformControls as TTransformControls } from 'three/examples/jsm/controls/TransformControls.js';
|
|
17
|
-
import globalObjectManage from "../global/global";
|
|
18
|
-
import { emitter } from "../../utils";
|
|
19
|
-
export var TransformControls = /*#__PURE__*/function (_TTransformControls) {
|
|
20
|
-
_inherits(TransformControls, _TTransformControls);
|
|
21
|
-
var _super = _createSuper(TransformControls);
|
|
22
|
-
function TransformControls(object, domElement) {
|
|
23
|
-
_classCallCheck(this, TransformControls);
|
|
24
|
-
return _super.call(this, object, domElement);
|
|
25
|
-
}
|
|
26
|
-
_createClass(TransformControls, [{
|
|
27
|
-
key: "dispose",
|
|
28
|
-
value: function dispose() {
|
|
29
|
-
var _this = this;
|
|
30
|
-
_get(_getPrototypeOf(TransformControls.prototype), "dispose", this).call(this);
|
|
31
|
-
var index = globalObjectManage.transformControls.findIndex(function (item) {
|
|
32
|
-
return item === _this;
|
|
33
|
-
});
|
|
34
|
-
if (index > -1) globalObjectManage.transformControls.splice(index, 1);
|
|
35
|
-
}
|
|
36
|
-
}]);
|
|
37
|
-
return TransformControls;
|
|
38
|
-
}(TTransformControls);
|
|
39
|
-
var create = function create() {
|
|
40
|
-
var size = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0.5;
|
|
41
|
-
var transformControl = new TransformControls(globalObjectManage.camera, globalObjectManage.domElement);
|
|
42
|
-
transformControl.size = size;
|
|
43
|
-
transformControl.addEventListener('change', function () {});
|
|
44
|
-
transformControl.addEventListener('dragging-changed', function (event) {
|
|
45
|
-
var controls = globalObjectManage.orbitControls;
|
|
46
|
-
if (controls) controls.enabled = !event.value;
|
|
47
|
-
});
|
|
48
|
-
globalObjectManage.setTransformControls(transformControl);
|
|
49
|
-
|
|
50
|
-
// maybe many controls
|
|
51
|
-
globalObjectManage.scene.add(transformControl);
|
|
52
|
-
return transformControl;
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* create TransformControls
|
|
57
|
-
* note: 不可使用await,否则会导致渲染器无法完成初始化
|
|
58
|
-
* @returns
|
|
59
|
-
*/
|
|
60
|
-
export var createTransformControls = function createTransformControls() {
|
|
61
|
-
var size = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0.5;
|
|
62
|
-
var promise = new Promise(function (resolve) {
|
|
63
|
-
if (!(globalObjectManage.camera && globalObjectManage.domElement)) {
|
|
64
|
-
emitter.on('after-render', function () {
|
|
65
|
-
resolve(create(size));
|
|
66
|
-
});
|
|
67
|
-
} else {
|
|
68
|
-
resolve(create(size));
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
return promise;
|
|
72
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { Camera, Scene } from 'three';
|
|
2
|
-
import { CSS2DRenderer } from 'three/examples/jsm/renderers/CSS2DRenderer';
|
|
3
|
-
import { CSS3DRenderer } from 'three/examples/jsm/renderers/CSS3DRenderer';
|
|
4
|
-
export declare type CssRendererType = 'base' | 'normal';
|
|
5
|
-
declare class CssRenderer {
|
|
6
|
-
private baseCssRenderer;
|
|
7
|
-
private normalCssRenderer;
|
|
8
|
-
cssRenderer: CSS2DRenderer | CSS3DRenderer;
|
|
9
|
-
constructor(type: CssRendererType);
|
|
10
|
-
getSize(): {
|
|
11
|
-
width: number;
|
|
12
|
-
height: number;
|
|
13
|
-
};
|
|
14
|
-
setSize(width: number, height: number): void;
|
|
15
|
-
render(scene: Scene, camera: Camera): void;
|
|
16
|
-
}
|
|
17
|
-
export default CssRenderer;
|
package/dist/core/events.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { Intersection, Mesh, Object3D, Raycaster } from 'three';
|
|
2
|
-
import type { CubeEventType, EventHandleFn } from '../type';
|
|
3
|
-
declare type RaycastFnType = (raycaster: Raycaster, intersects: Intersection[]) => void;
|
|
4
|
-
interface EventPrototype {
|
|
5
|
-
natureEventMap: Map<CubeEventType, EventHandleFn[]>;
|
|
6
|
-
entered: boolean;
|
|
7
|
-
handleBubble: (object3d: Object3D | undefined) => void;
|
|
8
|
-
cancelAncestorsBubble: (object3d: Object3D | undefined) => void;
|
|
9
|
-
raycast: RaycastFnType;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* process mesh created by the loader, eg: gltf, fbx ...
|
|
13
|
-
* this mesh not support raycaster, so we need to process it
|
|
14
|
-
*/
|
|
15
|
-
declare const provideEventPrototype: (raycast: RaycastFnType, mesh: Mesh) => EventPrototype;
|
|
16
|
-
export default provideEventPrototype;
|
package/dist/core/events.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { getObject3dAncestorsNodes } from "../utils";
|
|
2
|
-
import Group from "./group";
|
|
3
|
-
/**
|
|
4
|
-
* process mesh created by the loader, eg: gltf, fbx ...
|
|
5
|
-
* this mesh not support raycaster, so we need to process it
|
|
6
|
-
*/
|
|
7
|
-
var provideEventPrototype = function provideEventPrototype(raycast, mesh) {
|
|
8
|
-
var oldRaycast = raycast;
|
|
9
|
-
var ctx = mesh;
|
|
10
|
-
var eventPrototype = {
|
|
11
|
-
natureEventMap: new Map(),
|
|
12
|
-
entered: false,
|
|
13
|
-
handleBubble: function handleBubble(object3d) {
|
|
14
|
-
if (object3d) {
|
|
15
|
-
var ancestorObject3d = getObject3dAncestorsNodes(object3d, function (object3d) {
|
|
16
|
-
return object3d instanceof Group;
|
|
17
|
-
});
|
|
18
|
-
for (var i = 0; i < ancestorObject3d.length; i++) ancestorObject3d[i].raycastGroup();
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
cancelAncestorsBubble: function cancelAncestorsBubble(object3d) {
|
|
22
|
-
if (object3d) {
|
|
23
|
-
var ancestorObject3d = getObject3dAncestorsNodes(object3d, function (object3d) {
|
|
24
|
-
return object3d instanceof Group;
|
|
25
|
-
});
|
|
26
|
-
for (var i = 0; i < ancestorObject3d.length; i++) ancestorObject3d[i].cancel();
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
raycast: function raycast(raycaster, intersects) {
|
|
30
|
-
oldRaycast(raycaster, intersects);
|
|
31
|
-
var intersect = intersects[0];
|
|
32
|
-
var object = intersect && intersect.object;
|
|
33
|
-
if (object && object.id === ctx.id) ctx.handleBubble(ctx);else ctx.cancelAncestorsBubble(ctx);
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
return eventPrototype;
|
|
37
|
-
};
|
|
38
|
-
export default provideEventPrototype;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { Scene } from 'three';
|
|
2
|
-
import type { OrbitControls } from 'three/examples/jsm/controls/OrbitControls.js';
|
|
3
|
-
import type { TransformControls } from '../control/transformControls';
|
|
4
|
-
import type { PerspectiveCamera } from '../camera';
|
|
5
|
-
import type Group from '../group';
|
|
6
|
-
declare class GlobalObjectManage {
|
|
7
|
-
scene: Scene | null;
|
|
8
|
-
triggerClick: boolean;
|
|
9
|
-
camera: PerspectiveCamera | null;
|
|
10
|
-
domElement: HTMLElement | null;
|
|
11
|
-
orbitControls: OrbitControls | null;
|
|
12
|
-
transformControls: TransformControls[];
|
|
13
|
-
frameCallbacks: Set<() => void>;
|
|
14
|
-
groupCatch: Group[];
|
|
15
|
-
constructor();
|
|
16
|
-
addScene(object3d: Scene): void;
|
|
17
|
-
setCamera(camera: PerspectiveCamera): void;
|
|
18
|
-
setDomElement(domElement: HTMLElement): void;
|
|
19
|
-
setOrbitControls(orbitControls: OrbitControls): void;
|
|
20
|
-
setTransformControls(transformControls: TransformControls): void;
|
|
21
|
-
setTriggerClickState(state: boolean): void;
|
|
22
|
-
addFrameCallback(cb: () => void): void;
|
|
23
|
-
removeFrameCallback(cb: () => void): void;
|
|
24
|
-
addCatch(group: Group): void;
|
|
25
|
-
}
|
|
26
|
-
declare const _default: GlobalObjectManage;
|
|
27
|
-
export default _default;
|