@anov/3d 0.0.3 → 0.0.4-alpha12
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 +24 -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 -44
- package/dist/utils/index.js +29 -73
- 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/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 -53
- package/dist/core/group.js +0 -135
- package/dist/core/line.d.ts +0 -13
- package/dist/core/line.js +0 -83
- package/dist/core/mesh.d.ts +0 -49
- package/dist/core/mesh.js +0 -146
- package/dist/core/model.d.ts +0 -29
- package/dist/core/model.js +0 -85
- package/dist/core/scene.d.ts +0 -175
- package/dist/core/scene.js +0 -389
- 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 -4
- 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
|
@@ -1,803 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The Ease class provides a collection of easing functions for use with tween.js.
|
|
3
|
-
*/
|
|
4
|
-
var Easing = {
|
|
5
|
-
Linear: {
|
|
6
|
-
None: function (amount) {
|
|
7
|
-
return amount;
|
|
8
|
-
},
|
|
9
|
-
},
|
|
10
|
-
Quadratic: {
|
|
11
|
-
In: function (amount) {
|
|
12
|
-
return amount * amount;
|
|
13
|
-
},
|
|
14
|
-
Out: function (amount) {
|
|
15
|
-
return amount * (2 - amount);
|
|
16
|
-
},
|
|
17
|
-
InOut: function (amount) {
|
|
18
|
-
if ((amount *= 2) < 1) {
|
|
19
|
-
return 0.5 * amount * amount;
|
|
20
|
-
}
|
|
21
|
-
return -0.5 * (--amount * (amount - 2) - 1);
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
Cubic: {
|
|
25
|
-
In: function (amount) {
|
|
26
|
-
return amount * amount * amount;
|
|
27
|
-
},
|
|
28
|
-
Out: function (amount) {
|
|
29
|
-
return --amount * amount * amount + 1;
|
|
30
|
-
},
|
|
31
|
-
InOut: function (amount) {
|
|
32
|
-
if ((amount *= 2) < 1) {
|
|
33
|
-
return 0.5 * amount * amount * amount;
|
|
34
|
-
}
|
|
35
|
-
return 0.5 * ((amount -= 2) * amount * amount + 2);
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
Quartic: {
|
|
39
|
-
In: function (amount) {
|
|
40
|
-
return amount * amount * amount * amount;
|
|
41
|
-
},
|
|
42
|
-
Out: function (amount) {
|
|
43
|
-
return 1 - --amount * amount * amount * amount;
|
|
44
|
-
},
|
|
45
|
-
InOut: function (amount) {
|
|
46
|
-
if ((amount *= 2) < 1) {
|
|
47
|
-
return 0.5 * amount * amount * amount * amount;
|
|
48
|
-
}
|
|
49
|
-
return -0.5 * ((amount -= 2) * amount * amount * amount - 2);
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
Quintic: {
|
|
53
|
-
In: function (amount) {
|
|
54
|
-
return amount * amount * amount * amount * amount;
|
|
55
|
-
},
|
|
56
|
-
Out: function (amount) {
|
|
57
|
-
return --amount * amount * amount * amount * amount + 1;
|
|
58
|
-
},
|
|
59
|
-
InOut: function (amount) {
|
|
60
|
-
if ((amount *= 2) < 1) {
|
|
61
|
-
return 0.5 * amount * amount * amount * amount * amount;
|
|
62
|
-
}
|
|
63
|
-
return 0.5 * ((amount -= 2) * amount * amount * amount * amount + 2);
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
|
-
Sinusoidal: {
|
|
67
|
-
In: function (amount) {
|
|
68
|
-
return 1 - Math.cos((amount * Math.PI) / 2);
|
|
69
|
-
},
|
|
70
|
-
Out: function (amount) {
|
|
71
|
-
return Math.sin((amount * Math.PI) / 2);
|
|
72
|
-
},
|
|
73
|
-
InOut: function (amount) {
|
|
74
|
-
return 0.5 * (1 - Math.cos(Math.PI * amount));
|
|
75
|
-
},
|
|
76
|
-
},
|
|
77
|
-
Exponential: {
|
|
78
|
-
In: function (amount) {
|
|
79
|
-
return amount === 0 ? 0 : Math.pow(1024, amount - 1);
|
|
80
|
-
},
|
|
81
|
-
Out: function (amount) {
|
|
82
|
-
return amount === 1 ? 1 : 1 - Math.pow(2, -10 * amount);
|
|
83
|
-
},
|
|
84
|
-
InOut: function (amount) {
|
|
85
|
-
if (amount === 0) {
|
|
86
|
-
return 0;
|
|
87
|
-
}
|
|
88
|
-
if (amount === 1) {
|
|
89
|
-
return 1;
|
|
90
|
-
}
|
|
91
|
-
if ((amount *= 2) < 1) {
|
|
92
|
-
return 0.5 * Math.pow(1024, amount - 1);
|
|
93
|
-
}
|
|
94
|
-
return 0.5 * (-Math.pow(2, -10 * (amount - 1)) + 2);
|
|
95
|
-
},
|
|
96
|
-
},
|
|
97
|
-
Circular: {
|
|
98
|
-
In: function (amount) {
|
|
99
|
-
return 1 - Math.sqrt(1 - amount * amount);
|
|
100
|
-
},
|
|
101
|
-
Out: function (amount) {
|
|
102
|
-
return Math.sqrt(1 - --amount * amount);
|
|
103
|
-
},
|
|
104
|
-
InOut: function (amount) {
|
|
105
|
-
if ((amount *= 2) < 1) {
|
|
106
|
-
return -0.5 * (Math.sqrt(1 - amount * amount) - 1);
|
|
107
|
-
}
|
|
108
|
-
return 0.5 * (Math.sqrt(1 - (amount -= 2) * amount) + 1);
|
|
109
|
-
},
|
|
110
|
-
},
|
|
111
|
-
Elastic: {
|
|
112
|
-
In: function (amount) {
|
|
113
|
-
if (amount === 0) {
|
|
114
|
-
return 0;
|
|
115
|
-
}
|
|
116
|
-
if (amount === 1) {
|
|
117
|
-
return 1;
|
|
118
|
-
}
|
|
119
|
-
return -Math.pow(2, 10 * (amount - 1)) * Math.sin((amount - 1.1) * 5 * Math.PI);
|
|
120
|
-
},
|
|
121
|
-
Out: function (amount) {
|
|
122
|
-
if (amount === 0) {
|
|
123
|
-
return 0;
|
|
124
|
-
}
|
|
125
|
-
if (amount === 1) {
|
|
126
|
-
return 1;
|
|
127
|
-
}
|
|
128
|
-
return Math.pow(2, -10 * amount) * Math.sin((amount - 0.1) * 5 * Math.PI) + 1;
|
|
129
|
-
},
|
|
130
|
-
InOut: function (amount) {
|
|
131
|
-
if (amount === 0) {
|
|
132
|
-
return 0;
|
|
133
|
-
}
|
|
134
|
-
if (amount === 1) {
|
|
135
|
-
return 1;
|
|
136
|
-
}
|
|
137
|
-
amount *= 2;
|
|
138
|
-
if (amount < 1) {
|
|
139
|
-
return -0.5 * Math.pow(2, 10 * (amount - 1)) * Math.sin((amount - 1.1) * 5 * Math.PI);
|
|
140
|
-
}
|
|
141
|
-
return 0.5 * Math.pow(2, -10 * (amount - 1)) * Math.sin((amount - 1.1) * 5 * Math.PI) + 1;
|
|
142
|
-
},
|
|
143
|
-
},
|
|
144
|
-
Back: {
|
|
145
|
-
In: function (amount) {
|
|
146
|
-
var s = 1.70158;
|
|
147
|
-
return amount * amount * ((s + 1) * amount - s);
|
|
148
|
-
},
|
|
149
|
-
Out: function (amount) {
|
|
150
|
-
var s = 1.70158;
|
|
151
|
-
return --amount * amount * ((s + 1) * amount + s) + 1;
|
|
152
|
-
},
|
|
153
|
-
InOut: function (amount) {
|
|
154
|
-
var s = 1.70158 * 1.525;
|
|
155
|
-
if ((amount *= 2) < 1) {
|
|
156
|
-
return 0.5 * (amount * amount * ((s + 1) * amount - s));
|
|
157
|
-
}
|
|
158
|
-
return 0.5 * ((amount -= 2) * amount * ((s + 1) * amount + s) + 2);
|
|
159
|
-
},
|
|
160
|
-
},
|
|
161
|
-
Bounce: {
|
|
162
|
-
In: function (amount) {
|
|
163
|
-
return 1 - Easing.Bounce.Out(1 - amount);
|
|
164
|
-
},
|
|
165
|
-
Out: function (amount) {
|
|
166
|
-
if (amount < 1 / 2.75) {
|
|
167
|
-
return 7.5625 * amount * amount;
|
|
168
|
-
}
|
|
169
|
-
else if (amount < 2 / 2.75) {
|
|
170
|
-
return 7.5625 * (amount -= 1.5 / 2.75) * amount + 0.75;
|
|
171
|
-
}
|
|
172
|
-
else if (amount < 2.5 / 2.75) {
|
|
173
|
-
return 7.5625 * (amount -= 2.25 / 2.75) * amount + 0.9375;
|
|
174
|
-
}
|
|
175
|
-
else {
|
|
176
|
-
return 7.5625 * (amount -= 2.625 / 2.75) * amount + 0.984375;
|
|
177
|
-
}
|
|
178
|
-
},
|
|
179
|
-
InOut: function (amount) {
|
|
180
|
-
if (amount < 0.5) {
|
|
181
|
-
return Easing.Bounce.In(amount * 2) * 0.5;
|
|
182
|
-
}
|
|
183
|
-
return Easing.Bounce.Out(amount * 2 - 1) * 0.5 + 0.5;
|
|
184
|
-
},
|
|
185
|
-
},
|
|
186
|
-
};
|
|
187
|
-
|
|
188
|
-
var now;
|
|
189
|
-
// Include a performance.now polyfill.
|
|
190
|
-
// In node.js, use process.hrtime.
|
|
191
|
-
// eslint-disable-next-line
|
|
192
|
-
// @ts-ignore
|
|
193
|
-
if (typeof self === 'undefined' && typeof process !== 'undefined' && process.hrtime) {
|
|
194
|
-
now = function () {
|
|
195
|
-
// eslint-disable-next-line
|
|
196
|
-
// @ts-ignore
|
|
197
|
-
var time = process.hrtime();
|
|
198
|
-
// Convert [seconds, nanoseconds] to milliseconds.
|
|
199
|
-
return time[0] * 1000 + time[1] / 1000000;
|
|
200
|
-
};
|
|
201
|
-
}
|
|
202
|
-
// In a browser, use self.performance.now if it is available.
|
|
203
|
-
else if (typeof self !== 'undefined' && self.performance !== undefined && self.performance.now !== undefined) {
|
|
204
|
-
// This must be bound, because directly assigning this function
|
|
205
|
-
// leads to an invocation exception in Chrome.
|
|
206
|
-
now = self.performance.now.bind(self.performance);
|
|
207
|
-
}
|
|
208
|
-
// Use Date.now if it is available.
|
|
209
|
-
else if (Date.now !== undefined) {
|
|
210
|
-
now = Date.now;
|
|
211
|
-
}
|
|
212
|
-
// Otherwise, use 'new Date().getTime()'.
|
|
213
|
-
else {
|
|
214
|
-
now = function () {
|
|
215
|
-
return new Date().getTime();
|
|
216
|
-
};
|
|
217
|
-
}
|
|
218
|
-
var now$1 = now;
|
|
219
|
-
|
|
220
|
-
/**
|
|
221
|
-
* Controlling groups of tweens
|
|
222
|
-
*
|
|
223
|
-
* Using the TWEEN singleton to manage your tweens can cause issues in large apps with many components.
|
|
224
|
-
* In these cases, you may want to create your own smaller groups of tween
|
|
225
|
-
*/
|
|
226
|
-
var Group = /** @class */ (function () {
|
|
227
|
-
function Group() {
|
|
228
|
-
this._tweens = {};
|
|
229
|
-
this._tweensAddedDuringUpdate = {};
|
|
230
|
-
}
|
|
231
|
-
Group.prototype.getAll = function () {
|
|
232
|
-
var _this = this;
|
|
233
|
-
return Object.keys(this._tweens).map(function (tweenId) {
|
|
234
|
-
return _this._tweens[tweenId];
|
|
235
|
-
});
|
|
236
|
-
};
|
|
237
|
-
Group.prototype.removeAll = function () {
|
|
238
|
-
this._tweens = {};
|
|
239
|
-
};
|
|
240
|
-
Group.prototype.add = function (tween) {
|
|
241
|
-
this._tweens[tween.getId()] = tween;
|
|
242
|
-
this._tweensAddedDuringUpdate[tween.getId()] = tween;
|
|
243
|
-
};
|
|
244
|
-
Group.prototype.remove = function (tween) {
|
|
245
|
-
delete this._tweens[tween.getId()];
|
|
246
|
-
delete this._tweensAddedDuringUpdate[tween.getId()];
|
|
247
|
-
};
|
|
248
|
-
Group.prototype.update = function (time, preserve) {
|
|
249
|
-
if (time === void 0) { time = now$1(); }
|
|
250
|
-
if (preserve === void 0) { preserve = false; }
|
|
251
|
-
var tweenIds = Object.keys(this._tweens);
|
|
252
|
-
if (tweenIds.length === 0) {
|
|
253
|
-
return false;
|
|
254
|
-
}
|
|
255
|
-
// Tweens are updated in "batches". If you add a new tween during an
|
|
256
|
-
// update, then the new tween will be updated in the next batch.
|
|
257
|
-
// If you remove a tween during an update, it may or may not be updated.
|
|
258
|
-
// However, if the removed tween was added during the current batch,
|
|
259
|
-
// then it will not be updated.
|
|
260
|
-
while (tweenIds.length > 0) {
|
|
261
|
-
this._tweensAddedDuringUpdate = {};
|
|
262
|
-
for (var i = 0; i < tweenIds.length; i++) {
|
|
263
|
-
var tween = this._tweens[tweenIds[i]];
|
|
264
|
-
var autoStart = !preserve;
|
|
265
|
-
if (tween && tween.update(time, autoStart) === false && !preserve) {
|
|
266
|
-
delete this._tweens[tweenIds[i]];
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
tweenIds = Object.keys(this._tweensAddedDuringUpdate);
|
|
270
|
-
}
|
|
271
|
-
return true;
|
|
272
|
-
};
|
|
273
|
-
return Group;
|
|
274
|
-
}());
|
|
275
|
-
|
|
276
|
-
/**
|
|
277
|
-
*
|
|
278
|
-
*/
|
|
279
|
-
var Interpolation = {
|
|
280
|
-
Linear: function (v, k) {
|
|
281
|
-
var m = v.length - 1;
|
|
282
|
-
var f = m * k;
|
|
283
|
-
var i = Math.floor(f);
|
|
284
|
-
var fn = Interpolation.Utils.Linear;
|
|
285
|
-
if (k < 0) {
|
|
286
|
-
return fn(v[0], v[1], f);
|
|
287
|
-
}
|
|
288
|
-
if (k > 1) {
|
|
289
|
-
return fn(v[m], v[m - 1], m - f);
|
|
290
|
-
}
|
|
291
|
-
return fn(v[i], v[i + 1 > m ? m : i + 1], f - i);
|
|
292
|
-
},
|
|
293
|
-
Bezier: function (v, k) {
|
|
294
|
-
var b = 0;
|
|
295
|
-
var n = v.length - 1;
|
|
296
|
-
var pw = Math.pow;
|
|
297
|
-
var bn = Interpolation.Utils.Bernstein;
|
|
298
|
-
for (var i = 0; i <= n; i++) {
|
|
299
|
-
b += pw(1 - k, n - i) * pw(k, i) * v[i] * bn(n, i);
|
|
300
|
-
}
|
|
301
|
-
return b;
|
|
302
|
-
},
|
|
303
|
-
CatmullRom: function (v, k) {
|
|
304
|
-
var m = v.length - 1;
|
|
305
|
-
var f = m * k;
|
|
306
|
-
var i = Math.floor(f);
|
|
307
|
-
var fn = Interpolation.Utils.CatmullRom;
|
|
308
|
-
if (v[0] === v[m]) {
|
|
309
|
-
if (k < 0) {
|
|
310
|
-
i = Math.floor((f = m * (1 + k)));
|
|
311
|
-
}
|
|
312
|
-
return fn(v[(i - 1 + m) % m], v[i], v[(i + 1) % m], v[(i + 2) % m], f - i);
|
|
313
|
-
}
|
|
314
|
-
else {
|
|
315
|
-
if (k < 0) {
|
|
316
|
-
return v[0] - (fn(v[0], v[0], v[1], v[1], -f) - v[0]);
|
|
317
|
-
}
|
|
318
|
-
if (k > 1) {
|
|
319
|
-
return v[m] - (fn(v[m], v[m], v[m - 1], v[m - 1], f - m) - v[m]);
|
|
320
|
-
}
|
|
321
|
-
return fn(v[i ? i - 1 : 0], v[i], v[m < i + 1 ? m : i + 1], v[m < i + 2 ? m : i + 2], f - i);
|
|
322
|
-
}
|
|
323
|
-
},
|
|
324
|
-
Utils: {
|
|
325
|
-
Linear: function (p0, p1, t) {
|
|
326
|
-
return (p1 - p0) * t + p0;
|
|
327
|
-
},
|
|
328
|
-
Bernstein: function (n, i) {
|
|
329
|
-
var fc = Interpolation.Utils.Factorial;
|
|
330
|
-
return fc(n) / fc(i) / fc(n - i);
|
|
331
|
-
},
|
|
332
|
-
Factorial: (function () {
|
|
333
|
-
var a = [1];
|
|
334
|
-
return function (n) {
|
|
335
|
-
var s = 1;
|
|
336
|
-
if (a[n]) {
|
|
337
|
-
return a[n];
|
|
338
|
-
}
|
|
339
|
-
for (var i = n; i > 1; i--) {
|
|
340
|
-
s *= i;
|
|
341
|
-
}
|
|
342
|
-
a[n] = s;
|
|
343
|
-
return s;
|
|
344
|
-
};
|
|
345
|
-
})(),
|
|
346
|
-
CatmullRom: function (p0, p1, p2, p3, t) {
|
|
347
|
-
var v0 = (p2 - p0) * 0.5;
|
|
348
|
-
var v1 = (p3 - p1) * 0.5;
|
|
349
|
-
var t2 = t * t;
|
|
350
|
-
var t3 = t * t2;
|
|
351
|
-
return (2 * p1 - 2 * p2 + v0 + v1) * t3 + (-3 * p1 + 3 * p2 - 2 * v0 - v1) * t2 + v0 * t + p1;
|
|
352
|
-
},
|
|
353
|
-
},
|
|
354
|
-
};
|
|
355
|
-
|
|
356
|
-
/**
|
|
357
|
-
* Utils
|
|
358
|
-
*/
|
|
359
|
-
var Sequence = /** @class */ (function () {
|
|
360
|
-
function Sequence() {
|
|
361
|
-
}
|
|
362
|
-
Sequence.nextId = function () {
|
|
363
|
-
return Sequence._nextId++;
|
|
364
|
-
};
|
|
365
|
-
Sequence._nextId = 0;
|
|
366
|
-
return Sequence;
|
|
367
|
-
}());
|
|
368
|
-
|
|
369
|
-
var mainGroup = new Group();
|
|
370
|
-
|
|
371
|
-
/**
|
|
372
|
-
* Tween.js - Licensed under the MIT license
|
|
373
|
-
* https://github.com/tweenjs/tween.js
|
|
374
|
-
* ----------------------------------------------
|
|
375
|
-
*
|
|
376
|
-
* See https://github.com/tweenjs/tween.js/graphs/contributors for the full list of contributors.
|
|
377
|
-
* Thank you all, you're awesome!
|
|
378
|
-
*/
|
|
379
|
-
var Tween = /** @class */ (function () {
|
|
380
|
-
function Tween(_object, _group) {
|
|
381
|
-
if (_group === void 0) { _group = mainGroup; }
|
|
382
|
-
this._object = _object;
|
|
383
|
-
this._group = _group;
|
|
384
|
-
this._isPaused = false;
|
|
385
|
-
this._pauseStart = 0;
|
|
386
|
-
this._valuesStart = {};
|
|
387
|
-
this._valuesEnd = {};
|
|
388
|
-
this._valuesStartRepeat = {};
|
|
389
|
-
this._duration = 1000;
|
|
390
|
-
this._initialRepeat = 0;
|
|
391
|
-
this._repeat = 0;
|
|
392
|
-
this._yoyo = false;
|
|
393
|
-
this._isPlaying = false;
|
|
394
|
-
this._reversed = false;
|
|
395
|
-
this._delayTime = 0;
|
|
396
|
-
this._startTime = 0;
|
|
397
|
-
this._easingFunction = Easing.Linear.None;
|
|
398
|
-
this._interpolationFunction = Interpolation.Linear;
|
|
399
|
-
this._chainedTweens = [];
|
|
400
|
-
this._onStartCallbackFired = false;
|
|
401
|
-
this._id = Sequence.nextId();
|
|
402
|
-
this._isChainStopped = false;
|
|
403
|
-
this._goToEnd = false;
|
|
404
|
-
}
|
|
405
|
-
Tween.prototype.getId = function () {
|
|
406
|
-
return this._id;
|
|
407
|
-
};
|
|
408
|
-
Tween.prototype.isPlaying = function () {
|
|
409
|
-
return this._isPlaying;
|
|
410
|
-
};
|
|
411
|
-
Tween.prototype.isPaused = function () {
|
|
412
|
-
return this._isPaused;
|
|
413
|
-
};
|
|
414
|
-
Tween.prototype.to = function (properties, duration) {
|
|
415
|
-
// TODO? restore this, then update the 07_dynamic_to example to set fox
|
|
416
|
-
// tween's to on each update. That way the behavior is opt-in (there's
|
|
417
|
-
// currently no opt-out).
|
|
418
|
-
// for (const prop in properties) this._valuesEnd[prop] = properties[prop]
|
|
419
|
-
this._valuesEnd = Object.create(properties);
|
|
420
|
-
if (duration !== undefined) {
|
|
421
|
-
this._duration = duration;
|
|
422
|
-
}
|
|
423
|
-
return this;
|
|
424
|
-
};
|
|
425
|
-
Tween.prototype.duration = function (d) {
|
|
426
|
-
this._duration = d;
|
|
427
|
-
return this;
|
|
428
|
-
};
|
|
429
|
-
Tween.prototype.start = function (time) {
|
|
430
|
-
if (this._isPlaying) {
|
|
431
|
-
return this;
|
|
432
|
-
}
|
|
433
|
-
// eslint-disable-next-line
|
|
434
|
-
this._group && this._group.add(this);
|
|
435
|
-
this._repeat = this._initialRepeat;
|
|
436
|
-
if (this._reversed) {
|
|
437
|
-
// If we were reversed (f.e. using the yoyo feature) then we need to
|
|
438
|
-
// flip the tween direction back to forward.
|
|
439
|
-
this._reversed = false;
|
|
440
|
-
for (var property in this._valuesStartRepeat) {
|
|
441
|
-
this._swapEndStartRepeatValues(property);
|
|
442
|
-
this._valuesStart[property] = this._valuesStartRepeat[property];
|
|
443
|
-
}
|
|
444
|
-
}
|
|
445
|
-
this._isPlaying = true;
|
|
446
|
-
this._isPaused = false;
|
|
447
|
-
this._onStartCallbackFired = false;
|
|
448
|
-
this._isChainStopped = false;
|
|
449
|
-
this._startTime = time !== undefined ? (typeof time === 'string' ? now$1() + parseFloat(time) : time) : now$1();
|
|
450
|
-
this._startTime += this._delayTime;
|
|
451
|
-
this._setupProperties(this._object, this._valuesStart, this._valuesEnd, this._valuesStartRepeat);
|
|
452
|
-
return this;
|
|
453
|
-
};
|
|
454
|
-
Tween.prototype._setupProperties = function (_object, _valuesStart, _valuesEnd, _valuesStartRepeat) {
|
|
455
|
-
for (var property in _valuesEnd) {
|
|
456
|
-
var startValue = _object[property];
|
|
457
|
-
var startValueIsArray = Array.isArray(startValue);
|
|
458
|
-
var propType = startValueIsArray ? 'array' : typeof startValue;
|
|
459
|
-
var isInterpolationList = !startValueIsArray && Array.isArray(_valuesEnd[property]);
|
|
460
|
-
// If `to()` specifies a property that doesn't exist in the source object,
|
|
461
|
-
// we should not set that property in the object
|
|
462
|
-
if (propType === 'undefined' || propType === 'function') {
|
|
463
|
-
continue;
|
|
464
|
-
}
|
|
465
|
-
// Check if an Array was provided as property value
|
|
466
|
-
if (isInterpolationList) {
|
|
467
|
-
var endValues = _valuesEnd[property];
|
|
468
|
-
if (endValues.length === 0) {
|
|
469
|
-
continue;
|
|
470
|
-
}
|
|
471
|
-
// handle an array of relative values
|
|
472
|
-
endValues = endValues.map(this._handleRelativeValue.bind(this, startValue));
|
|
473
|
-
// Create a local copy of the Array with the start value at the front
|
|
474
|
-
_valuesEnd[property] = [startValue].concat(endValues);
|
|
475
|
-
}
|
|
476
|
-
// handle the deepness of the values
|
|
477
|
-
if ((propType === 'object' || startValueIsArray) && startValue && !isInterpolationList) {
|
|
478
|
-
_valuesStart[property] = startValueIsArray ? [] : {};
|
|
479
|
-
// eslint-disable-next-line
|
|
480
|
-
for (var prop in startValue) {
|
|
481
|
-
// eslint-disable-next-line
|
|
482
|
-
// @ts-ignore FIXME?
|
|
483
|
-
_valuesStart[property][prop] = startValue[prop];
|
|
484
|
-
}
|
|
485
|
-
_valuesStartRepeat[property] = startValueIsArray ? [] : {}; // TODO? repeat nested values? And yoyo? And array values?
|
|
486
|
-
// eslint-disable-next-line
|
|
487
|
-
// @ts-ignore FIXME?
|
|
488
|
-
this._setupProperties(startValue, _valuesStart[property], _valuesEnd[property], _valuesStartRepeat[property]);
|
|
489
|
-
}
|
|
490
|
-
else {
|
|
491
|
-
// Save the starting value, but only once.
|
|
492
|
-
if (typeof _valuesStart[property] === 'undefined') {
|
|
493
|
-
_valuesStart[property] = startValue;
|
|
494
|
-
}
|
|
495
|
-
if (!startValueIsArray) {
|
|
496
|
-
// eslint-disable-next-line
|
|
497
|
-
// @ts-ignore FIXME?
|
|
498
|
-
_valuesStart[property] *= 1.0; // Ensures we're using numbers, not strings
|
|
499
|
-
}
|
|
500
|
-
if (isInterpolationList) {
|
|
501
|
-
// eslint-disable-next-line
|
|
502
|
-
// @ts-ignore FIXME?
|
|
503
|
-
_valuesStartRepeat[property] = _valuesEnd[property].slice().reverse();
|
|
504
|
-
}
|
|
505
|
-
else {
|
|
506
|
-
_valuesStartRepeat[property] = _valuesStart[property] || 0;
|
|
507
|
-
}
|
|
508
|
-
}
|
|
509
|
-
}
|
|
510
|
-
};
|
|
511
|
-
Tween.prototype.stop = function () {
|
|
512
|
-
if (!this._isChainStopped) {
|
|
513
|
-
this._isChainStopped = true;
|
|
514
|
-
this.stopChainedTweens();
|
|
515
|
-
}
|
|
516
|
-
if (!this._isPlaying) {
|
|
517
|
-
return this;
|
|
518
|
-
}
|
|
519
|
-
// eslint-disable-next-line
|
|
520
|
-
this._group && this._group.remove(this);
|
|
521
|
-
this._isPlaying = false;
|
|
522
|
-
this._isPaused = false;
|
|
523
|
-
if (this._onStopCallback) {
|
|
524
|
-
this._onStopCallback(this._object);
|
|
525
|
-
}
|
|
526
|
-
return this;
|
|
527
|
-
};
|
|
528
|
-
Tween.prototype.end = function () {
|
|
529
|
-
this._goToEnd = true;
|
|
530
|
-
this.update(Infinity);
|
|
531
|
-
return this;
|
|
532
|
-
};
|
|
533
|
-
Tween.prototype.pause = function (time) {
|
|
534
|
-
if (time === void 0) { time = now$1(); }
|
|
535
|
-
if (this._isPaused || !this._isPlaying) {
|
|
536
|
-
return this;
|
|
537
|
-
}
|
|
538
|
-
this._isPaused = true;
|
|
539
|
-
this._pauseStart = time;
|
|
540
|
-
// eslint-disable-next-line
|
|
541
|
-
this._group && this._group.remove(this);
|
|
542
|
-
return this;
|
|
543
|
-
};
|
|
544
|
-
Tween.prototype.resume = function (time) {
|
|
545
|
-
if (time === void 0) { time = now$1(); }
|
|
546
|
-
if (!this._isPaused || !this._isPlaying) {
|
|
547
|
-
return this;
|
|
548
|
-
}
|
|
549
|
-
this._isPaused = false;
|
|
550
|
-
this._startTime += time - this._pauseStart;
|
|
551
|
-
this._pauseStart = 0;
|
|
552
|
-
// eslint-disable-next-line
|
|
553
|
-
this._group && this._group.add(this);
|
|
554
|
-
return this;
|
|
555
|
-
};
|
|
556
|
-
Tween.prototype.stopChainedTweens = function () {
|
|
557
|
-
for (var i = 0, numChainedTweens = this._chainedTweens.length; i < numChainedTweens; i++) {
|
|
558
|
-
this._chainedTweens[i].stop();
|
|
559
|
-
}
|
|
560
|
-
return this;
|
|
561
|
-
};
|
|
562
|
-
Tween.prototype.group = function (group) {
|
|
563
|
-
this._group = group;
|
|
564
|
-
return this;
|
|
565
|
-
};
|
|
566
|
-
Tween.prototype.delay = function (amount) {
|
|
567
|
-
this._delayTime = amount;
|
|
568
|
-
return this;
|
|
569
|
-
};
|
|
570
|
-
Tween.prototype.repeat = function (times) {
|
|
571
|
-
this._initialRepeat = times;
|
|
572
|
-
this._repeat = times;
|
|
573
|
-
return this;
|
|
574
|
-
};
|
|
575
|
-
Tween.prototype.repeatDelay = function (amount) {
|
|
576
|
-
this._repeatDelayTime = amount;
|
|
577
|
-
return this;
|
|
578
|
-
};
|
|
579
|
-
Tween.prototype.yoyo = function (yoyo) {
|
|
580
|
-
this._yoyo = yoyo;
|
|
581
|
-
return this;
|
|
582
|
-
};
|
|
583
|
-
Tween.prototype.easing = function (easingFunction) {
|
|
584
|
-
this._easingFunction = easingFunction;
|
|
585
|
-
return this;
|
|
586
|
-
};
|
|
587
|
-
Tween.prototype.interpolation = function (interpolationFunction) {
|
|
588
|
-
this._interpolationFunction = interpolationFunction;
|
|
589
|
-
return this;
|
|
590
|
-
};
|
|
591
|
-
Tween.prototype.chain = function () {
|
|
592
|
-
var tweens = [];
|
|
593
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
594
|
-
tweens[_i] = arguments[_i];
|
|
595
|
-
}
|
|
596
|
-
this._chainedTweens = tweens;
|
|
597
|
-
return this;
|
|
598
|
-
};
|
|
599
|
-
Tween.prototype.onStart = function (callback) {
|
|
600
|
-
this._onStartCallback = callback;
|
|
601
|
-
return this;
|
|
602
|
-
};
|
|
603
|
-
Tween.prototype.onUpdate = function (callback) {
|
|
604
|
-
this._onUpdateCallback = callback;
|
|
605
|
-
return this;
|
|
606
|
-
};
|
|
607
|
-
Tween.prototype.onRepeat = function (callback) {
|
|
608
|
-
this._onRepeatCallback = callback;
|
|
609
|
-
return this;
|
|
610
|
-
};
|
|
611
|
-
Tween.prototype.onComplete = function (callback) {
|
|
612
|
-
this._onCompleteCallback = callback;
|
|
613
|
-
return this;
|
|
614
|
-
};
|
|
615
|
-
Tween.prototype.onStop = function (callback) {
|
|
616
|
-
this._onStopCallback = callback;
|
|
617
|
-
return this;
|
|
618
|
-
};
|
|
619
|
-
/**
|
|
620
|
-
* @returns true if the tween is still playing after the update, false
|
|
621
|
-
* otherwise (calling update on a paused tween still returns true because
|
|
622
|
-
* it is still playing, just paused).
|
|
623
|
-
*/
|
|
624
|
-
Tween.prototype.update = function (time, autoStart) {
|
|
625
|
-
if (time === void 0) { time = now$1(); }
|
|
626
|
-
if (autoStart === void 0) { autoStart = true; }
|
|
627
|
-
if (this._isPaused)
|
|
628
|
-
return true;
|
|
629
|
-
var property;
|
|
630
|
-
var elapsed;
|
|
631
|
-
var endTime = this._startTime + this._duration;
|
|
632
|
-
if (!this._goToEnd && !this._isPlaying) {
|
|
633
|
-
if (time > endTime)
|
|
634
|
-
return false;
|
|
635
|
-
if (autoStart)
|
|
636
|
-
this.start(time);
|
|
637
|
-
}
|
|
638
|
-
this._goToEnd = false;
|
|
639
|
-
if (time < this._startTime) {
|
|
640
|
-
return true;
|
|
641
|
-
}
|
|
642
|
-
if (this._onStartCallbackFired === false) {
|
|
643
|
-
if (this._onStartCallback) {
|
|
644
|
-
this._onStartCallback(this._object);
|
|
645
|
-
}
|
|
646
|
-
this._onStartCallbackFired = true;
|
|
647
|
-
}
|
|
648
|
-
elapsed = (time - this._startTime) / this._duration;
|
|
649
|
-
elapsed = this._duration === 0 || elapsed > 1 ? 1 : elapsed;
|
|
650
|
-
var value = this._easingFunction(elapsed);
|
|
651
|
-
// properties transformations
|
|
652
|
-
this._updateProperties(this._object, this._valuesStart, this._valuesEnd, value);
|
|
653
|
-
if (this._onUpdateCallback) {
|
|
654
|
-
this._onUpdateCallback(this._object, elapsed);
|
|
655
|
-
}
|
|
656
|
-
if (elapsed === 1) {
|
|
657
|
-
if (this._repeat > 0) {
|
|
658
|
-
if (isFinite(this._repeat)) {
|
|
659
|
-
this._repeat--;
|
|
660
|
-
}
|
|
661
|
-
// Reassign starting values, restart by making startTime = now
|
|
662
|
-
for (property in this._valuesStartRepeat) {
|
|
663
|
-
if (!this._yoyo && typeof this._valuesEnd[property] === 'string') {
|
|
664
|
-
this._valuesStartRepeat[property] =
|
|
665
|
-
// eslint-disable-next-line
|
|
666
|
-
// @ts-ignore FIXME?
|
|
667
|
-
this._valuesStartRepeat[property] + parseFloat(this._valuesEnd[property]);
|
|
668
|
-
}
|
|
669
|
-
if (this._yoyo) {
|
|
670
|
-
this._swapEndStartRepeatValues(property);
|
|
671
|
-
}
|
|
672
|
-
this._valuesStart[property] = this._valuesStartRepeat[property];
|
|
673
|
-
}
|
|
674
|
-
if (this._yoyo) {
|
|
675
|
-
this._reversed = !this._reversed;
|
|
676
|
-
}
|
|
677
|
-
if (this._repeatDelayTime !== undefined) {
|
|
678
|
-
this._startTime = time + this._repeatDelayTime;
|
|
679
|
-
}
|
|
680
|
-
else {
|
|
681
|
-
this._startTime = time + this._delayTime;
|
|
682
|
-
}
|
|
683
|
-
if (this._onRepeatCallback) {
|
|
684
|
-
this._onRepeatCallback(this._object);
|
|
685
|
-
}
|
|
686
|
-
return true;
|
|
687
|
-
}
|
|
688
|
-
else {
|
|
689
|
-
if (this._onCompleteCallback) {
|
|
690
|
-
this._onCompleteCallback(this._object);
|
|
691
|
-
}
|
|
692
|
-
for (var i = 0, numChainedTweens = this._chainedTweens.length; i < numChainedTweens; i++) {
|
|
693
|
-
// Make the chained tweens start exactly at the time they should,
|
|
694
|
-
// even if the `update()` method was called way past the duration of the tween
|
|
695
|
-
this._chainedTweens[i].start(this._startTime + this._duration);
|
|
696
|
-
}
|
|
697
|
-
this._isPlaying = false;
|
|
698
|
-
return false;
|
|
699
|
-
}
|
|
700
|
-
}
|
|
701
|
-
return true;
|
|
702
|
-
};
|
|
703
|
-
Tween.prototype._updateProperties = function (_object, _valuesStart, _valuesEnd, value) {
|
|
704
|
-
for (var property in _valuesEnd) {
|
|
705
|
-
// Don't update properties that do not exist in the source object
|
|
706
|
-
if (_valuesStart[property] === undefined) {
|
|
707
|
-
continue;
|
|
708
|
-
}
|
|
709
|
-
var start = _valuesStart[property] || 0;
|
|
710
|
-
var end = _valuesEnd[property];
|
|
711
|
-
var startIsArray = Array.isArray(_object[property]);
|
|
712
|
-
var endIsArray = Array.isArray(end);
|
|
713
|
-
var isInterpolationList = !startIsArray && endIsArray;
|
|
714
|
-
if (isInterpolationList) {
|
|
715
|
-
_object[property] = this._interpolationFunction(end, value);
|
|
716
|
-
}
|
|
717
|
-
else if (typeof end === 'object' && end) {
|
|
718
|
-
// eslint-disable-next-line
|
|
719
|
-
// @ts-ignore FIXME?
|
|
720
|
-
this._updateProperties(_object[property], start, end, value);
|
|
721
|
-
}
|
|
722
|
-
else {
|
|
723
|
-
// Parses relative end values with start as base (e.g.: +10, -3)
|
|
724
|
-
end = this._handleRelativeValue(start, end);
|
|
725
|
-
// Protect against non numeric properties.
|
|
726
|
-
if (typeof end === 'number') {
|
|
727
|
-
// eslint-disable-next-line
|
|
728
|
-
// @ts-ignore FIXME?
|
|
729
|
-
_object[property] = start + (end - start) * value;
|
|
730
|
-
}
|
|
731
|
-
}
|
|
732
|
-
}
|
|
733
|
-
};
|
|
734
|
-
Tween.prototype._handleRelativeValue = function (start, end) {
|
|
735
|
-
if (typeof end !== 'string') {
|
|
736
|
-
return end;
|
|
737
|
-
}
|
|
738
|
-
if (end.charAt(0) === '+' || end.charAt(0) === '-') {
|
|
739
|
-
return start + parseFloat(end);
|
|
740
|
-
}
|
|
741
|
-
else {
|
|
742
|
-
return parseFloat(end);
|
|
743
|
-
}
|
|
744
|
-
};
|
|
745
|
-
Tween.prototype._swapEndStartRepeatValues = function (property) {
|
|
746
|
-
var tmp = this._valuesStartRepeat[property];
|
|
747
|
-
var endValue = this._valuesEnd[property];
|
|
748
|
-
if (typeof endValue === 'string') {
|
|
749
|
-
this._valuesStartRepeat[property] = this._valuesStartRepeat[property] + parseFloat(endValue);
|
|
750
|
-
}
|
|
751
|
-
else {
|
|
752
|
-
this._valuesStartRepeat[property] = this._valuesEnd[property];
|
|
753
|
-
}
|
|
754
|
-
this._valuesEnd[property] = tmp;
|
|
755
|
-
};
|
|
756
|
-
return Tween;
|
|
757
|
-
}());
|
|
758
|
-
|
|
759
|
-
var VERSION = '18.6.4';
|
|
760
|
-
|
|
761
|
-
/**
|
|
762
|
-
* Tween.js - Licensed under the MIT license
|
|
763
|
-
* https://github.com/tweenjs/tween.js
|
|
764
|
-
* ----------------------------------------------
|
|
765
|
-
*
|
|
766
|
-
* See https://github.com/tweenjs/tween.js/graphs/contributors for the full list of contributors.
|
|
767
|
-
* Thank you all, you're awesome!
|
|
768
|
-
*/
|
|
769
|
-
var nextId = Sequence.nextId;
|
|
770
|
-
/**
|
|
771
|
-
* Controlling groups of tweens
|
|
772
|
-
*
|
|
773
|
-
* Using the TWEEN singleton to manage your tweens can cause issues in large apps with many components.
|
|
774
|
-
* In these cases, you may want to create your own smaller groups of tweens.
|
|
775
|
-
*/
|
|
776
|
-
var TWEEN = mainGroup;
|
|
777
|
-
// This is the best way to export things in a way that's compatible with both ES
|
|
778
|
-
// Modules and CommonJS, without build hacks, and so as not to break the
|
|
779
|
-
// existing API.
|
|
780
|
-
// https://github.com/rollup/rollup/issues/1961#issuecomment-423037881
|
|
781
|
-
var getAll = TWEEN.getAll.bind(TWEEN);
|
|
782
|
-
var removeAll = TWEEN.removeAll.bind(TWEEN);
|
|
783
|
-
var add = TWEEN.add.bind(TWEEN);
|
|
784
|
-
var remove = TWEEN.remove.bind(TWEEN);
|
|
785
|
-
var update = TWEEN.update.bind(TWEEN);
|
|
786
|
-
var exports = {
|
|
787
|
-
Easing: Easing,
|
|
788
|
-
Group: Group,
|
|
789
|
-
Interpolation: Interpolation,
|
|
790
|
-
now: now$1,
|
|
791
|
-
Sequence: Sequence,
|
|
792
|
-
nextId: nextId,
|
|
793
|
-
Tween: Tween,
|
|
794
|
-
VERSION: VERSION,
|
|
795
|
-
getAll: getAll,
|
|
796
|
-
removeAll: removeAll,
|
|
797
|
-
add: add,
|
|
798
|
-
remove: remove,
|
|
799
|
-
update: update,
|
|
800
|
-
};
|
|
801
|
-
|
|
802
|
-
export default exports;
|
|
803
|
-
export { Easing, Group, Interpolation, Sequence, Tween, VERSION, add, getAll, nextId, now$1 as now, remove, removeAll, update };
|