@realsee/five 6.8.0-alpha.2 → 6.8.0-alpha.21
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/AGENTS_READ_ME.md +4 -0
- package/AI_CONTEXT.md +4 -0
- package/README.md +9 -6
- package/{guides → ai_guides}/README.md +12 -2
- package/ai_guides/ai-doc-guidelines.md +102 -0
- package/{guides → ai_guides}/api.md +24 -1
- package/ai_guides/features/3dtile.md +172 -0
- package/{guides → ai_guides}/features/camera-animation.md +24 -3
- package/{guides → ai_guides}/features/clipper.md +2 -0
- package/{guides/features/coordnate-system.md → ai_guides/features/coordinate-system.md} +2 -0
- package/{guides → ai_guides}/features/event.md +2 -0
- package/{guides → ai_guides}/features/five.md +4 -0
- package/ai_guides/features/flowing-light-2d-pass.md +438 -0
- package/ai_guides/features/flowing-light-3d-pass.md +420 -0
- package/ai_guides/features/gaussian-blur-pass.md +202 -0
- package/{guides → ai_guides}/features/gesture.md +3 -0
- package/{guides → ai_guides}/features/get-screen-pixels.md +2 -0
- package/{guides → ai_guides}/features/image-options.md +3 -0
- package/{guides → ai_guides}/features/load-external-model.md +21 -0
- package/ai_guides/features/load-progress.md +140 -0
- package/ai_guides/features/material.md +153 -0
- package/{guides → ai_guides}/features/mode.md +4 -0
- package/{guides → ai_guides}/features/model.md +4 -1
- package/{guides → ai_guides}/features/move-pano-effect.md +2 -0
- package/{guides → ai_guides}/features/multi-work.md +2 -0
- package/ai_guides/features/pano-filter.md +148 -0
- package/{guides → ai_guides}/features/pano-tile.md +7 -14
- package/ai_guides/features/pano-uv.md +131 -0
- package/ai_guides/features/parameter.md +153 -0
- package/ai_guides/features/plugin.md +210 -0
- package/{guides → ai_guides}/features/postprocessing.md +39 -4
- package/{guides → ai_guides}/features/raycast.md +11 -0
- package/{guides → ai_guides}/features/request-proxy.md +2 -0
- package/{guides → ai_guides}/features/screen-project.md +2 -0
- package/{guides → ai_guides}/features/state.md +2 -0
- package/ai_guides/features/view-layer.md +187 -0
- package/{guides → ai_guides}/features/work.md +63 -2
- package/{guides → ai_guides}/glossary.md +26 -5
- package/{guides → ai_guides}/intro.md +1 -1
- package/{guides → ai_guides}/quick-start.md +1 -0
- package/ai_guides/release_notes/6.8.md +208 -0
- package/{guides → ai_guides}/template.md +17 -3
- package/docs/00_FOR_AI_AGENTS.md +11 -0
- package/docs/README.md +4 -7
- package/docs/assets/hierarchy.js +1 -1
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/five.AdaptiveLuminancePass.html +7 -6
- package/docs/classes/five.BoundingMesh.html +2 -2
- package/docs/classes/five.Camera.html +1 -1
- package/docs/classes/five.EyeDomeLightingPass.html +1 -1
- package/docs/classes/five.Five.html +73 -72
- package/docs/classes/five.FivePass.html +1 -1
- package/docs/classes/five.Histogram.html +19 -0
- package/docs/classes/five.InternalWebGLRenderer.html +1 -1
- package/docs/classes/five.Model.html +31 -31
- package/docs/classes/five.ModelScene.html +1 -1
- package/docs/classes/five.NetworkSubscribe.html +1 -1
- package/docs/classes/five.PBMContainer.html +1 -1
- package/docs/classes/five.PBMCustomShader.html +42 -3
- package/docs/classes/five.PBMGSObject.html +5 -3
- package/docs/classes/five.PBMGroup.html +1 -1
- package/docs/classes/five.PBMMesh.html +1 -1
- package/docs/classes/five.PBMMeshMaterial.html +16 -7
- package/docs/classes/five.PBMPanoFilter.html +61 -0
- package/docs/classes/five.PBMPointCloud.html +1 -1
- package/docs/classes/five.PBMPointCloudMaterial.html +5 -6
- package/docs/classes/five.PBMSkinnedMesh.html +1 -1
- package/docs/classes/five.PBMUpdateable.html +41 -0
- package/docs/classes/five.PanoCircleMesh.html +1 -1
- package/docs/classes/five.PanoCircleMeshCustom.html +1 -1
- package/docs/classes/five.PanoCircleMeshSolid.html +1 -1
- package/docs/classes/five.Parameter.html +57 -53
- package/docs/classes/five.Scene.html +1 -1
- package/docs/classes/five.Subscribe.html +1 -1
- package/docs/classes/five.Tile.html +1 -1
- package/docs/classes/five.Tile3D.html +30 -26
- package/docs/classes/five.TileNode.html +1 -1
- package/docs/classes/five.Trajectory.html +1 -1
- package/docs/classes/five.TrajectoryNode.html +1 -1
- package/docs/classes/five.Work.html +16 -16
- package/docs/classes/five.WorkResolvedObserver.html +27 -2
- package/docs/classes/gltf-loader.DDSLoader.html +1 -1
- package/docs/classes/gltf-loader.DRACOLoader.html +1 -1
- package/docs/classes/gltf-loader.GLTFLoader.html +1 -1
- package/docs/classes/gltf-loader.GLTFObject.html +1 -1
- package/docs/classes/gltf-loader.GLTFParser.html +1 -1
- package/docs/classes/gltf-loader.THREEGLTFLoader.html +1 -1
- package/docs/classes/line.Line.html +1 -1
- package/docs/classes/line.LineGeometry.html +1 -1
- package/docs/classes/line.LineMaterial.html +1 -1
- package/docs/classes/line.LineSegmentsGeometry.html +1 -1
- package/docs/classes/line.THREE_Line2.html +1 -1
- package/docs/classes/line.THREE_LineSegments2.html +1 -1
- package/docs/classes/plugins.BasePlugin.Controller.html +1 -1
- package/docs/classes/plugins.RoundedBoxGeometry.html +1 -1
- package/docs/classes/sticker.Sticker.html +1 -1
- package/docs/classes/vfx.Airflow.html +1 -1
- package/docs/classes/vfx.Flame.html +1 -1
- package/docs/classes/vfx.Particle.html +1 -1
- package/docs/classes/vfx.ParticleGPU.html +1 -1
- package/docs/classes/vfx.SpotLight.html +1 -1
- package/docs/documents/README.html +11 -2
- package/docs/documents/ai-doc-guidelines.html +60 -15
- package/docs/documents/api.html +40 -15
- package/docs/documents/features_3dtile.html +142 -45
- package/docs/documents/features_camera-animation.html +62 -5
- package/docs/documents/features_clipper.html +3 -0
- package/docs/documents/{features_coordnate-system.html → features_coordinate-system.html} +4 -1
- package/docs/documents/features_event.html +3 -0
- package/docs/documents/features_five.html +4 -0
- package/docs/documents/features_flowing-light-2d-pass.html +356 -0
- package/docs/documents/features_flowing-light-3d-pass.html +351 -0
- package/docs/documents/features_gaussian-blur-pass.html +182 -0
- package/docs/documents/features_gesture.html +4 -0
- package/docs/documents/features_get-screen-pixels.html +3 -0
- package/docs/documents/features_image-options.html +3 -0
- package/docs/documents/features_load-external-model.html +25 -2
- package/docs/documents/features_load-progress.html +110 -0
- package/docs/documents/features_material.html +341 -0
- package/docs/documents/features_mode.html +5 -0
- package/docs/documents/features_model.html +5 -1
- package/docs/documents/features_move-pano-effect.html +3 -0
- package/docs/documents/features_multi-work.html +3 -0
- package/docs/documents/features_pano-filter.html +122 -0
- package/docs/documents/features_pano-tile.html +34 -19
- package/docs/documents/features_pano-uv.html +82 -0
- package/docs/documents/features_parameter.html +76 -56
- package/docs/documents/features_plugin.html +105 -0
- package/docs/documents/features_postprocessing.html +22 -5
- package/docs/documents/features_raycast.html +4 -1
- package/docs/documents/features_request-proxy.html +3 -0
- package/docs/documents/features_screen-project.html +3 -0
- package/docs/documents/features_state.html +3 -0
- package/docs/documents/features_view-layer.html +158 -0
- package/docs/documents/features_work.html +63 -2
- package/docs/documents/glossary.html +31 -6
- package/docs/documents/intro.html +1 -1
- package/docs/documents/quick-start.html +1 -0
- package/docs/documents/release_notes_6.8.html +189 -0
- package/docs/documents/template.html +45 -4
- package/docs/functions/five.loadAt3d.html +1 -1
- package/docs/functions/five.loadB3dm.html +1 -1
- package/docs/functions/five.loadDome.html +1 -1
- package/docs/functions/five.loadDomez.html +1 -1
- package/docs/functions/five.loadFbx.html +1 -1
- package/docs/functions/five.loadGltf.html +1 -1
- package/docs/functions/five.loadPbm.html +1 -1
- package/docs/functions/five.loadPly.html +1 -1
- package/docs/functions/five.loadPnts.html +1 -1
- package/docs/functions/five.loadSplat.html +1 -1
- package/docs/functions/five.loadSpz.html +1 -1
- package/docs/functions/five.loadX3p.html +1 -1
- package/docs/functions/five.parseWork.html +1 -1
- package/docs/functions/vue.useFiveWorks.html +2 -2
- package/docs/hierarchy.html +1 -1
- package/docs/index.html +11 -2
- package/docs/interfaces/five.AddableObject.html +1 -1
- package/docs/interfaces/five.AjaxOptions.html +1 -1
- package/docs/interfaces/five.BaseEvent.html +2 -2
- package/docs/interfaces/five.EventCallback.html +53 -47
- package/docs/interfaces/five.FloorplanControllerCustomInitArgs.html +9 -9
- package/docs/interfaces/five.GestureEvent.html +2 -2
- package/docs/interfaces/five.ImageOptions.html +1 -1
- package/docs/interfaces/five.IntersectEvent.html +2 -2
- package/docs/interfaces/five.IntersectMesh.html +1 -1
- package/docs/interfaces/five.IntersectMeshInterface.html +1 -1
- package/docs/interfaces/five.Intersection.html +4 -3
- package/docs/interfaces/five.LooseWorkWithExtrinsics.html +6 -6
- package/docs/interfaces/five.MapviewControllerCustomInitArgs.html +9 -9
- package/docs/interfaces/five.ModeChangeEvent.html +2 -2
- package/docs/interfaces/five.ModelControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/five.ModelEvent.html +2 -2
- package/docs/interfaces/five.ModelSceneEvent.html +2 -2
- package/docs/interfaces/five.ModelTileEvent.html +8 -0
- package/docs/interfaces/five.MovePanoOptions.html +7 -7
- package/docs/interfaces/five.NetworkAbortError.html +1 -1
- package/docs/interfaces/five.NetworkFirbiddenError.html +1 -1
- package/docs/interfaces/five.NetworkOptions.html +1 -1
- package/docs/interfaces/five.NetworkProxyError.html +1 -1
- package/docs/interfaces/five.NetworkResourceEvent.html +2 -2
- package/docs/interfaces/five.NetworkResponseError.html +1 -1
- package/docs/interfaces/five.NetworkTimeoutError.html +1 -1
- package/docs/interfaces/five.ObjectEvent.html +2 -2
- package/docs/interfaces/five.PBMClipperParameter.html +2 -2
- package/docs/interfaces/five.PBMCustomShaderInitArgs.html +2 -2
- package/docs/interfaces/five.PBMCustomShaderSlots.html +2 -2
- package/docs/interfaces/five.PBMMaterial.html +1 -1
- package/docs/interfaces/five.PBMMeshMaterialParameters.html +5 -3
- package/docs/interfaces/five.PBMPanoDepth.html +5 -5
- package/docs/interfaces/five.PBMPanoFilterValue.html +6 -0
- package/docs/interfaces/five.PBMPanoPicture.html +8 -6
- package/docs/interfaces/five.PBMPointCloudMaterialParameters.html +2 -3
- package/docs/interfaces/five.PBMRefinedScreen.html +2 -2
- package/docs/interfaces/five.PanoCircleMeshInterface.html +1 -1
- package/docs/interfaces/five.PanoEvent.html +2 -2
- package/docs/interfaces/five.PanoTextureEvent.html +2 -2
- package/docs/interfaces/five.PanoramaControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/five.PanoramaLikeControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/five.ParameterMaterialValue.html +42 -38
- package/docs/interfaces/five.ParameterTilesetValue.html +15 -15
- package/docs/interfaces/five.ParameterValue.html +56 -52
- package/docs/interfaces/five.Pose.html +1 -1
- package/docs/interfaces/five.RenderEvent.html +2 -2
- package/docs/interfaces/five.ResolvedParameterValue.html +56 -52
- package/docs/interfaces/five.RgbaData.html +7 -0
- package/docs/interfaces/five.SplatData.html +2 -2
- package/docs/interfaces/five.State.html +1 -1
- package/docs/interfaces/five.StateEvent.html +2 -2
- package/docs/interfaces/five.TextureOptions.html +1 -1
- package/docs/interfaces/five.Tile3DOptions.html +2 -2
- package/docs/interfaces/five.TopviewControllerCustomInitArgs.html +7 -7
- package/docs/interfaces/five.VRPanoramaControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/five.ViewLayer.html +30 -26
- package/docs/interfaces/five.WorkCubeImage.html +1 -1
- package/docs/interfaces/five.WorkImage.html +1 -1
- package/docs/interfaces/five.WorkModel.html +8 -8
- package/docs/interfaces/five.WorkModelLayer.html +6 -6
- package/docs/interfaces/five.WorkObserver.html +27 -2
- package/docs/interfaces/five.WorkTile.html +1 -1
- package/docs/interfaces/five.WorksEvent.html +2 -2
- package/docs/interfaces/five.XRControllerEvent.html +2 -2
- package/docs/interfaces/five.XRGestureEvent.html +2 -2
- package/docs/interfaces/five.XRPanoramaControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/five.XRSessionEvent.html +2 -2
- package/docs/interfaces/plugins.BackgroundPluginController.html +1 -1
- package/docs/interfaces/plugins.BackgroundPluginType.EventMap.html +1 -1
- package/docs/interfaces/plugins.BasePlugin.State.html +1 -1
- package/docs/interfaces/plugins.DynamicPathLinePluginController.html +1 -1
- package/docs/interfaces/plugins.DynamicPathLinePluginType.EventMap.html +1 -1
- package/docs/interfaces/plugins.DynamicPathLinePluginType.State.html +1 -1
- package/docs/interfaces/plugins.ItemMaskController.html +1 -1
- package/docs/interfaces/plugins.ItemMaskPluginType.EventMap.html +1 -1
- package/docs/interfaces/plugins.ItemMaskPluginType.State.html +1 -1
- package/docs/interfaces/plugins.OrientationPluginController.html +1 -1
- package/docs/interfaces/plugins.OrientationPluginType.EventMap.html +1 -1
- package/docs/interfaces/plugins.OrientationPluginType.State.html +1 -1
- package/docs/interfaces/plugins.PanoAnimeController.html +1 -1
- package/docs/interfaces/plugins.PanoAnimePluginType.EventMap.html +1 -1
- package/docs/interfaces/plugins.PanoAnimePluginType.State.html +1 -1
- package/docs/interfaces/plugins.PluginTemplateType.EventMap.html +1 -1
- package/docs/interfaces/plugins.PluginTemplateType.State.html +1 -1
- package/docs/interfaces/plugins.TrajectoryController.html +1 -1
- package/docs/interfaces/react.FiveInjectionTypes.html +13 -13
- package/docs/modules/five.html +1 -1
- package/docs/modules.html +1 -1
- package/docs/types/five.ControllerEventTypes.html +27 -25
- package/docs/types/five.EasingFunction.html +1 -0
- package/docs/types/five.EventTypes.html +27 -25
- package/docs/types/five.FivePlugin.html +1 -1
- package/docs/types/five.FivePluginInit.html +1 -1
- package/docs/types/five.FivePluginInstance.html +1 -1
- package/docs/types/five.NetworkProgressCallback.html +1 -1
- package/docs/types/five.PBMAlphaMode.html +1 -1
- package/docs/types/five.PBMColorStyle.html +1 -1
- package/docs/types/five.PBMFloorStyle.html +1 -1
- package/docs/types/five.PBMMeshShaderType.html +1 -1
- package/docs/types/five.PBMPointBack.html +1 -1
- package/docs/types/five.PBMPointCloudShaderType.html +1 -1
- package/docs/types/five.PBMPointShape.html +1 -1
- package/docs/types/five.PBMPointSize.html +1 -1
- package/docs/types/five.PBMTransition.html +1 -1
- package/docs/types/five.ParseOptions.html +6 -6
- package/docs/types/plugins.BasePlugin.EventMap.html +1 -1
- package/docs/variables/five.PROXY_CONTROLLER_EVENT_NAMES.html +1 -1
- package/five/application/analysis.d.ts +40 -0
- package/five/application/controllers.d.ts +41 -0
- package/five/application/events-legacy.d.ts +454 -0
- package/five/application/events.d.ts +69 -0
- package/five/application/five.d.ts +519 -0
- package/five/application/fiveInitArgs.d.ts +176 -0
- package/five/application/fiveLoadOptions.d.ts +21 -0
- package/five/application/generateDefaultVideoElement.d.ts +2 -0
- package/five/application/getViewportScale.d.ts +2 -0
- package/five/application/initLights.d.ts +3 -0
- package/five/application/mode.d.ts +28 -0
- package/five/application/renderPoweredByRealsee.d.ts +3 -0
- package/five/assets/cardboard-png-data-url.d.ts +2 -0
- package/five/assets/gradient-png-data-url.d.ts +2 -0
- package/five/assets/loading-png-data-url.d.ts +2 -0
- package/five/assets/phone-png-data-url.d.ts +2 -0
- package/five/assets/realsee-png-data-url.d.ts +2 -0
- package/five/bvh/bvhMath.d.ts +33 -0
- package/five/bvh/bvhMesh.d.ts +7 -0
- package/five/bvh/bvhNode.d.ts +29 -0
- package/five/bvh/bvhObject.d.ts +18 -0
- package/five/bvh/bvhPoints.d.ts +6 -0
- package/five/bvh/index.d.ts +10 -0
- package/five/bvh/worker.d.ts +35 -0
- package/five/cardboard/helper.d.ts +2 -0
- package/five/cardboard/index.d.ts +13 -0
- package/five/cardboard/sensor.d.ts +158 -0
- package/five/certificates/hardware.d.ts +1 -0
- package/five/controllers/base.d.ts +167 -0
- package/five/controllers/events.d.ts +71 -0
- package/five/controllers/floorplan.d.ts +119 -0
- package/five/controllers/mapview.d.ts +139 -0
- package/five/controllers/model.d.ts +57 -0
- package/five/controllers/panorama.d.ts +143 -0
- package/five/controllers/panoramaLike.d.ts +87 -0
- package/five/controllers/topview.d.ts +42 -0
- package/five/controllers/vrPanorama.d.ts +56 -0
- package/five/controllers/xrPanorama.d.ts +81 -0
- package/five/core/camera.d.ts +65 -0
- package/five/core/internalWebGLRenderer.d.ts +14 -0
- package/five/core/panoVideo.d.ts +18 -0
- package/five/core/scene.d.ts +10 -0
- package/five/core/tiling.d.ts +43 -0
- package/five/declare.d.ts +2 -1
- package/five/gaussian-splatting/util/renderData.d.ts +52 -0
- package/five/gaussian-splatting/wasm/data.d.ts +20 -0
- package/five/gaussian-splatting/wasm/sort.d.ts +18 -0
- package/five/gaussian-splatting/worker/dataWorker.d.ts +1 -0
- package/five/gaussian-splatting/worker/sortWorker.d.ts +1 -0
- package/five/index.d.ts +60 -4637
- package/five/index.js +193 -341
- package/five/index.mjs +26455 -31011
- package/five/meshes/boundingMesh.d.ts +12 -0
- package/five/meshes/intersectMesh.d.ts +8 -0
- package/five/meshes/panoCircleMesh.d.ts +35 -0
- package/five/meshes/panoCircleMeshCustom.d.ts +40 -0
- package/five/meshes/panoCircleMeshSolid.d.ts +34 -0
- package/five/meshes/panoSphereMesh.d.ts +27 -0
- package/five/model/helpers/coordinate-transform.d.ts +3 -0
- package/five/model/helpers/ellipsoid-coordinates.d.ts +14 -0
- package/five/model/helpers/get-edges-by-sphere.d.ts +8 -0
- package/five/model/helpers/get-recommend-tile3d-parameters.d.ts +8 -0
- package/five/model/index.d.ts +70 -0
- package/five/model/intersection.d.ts +18 -0
- package/five/model/loaders/at3d.d.ts +12 -0
- package/five/model/loaders/b3dm.d.ts +9 -0
- package/five/model/loaders/dome.d.ts +22 -0
- package/five/model/loaders/domez.d.ts +11 -0
- package/five/model/loaders/fbx.d.ts +8 -0
- package/five/model/loaders/glTF-helpers/extensions/CESIUM_RTC.d.ts +9 -0
- package/five/model/loaders/glTF-helpers/extensions/EXT_meshopt_compression.d.ts +8 -0
- package/five/model/loaders/glTF-helpers/extensions/EXT_texture_webp.d.ts +11 -0
- package/five/model/loaders/glTF-helpers/extensions/KHR_animation_pointer.d.ts +6 -0
- package/five/model/loaders/glTF-helpers/extensions/KHR_binary_glTF.d.ts +25 -0
- package/five/model/loaders/glTF-helpers/extensions/KHR_draco_mesh_compression.d.ts +11 -0
- package/five/model/loaders/glTF-helpers/extensions/KHR_gaussian_splatting_compression_spz.d.ts +9 -0
- package/five/model/loaders/glTF-helpers/extensions/KHR_materials_clearcoat.d.ts +10 -0
- package/five/model/loaders/glTF-helpers/extensions/KHR_materials_emissive_strength.d.ts +10 -0
- package/five/model/loaders/glTF-helpers/extensions/KHR_materials_sheen.d.ts +10 -0
- package/five/model/loaders/glTF-helpers/extensions/KHR_materials_transmission.d.ts +10 -0
- package/five/model/loaders/glTF-helpers/extensions/KHR_materials_unlit.d.ts +10 -0
- package/five/model/loaders/glTF-helpers/extensions/KHR_mesh_quantization.d.ts +6 -0
- package/five/model/loaders/glTF-helpers/extensions/KHR_node_visibility.d.ts +10 -0
- package/five/model/loaders/glTF-helpers/extensions/KHR_texture_basisu.d.ts +9 -0
- package/five/model/loaders/glTF-helpers/extensions/KHR_texture_transform.d.ts +10 -0
- package/five/model/loaders/glTF-helpers/extensions/REALSEE_materials_lightmap.d.ts +7 -0
- package/five/model/loaders/glTF-helpers/extensions/base.d.ts +24 -0
- package/five/model/loaders/glTF-helpers/glTF.d.ts +713 -0
- package/five/model/loaders/glTF-helpers/index.d.ts +47 -0
- package/five/model/loaders/glTF-helpers/parser.d.ts +114 -0
- package/five/model/loaders/glTF-helpers/type.d.ts +14 -0
- package/five/model/loaders/gltf.d.ts +10 -0
- package/five/model/loaders/obj.d.ts +9 -0
- package/five/model/loaders/pbm.d.ts +26 -0
- package/five/model/loaders/ply.d.ts +24 -0
- package/five/model/loaders/pnts.d.ts +8 -0
- package/five/model/loaders/protobuf/dome.d.ts +540 -0
- package/five/model/loaders/protobuf/pbm.d.ts +203 -0
- package/five/model/loaders/shared.d.ts +16 -0
- package/five/model/loaders/splat.d.ts +8 -0
- package/five/model/loaders/spz.d.ts +14 -0
- package/five/model/loaders/tile3d-helpers/feature-table.d.ts +15 -0
- package/five/model/loaders/tile3d-helpers/gl-type.d.ts +20 -0
- package/five/model/loaders/tile3d-helpers/parse-gltf-array-buffer.d.ts +2 -0
- package/five/model/loaders/tile3d-helpers/parse-header.d.ts +2 -0
- package/five/model/loaders/tile3d-helpers/parse-point-cloud-attributes.d.ts +2 -0
- package/five/model/loaders/tile3d-helpers/parse-point-cloud-attributes.worker.d.ts +6 -0
- package/five/model/loaders/tile3d-helpers/parse-table.d.ts +3 -0
- package/five/model/loaders/tile3d-helpers/tile3d-type.d.ts +35 -0
- package/five/model/loaders/x3p.d.ts +22 -0
- package/five/model/materials/pbmMaterial.d.ts +137 -0
- package/five/model/materials/pbmMeshMaterial.d.ts +126 -0
- package/five/model/materials/pbmPointCloudMaterial.d.ts +70 -0
- package/five/model/model-scene.d.ts +172 -0
- package/five/model/model.d.ts +209 -0
- package/five/model/objects/pbmContainer.d.ts +28 -0
- package/five/model/objects/pbmGaussianSplattingObject.d.ts +43 -0
- package/five/model/objects/pbmGaussianSplattingRenderMesh.d.ts +55 -0
- package/five/model/objects/pbmGaussianSplattingTestMesh.d.ts +7 -0
- package/five/model/objects/pbmGroup.d.ts +8 -0
- package/five/model/objects/pbmMesh.d.ts +10 -0
- package/five/model/objects/pbmPointCloud.d.ts +7 -0
- package/five/model/parameter.d.ts +140 -0
- package/five/model/shaders/pbm_gaussian_splatting/fragment.d.ts +2 -0
- package/five/model/shaders/pbm_gaussian_splatting/vertex.d.ts +2 -0
- package/five/model/shaders/pbm_mesh_basic/fragment.d.ts +2 -0
- package/five/model/shaders/pbm_mesh_basic/vertex.d.ts +2 -0
- package/five/model/shaders/pbm_mesh_none/fragment.d.ts +2 -0
- package/five/model/shaders/pbm_mesh_none/vertex.d.ts +2 -0
- package/five/model/shaders/pbm_mesh_phong/fragment.d.ts +2 -0
- package/five/model/shaders/pbm_mesh_phong/vertex.d.ts +2 -0
- package/five/model/shaders/pbm_mesh_standard/fragment.d.ts +2 -0
- package/five/model/shaders/pbm_mesh_standard/vertex.d.ts +2 -0
- package/five/model/shaders/pbm_pointcloud/fragment.d.ts +2 -0
- package/five/model/shaders/pbm_pointcloud/vertex.d.ts +2 -0
- package/five/model/tile3d/header.d.ts +88 -0
- package/five/model/tile3d/index.d.ts +214 -0
- package/five/model/tile3d/tile-cache.d.ts +18 -0
- package/five/model/tile3d/tile-content.d.ts +10 -0
- package/five/model/tile3d/tile-node.d.ts +24 -0
- package/five/model/tile3d/tile-request-scheduler.d.ts +17 -0
- package/five/model/tile3d/tile.d.ts +79 -0
- package/five/model/tile3d/tileset-base-traverser.d.ts +59 -0
- package/five/model/tile3d/tileset-most-detail-traverser.d.ts +14 -0
- package/five/model/tile3d/tileset-normal-traverser.d.ts +15 -0
- package/five/model/tile3d/tileset-skip-traverser.d.ts +60 -0
- package/five/model/tile3d/tileset.d.ts +69 -0
- package/five/model/tile3d/trajectory-content.d.ts +9 -0
- package/five/model/tile3d/trajectory-node.d.ts +15 -0
- package/five/model/tile3d/trajectory.d.ts +30 -0
- package/five/model/tile3d/types.d.ts +33 -0
- package/five/model/view-layer.d.ts +20 -0
- package/five/renderer/five-renderer.d.ts +17 -0
- package/five/renderer/index.d.ts +3 -0
- package/five/renderer/postprocessing/composer.d.ts +37 -0
- package/five/renderer/postprocessing/index.d.ts +7 -0
- package/five/renderer/postprocessing/passes/adaptive-luminance-pass.d.ts +17 -0
- package/five/renderer/postprocessing/passes/eye-dome-lighting-pass.d.ts +14 -0
- package/five/renderer/postprocessing/passes/flowing-light-2d-pass.d.ts +36 -0
- package/five/renderer/postprocessing/passes/flowing-light-3d-pass.d.ts +36 -0
- package/five/renderer/postprocessing/passes/gaussian-blur-pass.d.ts +12 -0
- package/five/renderer/postprocessing/passes/pass.d.ts +38 -0
- package/five/renderer/scene-renderers/point-cloud-high-quality-scene-renderer.d.ts +11 -0
- package/five/renderer/scene-renderers/scene-renderer.d.ts +9 -0
- package/five/renderer/scene-renderers/ssaa-scene-renderer.d.ts +15 -0
- package/five/renderer/tools/full-screen-quad.d.ts +15 -0
- package/five/renderer/tools/render-cube-to-equirectangular.d.ts +7 -0
- package/five/renderer/tools/render-full-screen-depth.d.ts +2 -0
- package/five/renderer/tools/render-full-screen.d.ts +2 -0
- package/five/texture/histogram.d.ts +54 -0
- package/five/texture/imageBitmap.d.ts +13 -0
- package/five/texture/initTexture.d.ts +3 -0
- package/five/texture/loader.d.ts +39 -0
- package/five/texture/textureData.d.ts +11 -0
- package/five/thirdparty/fflate.d.ts +1407 -0
- package/five/thirdparty/hammer.d.ts +375 -0
- package/five/thirdparty/jsrsasign.d.ts +753 -0
- package/five/thirdparty/meshopt_decoder.d.ts +15 -0
- package/five/three-version-check.d.ts +1 -0
- package/five/types/addableObject.d.ts +12 -0
- package/five/types/cube.d.ts +1 -0
- package/five/types/gestureInput.d.ts +24 -0
- package/five/types/imageOptions.d.ts +20 -0
- package/five/types/intersectMeshInterface.d.ts +8 -0
- package/five/types/movePanoEffect.d.ts +13 -0
- package/five/types/movePanoOptions.d.ts +36 -0
- package/five/types/panoCircleMeshInterface.d.ts +34 -0
- package/five/types/plugin.d.ts +25 -0
- package/five/types/pose.d.ts +17 -0
- package/five/types/state.d.ts +20 -0
- package/five/types/viewport.d.ts +22 -0
- package/five/utils/ajax.d.ts +66 -0
- package/five/utils/animationFrameLoop.d.ts +45 -0
- package/five/utils/array.d.ts +31 -0
- package/five/utils/asyncTaskQueue.d.ts +8 -0
- package/five/utils/bufferGeometry.d.ts +33 -0
- package/five/utils/calculateProgress.d.ts +39 -0
- package/five/utils/calculateThreeMouse.d.ts +13 -0
- package/five/utils/canplayVideo.d.ts +2 -0
- package/five/utils/clamp.d.ts +2 -0
- package/five/utils/clock.d.ts +17 -0
- package/five/utils/createSymbol.d.ts +5 -0
- package/five/utils/decodeText.d.ts +2 -0
- package/five/utils/deepEqual.d.ts +2 -0
- package/five/utils/deepFreeze.d.ts +2 -0
- package/five/utils/defineProperty.d.ts +9 -0
- package/five/utils/detector.d.ts +14 -0
- package/five/utils/distance.d.ts +10 -0
- package/five/utils/draco.d.ts +26 -0
- package/five/utils/easing.d.ts +63 -0
- package/five/utils/event.d.ts +159 -0
- package/five/utils/formatRad.d.ts +7 -0
- package/five/utils/imageSupport.d.ts +6 -0
- package/five/utils/imageURL.d.ts +42 -0
- package/five/utils/isEmptyObject.d.ts +2 -0
- package/five/utils/isNil.d.ts +6 -0
- package/five/utils/isNumber.d.ts +2 -0
- package/five/utils/isPowerOfTwo.d.ts +2 -0
- package/five/utils/isPromise.d.ts +2 -0
- package/five/utils/isSimilar.d.ts +6 -0
- package/five/utils/json.d.ts +7 -0
- package/five/utils/ktx2.d.ts +30 -0
- package/five/utils/lzma/index.d.ts +2 -0
- package/five/utils/lzma/lzma.d.ts +3 -0
- package/five/utils/lzma/lzmaWASM.d.ts +2 -0
- package/five/utils/lzma/lzmaWorker.d.ts +14 -0
- package/five/utils/memoryUsage.d.ts +29 -0
- package/five/utils/motion.d.ts +38 -0
- package/five/utils/noop.d.ts +6 -0
- package/five/utils/now.d.ts +7 -0
- package/five/utils/pano.d.ts +9 -0
- package/five/utils/pick.d.ts +3 -0
- package/five/utils/poseUtils.d.ts +5 -0
- package/five/utils/renderCubeTextureToCubeRenderTarget.d.ts +3 -0
- package/five/utils/renderDepth.d.ts +2 -0
- package/five/utils/renderTexturesToCubeRenderTarget.d.ts +10 -0
- package/five/utils/requestPermission.d.ts +3 -0
- package/five/utils/shaderContentFix.d.ts +7 -0
- package/five/utils/shaderMaterial.d.ts +20 -0
- package/five/utils/stateUtils.d.ts +5 -0
- package/five/utils/string-pattern.d.ts +8 -0
- package/five/utils/subscribe.d.ts +67 -0
- package/five/utils/tileCube.d.ts +19 -0
- package/five/utils/toFastProperties.d.ts +1 -0
- package/five/utils/typedCache.d.ts +10 -0
- package/five/utils/uniform.d.ts +15 -0
- package/five/utils/url.d.ts +35 -0
- package/five/utils/uuid.d.ts +5 -0
- package/five/utils/values.d.ts +2 -0
- package/five/utils/vectorCoordinates.d.ts +29 -0
- package/five/utils/volume.d.ts +111 -0
- package/five/utils/webglError.d.ts +7 -0
- package/five/utils/worker.d.ts +26 -0
- package/five/webxr/XRControllerModelFactory.d.ts +28 -0
- package/five/webxr/motionHelper.d.ts +68 -0
- package/five/webxr/xrButton.d.ts +4 -0
- package/five/webxr/xrController.d.ts +24 -0
- package/five/webxr/xrManager.d.ts +84 -0
- package/five/work/_ALLOW_HOST.d.ts +2 -0
- package/five/work/index.d.ts +6 -0
- package/five/work/keychain.d.ts +5 -0
- package/five/work/looseWorkType.d.ts +121 -0
- package/five/work/verify.d.ts +7 -0
- package/five/work/work.d.ts +236 -0
- package/five/work/workFetcher.d.ts +4 -0
- package/five/work/workJson.d.ts +3 -0
- package/five/work/workJsonType.d.ts +73 -0
- package/five/work/workObserverUtils.d.ts +36 -0
- package/five/work/workParser.d.ts +6 -0
- package/five/work/workResolvedObserver.d.ts +12 -0
- package/five/work/workVerify.d.ts +2 -0
- package/five/work/works.d.ts +10 -0
- package/gltf-loader/gltf-object.d.ts +17 -0
- package/gltf-loader/index.d.ts +60 -160
- package/gltf-loader/index.js +9 -9
- package/gltf-loader/index.mjs +1351 -1451
- package/gltf-loader/thirdparty/DDSLoader.d.ts +23 -0
- package/gltf-loader/thirdparty/DRACOLoader.d.ts +18 -0
- package/gltf-loader/thirdparty/GLTFLoader.d.ts +59 -0
- package/line/circle_png.d.ts +1 -0
- package/line/index.d.ts +19 -69
- package/line/index.js +4 -4
- package/line/index.mjs +334 -513
- package/line/utils/Line2.d.ts +7 -0
- package/line/utils/LineGeometry.d.ts +10 -0
- package/line/utils/LineMaterial.d.ts +20 -0
- package/line/utils/LineSegments2.d.ts +11 -0
- package/line/utils/LineSegmentsGeometry.d.ts +15 -0
- package/llms.txt +43 -31
- package/package.json +11 -2
- package/plugins/BackgroundPlugin/Controller.d.ts +20 -0
- package/plugins/BackgroundPlugin/index.d.ts +5 -0
- package/plugins/BackgroundPlugin/typings.d.ts +44 -0
- package/plugins/BasePlugin/index.d.ts +119 -0
- package/plugins/DynamicPathLinePlugin/Controller.d.ts +167 -0
- package/plugins/DynamicPathLinePlugin/index.d.ts +5 -0
- package/plugins/DynamicPathLinePlugin/line2/Line2.d.ts +7 -0
- package/plugins/DynamicPathLinePlugin/line2/LineGeometry.d.ts +10 -0
- package/plugins/DynamicPathLinePlugin/line2/LineMaterial.d.ts +17 -0
- package/plugins/DynamicPathLinePlugin/line2/LineSegments2.d.ts +11 -0
- package/plugins/DynamicPathLinePlugin/line2/LineSegmentsGeometry.d.ts +15 -0
- package/plugins/DynamicPathLinePlugin/typing.d.ts +129 -0
- package/plugins/DynamicPathLinePlugin/typings.d.ts +72 -0
- package/plugins/ItemMaskPlugin/Controller.d.ts +48 -0
- package/plugins/ItemMaskPlugin/index.d.ts +5 -0
- package/plugins/ItemMaskPlugin/typing.d.ts +58 -0
- package/plugins/OrientationPlugin/Controller.d.ts +82 -0
- package/plugins/OrientationPlugin/RoundedBoxGeometry.d.ts +11 -0
- package/plugins/OrientationPlugin/index.d.ts +6 -0
- package/plugins/OrientationPlugin/typing.d.ts +25 -0
- package/plugins/PanoAnimePlugin/Controller.d.ts +46 -0
- package/plugins/PanoAnimePlugin/index.d.ts +5 -0
- package/plugins/PanoAnimePlugin/typing.d.ts +37 -0
- package/plugins/PluginTemplate/Controller.d.ts +27 -0
- package/plugins/PluginTemplate/index.d.ts +5 -0
- package/plugins/PluginTemplate/typing.d.ts +21 -0
- package/plugins/TrajectoryPlugin/Controller.d.ts +85 -0
- package/plugins/TrajectoryPlugin/index.d.ts +6 -0
- package/plugins/TrajectoryPlugin/typing.d.ts +25 -0
- package/plugins/index.d.ts +9 -1102
- package/plugins/index.js +17 -21
- package/plugins/index.mjs +3342 -4245
- package/plugins/thirdParty/CSS3DRenderer.d.ts +32 -0
- package/plugins/thirdParty/OrbitControls.d.ts +78 -0
- package/plugins/utils/absoluteUrl.d.ts +5 -0
- package/plugins/utils/clamp.d.ts +2 -0
- package/plugins/utils/loadImage.d.ts +1 -0
- package/plugins/utils/motion.d.ts +38 -0
- package/plugins/utils/now.d.ts +6 -0
- package/plugins/utils/uuid.d.ts +5 -0
- package/react/canvas.d.ts +19 -0
- package/react/context.d.ts +11 -0
- package/react/createProvider.d.ts +95 -0
- package/react/createStore.d.ts +144 -0
- package/react/hooks/unsafe__useFiveInstance.d.ts +9 -0
- package/react/hooks/useFiveAction.d.ts +147 -0
- package/react/hooks/useFiveCameraDirection.d.ts +7 -0
- package/react/hooks/useFiveCameraRaycaster.d.ts +7 -0
- package/react/hooks/useFiveCurrentObserver.d.ts +11 -0
- package/react/hooks/useFiveCurrentState.d.ts +15 -0
- package/react/hooks/useFiveEventCallback.d.ts +12 -0
- package/react/hooks/useFiveFloor.d.ts +15 -0
- package/react/hooks/useFiveHelper.d.ts +14 -0
- package/react/hooks/useFiveModelBounding.d.ts +5 -0
- package/react/hooks/useFiveModelEffect.d.ts +14 -0
- package/react/hooks/useFiveModelIntersectRaycaster.d.ts +22 -0
- package/react/hooks/useFiveModelReadyState.d.ts +8 -0
- package/react/hooks/useFiveProject2d.d.ts +20 -0
- package/react/hooks/useFiveSceneEffect.d.ts +21 -0
- package/react/hooks/useFiveState.d.ts +6 -0
- package/react/hooks/useFiveWork.d.ts +29 -0
- package/react/index.d.ts +24 -830
- package/react/index.js +3 -3
- package/react/index.mjs +572 -783
- package/react/rendererPool.d.ts +7 -0
- package/react/withFive.d.ts +213 -0
- package/shader-lib/EvenessPlane/index.d.ts +10 -0
- package/shader-lib/PointCloudExpand/index.d.ts +59 -0
- package/shader-lib/PolygonCuter/index.d.ts +52 -0
- package/shader-lib/PolygonCuter/worker.d.ts +14 -0
- package/shader-lib/ShineModel/index.d.ts +7 -0
- package/shader-lib/SweepModel/index.d.ts +7 -0
- package/shader-lib/index.d.ts +5 -86
- package/shader-lib/index.js +13 -14
- package/shader-lib/index.mjs +424 -824
- package/sticker/geometry.d.ts +3 -0
- package/sticker/index.d.ts +68 -71
- package/sticker/index.js +3 -3
- package/sticker/index.mjs +102 -142
- package/umd/five-gltf-loader.js +9 -9
- package/umd/five-line.js +4 -4
- package/umd/five-plugins.js +17 -21
- package/umd/five-react.js +3 -3
- package/umd/five-shader-lib.js +13 -14
- package/umd/five-sticker.js +3 -3
- package/umd/five-vfx.js +21 -21
- package/umd/five-vue.js +3 -3
- package/umd/five.js +188 -336
- package/vfx/airflow/airflow.d.ts +18 -0
- package/vfx/airflow/fragment-shader.d.ts +2 -0
- package/vfx/airflow/vertex-shader.d.ts +2 -0
- package/vfx/common/scale-shader.d.ts +2 -0
- package/vfx/common/simplex-noise-shader.d.ts +2 -0
- package/vfx/frame/fragment-shader.d.ts +2 -0
- package/vfx/frame/frame.d.ts +22 -0
- package/vfx/frame/vertex-shader.d.ts +2 -0
- package/vfx/index.d.ts +7 -363
- package/vfx/index.js +21 -21
- package/vfx/index.mjs +454 -910
- package/vfx/particle/fragment-shader.d.ts +2 -0
- package/vfx/particle/instance.d.ts +36 -0
- package/vfx/particle/particle.d.ts +205 -0
- package/vfx/particle/utils.d.ts +11 -0
- package/vfx/particle/vertex-shader.d.ts +2 -0
- package/vfx/particle-gpu/fragment-shader.d.ts +2 -0
- package/vfx/particle-gpu/instance.d.ts +36 -0
- package/vfx/particle-gpu/particle.d.ts +95 -0
- package/vfx/particle-gpu/utils.d.ts +11 -0
- package/vfx/particle-gpu/vertex-shader.d.ts +2 -0
- package/vfx/spotLight/fragment-shader.d.ts +2 -0
- package/vfx/spotLight/spotLight.d.ts +15 -0
- package/vfx/spotLight/vertex-shader.d.ts +2 -0
- package/vue/context.d.ts +7 -0
- package/vue/hooks/FiveCanvas.d.ts +36 -0
- package/vue/hooks/FiveProvider.d.ts +35 -0
- package/vue/hooks/unsafe__useFiveInject.d.ts +9 -0
- package/vue/hooks/useFiveAction.d.ts +178 -0
- package/vue/hooks/useFiveCameraDirection.d.ts +8 -0
- package/vue/hooks/useFiveCameraRaycaster.d.ts +8 -0
- package/vue/hooks/useFiveCurrentObserver.d.ts +12 -0
- package/vue/hooks/useFiveCurrentState.d.ts +16 -0
- package/vue/hooks/useFiveEventCallback.d.ts +11 -0
- package/vue/hooks/useFiveFloor.d.ts +16 -0
- package/vue/hooks/useFiveHelper.d.ts +15 -0
- package/vue/hooks/useFiveModel.d.ts +7 -0
- package/vue/hooks/useFiveModelBounding.d.ts +7 -0
- package/vue/hooks/useFiveModelIntersectRaycaster.d.ts +23 -0
- package/vue/hooks/useFiveModelReadyState.d.ts +9 -0
- package/vue/hooks/useFiveProject2d.d.ts +26 -0
- package/vue/hooks/useFiveScene.d.ts +6 -0
- package/vue/hooks/useFiveState.d.ts +16 -0
- package/vue/hooks/useFiveWork.d.ts +30 -0
- package/vue/index.d.ts +23 -467
- package/vue/index.js +3 -3
- package/vue/index.mjs +309 -301
- package/vue/rendererPool.d.ts +10 -0
- package/work-downloader/components/model-3d-tile.d.ts +2 -0
- package/work-downloader/components/model.d.ts +3 -0
- package/work-downloader/components/observer.d.ts +7 -0
- package/work-downloader/download.d.ts +16 -0
- package/work-downloader/index.d.ts +2 -33
- package/work-downloader/index.js +3 -3
- package/work-downloader/index.mjs +317 -556
- package/work-downloader/type.d.ts +28 -0
- package/work-downloader/utils/download-to-file.d.ts +1 -0
- package/work-downloader/utils/image-processing.d.ts +7 -0
- package/work-downloader/utils/join-url.d.ts +2 -0
- package/work-downloader/utils/log.d.ts +1 -0
- package/work-downloader/utils/relative-url.d.ts +1 -0
- package/docs/documents/five.FivePlugin.plugin.html +0 -60
- package/docs/documents/plugin.html +0 -60
- package/docs/media/five.ts +0 -2881
- package/docs/media/pass.ts +0 -64
- package/guides/ai-doc-guidelines.md +0 -72
- package/guides/features/3dtile.md +0 -264
- package/guides/features/parameter.md +0 -178
- package/guides/plugin.md +0 -206
- /package/{guides → ai_guides}/release_notes/6.6.md +0 -0
- /package/{guides → ai_guides}/release_notes/6.7.md +0 -0
- /package/{guides → ai_guides}/support.md +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const FRAGMENT_SHADER = "\nvarying vec4 vColor;\n\n#if defined(USE_MAP)\n uniform sampler2D map;\n varying float vAngle;\n#endif\n\nvoid main() {\n gl_FragColor = vColor;\n\n #if defined(USE_MAP)\n float c = cos(vAngle);\n float s = sin(vAngle);\n\n // rotate UV coordinates to rotate texture\n vec2 rotatedUV = vec2(\n c * (gl_PointCoord.x - 0.5) + s * (gl_PointCoord.y - 0.5) + 0.5,\n c * (gl_PointCoord.y - 0.5) - s * (gl_PointCoord.x - 0.5) + 0.5\n );\n vec4 rotatedTexture = texture2D(map, rotatedUV);\n gl_FragColor = vColor * rotatedTexture;\n #endif\n}\n";
|
|
2
|
+
export { FRAGMENT_SHADER };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import { TweenKeyframe } from './utils';
|
|
3
|
+
declare class Instance {
|
|
4
|
+
birthTime: number;
|
|
5
|
+
deathAge: number;
|
|
6
|
+
position: THREE.Vector3;
|
|
7
|
+
velocity: THREE.Vector3;
|
|
8
|
+
acceleration: THREE.Vector3;
|
|
9
|
+
angle: number;
|
|
10
|
+
angleVelocity: number;
|
|
11
|
+
angleAcceleration: number;
|
|
12
|
+
size: number;
|
|
13
|
+
sizeTween: TweenKeyframe<number> | null;
|
|
14
|
+
color: THREE.Vector3;
|
|
15
|
+
colorTween: TweenKeyframe<THREE.Vector3> | null;
|
|
16
|
+
opacity: number;
|
|
17
|
+
opacityTween: TweenKeyframe<number> | null;
|
|
18
|
+
constructor(birthTime: number, deathAge: number, position: THREE.Vector3, velocity: THREE.Vector3, acceleration: THREE.Vector3, angle: number, angleVelocity: number, angleAcceleration: number, color: THREE.Vector3, colorTween: TweenKeyframe<THREE.Vector3> | null, size: number, sizeTween: TweenKeyframe<number> | null, opacity: number, opacityTween: TweenKeyframe<number> | null);
|
|
19
|
+
/**
|
|
20
|
+
* @param time 秒
|
|
21
|
+
*/
|
|
22
|
+
getAlive(time: number): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* @param time 秒
|
|
25
|
+
*/
|
|
26
|
+
getState(time: number): {
|
|
27
|
+
alive: boolean;
|
|
28
|
+
age: number;
|
|
29
|
+
position: THREE.Vector3;
|
|
30
|
+
angle: number;
|
|
31
|
+
size: number;
|
|
32
|
+
color: THREE.Color;
|
|
33
|
+
opacity: number;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
export { Instance };
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import { TweenKeyframe } from './utils';
|
|
3
|
+
type ParticleType = 'CUBE' | 'SPHERE';
|
|
4
|
+
/**
|
|
5
|
+
* 粒子系统初始化参数
|
|
6
|
+
*/
|
|
7
|
+
interface ParticleArgs {
|
|
8
|
+
/** 粒子的初始位置坐标 */
|
|
9
|
+
positionBase: THREE.Vector3;
|
|
10
|
+
/**
|
|
11
|
+
* 粒子坐标的抖动计算形式
|
|
12
|
+
* @description
|
|
13
|
+
* 粒子坐标的抖动计算形式,分 `CUBE` 和 `SPHERE` 形式。
|
|
14
|
+
* `CUBE` 形式通过一个 三维向量 的扩散值 positionCubeSpread,乘上一个 [0, 1] 的随机三维向量 计算。
|
|
15
|
+
* `SPHERE` 形式通过一个 数字 的扩散值 positionSphereSpread,乘上一个随机单位向量 计算。
|
|
16
|
+
*/
|
|
17
|
+
positionStyle: ParticleType;
|
|
18
|
+
/** 粒子坐标的抖动`CUBE`计算形式下的扩散值 */
|
|
19
|
+
positionCubeSpread: THREE.Vector3;
|
|
20
|
+
/** 粒子坐标的抖动`SPHERE`计算形式下的扩散值 */
|
|
21
|
+
positionSphereSpread: number;
|
|
22
|
+
/**
|
|
23
|
+
* 粒子速度的抖动计算形式
|
|
24
|
+
* @description
|
|
25
|
+
* 粒子速度的抖动计算形式,分 `CUBE` 和 `SPHERE` 形式。
|
|
26
|
+
* `CUBE` 形式通过一个 三维向量 的速度值 velocityCubeBase 加上 三维向量 的扩散值 velocityCubeSpread 乘上一个 [0, 1] 的随机三维向量 计算。
|
|
27
|
+
* `SPHERE` 形式通过一个 数字 的速度值 velocitySphereBase 加上 数字 的扩散值 velocitySphereSpread 乘上 粒子坐标与粒子的初始位置坐标方向的单位向量 计算。
|
|
28
|
+
*/
|
|
29
|
+
velocityStyle: ParticleType;
|
|
30
|
+
/** 粒子速度的`CUBE`计算形式下的速度值 */
|
|
31
|
+
velocityCubeBase: THREE.Vector3;
|
|
32
|
+
/** 粒子速度的`CUBE`计算形式下的扩散值 */
|
|
33
|
+
velocityCubeSpread: THREE.Vector3;
|
|
34
|
+
/** 粒子速度的`SPHERE`计算形式下的速度值 */
|
|
35
|
+
velocitySphereBase: number;
|
|
36
|
+
/** 粒子速度的`SPHERE`计算形式下的扩散值 */
|
|
37
|
+
velocitySphereSpread: number;
|
|
38
|
+
/** 粒子加速度 */
|
|
39
|
+
accelerationBase: THREE.Vector3;
|
|
40
|
+
/** 粒子加速度扩散值 */
|
|
41
|
+
accelerationSpread: THREE.Vector3;
|
|
42
|
+
/** 旋转角度初始值 */
|
|
43
|
+
angleBase: number;
|
|
44
|
+
/** 旋转角度初始值的扩散值 */
|
|
45
|
+
angleSpread: number;
|
|
46
|
+
/** 旋转角度速度值 */
|
|
47
|
+
angleVelocityBase: number;
|
|
48
|
+
/** 旋转角度速度值的扩散值 */
|
|
49
|
+
angleVelocitySpread: number;
|
|
50
|
+
/** 旋转角度加速度值 */
|
|
51
|
+
angleAccelerationBase: number;
|
|
52
|
+
/** 旋转角度加速度值扩散值 */
|
|
53
|
+
angleAccelerationSpread: number;
|
|
54
|
+
/** 粒子大小 */
|
|
55
|
+
sizeBase: number;
|
|
56
|
+
/** 粒子大小的扩散值 */
|
|
57
|
+
sizeSpread: number;
|
|
58
|
+
/** 粒子大小随时间分布的增益 */
|
|
59
|
+
sizeTween: TweenKeyframe<number> | null;
|
|
60
|
+
/**
|
|
61
|
+
* 颜色(hsl)
|
|
62
|
+
* @description
|
|
63
|
+
* http://en.wikipedia.org/wiki/HSL_and_HSV
|
|
64
|
+
* `{ x: h, y: s, z: l }`
|
|
65
|
+
*/
|
|
66
|
+
colorBase: THREE.Vector3;
|
|
67
|
+
/** 颜色(hsl)的扩散值
|
|
68
|
+
* @description
|
|
69
|
+
* http://en.wikipedia.org/wiki/HSL_and_HSV
|
|
70
|
+
* `{ x: h, y: s, z: l }`
|
|
71
|
+
*/
|
|
72
|
+
colorSpread: THREE.Vector3;
|
|
73
|
+
/**
|
|
74
|
+
* 颜色(hsl)随时间分布的增益
|
|
75
|
+
* @description
|
|
76
|
+
* http://en.wikipedia.org/wiki/HSL_and_HSV
|
|
77
|
+
* `{ x: h, y: s, z: l }`
|
|
78
|
+
*/
|
|
79
|
+
colorTween: TweenKeyframe<THREE.Vector3> | null;
|
|
80
|
+
/** 透明度 */
|
|
81
|
+
opacityBase: number;
|
|
82
|
+
/** 透明度的扩散值 */
|
|
83
|
+
opacitySpread: number;
|
|
84
|
+
/** 透明度随时间分布的增益 */
|
|
85
|
+
opacityTween: TweenKeyframe<number> | null;
|
|
86
|
+
/** 贴图素材 */
|
|
87
|
+
texture: THREE.Texture;
|
|
88
|
+
/** 材质混合方式 */
|
|
89
|
+
blending: THREE.Blending;
|
|
90
|
+
/** 一秒产生多少粒子 */
|
|
91
|
+
particlesPerSecond: number;
|
|
92
|
+
/** 粒子存活时长 */
|
|
93
|
+
particleDeathAge: number;
|
|
94
|
+
}
|
|
95
|
+
declare class Particle extends THREE.Points<THREE.BufferGeometry, THREE.ShaderMaterial> {
|
|
96
|
+
needsRender: boolean;
|
|
97
|
+
/** 是否暂停 */
|
|
98
|
+
paused: boolean;
|
|
99
|
+
private disposed;
|
|
100
|
+
private birthTime;
|
|
101
|
+
private instances;
|
|
102
|
+
/** 粒子的初始位置坐标 */
|
|
103
|
+
positionBase: THREE.Vector3;
|
|
104
|
+
/**
|
|
105
|
+
* 粒子坐标的抖动计算形式
|
|
106
|
+
* @description
|
|
107
|
+
* 粒子坐标的抖动计算形式,分 `CUBE` 和 `SPHERE` 形式。
|
|
108
|
+
* `CUBE` 形式通过一个 三维向量 的扩散值 positionCubeSpread,乘上一个 [0, 1] 的随机三维向量 计算。
|
|
109
|
+
* `SPHERE` 形式通过一个 数字 的扩散值 positionSphereSpread,乘上一个随机单位向量 计算。
|
|
110
|
+
*/
|
|
111
|
+
positionStyle: ParticleType;
|
|
112
|
+
/** 粒子坐标的抖动`CUBE`计算形式下的扩散值 */
|
|
113
|
+
positionCubeSpread: THREE.Vector3;
|
|
114
|
+
/** 粒子坐标的抖动`SPHERE`计算形式下的扩散值 */
|
|
115
|
+
positionSphereSpread: number;
|
|
116
|
+
/**
|
|
117
|
+
* 粒子速度的抖动计算形式
|
|
118
|
+
* @description
|
|
119
|
+
* 粒子速度的抖动计算形式,分 `CUBE` 和 `SPHERE` 形式。
|
|
120
|
+
* `CUBE` 形式通过一个 三维向量 的速度值 velocityCubeBase 加上 三维向量 的扩散值 velocityCubeSpread 乘上一个 [0, 1] 的随机三维向量 计算。
|
|
121
|
+
* `SPHERE` 形式通过一个 数字 的速度值 velocitySphereBase 加上 数字 的扩散值 velocitySphereSpread 乘上 粒子坐标与粒子的初始位置坐标方向的单位向量 计算。
|
|
122
|
+
*/
|
|
123
|
+
velocityStyle: ParticleType;
|
|
124
|
+
/** 粒子速度的`CUBE`计算形式下的速度值 */
|
|
125
|
+
velocityCubeBase: THREE.Vector3;
|
|
126
|
+
/** 粒子速度的`CUBE`计算形式下的扩散值 */
|
|
127
|
+
velocityCubeSpread: THREE.Vector3;
|
|
128
|
+
/** 粒子速度的`SPHERE`计算形式下的速度值 */
|
|
129
|
+
velocitySphereBase: number;
|
|
130
|
+
/** 粒子速度的`SPHERE`计算形式下的扩散值 */
|
|
131
|
+
velocitySphereSpread: number;
|
|
132
|
+
/** 粒子加速度 */
|
|
133
|
+
accelerationBase: THREE.Vector3;
|
|
134
|
+
/** 粒子加速度扩散值 */
|
|
135
|
+
accelerationSpread: THREE.Vector3;
|
|
136
|
+
/** 旋转角度初始值 */
|
|
137
|
+
angleBase: number;
|
|
138
|
+
/** 旋转角度初始值的扩散值 */
|
|
139
|
+
angleSpread: number;
|
|
140
|
+
/** 旋转角度速度值 */
|
|
141
|
+
angleVelocityBase: number;
|
|
142
|
+
/** 旋转角度速度值的扩散值 */
|
|
143
|
+
angleVelocitySpread: number;
|
|
144
|
+
/** 旋转角度加速度值 */
|
|
145
|
+
angleAccelerationBase: number;
|
|
146
|
+
/** 旋转角度加速度值扩散值 */
|
|
147
|
+
angleAccelerationSpread: number;
|
|
148
|
+
/** 粒子大小 */
|
|
149
|
+
sizeBase: number;
|
|
150
|
+
/** 粒子大小的扩散值 */
|
|
151
|
+
sizeSpread: number;
|
|
152
|
+
/** 粒子大小随时间分布的增益 */
|
|
153
|
+
sizeTween: TweenKeyframe<number> | null;
|
|
154
|
+
/**
|
|
155
|
+
* 颜色(hsl)
|
|
156
|
+
* @description
|
|
157
|
+
* http://en.wikipedia.org/wiki/HSL_and_HSV
|
|
158
|
+
* `{ x: h, y: s, z: l }`
|
|
159
|
+
*/
|
|
160
|
+
colorBase: THREE.Vector3;
|
|
161
|
+
/** 颜色(hsl)的扩散值
|
|
162
|
+
* @description
|
|
163
|
+
* http://en.wikipedia.org/wiki/HSL_and_HSV
|
|
164
|
+
* `{ x: h, y: s, z: l }`
|
|
165
|
+
*/
|
|
166
|
+
colorSpread: THREE.Vector3;
|
|
167
|
+
/**
|
|
168
|
+
* 颜色(hsl)随时间分布的增益
|
|
169
|
+
* @description
|
|
170
|
+
* http://en.wikipedia.org/wiki/HSL_and_HSV
|
|
171
|
+
* `{ x: h, y: s, z: l }`
|
|
172
|
+
*/
|
|
173
|
+
colorTween: TweenKeyframe<THREE.Vector3> | null;
|
|
174
|
+
/** 透明度 */
|
|
175
|
+
opacityBase: number;
|
|
176
|
+
/** 透明度的扩散值 */
|
|
177
|
+
opacitySpread: number;
|
|
178
|
+
/** 透明度随时间分布的增益 */
|
|
179
|
+
opacityTween: TweenKeyframe<number> | null;
|
|
180
|
+
/** 一秒产生多少粒子 */
|
|
181
|
+
particlesPerSecond: number;
|
|
182
|
+
/** 粒子存活时长 */
|
|
183
|
+
particleDeathAge: number;
|
|
184
|
+
constructor(args: Partial<ParticleArgs>);
|
|
185
|
+
/** 贴图素材 */
|
|
186
|
+
get texture(): THREE.Texture | null;
|
|
187
|
+
set texture(value: THREE.Texture | null);
|
|
188
|
+
/** 材质混合方式 */
|
|
189
|
+
get blending(): THREE.Blending;
|
|
190
|
+
set blending(value: THREE.Blending);
|
|
191
|
+
private createInstance;
|
|
192
|
+
/** 暂停 */
|
|
193
|
+
pause(): void;
|
|
194
|
+
/** 开始 */
|
|
195
|
+
play(): void;
|
|
196
|
+
/**
|
|
197
|
+
* 通过 Five 默认调用的 setTime 方法
|
|
198
|
+
* @param time - 毫秒
|
|
199
|
+
*/
|
|
200
|
+
setTime(time: number): void;
|
|
201
|
+
/** 析构 */
|
|
202
|
+
dispose(): void;
|
|
203
|
+
}
|
|
204
|
+
export { Particle };
|
|
205
|
+
export type { ParticleArgs, ParticleType, TweenKeyframe as ParticleTweenKeyframe };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
declare function random(base: number, spread: number): number;
|
|
3
|
+
declare function randomVector3(base: THREE.Vector3, spread: THREE.Vector3): THREE.Vector3;
|
|
4
|
+
declare function displacement(velocity: number, acceleration: number, time: number): number;
|
|
5
|
+
declare function displacementVector3(velocity: THREE.Vector3, acceleration: THREE.Vector3, time: number): THREE.Vector3;
|
|
6
|
+
interface TweenKeyframe<T extends (number | THREE.Vector3)> {
|
|
7
|
+
times: number[];
|
|
8
|
+
values: T[];
|
|
9
|
+
}
|
|
10
|
+
declare function tweenLerp<T extends (number | THREE.Vector3)>(tweenKeyframe: TweenKeyframe<T>, time: number): T;
|
|
11
|
+
export { random, randomVector3, displacement, displacementVector3, TweenKeyframe, tweenLerp };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const VERTEX_SHADER = "\nattribute vec3 color;\nattribute float opacity;\nattribute float size;\nattribute float alive; // float used as boolean (0 = false, 1 = true)\n\nvarying vec4 vColor;\n\n#if defined(USE_MAP)\n attribute float angle;\n varying float vAngle;\n#endif\n\nvoid main() {\n if (alive > 0.5) {\n vColor = vec4(color, opacity);\n } else {\n vColor = vec4(0.0, 0.0, 0.0, 0.0);\n }\n #if defined(USE_MAP)\n vAngle = angle;\n #endif\n vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n gl_PointSize = size * ( 300.0 / length( mvPosition.xyz ) );\n gl_Position = projectionMatrix * mvPosition;\n}\n";
|
|
2
|
+
export { VERTEX_SHADER };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const FRAGMENT_SHADER = "\nvarying vec4 vColor;\nvarying float vAngle;\n\n#if defined(USE_MAP)\n uniform sampler2D map;\n#endif\n\nvoid main() {\n // \u5982\u679C\u7C92\u5B50\u900F\u660E\u5EA6\u4E3A0\uFF0C\u76F4\u63A5\u4E22\u5F03\n if (vColor.a <= 0.0) {\n discard;\n }\n \n gl_FragColor = vColor;\n\n #if defined(USE_MAP)\n float c = cos(vAngle);\n float s = sin(vAngle);\n\n // \u65CB\u8F6CUV\u5750\u6807\u4EE5\u65CB\u8F6C\u7EB9\u7406\n vec2 rotatedUV = vec2(\n c * (gl_PointCoord.x - 0.5) + s * (gl_PointCoord.y - 0.5) + 0.5,\n c * (gl_PointCoord.y - 0.5) - s * (gl_PointCoord.x - 0.5) + 0.5\n );\n \n vec4 textureColor = texture2D(map, rotatedUV);\n gl_FragColor = vColor * textureColor;\n #endif\n}\n";
|
|
2
|
+
export { FRAGMENT_SHADER };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import { TweenKeyframe } from './utils';
|
|
3
|
+
declare class Instance {
|
|
4
|
+
birthTime: number;
|
|
5
|
+
deathAge: number;
|
|
6
|
+
position: THREE.Vector3;
|
|
7
|
+
velocity: THREE.Vector3;
|
|
8
|
+
acceleration: THREE.Vector3;
|
|
9
|
+
angle: number;
|
|
10
|
+
angleVelocity: number;
|
|
11
|
+
angleAcceleration: number;
|
|
12
|
+
size: number;
|
|
13
|
+
sizeTween: TweenKeyframe<number> | null;
|
|
14
|
+
color: THREE.Vector3;
|
|
15
|
+
colorTween: TweenKeyframe<THREE.Vector3> | null;
|
|
16
|
+
opacity: number;
|
|
17
|
+
opacityTween: TweenKeyframe<number> | null;
|
|
18
|
+
constructor(birthTime: number, deathAge: number, position: THREE.Vector3, velocity: THREE.Vector3, acceleration: THREE.Vector3, angle: number, angleVelocity: number, angleAcceleration: number, color: THREE.Vector3, colorTween: TweenKeyframe<THREE.Vector3> | null, size: number, sizeTween: TweenKeyframe<number> | null, opacity: number, opacityTween: TweenKeyframe<number> | null);
|
|
19
|
+
/**
|
|
20
|
+
* @param time 秒
|
|
21
|
+
*/
|
|
22
|
+
getAlive(time: number): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* @param time 秒
|
|
25
|
+
*/
|
|
26
|
+
getState(time: number): {
|
|
27
|
+
alive: boolean;
|
|
28
|
+
age: number;
|
|
29
|
+
position: THREE.Vector3;
|
|
30
|
+
angle: number;
|
|
31
|
+
size: number;
|
|
32
|
+
color: THREE.Color;
|
|
33
|
+
opacity: number;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
export { Instance };
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import { TweenKeyframe } from './utils';
|
|
3
|
+
type ParticleType = 'CUBE' | 'SPHERE';
|
|
4
|
+
/**
|
|
5
|
+
* GPU粒子系统初始化参数
|
|
6
|
+
*/
|
|
7
|
+
interface ParticleArgs {
|
|
8
|
+
/** 粒子的初始位置坐标 */
|
|
9
|
+
positionBase: THREE.Vector3;
|
|
10
|
+
/** 粒子坐标的抖动计算形式 */
|
|
11
|
+
positionStyle: ParticleType;
|
|
12
|
+
/** 粒子坐标的抖动`CUBE`计算形式下的扩散值 */
|
|
13
|
+
positionCubeSpread: THREE.Vector3;
|
|
14
|
+
/** 粒子坐标的抖动`SPHERE`计算形式下的扩散值 */
|
|
15
|
+
positionSphereSpread: number;
|
|
16
|
+
/** 粒子速度的抖动计算形式 */
|
|
17
|
+
velocityStyle: ParticleType;
|
|
18
|
+
/** 粒子速度的`CUBE`计算形式下的速度值 */
|
|
19
|
+
velocityCubeBase: THREE.Vector3;
|
|
20
|
+
/** 粒子速度的`CUBE`计算形式下的扩散值 */
|
|
21
|
+
velocityCubeSpread: THREE.Vector3;
|
|
22
|
+
/** 粒子速度的`SPHERE`计算形式下的速度值 */
|
|
23
|
+
velocitySphereBase: number;
|
|
24
|
+
/** 粒子速度的`SPHERE`计算形式下的扩散值 */
|
|
25
|
+
velocitySphereSpread: number;
|
|
26
|
+
/** 粒子加速度 */
|
|
27
|
+
accelerationBase: THREE.Vector3;
|
|
28
|
+
/** 粒子加速度扩散值 */
|
|
29
|
+
accelerationSpread: THREE.Vector3;
|
|
30
|
+
/** 旋转角度初始值 */
|
|
31
|
+
angleBase: number;
|
|
32
|
+
/** 旋转角度初始值的扩散值 */
|
|
33
|
+
angleSpread: number;
|
|
34
|
+
/** 旋转角度速度值 */
|
|
35
|
+
angleVelocityBase: number;
|
|
36
|
+
/** 旋转角度速度值的扩散值 */
|
|
37
|
+
angleVelocitySpread: number;
|
|
38
|
+
/** 粒子大小 */
|
|
39
|
+
sizeBase: number;
|
|
40
|
+
/** 粒子大小的扩散值 */
|
|
41
|
+
sizeSpread: number;
|
|
42
|
+
/** 粒子大小增长率 */
|
|
43
|
+
sizeGrowth: number;
|
|
44
|
+
/** 颜色(hsl) */
|
|
45
|
+
colorBase: THREE.Vector3;
|
|
46
|
+
/** 颜色(hsl)的扩散值 */
|
|
47
|
+
colorSpread: THREE.Vector3;
|
|
48
|
+
/** 透明度 */
|
|
49
|
+
opacityBase: number;
|
|
50
|
+
/** 透明度的扩散值 */
|
|
51
|
+
opacitySpread: number;
|
|
52
|
+
/** 贴图素材 */
|
|
53
|
+
texture: THREE.Texture;
|
|
54
|
+
/** 材质混合方式 */
|
|
55
|
+
blending: THREE.Blending;
|
|
56
|
+
/** 一秒产生多少粒子 */
|
|
57
|
+
particlesPerSecond: number;
|
|
58
|
+
/** 粒子存活时长 */
|
|
59
|
+
particleDeathAge: number;
|
|
60
|
+
/** 重力 */
|
|
61
|
+
gravity: THREE.Vector3;
|
|
62
|
+
/** 噪声强度 */
|
|
63
|
+
noiseStrength: number;
|
|
64
|
+
/** 阻尼系数 */
|
|
65
|
+
damping: number;
|
|
66
|
+
}
|
|
67
|
+
declare class Particle extends THREE.Points<THREE.BufferGeometry, THREE.ShaderMaterial> {
|
|
68
|
+
needsRender: boolean;
|
|
69
|
+
paused: boolean;
|
|
70
|
+
private disposed;
|
|
71
|
+
private startTime;
|
|
72
|
+
private particleCount;
|
|
73
|
+
particlesPerSecond: number;
|
|
74
|
+
particleDeathAge: number;
|
|
75
|
+
constructor(args: Partial<ParticleArgs>);
|
|
76
|
+
/** 贴图素材 */
|
|
77
|
+
get texture(): THREE.Texture | null;
|
|
78
|
+
set texture(value: THREE.Texture | null);
|
|
79
|
+
/** 材质混合方式 */
|
|
80
|
+
get blending(): THREE.Blending;
|
|
81
|
+
set blending(value: THREE.Blending);
|
|
82
|
+
/** 暂停 */
|
|
83
|
+
pause(): void;
|
|
84
|
+
/** 开始 */
|
|
85
|
+
play(): void;
|
|
86
|
+
/**
|
|
87
|
+
* 通过 Five 默认调用的 setTime 方法
|
|
88
|
+
* @param time - 毫秒
|
|
89
|
+
*/
|
|
90
|
+
setTime(time: number): void;
|
|
91
|
+
/** 析构 */
|
|
92
|
+
dispose(): void;
|
|
93
|
+
}
|
|
94
|
+
export { Particle };
|
|
95
|
+
export type { ParticleArgs, ParticleType, TweenKeyframe as ParticleTweenKeyframe };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
declare function random(base: number, spread: number): number;
|
|
3
|
+
declare function randomVector3(base: THREE.Vector3, spread: THREE.Vector3): THREE.Vector3;
|
|
4
|
+
declare function displacement(velocity: number, acceleration: number, time: number): number;
|
|
5
|
+
declare function displacementVector3(velocity: THREE.Vector3, acceleration: THREE.Vector3, time: number): THREE.Vector3;
|
|
6
|
+
interface TweenKeyframe<T extends (number | THREE.Vector3)> {
|
|
7
|
+
times: number[];
|
|
8
|
+
values: T[];
|
|
9
|
+
}
|
|
10
|
+
declare function tweenLerp<T extends (number | THREE.Vector3)>(tweenKeyframe: TweenKeyframe<T>, time: number): T;
|
|
11
|
+
export { random, randomVector3, displacement, displacementVector3, TweenKeyframe, tweenLerp };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const VERTEX_SHADER = "\n// \u7C92\u5B50\u521D\u59CB\u5C5E\u6027\nattribute vec3 initialVelocity;\nattribute vec3 acceleration;\nattribute float birthTime;\nattribute float lifeTime;\nattribute float initialSize;\nattribute float sizeGrowth;\nattribute vec3 initialColor;\nattribute float initialOpacity;\nattribute float initialAngle;\nattribute float angleVelocity;\nattribute float particleIndex;\n\n// \u5168\u5C40uniform\u53C2\u6570\nuniform float uTime;\n\n// \u4F20\u9012\u7ED9fragment shader\u7684\u53D8\u91CF\nvarying vec4 vColor;\nvarying float vAngle;\n\n// \u7B80\u5355\u566A\u58F0\u51FD\u6570\nfloat random(vec2 st) {\n return fract(sin(dot(st.xy, vec2(12.9898,78.233))) * 43758.5453123);\n}\n\n// HSL\u8F6CRGB\u51FD\u6570\nvec3 hsl2rgb(vec3 c) {\n vec3 rgb = clamp(abs(mod(c.x*6.0+vec3(0.0,4.0,2.0), 6.0)-3.0)-1.0, 0.0, 1.0);\n return c.z + c.y * (rgb-0.5)*(1.0-abs(2.0*c.z-1.0));\n}\n\nvoid main() {\n // \u8BA1\u7B97\u7C92\u5B50\u7684\u5B9E\u9645\u5E74\u9F84\uFF0C\u8003\u8651\u5FAA\u73AF\u91CD\u751F\n float totalCycleTime = lifeTime;\n float adjustedTime = uTime + birthTime;\n float cycleTime = mod(adjustedTime, totalCycleTime);\n float age = cycleTime;\n float normalizedAge = clamp(age / lifeTime, 0.0, 1.0);\n \n // \u5982\u679C\u7C92\u5B50\u5E74\u9F84\u8D85\u8FC7\u751F\u547D\u5468\u671F\uFF0C\u8BA9\u5B83\u91CD\u65B0\u5F00\u59CB\n if (age > lifeTime) {\n age = 0.0;\n normalizedAge = 0.0;\n }\n \n // \u8BA1\u7B97\u5F53\u524D\u4F4D\u7F6E\uFF08\u7269\u7406\u6A21\u62DF\uFF09\n vec3 currentVelocity = initialVelocity + acceleration * age;\n \n vec3 currentPosition = position + currentVelocity * age;\n \n // \u8BA1\u7B97\u5F53\u524D\u5927\u5C0F\uFF08\u968F\u65F6\u95F4\u53D8\u5316\uFF09\n float currentSize = initialSize + sizeGrowth * normalizedAge;\n \n // \u8BA1\u7B97\u5F53\u524D\u89D2\u5EA6\n vAngle = initialAngle + angleVelocity * age;\n \n // \u8BA1\u7B97\u5F53\u524D\u989C\u8272\u548C\u900F\u660E\u5EA6\uFF08\u751F\u547D\u5468\u671F\u6E10\u53D8\uFF09\n vec3 currentColor = initialColor;\n float currentOpacity = initialOpacity;\n \n // \u751F\u547D\u5468\u671F\u900F\u660E\u5EA6\u6E10\u53D8\uFF08\u51FA\u751F\u548C\u6B7B\u4EA1\u65F6\u6E10\u53D8\uFF09\n if (normalizedAge < 0.1) {\n currentOpacity *= normalizedAge / 0.1; // \u6DE1\u5165\n } else if (normalizedAge > 0.8) {\n currentOpacity *= (1.0 - normalizedAge) / 0.2; // \u6DE1\u51FA\n }\n \n // \u5C06HSL\u989C\u8272\u8F6C\u6362\u4E3ARGB\n vec3 rgbColor = hsl2rgb(currentColor);\n vColor = vec4(rgbColor, currentOpacity);\n \n // \u8BA1\u7B97\u6700\u7EC8\u4F4D\u7F6E\u548C\u5927\u5C0F\n vec4 mvPosition = modelViewMatrix * vec4(currentPosition, 1.0);\n gl_PointSize = currentSize * (300.0 / length(mvPosition.xyz));\n gl_Position = projectionMatrix * mvPosition;\n}\n";
|
|
2
|
+
export { VERTEX_SHADER };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const FRAGMENT_SHADER = "\nuniform vec3 uLightColor;\nuniform vec3 uSpotPosition;\nuniform float uAttenuation;\nuniform float uAnglePower;\n\nvarying vec3 vNormal;\nvarying vec3 vWorldPosition;\nvarying float vNoise;\n\nvoid main() {\n float intensity;\n intensity\t= distance(vWorldPosition, uSpotPosition) / uAttenuation;\n intensity\t= 1.0 - clamp(intensity, 0.1, 1.0);\n\n vec3 normal = vec3(vNormal.x, vNormal.y, abs(vNormal.z));\n float angleIntensity = pow( dot(normal, vec3(0.0, 0.0, 1.0)), uAnglePower * vNoise );\n intensity\t= intensity * angleIntensity * vNoise;\n gl_FragColor = vec4( uLightColor, intensity );\n}\n";
|
|
2
|
+
export { FRAGMENT_SHADER };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
declare class SpotLight extends THREE.Group {
|
|
3
|
+
private uniforms;
|
|
4
|
+
needsRender: boolean;
|
|
5
|
+
private startTime?;
|
|
6
|
+
constructor(height?: number, radiusTop?: number, radiusBottom?: number);
|
|
7
|
+
setTime(time: number): void;
|
|
8
|
+
set attenuation(value: number);
|
|
9
|
+
get attenuation(): number;
|
|
10
|
+
set anglePower(value: number);
|
|
11
|
+
get anglePower(): number;
|
|
12
|
+
set color(value: THREE.Color);
|
|
13
|
+
get color(): THREE.Color;
|
|
14
|
+
}
|
|
15
|
+
export { SpotLight };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const VERTEX_SHADER = "\n\nuniform float uTime;\n\nvarying vec3 vNormal;\nvarying vec3 vWorldPosition;\nvarying float vNoise;\n\n\n// Simplex 4D Noise\n// by Ian McEwan, Ashima Arts\n//\nvec4 permute(vec4 x) {\n return mod((x * 34.0 + 1.0) * x, 289.0);\n}\nfloat permute(float x) {\n return floor( mod((x * 34.0 + 1.0) * x, 289.0) );\n}\nvec4 taylorInvSqrt(vec4 r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\nfloat taylorInvSqrt(float r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nvec4 grad4(float j, vec4 ip) {\n const vec4 ones = vec4(1.0, 1.0, 1.0, -1.0);\n vec4 p,s;\n\n p.xyz = floor( fract (vec3(j) * ip.xyz) * 7.0) * ip.z - 1.0;\n p.w = 1.5 - dot(abs(p.xyz), ones.xyz);\n s = vec4(lessThan(p, vec4(0.0)));\n p.xyz = p.xyz + (s.xyz*2.0 - 1.0) * s.www;\n\n return p;\n}\n\nfloat simplexNoise(vec4 v) {\n const vec2 C = vec2( 0.138196601125010504, // (5 - sqrt(5))/20 G4\n 0.309016994374947451); // (sqrt(5) - 1)/4 F4\n // First corner\n vec4 i = floor(v + dot(v, C.yyyy) );\n vec4 x0 = v - i + dot(i, C.xxxx);\n\n // Other corners\n\n // Rank sorting originally contributed by Bill Licea-Kane, AMD (formerly ATI)\n vec4 i0;\n\n vec3 isX = step( x0.yzw, x0.xxx );\n vec3 isYZ = step( x0.zww, x0.yyz );\n\n // i0.x = dot( isX, vec3( 1.0 ) );\n i0.x = isX.x + isX.y + isX.z;\n i0.yzw = 1.0 - isX;\n\n // i0.y += dot( isYZ.xy, vec2( 1.0 ) );\n i0.y += isYZ.x + isYZ.y;\n i0.zw += 1.0 - isYZ.xy;\n\n i0.z += isYZ.z;\n i0.w += 1.0 - isYZ.z;\n\n // i0 now contains the unique values 0,1,2,3 in each channel\n vec4 i3 = clamp( i0, 0.0, 1.0 );\n vec4 i2 = clamp( i0-1.0, 0.0, 1.0 );\n vec4 i1 = clamp( i0-2.0, 0.0, 1.0 );\n\n // x0 = x0 - 0.0 + 0.0 * C\n vec4 x1 = x0 - i1 + 1.0 * C.xxxx;\n vec4 x2 = x0 - i2 + 2.0 * C.xxxx;\n vec4 x3 = x0 - i3 + 3.0 * C.xxxx;\n vec4 x4 = x0 - 1.0 + 4.0 * C.xxxx;\n\n // Permutations\n i = mod(i, 289.0);\n float j0 = permute( permute( permute( permute(i.w) + i.z) + i.y) + i.x);\n vec4 j1 = permute( permute( permute( permute (\n i.w + vec4(i1.w, i2.w, i3.w, 1.0 ))\n + i.z + vec4(i1.z, i2.z, i3.z, 1.0 ))\n + i.y + vec4(i1.y, i2.y, i3.y, 1.0 ))\n + i.x + vec4(i1.x, i2.x, i3.x, 1.0 ));\n\n // Gradients\n // ( 7*7*6 points uniformly over a cube, mapped onto a 4-octahedron.)\n // 7*7*6 = 294, which is close to the ring size 17*17 = 289.\n\n vec4 ip = vec4(1.0/294.0, 1.0/49.0, 1.0/7.0, 0.0) ;\n\n vec4 p0 = grad4(j0, ip);\n vec4 p1 = grad4(j1.x, ip);\n vec4 p2 = grad4(j1.y, ip);\n vec4 p3 = grad4(j1.z, ip);\n vec4 p4 = grad4(j1.w, ip);\n\n // Normalise gradients\n vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n p4 *= taylorInvSqrt(dot(p4,p4));\n\n // Mix contributions from the five corners\n vec3 m0 = max(0.6 - vec3(dot(x0,x0), dot(x1,x1), dot(x2,x2)), 0.0);\n vec2 m1 = max(0.6 - vec2(dot(x3,x3), dot(x4,x4) ), 0.0);\n m0 = m0 * m0;\n m1 = m1 * m1;\n return 49.0 * ( dot(m0*m0, vec3( dot( p0, x0 ), dot( p1, x1 ), dot( p2, x2 )))\n + dot(m1*m1, vec2( dot( p3, x3 ), dot( p4, x4 ) ) ) ) ;\n\n}\n\n\nfloat scale(float value, float fromMin, float fromMax, float toMin, float toMax) {\n return toMin + (value - fromMin) * (toMax - toMin) / (fromMax - fromMin);\n}\n\n\nvoid main(){\n\n vNormal = normalize( normalMatrix * normal );\n vec4 worldPosition = modelMatrix * vec4( position, 1.0 );\n vWorldPosition = worldPosition.xyz;\n vNoise = simplexNoise(vec4(position - vec3(0.0, uTime * 0.4, 0.0), 0));\n vNoise = scale(vNoise, -1.0, 1.0, 0.5, 1.0);\n\n gl_Position\t= projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n";
|
|
2
|
+
export { VERTEX_SHADER };
|
package/vue/context.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { InjectionKey } from "vue";
|
|
2
|
+
import { Five } from "@realsee/five";
|
|
3
|
+
declare let hasPropsWork: boolean;
|
|
4
|
+
declare function setHasPropsWork(val: boolean): void;
|
|
5
|
+
declare const injectionKeyFive: InjectionKey<Five>;
|
|
6
|
+
declare function useFiveInject(): Five;
|
|
7
|
+
export { injectionKeyFive, useFiveInject, setHasPropsWork, hasPropsWork };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { PropType } from "vue";
|
|
2
|
+
/**
|
|
3
|
+
* Five 渲染区域组件
|
|
4
|
+
* @description Five 渲染区域组件,请在 FiveProvider 内使用
|
|
5
|
+
* @param width - 渲染区域的宽度
|
|
6
|
+
* @param height - 渲染区域的高度
|
|
7
|
+
* @returns Vue 元素
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* <FiveProvider :initialWork="work">
|
|
11
|
+
* <FiveCanvas width="512" height="512"/>
|
|
12
|
+
* </FiveProvider>
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
declare const FiveCanvas: import("vue").DefineComponent<{
|
|
16
|
+
width: {
|
|
17
|
+
type: PropType<number>;
|
|
18
|
+
required: true;
|
|
19
|
+
};
|
|
20
|
+
height: {
|
|
21
|
+
type: PropType<number>;
|
|
22
|
+
required: true;
|
|
23
|
+
};
|
|
24
|
+
}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
25
|
+
[key: string]: any;
|
|
26
|
+
}>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
27
|
+
width: {
|
|
28
|
+
type: PropType<number>;
|
|
29
|
+
required: true;
|
|
30
|
+
};
|
|
31
|
+
height: {
|
|
32
|
+
type: PropType<number>;
|
|
33
|
+
required: true;
|
|
34
|
+
};
|
|
35
|
+
}>>, {}, {}>;
|
|
36
|
+
export { FiveCanvas };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Five, Work, Works, State, FiveInitArgs } from "@realsee/five";
|
|
2
|
+
import { DefineComponent, PropType } from "vue";
|
|
3
|
+
type FiveProviderComponent = DefineComponent<{
|
|
4
|
+
works: PropType<Work[]>;
|
|
5
|
+
initialWorks: PropType<Work[] | Promise<Work[]>>;
|
|
6
|
+
initialState: PropType<"inherit" | "initial" | Partial<Omit<State, "offset">>>;
|
|
7
|
+
initialUserAction: BooleanConstructor;
|
|
8
|
+
onWorksChange: PropType<(work: Works) => void>;
|
|
9
|
+
onStateChange: PropType<(state: State, userAction: boolean) => void>;
|
|
10
|
+
onCurrentStateChange: PropType<(state: State, userAction: boolean) => void>;
|
|
11
|
+
onError: PropType<(error: Error) => void>;
|
|
12
|
+
fiveInitArgs: {
|
|
13
|
+
type: PropType<Omit<FiveInitArgs, "renderer" | "scissor">>;
|
|
14
|
+
default: () => {};
|
|
15
|
+
};
|
|
16
|
+
style: ObjectConstructor;
|
|
17
|
+
}, {
|
|
18
|
+
five: Readonly<Five>;
|
|
19
|
+
}>;
|
|
20
|
+
/**
|
|
21
|
+
* Five 实例化Five 组件
|
|
22
|
+
*
|
|
23
|
+
* 在 FiveProvider 下,可以使用 FiveCanvas 来创建渲染画布。
|
|
24
|
+
* 以及使用 useFiveState useFiveEventCallback等 Five Vue Composition API 来对 FiveProvider 进行操作
|
|
25
|
+
* @description Five 创建Five实例的组件
|
|
26
|
+
* @param FiveProviderComponent - Five 参数
|
|
27
|
+
* @example
|
|
28
|
+
* ```typescript
|
|
29
|
+
* <FiveProvider :initialWork="work">
|
|
30
|
+
* <FiveCanvas width="512" height="512"/>
|
|
31
|
+
* </FiveProvider>
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
declare const FiveProvider: FiveProviderComponent;
|
|
35
|
+
export { FiveProvider, FiveProviderComponent };
|