@xort/cga 0.0.71
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/.github/FUNDING.yml +12 -0
- package/LICENSE +21 -0
- package/build/cga.js +14564 -0
- package/cga/1./347/202/271/344/270/216/347/272/277/346/200/247/345/205/203/347/264/240/347/232/204/350/267/235/347/246/273.html +601 -0
- package/cga/1./347/202/271/344/270/216/347/272/277/346/200/247/345/205/203/347/264/240/347/232/204/350/267/235/347/246/273.md +111 -0
- package/cga/2./347/202/271/344/270/216/351/235/242/346/200/247/345/205/203/347/264/240.md +4 -0
- package/cga/img//347/202/271/344/270/216/345/260/204/347/272/277.png +0 -0
- package/cga/img//347/202/271/344/270/216/347/233/264/347/272/277.png +0 -0
- package/cga/img//347/202/271/344/270/216/347/272/277/346/256/265.png +0 -0
- package/cga/img//347/233/264/347/272/277/347/232/204/350/241/250/350/276/276/345/274/217.png +0 -0
- package/deploy.sh +27 -0
- package/dist/IKanimation/Bone.d.ts +9 -0
- package/dist/IKanimation/Bone.js +38 -0
- package/dist/IKanimation/CCDSolver.d.ts +37 -0
- package/dist/IKanimation/CCDSolver.js +93 -0
- package/dist/IKanimation/Joint.d.ts +3 -0
- package/dist/IKanimation/Joint.js +17 -0
- package/dist/IKanimation/constaint/constraint.d.ts +10 -0
- package/dist/IKanimation/constaint/constraint.js +25 -0
- package/dist/IKanimation/constaint/hinge.d.ts +12 -0
- package/dist/IKanimation/constaint/hinge.js +44 -0
- package/dist/IKanimation/constaint/slider.d.ts +12 -0
- package/dist/IKanimation/constaint/slider.js +42 -0
- package/dist/IKanimation/index.d.ts +0 -0
- package/dist/IKanimation/index.js +9 -0
- package/dist/IKanimation/isolver.d.ts +4 -0
- package/dist/IKanimation/isolver.js +10 -0
- package/dist/IKanimation/skeleton.d.ts +13 -0
- package/dist/IKanimation/skeleton.js +31 -0
- package/dist/alg/common.d.ts +114 -0
- package/dist/alg/common.js +302 -0
- package/dist/alg/curve.d.ts +4 -0
- package/dist/alg/curve.js +11 -0
- package/dist/alg/delaunator.d.ts +29 -0
- package/dist/alg/delaunator.js +442 -0
- package/dist/alg/delaunay.d.ts +20 -0
- package/dist/alg/delaunay.js +199 -0
- package/dist/alg/delaunayslow.d.ts +18 -0
- package/dist/alg/delaunayslow.js +140 -0
- package/dist/alg/extrude/extrude.d.ts +3 -0
- package/dist/alg/extrude/extrude.js +17 -0
- package/dist/alg/extrude.d.ts +199 -0
- package/dist/alg/extrude.js +729 -0
- package/dist/alg/offset/index.d.ts +0 -0
- package/dist/alg/offset/index.js +9 -0
- package/dist/alg/offset.d.ts +0 -0
- package/dist/alg/offset.js +472 -0
- package/dist/alg/pointset.d.ts +94 -0
- package/dist/alg/pointset.js +223 -0
- package/dist/alg/recognition.d.ts +14 -0
- package/dist/alg/recognition.js +37 -0
- package/dist/alg/result.d.ts +22 -0
- package/dist/alg/result.js +2 -0
- package/dist/alg/segmentset.d.ts +11 -0
- package/dist/alg/segmentset.js +45 -0
- package/dist/alg/sort.d.ts +2 -0
- package/dist/alg/sort.js +14 -0
- package/dist/alg/split.d.ts +8 -0
- package/dist/alg/split.js +10 -0
- package/dist/alg/trianglution.d.ts +20 -0
- package/dist/alg/trianglution.js +75 -0
- package/dist/alg/vol.d.ts +6 -0
- package/dist/alg/vol.js +18 -0
- package/dist/alg/voronoi.d.ts +31 -0
- package/dist/alg/voronoi.js +418 -0
- package/dist/app.d.ts +1 -0
- package/dist/app.js +241 -0
- package/dist/basic/distance.d.ts +12 -0
- package/dist/basic/distance.js +42 -0
- package/dist/csg/bsp.d.ts +9 -0
- package/dist/csg/bsp.js +22 -0
- package/dist/csg/node.d.ts +12 -0
- package/dist/csg/node.js +75 -0
- package/dist/csg/polygon.d.ts +43 -0
- package/dist/csg/polygon.js +161 -0
- package/dist/diamondMaterialShader.d.ts +92 -0
- package/dist/diamondMaterialShader.js +114 -0
- package/dist/effect/breath-light.d.ts +4 -0
- package/dist/effect/breath-light.js +37 -0
- package/dist/extends/geometryaid.d.ts +28 -0
- package/dist/extends/geometryaid.js +80 -0
- package/dist/extends/split.d.ts +3 -0
- package/dist/extends/split.js +13 -0
- package/dist/glview.d.ts +112 -0
- package/dist/glview.js +564 -0
- package/dist/index.d.ts +36 -0
- package/dist/index.js +50 -0
- package/dist/math/Euler.d.ts +47 -0
- package/dist/math/Euler.js +243 -0
- package/dist/math/HVec3.d.ts +44 -0
- package/dist/math/HVec3.js +193 -0
- package/dist/math/Mat3.d.ts +29 -0
- package/dist/math/Mat3.js +244 -0
- package/dist/math/Mat4.d.ts +85 -0
- package/dist/math/Mat4.js +791 -0
- package/dist/math/Math.d.ts +130 -0
- package/dist/math/Math.js +198 -0
- package/dist/math/Quat.d.ts +83 -0
- package/dist/math/Quat.js +438 -0
- package/dist/math/Vec.d.ts +7 -0
- package/dist/math/Vec.js +41 -0
- package/dist/math/Vec2.d.ts +68 -0
- package/dist/math/Vec2.js +345 -0
- package/dist/math/Vec3.d.ts +232 -0
- package/dist/math/Vec3.js +1087 -0
- package/dist/math/Vec4.d.ts +81 -0
- package/dist/math/Vec4.js +492 -0
- package/dist/math/vector.d.ts +114 -0
- package/dist/math/vector.js +371 -0
- package/dist/render/buffer-attribute.d.ts +100 -0
- package/dist/render/buffer-attribute.js +356 -0
- package/dist/render/eventhandler.d.ts +78 -0
- package/dist/render/eventhandler.js +187 -0
- package/dist/render/geometry.d.ts +89 -0
- package/dist/render/geometry.js +775 -0
- package/dist/render/mesh.d.ts +25 -0
- package/dist/render/mesh.js +80 -0
- package/dist/render/thing.d.ts +34 -0
- package/dist/render/thing.js +194 -0
- package/dist/render/types.d.ts +2 -0
- package/dist/render/types.js +7 -0
- package/dist/robust/plane.d.ts +7 -0
- package/dist/robust/plane.js +17 -0
- package/dist/robust/vec.d.ts +15 -0
- package/dist/robust/vec.js +71 -0
- package/dist/shape/arc.d.ts +2 -0
- package/dist/shape/arc.js +14 -0
- package/dist/src/IKanimation/Bone.d.ts +9 -0
- package/dist/src/IKanimation/Bone.js +40 -0
- package/dist/src/IKanimation/CCDSolver.d.ts +37 -0
- package/dist/src/IKanimation/CCDSolver.js +93 -0
- package/dist/src/IKanimation/Joint.d.ts +3 -0
- package/dist/src/IKanimation/Joint.js +17 -0
- package/dist/src/IKanimation/constaint/constraint.d.ts +10 -0
- package/dist/src/IKanimation/constaint/constraint.js +25 -0
- package/dist/src/IKanimation/constaint/hinge.d.ts +12 -0
- package/dist/src/IKanimation/constaint/hinge.js +46 -0
- package/dist/src/IKanimation/constaint/slider.d.ts +12 -0
- package/dist/src/IKanimation/constaint/slider.js +44 -0
- package/dist/src/IKanimation/index.d.ts +0 -0
- package/dist/src/IKanimation/index.js +9 -0
- package/dist/src/IKanimation/isolver.d.ts +4 -0
- package/dist/src/IKanimation/isolver.js +10 -0
- package/dist/src/IKanimation/skeleton.d.ts +13 -0
- package/dist/src/IKanimation/skeleton.js +31 -0
- package/dist/src/alg/common.d.ts +114 -0
- package/dist/src/alg/common.js +302 -0
- package/dist/src/alg/curve.d.ts +4 -0
- package/dist/src/alg/curve.js +11 -0
- package/dist/src/alg/delaunator.d.ts +29 -0
- package/dist/src/alg/delaunator.js +442 -0
- package/dist/src/alg/delaunay.d.ts +20 -0
- package/dist/src/alg/delaunay.js +199 -0
- package/dist/src/alg/delaunayslow.d.ts +18 -0
- package/dist/src/alg/delaunayslow.js +140 -0
- package/dist/src/alg/extrude/extrude.d.ts +3 -0
- package/dist/src/alg/extrude/extrude.js +17 -0
- package/dist/src/alg/extrude.d.ts +199 -0
- package/dist/src/alg/extrude.js +731 -0
- package/dist/src/alg/offset/index.d.ts +0 -0
- package/dist/src/alg/offset/index.js +9 -0
- package/dist/src/alg/offset.d.ts +0 -0
- package/dist/src/alg/offset.js +472 -0
- package/dist/src/alg/pointset.d.ts +94 -0
- package/dist/src/alg/pointset.js +223 -0
- package/dist/src/alg/recognition.d.ts +14 -0
- package/dist/src/alg/recognition.js +37 -0
- package/dist/src/alg/result.d.ts +22 -0
- package/dist/src/alg/result.js +2 -0
- package/dist/src/alg/segmentset.d.ts +11 -0
- package/dist/src/alg/segmentset.js +45 -0
- package/dist/src/alg/sort.d.ts +2 -0
- package/dist/src/alg/sort.js +14 -0
- package/dist/src/alg/split.d.ts +8 -0
- package/dist/src/alg/split.js +10 -0
- package/dist/src/alg/trianglution.d.ts +20 -0
- package/dist/src/alg/trianglution.js +77 -0
- package/dist/src/alg/vol.d.ts +6 -0
- package/dist/src/alg/vol.js +18 -0
- package/dist/src/alg/voronoi.d.ts +31 -0
- package/dist/src/alg/voronoi.js +418 -0
- package/dist/src/app.d.ts +1 -0
- package/dist/src/app.js +245 -0
- package/dist/src/basic/distance.d.ts +12 -0
- package/dist/src/basic/distance.js +42 -0
- package/dist/src/csg/bsp.d.ts +9 -0
- package/dist/src/csg/bsp.js +22 -0
- package/dist/src/csg/node.d.ts +12 -0
- package/dist/src/csg/node.js +75 -0
- package/dist/src/csg/polygon.d.ts +43 -0
- package/dist/src/csg/polygon.js +161 -0
- package/dist/src/diamondMaterialShader.d.ts +92 -0
- package/dist/src/diamondMaterialShader.js +118 -0
- package/dist/src/effect/breath-light.d.ts +4 -0
- package/dist/src/effect/breath-light.js +39 -0
- package/dist/src/extends/geometryaid.d.ts +28 -0
- package/dist/src/extends/geometryaid.js +80 -0
- package/dist/src/extends/split.d.ts +3 -0
- package/dist/src/extends/split.js +13 -0
- package/dist/src/glview.d.ts +112 -0
- package/dist/src/glview.js +564 -0
- package/dist/src/index.d.ts +36 -0
- package/dist/src/index.js +54 -0
- package/dist/src/math/Euler.d.ts +47 -0
- package/dist/src/math/Euler.js +245 -0
- package/dist/src/math/HVec3.d.ts +44 -0
- package/dist/src/math/HVec3.js +195 -0
- package/dist/src/math/Mat3.d.ts +29 -0
- package/dist/src/math/Mat3.js +244 -0
- package/dist/src/math/Mat4.d.ts +85 -0
- package/dist/src/math/Mat4.js +791 -0
- package/dist/src/math/Math.d.ts +130 -0
- package/dist/src/math/Math.js +198 -0
- package/dist/src/math/Quat.d.ts +83 -0
- package/dist/src/math/Quat.js +440 -0
- package/dist/src/math/Vec.d.ts +7 -0
- package/dist/src/math/Vec.js +43 -0
- package/dist/src/math/Vec2.d.ts +68 -0
- package/dist/src/math/Vec2.js +347 -0
- package/dist/src/math/Vec3.d.ts +232 -0
- package/dist/src/math/Vec3.js +1089 -0
- package/dist/src/math/Vec4.d.ts +81 -0
- package/dist/src/math/Vec4.js +494 -0
- package/dist/src/math/vector.d.ts +114 -0
- package/dist/src/math/vector.js +373 -0
- package/dist/src/render/buffer-attribute.d.ts +100 -0
- package/dist/src/render/buffer-attribute.js +340 -0
- package/dist/src/render/eventhandler.d.ts +78 -0
- package/dist/src/render/eventhandler.js +189 -0
- package/dist/src/render/geometry.d.ts +89 -0
- package/dist/src/render/geometry.js +775 -0
- package/dist/src/render/mesh.d.ts +25 -0
- package/dist/src/render/mesh.js +82 -0
- package/dist/src/render/thing.d.ts +34 -0
- package/dist/src/render/thing.js +196 -0
- package/dist/src/render/types.d.ts +2 -0
- package/dist/src/render/types.js +8 -0
- package/dist/src/robust/plane.d.ts +7 -0
- package/dist/src/robust/plane.js +17 -0
- package/dist/src/robust/vec.d.ts +15 -0
- package/dist/src/robust/vec.js +71 -0
- package/dist/src/shape/arc.d.ts +2 -0
- package/dist/src/shape/arc.js +14 -0
- package/dist/src/struct/3d/Box.d.ts +23 -0
- package/dist/src/struct/3d/Box.js +109 -0
- package/dist/src/struct/3d/Capsule.d.ts +12 -0
- package/dist/src/struct/3d/Capsule.js +36 -0
- package/dist/src/struct/3d/Circle.d.ts +34 -0
- package/dist/src/struct/3d/Circle.js +80 -0
- package/dist/src/struct/3d/Disk.d.ts +10 -0
- package/dist/src/struct/3d/Disk.js +22 -0
- package/dist/src/struct/3d/Frustum.d.ts +35 -0
- package/dist/src/struct/3d/Frustum.js +159 -0
- package/dist/src/struct/3d/Line.d.ts +40 -0
- package/dist/src/struct/3d/Line.js +339 -0
- package/dist/src/struct/3d/Path.d.ts +75 -0
- package/dist/src/struct/3d/Path.js +308 -0
- package/dist/src/struct/3d/Plane.d.ts +74 -0
- package/dist/src/struct/3d/Plane.js +295 -0
- package/dist/src/struct/3d/Point.d.ts +4 -0
- package/dist/src/struct/3d/Point.js +30 -0
- package/dist/src/struct/3d/Polygon.d.ts +8 -0
- package/dist/src/struct/3d/Polygon.js +55 -0
- package/dist/src/struct/3d/Polyline.d.ts +25 -0
- package/dist/src/struct/3d/Polyline.js +109 -0
- package/dist/src/struct/3d/Ray.d.ts +21 -0
- package/dist/src/struct/3d/Ray.js +262 -0
- package/dist/src/struct/3d/Rectangle.d.ts +7 -0
- package/dist/src/struct/3d/Rectangle.js +35 -0
- package/dist/src/struct/3d/Segment.d.ts +32 -0
- package/dist/src/struct/3d/Segment.js +334 -0
- package/dist/src/struct/3d/Shape.d.ts +4 -0
- package/dist/src/struct/3d/Shape.js +27 -0
- package/dist/src/struct/3d/Sphere.d.ts +11 -0
- package/dist/src/struct/3d/Sphere.js +30 -0
- package/dist/src/struct/3d/Triangle.d.ts +8 -0
- package/dist/src/struct/3d/Triangle.js +53 -0
- package/dist/src/struct/data/ArrayList.d.ts +42 -0
- package/dist/src/struct/data/ArrayList.js +172 -0
- package/dist/src/struct/data/ArrayObject.d.ts +30 -0
- package/dist/src/struct/data/ArrayObject.js +131 -0
- package/dist/src/struct/data/type.d.ts +13 -0
- package/dist/src/struct/data/type.js +18 -0
- package/dist/src/utils/array.d.ts +24 -0
- package/dist/src/utils/array.js +89 -0
- package/dist/src/utils/types.d.ts +24 -0
- package/dist/src/utils/types.js +20 -0
- package/dist/src-gis/app.d.ts +1 -0
- package/dist/src-gis/app.js +4 -0
- package/dist/src-gis/core/Cartographic.d.ts +20 -0
- package/dist/src-gis/core/Cartographic.js +52 -0
- package/dist/src-gis/core/EllipsoidGeodesic.d.ts +14 -0
- package/dist/src-gis/core/EllipsoidGeodesic.js +51 -0
- package/dist/src-gis/core/EllipsoidTerrainProvider.d.ts +10 -0
- package/dist/src-gis/core/EllipsoidTerrainProvider.js +29 -0
- package/dist/src-gis/core/HeightmapTerrainData.d.ts +3 -0
- package/dist/src-gis/core/HeightmapTerrainData.js +9 -0
- package/dist/src-gis/core/Rectangle.d.ts +45 -0
- package/dist/src-gis/core/Rectangle.js +127 -0
- package/dist/src-gis/core/TaskProcessor.d.ts +35 -0
- package/dist/src-gis/core/TaskProcessor.js +183 -0
- package/dist/src-gis/gis.d.ts +5 -0
- package/dist/src-gis/gis.js +12 -0
- package/dist/src-gis/globe.d.ts +12 -0
- package/dist/src-gis/globe.js +61 -0
- package/dist/src-gis/math/Cartographic.d.ts +8 -0
- package/dist/src-gis/math/Cartographic.js +26 -0
- package/dist/src-gis/math/GVec3.d.ts +12 -0
- package/dist/src-gis/math/GVec3.js +69 -0
- package/dist/src-gis/math/ellipsoid.d.ts +8 -0
- package/dist/src-gis/math/ellipsoid.js +14 -0
- package/dist/src-gis/provider/DcTerrainProvider.d.ts +15 -0
- package/dist/src-gis/provider/DcTerrainProvider.js +19 -0
- package/dist/src-gis/provider/TerrainProvider.d.ts +3 -0
- package/dist/src-gis/provider/TerrainProvider.js +17 -0
- package/dist/src-gis/scene/DcImageryProvider.d.ts +6 -0
- package/dist/src-gis/scene/DcImageryProvider.js +35 -0
- package/dist/src-gis/scene/GeographicTilingScheme.d.ts +21 -0
- package/dist/src-gis/scene/GeographicTilingScheme.js +46 -0
- package/dist/src-gis/scene/Globe.d.ts +34 -0
- package/dist/src-gis/scene/Globe.js +62 -0
- package/dist/src-gis/scene/GlobeSurfaceShaderSet.d.ts +6 -0
- package/dist/src-gis/scene/GlobeSurfaceShaderSet.js +11 -0
- package/dist/src-gis/scene/GlobeSurfaceTileProvider.d.ts +21 -0
- package/dist/src-gis/scene/GlobeSurfaceTileProvider.js +15 -0
- package/dist/src-gis/scene/ImageryLayerCollection.d.ts +21 -0
- package/dist/src-gis/scene/ImageryLayerCollection.js +87 -0
- package/dist/src-gis/scene/ImageryProvider.d.ts +4 -0
- package/dist/src-gis/scene/ImageryProvider.js +28 -0
- package/dist/src-gis/scene/QuadtreeTile.d.ts +48 -0
- package/dist/src-gis/scene/QuadtreeTile.js +137 -0
- package/dist/src-gis/scene/UrlTemplateImageryProvider.d.ts +9 -0
- package/dist/src-gis/scene/UrlTemplateImageryProvider.js +29 -0
- package/dist/src-gis/scene/quadtree_primitive.d.ts +14 -0
- package/dist/src-gis/scene/quadtree_primitive.js +50 -0
- package/dist/struct/3d/Box.d.ts +23 -0
- package/dist/struct/3d/Box.js +109 -0
- package/dist/struct/3d/Capsule.d.ts +12 -0
- package/dist/struct/3d/Capsule.js +34 -0
- package/dist/struct/3d/Circle.d.ts +34 -0
- package/dist/struct/3d/Circle.js +80 -0
- package/dist/struct/3d/Disk.d.ts +10 -0
- package/dist/struct/3d/Disk.js +22 -0
- package/dist/struct/3d/Frustum.d.ts +35 -0
- package/dist/struct/3d/Frustum.js +159 -0
- package/dist/struct/3d/Line.d.ts +40 -0
- package/dist/struct/3d/Line.js +339 -0
- package/dist/struct/3d/Path.d.ts +75 -0
- package/dist/struct/3d/Path.js +306 -0
- package/dist/struct/3d/Plane.d.ts +74 -0
- package/dist/struct/3d/Plane.js +293 -0
- package/dist/struct/3d/Point.d.ts +4 -0
- package/dist/struct/3d/Point.js +28 -0
- package/dist/struct/3d/Polygon.d.ts +8 -0
- package/dist/struct/3d/Polygon.js +53 -0
- package/dist/struct/3d/Polyline.d.ts +25 -0
- package/dist/struct/3d/Polyline.js +107 -0
- package/dist/struct/3d/Ray.d.ts +21 -0
- package/dist/struct/3d/Ray.js +262 -0
- package/dist/struct/3d/Rectangle.d.ts +7 -0
- package/dist/struct/3d/Rectangle.js +33 -0
- package/dist/struct/3d/Segment.d.ts +32 -0
- package/dist/struct/3d/Segment.js +332 -0
- package/dist/struct/3d/Shape.d.ts +4 -0
- package/dist/struct/3d/Shape.js +25 -0
- package/dist/struct/3d/Sphere.d.ts +11 -0
- package/dist/struct/3d/Sphere.js +30 -0
- package/dist/struct/3d/Triangle.d.ts +8 -0
- package/dist/struct/3d/Triangle.js +51 -0
- package/dist/struct/data/ArrayList.d.ts +42 -0
- package/dist/struct/data/ArrayList.js +170 -0
- package/dist/struct/data/ArrayObject.d.ts +30 -0
- package/dist/struct/data/ArrayObject.js +129 -0
- package/dist/struct/data/type.d.ts +13 -0
- package/dist/struct/data/type.js +18 -0
- package/dist/utils/array.d.ts +24 -0
- package/dist/utils/array.js +89 -0
- package/dist/utils/types.d.ts +24 -0
- package/dist/utils/types.js +20 -0
- package/docs/.vuepress/components/distance.vue +125 -0
- package/docs/.vuepress/components/intersect.vue +0 -0
- package/docs/.vuepress/components/trianglution.vue +121 -0
- package/docs/.vuepress/components/utils.js +314 -0
- package/docs/.vuepress/config.js +99 -0
- package/docs/.vuepress/enhanceApp.js +13 -0
- package/docs/.vuepress/public/delaunay.png +0 -0
- package/docs/.vuepress/public/logo.png +0 -0
- package/docs/.vuepress/public/plane-set-convex.png +0 -0
- package/docs/.vuepress/public/sponsor/alipay.jpg +0 -0
- package/docs/.vuepress/public/sponsor/wechat.png +0 -0
- package/docs/README.md +14 -0
- package/docs/demo/README.md +9 -0
- package/docs/guide/README.md +94 -0
- package/docs/guide/array.md +10 -0
- package/docs/guide/cy/trianglution.html +2 -0
- package/docs/guide/distLineAll.md +85 -0
- package/docs/guide/distPointAll.md +137 -0
- package/docs/guide/distRayAll.md +69 -0
- package/docs/guide/distSegmentAll.md +19 -0
- package/docs/guide/point.vue +12 -0
- package/docs/guide/vector.md +10 -0
- package/docs/guide//345/270/270/347/224/250.md +156 -0
- package/docs/sponsor/README.md +15 -0
- package/docs//345/274/200/345/217/221/346/227/245/345/277/227/2020/345/271/2643/346/234/21013/346/227/245.md +6 -0
- package/effect/common.glsl +34 -0
- package/effect/drawing.glsl +36 -0
- package/effect/shape.arc.glsl +13 -0
- package/effect/shape.circle.glsl +13 -0
- package/effect/shape.grid.glsl +42 -0
- package/effect/shape.line.glsl +18 -0
- package/effect/shape.pie.glsl +18 -0
- package/effect/shape.plot.glsl +10 -0
- package/effect/shape.poly.glsl +15 -0
- package/effect/shape.rect.glsl +14 -0
- package/effect/shape.rectround.glsl +15 -0
- package/effect/shape.segment.glsl +10 -0
- package/effect/shape.spiral.glsl +12 -0
- package/effect/shape.star.glsl +16 -0
- package/examples/index.html +31 -0
- package/git.sh +12 -0
- package/image/readme/1640758500266.png +0 -0
- package/image/readme/1640758513361.png +0 -0
- package/index.html +14 -0
- package/linear algorithm//346/225/260/345/255/246/350/241/250/350/276/276/345/274/217.md" +122 -0
- package/linear algorithm//347/237/251/351/230/265.md" +91 -0
- package/package.json +72 -0
- package/readme.md +247 -0
- package/rollup.config.js +71 -0
- package/scripttest.html +23 -0
- package/src/IKanimation/Bone.ts +24 -0
- package/src/IKanimation/CCDSolver.ts +114 -0
- package/src/IKanimation/Joint.ts +13 -0
- package/src/IKanimation/constaint/constraint.ts +23 -0
- package/src/IKanimation/constaint/hinge.ts +29 -0
- package/src/IKanimation/constaint/slider.ts +25 -0
- package/src/IKanimation/index.ts +8 -0
- package/src/IKanimation/isolver.ts +13 -0
- package/src/IKanimation/skeleton.ts +30 -0
- package/src/alg/common.ts +304 -0
- package/src/alg/curve.ts +9 -0
- package/src/alg/delaunator.ts +519 -0
- package/src/alg/delaunay.ts +163 -0
- package/src/alg/delaunayslow.ts +183 -0
- package/src/alg/extrude/extrude.ts +19 -0
- package/src/alg/extrude.ts +941 -0
- package/src/alg/offset/index.ts +8 -0
- package/src/alg/offset.ts +501 -0
- package/src/alg/pointset.ts +219 -0
- package/src/alg/recognition.ts +43 -0
- package/src/alg/result.ts +24 -0
- package/src/alg/segmentset.ts +44 -0
- package/src/alg/sort.ts +11 -0
- package/src/alg/split.ts +15 -0
- package/src/alg/trianglution.ts +58 -0
- package/src/alg/vol.ts +18 -0
- package/src/alg/voronoi.ts +303 -0
- package/src/app.css +12 -0
- package/src/app.ts +290 -0
- package/src/assets/color.jpg +0 -0
- package/src/basic/distance.ts +40 -0
- package/src/clipper/clipper.d.ts +323 -0
- package/src/clipper/clipper.js +7626 -0
- package/src/clipper/clipper_float.js +185 -0
- package/src/clipper/clipper_float_unminified.js +5639 -0
- package/src/clipper/clipperint.js +7626 -0
- package/src/csg/bsp.ts +24 -0
- package/src/csg/csg.js +583 -0
- package/src/csg/node.ts +91 -0
- package/src/csg/polygon.ts +177 -0
- package/src/diamondMaterialShader.ts +93 -0
- package/src/effect/breath-light.ts +24 -0
- package/src/extends/geometryaid.ts +89 -0
- package/src/extends/split.ts +15 -0
- package/src/glview.ts +570 -0
- package/src/index.ts +44 -0
- package/src/math/Euler.ts +239 -0
- package/src/math/HVec3.ts +1146 -0
- package/src/math/Mat3.ts +365 -0
- package/src/math/Mat4.ts +1134 -0
- package/src/math/Math.ts +213 -0
- package/src/math/Quat.ts +541 -0
- package/src/math/Vec.ts +26 -0
- package/src/math/Vec2.ts +408 -0
- package/src/math/Vec3.ts +1294 -0
- package/src/math/Vec4.ts +587 -0
- package/src/math/vector.ts +378 -0
- package/src/render/buffer-attribute.ts +484 -0
- package/src/render/eventhandler.ts +193 -0
- package/src/render/geometry.ts +1326 -0
- package/src/render/mesh.ts +80 -0
- package/src/render/thing.ts +204 -0
- package/src/render/types.ts +15 -0
- package/src/robust/plane.ts +12 -0
- package/src/robust/readme.md +1 -0
- package/src/robust/vec.ts +61 -0
- package/src/shader/cga.glsl +202 -0
- package/src/shader/common.glsl +87 -0
- package/src/shader/noise/GLSL-Noise.md +1108 -0
- package/src/shader/noise/cellular2D.glsl +69 -0
- package/src/shader/noise/cellular2x2.glsl +64 -0
- package/src/shader/noise/cellular2x2x2.glsl +88 -0
- package/src/shader/noise/cellular3D.glsl +187 -0
- package/src/shader/noise/classicnoise2D.glsl +113 -0
- package/src/shader/noise/classicnoise3D.glsl +177 -0
- package/src/shader/noise/classicnoise4D.glsl +302 -0
- package/src/shader/noise/noise2D.glsl +71 -0
- package/src/shader/noise/noise3D.glsl +103 -0
- package/src/shader/noise/noise3Dgrad.glsl +111 -0
- package/src/shader/noise/noise4D.glsl +129 -0
- package/src/shader/noise/psrdnoise2D.glsl +462 -0
- package/src/shape/arc.ts +14 -0
- package/src/struct/3d/Box.ts +124 -0
- package/src/struct/3d/Capsule.ts +18 -0
- package/src/struct/3d/Circle.ts +78 -0
- package/src/struct/3d/Disk.ts +22 -0
- package/src/struct/3d/Frustum.ts +189 -0
- package/src/struct/3d/Line.ts +378 -0
- package/src/struct/3d/Path.ts +314 -0
- package/src/struct/3d/Plane.ts +339 -0
- package/src/struct/3d/Point.ts +7 -0
- package/src/struct/3d/PolyLine.ts +98 -0
- package/src/struct/3d/Polygon.ts +44 -0
- package/src/struct/3d/Ray.ts +285 -0
- package/src/struct/3d/Rectangle.ts +18 -0
- package/src/struct/3d/Segment.ts +330 -0
- package/src/struct/3d/Shape.ts +7 -0
- package/src/struct/3d/Sphere.ts +31 -0
- package/src/struct/3d/Triangle.ts +28 -0
- package/src/struct/data/ArrayList.ts +144 -0
- package/src/struct/data/ArrayObject.ts +105 -0
- package/src/struct/data/type.ts +14 -0
- package/src/utils/array.ts +106 -0
- package/src/utils/types.ts +42 -0
- package/src-gis/app.ts +7 -0
- package/src-gis/core/Cartographic.ts +48 -0
- package/src-gis/core/EllipsoidGeodesic.ts +56 -0
- package/src-gis/core/EllipsoidTerrainProvider.ts +35 -0
- package/src-gis/core/HeightmapTerrainData.ts +5 -0
- package/src-gis/core/Rectangle.ts +112 -0
- package/src-gis/core/TaskProcessor.ts +222 -0
- package/src-gis/gis.ts +25 -0
- package/src-gis/globe.ts +54 -0
- package/src-gis/math/Cartographic.ts +24 -0
- package/src-gis/math/GVec3.ts +55 -0
- package/src-gis/math/ellipsoid.ts +13 -0
- package/src-gis/provider/DcTerrainProvider.ts +36 -0
- package/src-gis/provider/TerrainProvider.ts +12 -0
- package/src-gis/scene/DcImageryProvider.ts +36 -0
- package/src-gis/scene/GeographicTilingScheme.ts +65 -0
- package/src-gis/scene/Globe.ts +76 -0
- package/src-gis/scene/GlobeSurfaceShaderSet.ts +9 -0
- package/src-gis/scene/GlobeSurfaceTileProvider.ts +25 -0
- package/src-gis/scene/ImageryLayerCollection.ts +75 -0
- package/src-gis/scene/ImageryProvider.ts +28 -0
- package/src-gis/scene/QuadtreeTile.ts +162 -0
- package/src-gis/scene/UrlTemplateImageryProvider.ts +32 -0
- package/src-gis/scene/quadtree_primitive.ts +58 -0
- package/tsconfig.json +75 -0
- package/webpack.config.js +112 -0
- package//350/256/241/347/256/227/345/207/240/344/275/225/351/227/256/351/242/230.md +26 -0
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.Float64BufferAttribute = exports.Float32BufferAttribute = exports.Uint32BufferAttribute = exports.Int32BufferAttribute = exports.Uint16BufferAttribute = exports.Int16BufferAttribute = exports.Uint8ClampedBufferAttribute = exports.Uint8BufferAttribute = exports.Int8BufferAttribute = exports.BufferAttribute = void 0;
|
|
19
|
+
var Vec2_1 = require("../math/Vec2");
|
|
20
|
+
var Vec3_1 = require("../math/Vec3");
|
|
21
|
+
var Vec4_1 = require("../math/Vec4");
|
|
22
|
+
var _vector = new Vec3_1.Vec3();
|
|
23
|
+
var BufferAttribute = /** @class */ (function () {
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @param array {BufferArray} Buffer数据
|
|
27
|
+
* @param itemSize 单元长度,vec3是3,vec4是4
|
|
28
|
+
* @param normalized
|
|
29
|
+
*/
|
|
30
|
+
function BufferAttribute(array, itemSize, normalized) {
|
|
31
|
+
this.isBufferAttribute = true;
|
|
32
|
+
this.name = '';
|
|
33
|
+
this.array = array;
|
|
34
|
+
this.itemSize = itemSize;
|
|
35
|
+
this.count = array !== undefined ? array.length / itemSize : 0;
|
|
36
|
+
this.normalized = normalized === true;
|
|
37
|
+
// this.usage = StaticDrawUsage;
|
|
38
|
+
this.updateRange = { offset: 0, count: -1 };
|
|
39
|
+
this.version = 0;
|
|
40
|
+
}
|
|
41
|
+
Object.defineProperty(BufferAttribute.prototype, "needsUpdate", {
|
|
42
|
+
set: function (value) {
|
|
43
|
+
if (value === true)
|
|
44
|
+
this.version++;
|
|
45
|
+
},
|
|
46
|
+
enumerable: false,
|
|
47
|
+
configurable: true
|
|
48
|
+
});
|
|
49
|
+
BufferAttribute.prototype.onUpload = function (callback) {
|
|
50
|
+
this.onUploadCallback = callback;
|
|
51
|
+
return this;
|
|
52
|
+
};
|
|
53
|
+
BufferAttribute.prototype.setUsage = function (usage) {
|
|
54
|
+
return this;
|
|
55
|
+
};
|
|
56
|
+
BufferAttribute.prototype.copy = function (source) {
|
|
57
|
+
this.name = source.name;
|
|
58
|
+
this.array = new source.array.constructor(source.array);
|
|
59
|
+
this.itemSize = source.itemSize;
|
|
60
|
+
this.count = source.count;
|
|
61
|
+
this.normalized = source.normalized;
|
|
62
|
+
// this.usage = source.usage;
|
|
63
|
+
return this;
|
|
64
|
+
};
|
|
65
|
+
BufferAttribute.prototype.copyAt = function (index1, attribute, index2) {
|
|
66
|
+
index1 *= this.itemSize;
|
|
67
|
+
index2 *= attribute.itemSize;
|
|
68
|
+
for (var i = 0, l = this.itemSize; i < l; i++) {
|
|
69
|
+
this.array[index1 + i] = attribute.array[index2 + i];
|
|
70
|
+
}
|
|
71
|
+
return this;
|
|
72
|
+
};
|
|
73
|
+
BufferAttribute.prototype.copyArray = function (array) {
|
|
74
|
+
this.array.set(array);
|
|
75
|
+
return this;
|
|
76
|
+
};
|
|
77
|
+
BufferAttribute.prototype.copyColorsArray = function (colors) {
|
|
78
|
+
var array = this.array, offset = 0;
|
|
79
|
+
for (var i = 0, l = colors.length; i < l; i++) {
|
|
80
|
+
var color = colors[i];
|
|
81
|
+
// if (color === undefined) {
|
|
82
|
+
// console.warn('THREE.BufferAttribute.copyColorsArray(): color is undefined', i);
|
|
83
|
+
// color = new Color();
|
|
84
|
+
// }
|
|
85
|
+
// array[offset++] = color.r;
|
|
86
|
+
// array[offset++] = color.g;
|
|
87
|
+
// array[offset++] = color.b;
|
|
88
|
+
}
|
|
89
|
+
return this;
|
|
90
|
+
};
|
|
91
|
+
BufferAttribute.prototype.copyVec2sArray = function (vectors) {
|
|
92
|
+
var array = this.array, offset = 0;
|
|
93
|
+
for (var i = 0, l = vectors.length; i < l; i++) {
|
|
94
|
+
var vector = vectors[i];
|
|
95
|
+
if (vector === undefined) {
|
|
96
|
+
console.warn('THREE.BufferAttribute.copyVec2sArray(): vector is undefined', i);
|
|
97
|
+
vector = new Vec2_1.Vec2();
|
|
98
|
+
}
|
|
99
|
+
array[offset++] = vector.x;
|
|
100
|
+
array[offset++] = vector.y;
|
|
101
|
+
}
|
|
102
|
+
return this;
|
|
103
|
+
};
|
|
104
|
+
BufferAttribute.prototype.copyVec3sArray = function (vectors) {
|
|
105
|
+
var array = this.array, offset = 0;
|
|
106
|
+
for (var i = 0, l = vectors.length; i < l; i++) {
|
|
107
|
+
var vector = vectors[i];
|
|
108
|
+
if (vector === undefined) {
|
|
109
|
+
console.warn('THREE.BufferAttribute.copyVec3sArray(): vector is undefined', i);
|
|
110
|
+
vector = new Vec3_1.Vec3();
|
|
111
|
+
}
|
|
112
|
+
array[offset++] = vector.x;
|
|
113
|
+
array[offset++] = vector.y;
|
|
114
|
+
array[offset++] = vector.z;
|
|
115
|
+
}
|
|
116
|
+
return this;
|
|
117
|
+
};
|
|
118
|
+
BufferAttribute.prototype.copyVec4sArray = function (vectors) {
|
|
119
|
+
var array = this.array, offset = 0;
|
|
120
|
+
for (var i = 0, l = vectors.length; i < l; i++) {
|
|
121
|
+
var vector = vectors[i];
|
|
122
|
+
if (vector === undefined) {
|
|
123
|
+
console.warn('THREE.BufferAttribute.copyVec4sArray(): vector is undefined', i);
|
|
124
|
+
vector = new Vec4_1.Vec4();
|
|
125
|
+
}
|
|
126
|
+
array[offset++] = vector.x;
|
|
127
|
+
array[offset++] = vector.y;
|
|
128
|
+
array[offset++] = vector.z;
|
|
129
|
+
array[offset++] = vector.w;
|
|
130
|
+
}
|
|
131
|
+
return this;
|
|
132
|
+
};
|
|
133
|
+
BufferAttribute.prototype.applyMat3 = function (m) {
|
|
134
|
+
for (var i = 0, l = this.count; i < l; i++) {
|
|
135
|
+
_vector.x = this.getX(i);
|
|
136
|
+
_vector.y = this.getY(i);
|
|
137
|
+
_vector.z = this.getZ(i);
|
|
138
|
+
_vector.applyMat3(m);
|
|
139
|
+
this.setXYZ(i, _vector.x, _vector.y, _vector.z);
|
|
140
|
+
}
|
|
141
|
+
return this;
|
|
142
|
+
};
|
|
143
|
+
BufferAttribute.prototype.applyMat4 = function (m) {
|
|
144
|
+
for (var i = 0, l = this.count; i < l; i++) {
|
|
145
|
+
_vector.x = this.getX(i);
|
|
146
|
+
_vector.y = this.getY(i);
|
|
147
|
+
_vector.z = this.getZ(i);
|
|
148
|
+
_vector.applyMat4(m);
|
|
149
|
+
this.setXYZ(i, _vector.x, _vector.y, _vector.z);
|
|
150
|
+
}
|
|
151
|
+
return this;
|
|
152
|
+
};
|
|
153
|
+
BufferAttribute.prototype.applyNormalMat = function (m) {
|
|
154
|
+
for (var i = 0, l = this.count; i < l; i++) {
|
|
155
|
+
_vector.x = this.getX(i);
|
|
156
|
+
_vector.y = this.getY(i);
|
|
157
|
+
_vector.z = this.getZ(i);
|
|
158
|
+
_vector.applyNormalMat(m);
|
|
159
|
+
this.setXYZ(i, _vector.x, _vector.y, _vector.z);
|
|
160
|
+
}
|
|
161
|
+
return this;
|
|
162
|
+
};
|
|
163
|
+
BufferAttribute.prototype.transformDirection = function (m) {
|
|
164
|
+
for (var i = 0, l = this.count; i < l; i++) {
|
|
165
|
+
_vector.x = this.getX(i);
|
|
166
|
+
_vector.y = this.getY(i);
|
|
167
|
+
_vector.z = this.getZ(i);
|
|
168
|
+
_vector.transformDirection(m);
|
|
169
|
+
this.setXYZ(i, _vector.x, _vector.y, _vector.z);
|
|
170
|
+
}
|
|
171
|
+
return this;
|
|
172
|
+
};
|
|
173
|
+
BufferAttribute.prototype.set = function (value, offset) {
|
|
174
|
+
if (offset === undefined)
|
|
175
|
+
offset = 0;
|
|
176
|
+
this.array.set(value, offset);
|
|
177
|
+
return this;
|
|
178
|
+
};
|
|
179
|
+
BufferAttribute.prototype.getX = function (index) {
|
|
180
|
+
return this.array[index * this.itemSize];
|
|
181
|
+
};
|
|
182
|
+
BufferAttribute.prototype.setX = function (index, x) {
|
|
183
|
+
this.array[index * this.itemSize] = x;
|
|
184
|
+
return this;
|
|
185
|
+
};
|
|
186
|
+
BufferAttribute.prototype.getY = function (index) {
|
|
187
|
+
return this.array[index * this.itemSize + 1];
|
|
188
|
+
};
|
|
189
|
+
BufferAttribute.prototype.setY = function (index, y) {
|
|
190
|
+
this.array[index * this.itemSize + 1] = y;
|
|
191
|
+
return this;
|
|
192
|
+
};
|
|
193
|
+
BufferAttribute.prototype.getZ = function (index) {
|
|
194
|
+
return this.array[index * this.itemSize + 2];
|
|
195
|
+
};
|
|
196
|
+
BufferAttribute.prototype.setZ = function (index, z) {
|
|
197
|
+
this.array[index * this.itemSize + 2] = z;
|
|
198
|
+
return this;
|
|
199
|
+
};
|
|
200
|
+
BufferAttribute.prototype.getW = function (index) {
|
|
201
|
+
return this.array[index * this.itemSize + 3];
|
|
202
|
+
};
|
|
203
|
+
BufferAttribute.prototype.setW = function (index, w) {
|
|
204
|
+
this.array[index * this.itemSize + 3] = w;
|
|
205
|
+
return this;
|
|
206
|
+
};
|
|
207
|
+
BufferAttribute.prototype.setXY = function (index, x, y) {
|
|
208
|
+
index *= this.itemSize;
|
|
209
|
+
this.array[index + 0] = x;
|
|
210
|
+
this.array[index + 1] = y;
|
|
211
|
+
return this;
|
|
212
|
+
};
|
|
213
|
+
BufferAttribute.prototype.setXYZ = function (index, x, y, z) {
|
|
214
|
+
index *= this.itemSize;
|
|
215
|
+
this.array[index + 0] = x;
|
|
216
|
+
this.array[index + 1] = y;
|
|
217
|
+
this.array[index + 2] = z;
|
|
218
|
+
return this;
|
|
219
|
+
};
|
|
220
|
+
BufferAttribute.prototype.setXYZW = function (index, x, y, z, w) {
|
|
221
|
+
index *= this.itemSize;
|
|
222
|
+
this.array[index + 0] = x;
|
|
223
|
+
this.array[index + 1] = y;
|
|
224
|
+
this.array[index + 2] = z;
|
|
225
|
+
this.array[index + 3] = w;
|
|
226
|
+
return this;
|
|
227
|
+
};
|
|
228
|
+
BufferAttribute.prototype.clone = function () {
|
|
229
|
+
return new BufferAttribute(this.array, this.itemSize).copy(this);
|
|
230
|
+
};
|
|
231
|
+
BufferAttribute.prototype.toJSON = function () {
|
|
232
|
+
return {
|
|
233
|
+
itemSize: this.itemSize,
|
|
234
|
+
type: this.array.constructor.name,
|
|
235
|
+
array: Array.prototype.slice.call(this.array),
|
|
236
|
+
normalized: this.normalized
|
|
237
|
+
};
|
|
238
|
+
};
|
|
239
|
+
return BufferAttribute;
|
|
240
|
+
}());
|
|
241
|
+
exports.BufferAttribute = BufferAttribute;
|
|
242
|
+
var Int8BufferAttribute = /** @class */ (function (_super) {
|
|
243
|
+
__extends(Int8BufferAttribute, _super);
|
|
244
|
+
function Int8BufferAttribute(array, itemSize, normalized) {
|
|
245
|
+
if (normalized === void 0) { normalized = false; }
|
|
246
|
+
if (Array.isArray(array))
|
|
247
|
+
array = new Int8Array(array);
|
|
248
|
+
return _super.call(this, new Int8Array(array), itemSize, normalized) || this;
|
|
249
|
+
}
|
|
250
|
+
return Int8BufferAttribute;
|
|
251
|
+
}(BufferAttribute));
|
|
252
|
+
exports.Int8BufferAttribute = Int8BufferAttribute;
|
|
253
|
+
var Uint8BufferAttribute = /** @class */ (function (_super) {
|
|
254
|
+
__extends(Uint8BufferAttribute, _super);
|
|
255
|
+
function Uint8BufferAttribute(array, itemSize, normalized) {
|
|
256
|
+
if (normalized === void 0) { normalized = false; }
|
|
257
|
+
if (Array.isArray(array))
|
|
258
|
+
array = new Uint8Array(array);
|
|
259
|
+
return _super.call(this, array, itemSize, normalized) || this;
|
|
260
|
+
}
|
|
261
|
+
return Uint8BufferAttribute;
|
|
262
|
+
}(BufferAttribute));
|
|
263
|
+
exports.Uint8BufferAttribute = Uint8BufferAttribute;
|
|
264
|
+
var Uint8ClampedBufferAttribute = /** @class */ (function (_super) {
|
|
265
|
+
__extends(Uint8ClampedBufferAttribute, _super);
|
|
266
|
+
function Uint8ClampedBufferAttribute(array, itemSize, normalized) {
|
|
267
|
+
if (normalized === void 0) { normalized = false; }
|
|
268
|
+
if (Array.isArray(array))
|
|
269
|
+
array = new Uint8ClampedArray(array);
|
|
270
|
+
return _super.call(this, array, itemSize, normalized) || this;
|
|
271
|
+
}
|
|
272
|
+
return Uint8ClampedBufferAttribute;
|
|
273
|
+
}(BufferAttribute));
|
|
274
|
+
exports.Uint8ClampedBufferAttribute = Uint8ClampedBufferAttribute;
|
|
275
|
+
var Int16BufferAttribute = /** @class */ (function (_super) {
|
|
276
|
+
__extends(Int16BufferAttribute, _super);
|
|
277
|
+
function Int16BufferAttribute(array, itemSize, normalized) {
|
|
278
|
+
if (normalized === void 0) { normalized = false; }
|
|
279
|
+
if (Array.isArray(array))
|
|
280
|
+
array = new Int16Array(array);
|
|
281
|
+
return _super.call(this, array, itemSize, normalized) || this;
|
|
282
|
+
}
|
|
283
|
+
return Int16BufferAttribute;
|
|
284
|
+
}(BufferAttribute));
|
|
285
|
+
exports.Int16BufferAttribute = Int16BufferAttribute;
|
|
286
|
+
var Uint16BufferAttribute = /** @class */ (function (_super) {
|
|
287
|
+
__extends(Uint16BufferAttribute, _super);
|
|
288
|
+
function Uint16BufferAttribute(array, itemSize, normalized) {
|
|
289
|
+
if (normalized === void 0) { normalized = false; }
|
|
290
|
+
if (Array.isArray(array))
|
|
291
|
+
array = new Uint16Array(array);
|
|
292
|
+
return _super.call(this, array, itemSize) || this;
|
|
293
|
+
}
|
|
294
|
+
return Uint16BufferAttribute;
|
|
295
|
+
}(BufferAttribute));
|
|
296
|
+
exports.Uint16BufferAttribute = Uint16BufferAttribute;
|
|
297
|
+
var Int32BufferAttribute = /** @class */ (function (_super) {
|
|
298
|
+
__extends(Int32BufferAttribute, _super);
|
|
299
|
+
function Int32BufferAttribute(array, itemSize, normalized) {
|
|
300
|
+
if (normalized === void 0) { normalized = false; }
|
|
301
|
+
if (Array.isArray(array))
|
|
302
|
+
array = new Int32Array(array);
|
|
303
|
+
return _super.call(this, array, itemSize, normalized) || this;
|
|
304
|
+
}
|
|
305
|
+
return Int32BufferAttribute;
|
|
306
|
+
}(BufferAttribute));
|
|
307
|
+
exports.Int32BufferAttribute = Int32BufferAttribute;
|
|
308
|
+
var Uint32BufferAttribute = /** @class */ (function (_super) {
|
|
309
|
+
__extends(Uint32BufferAttribute, _super);
|
|
310
|
+
function Uint32BufferAttribute(array, itemSize, normalized) {
|
|
311
|
+
if (normalized === void 0) { normalized = false; }
|
|
312
|
+
if (Array.isArray(array))
|
|
313
|
+
array = new Uint32Array(array);
|
|
314
|
+
return _super.call(this, array, itemSize, normalized) || this;
|
|
315
|
+
}
|
|
316
|
+
return Uint32BufferAttribute;
|
|
317
|
+
}(BufferAttribute));
|
|
318
|
+
exports.Uint32BufferAttribute = Uint32BufferAttribute;
|
|
319
|
+
var Float32BufferAttribute = /** @class */ (function (_super) {
|
|
320
|
+
__extends(Float32BufferAttribute, _super);
|
|
321
|
+
function Float32BufferAttribute(array, itemSize, normalized) {
|
|
322
|
+
if (normalized === void 0) { normalized = false; }
|
|
323
|
+
if (Array.isArray(array))
|
|
324
|
+
array = new Float32Array(array);
|
|
325
|
+
return _super.call(this, array, itemSize, normalized) || this;
|
|
326
|
+
}
|
|
327
|
+
return Float32BufferAttribute;
|
|
328
|
+
}(BufferAttribute));
|
|
329
|
+
exports.Float32BufferAttribute = Float32BufferAttribute;
|
|
330
|
+
var Float64BufferAttribute = /** @class */ (function (_super) {
|
|
331
|
+
__extends(Float64BufferAttribute, _super);
|
|
332
|
+
function Float64BufferAttribute(array, itemSize, normalized) {
|
|
333
|
+
if (normalized === void 0) { normalized = false; }
|
|
334
|
+
if (Array.isArray(array))
|
|
335
|
+
array = new Float64Array(array);
|
|
336
|
+
return _super.call(this, array, itemSize, normalized) || this;
|
|
337
|
+
}
|
|
338
|
+
return Float64BufferAttribute;
|
|
339
|
+
}(BufferAttribute));
|
|
340
|
+
exports.Float64BufferAttribute = Float64BufferAttribute;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
export declare class EventHandler {
|
|
2
|
+
private _callbacks;
|
|
3
|
+
private _callbackActive;
|
|
4
|
+
constructor();
|
|
5
|
+
_addCallback(name: string, callback: any, scope: any, once: boolean): void;
|
|
6
|
+
/**
|
|
7
|
+
* @function
|
|
8
|
+
* @name EventHandler#on
|
|
9
|
+
* @description Attach an event handler to an event.
|
|
10
|
+
* @param {string} name - Name of the event to bind the callback to.
|
|
11
|
+
* @param {callbacks.HandleEvent} callback - Function that is called when event is fired. Note the callback is limited to 8 arguments.
|
|
12
|
+
* @param {object} [scope] - Object to use as 'this' when the event is fired, defaults to current this.
|
|
13
|
+
* @returns {EventHandler} Self for chaining.
|
|
14
|
+
* @example
|
|
15
|
+
* obj.on('test', function (a, b) {
|
|
16
|
+
* console.log(a + b);
|
|
17
|
+
* });
|
|
18
|
+
* obj.fire('test', 1, 2); // prints 3 to the console
|
|
19
|
+
*/
|
|
20
|
+
on(name: string, callback: any, scope?: any): this;
|
|
21
|
+
/**
|
|
22
|
+
* @function
|
|
23
|
+
* @name EventHandler#off
|
|
24
|
+
* @description Detach an event handler from an event. If callback is not provided then all callbacks are unbound from the event,
|
|
25
|
+
* if scope is not provided then all events with the callback will be unbound.
|
|
26
|
+
* @param {string} [name] - Name of the event to unbind.
|
|
27
|
+
* @param {callbacks.HandleEvent} [callback] - Function to be unbound.
|
|
28
|
+
* @param {object} [scope] - Scope that was used as the this when the event is fired.
|
|
29
|
+
* @returns {EventHandler} Self for chaining.
|
|
30
|
+
* @example
|
|
31
|
+
* var handler = function () {
|
|
32
|
+
* };
|
|
33
|
+
* obj.on('test', handler);
|
|
34
|
+
*
|
|
35
|
+
* obj.off(); // Removes all events
|
|
36
|
+
* obj.off('test'); // Removes all events called 'test'
|
|
37
|
+
* obj.off('test', handler); // Removes all handler functions, called 'test'
|
|
38
|
+
* obj.off('test', handler, this); // Removes all hander functions, called 'test' with scope this
|
|
39
|
+
*/
|
|
40
|
+
off(name: string | number, callback: any, scope: any): this;
|
|
41
|
+
/**
|
|
42
|
+
* @function
|
|
43
|
+
* @name EventHandler#fire
|
|
44
|
+
* @description Fire an event, all additional arguments are passed on to the event listener.
|
|
45
|
+
* @param {object} name - Name of event to fire.
|
|
46
|
+
* @param {*} [args] - arguments that is passed to the event handler.
|
|
47
|
+
* obj.fire('test', 'This is the message');
|
|
48
|
+
*/
|
|
49
|
+
fire(name: string | number, ...args: any[]): this;
|
|
50
|
+
/**
|
|
51
|
+
* @function
|
|
52
|
+
* @name EventHandler#once
|
|
53
|
+
* @description Attach an event handler to an event. This handler will be removed after being fired once.
|
|
54
|
+
* @param {string} name - Name of the event to bind the callback to.
|
|
55
|
+
* @param {callbacks.HandleEvent} callback - Function that is called when event is fired. Note the callback is limited to 8 arguments.
|
|
56
|
+
* @param {object} [scope] - Object to use as 'this' when the event is fired, defaults to current this.
|
|
57
|
+
* @returns {EventHandler} Self for chaining.
|
|
58
|
+
* @example
|
|
59
|
+
* obj.once('test', function (a, b) {
|
|
60
|
+
* console.log(a + b);
|
|
61
|
+
* });
|
|
62
|
+
* obj.fire('test', 1, 2); // prints 3 to the console
|
|
63
|
+
* obj.fire('test', 1, 2); // not going to get handled
|
|
64
|
+
*/
|
|
65
|
+
once(name: string, callback: any, scope: any): this;
|
|
66
|
+
/**
|
|
67
|
+
* @function
|
|
68
|
+
* @name EventHandler#hasEvent
|
|
69
|
+
* @description Test if there are any handlers bound to an event name.
|
|
70
|
+
* @param {string} name - The name of the event to test.
|
|
71
|
+
* @returns {boolean} True if the object has handlers bound to the specified event name.
|
|
72
|
+
* @example
|
|
73
|
+
* obj.on('test', function () { }); // bind an event to 'test'
|
|
74
|
+
* obj.hasEvent('test'); // returns true
|
|
75
|
+
* obj.hasEvent('hello'); // returns false
|
|
76
|
+
*/
|
|
77
|
+
hasEvent(name: string | number): any;
|
|
78
|
+
}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
3
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
4
|
+
if (ar || !(i in from)) {
|
|
5
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
6
|
+
ar[i] = from[i];
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.EventHandler = void 0;
|
|
13
|
+
var EventHandler = /** @class */ (function () {
|
|
14
|
+
function EventHandler() {
|
|
15
|
+
this._callbacks = {};
|
|
16
|
+
this._callbackActive = {};
|
|
17
|
+
}
|
|
18
|
+
EventHandler.prototype._addCallback = function (name, callback, scope, once) {
|
|
19
|
+
if (!name || typeof name !== 'string' || !callback)
|
|
20
|
+
return;
|
|
21
|
+
if (!this._callbacks[name])
|
|
22
|
+
this._callbacks[name] = [];
|
|
23
|
+
if (this._callbackActive[name] && this._callbackActive[name] === this._callbacks[name])
|
|
24
|
+
this._callbackActive[name] = this._callbackActive[name].slice();
|
|
25
|
+
this._callbacks[name].push({
|
|
26
|
+
callback: callback,
|
|
27
|
+
scope: scope || this,
|
|
28
|
+
once: once || false
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* @function
|
|
33
|
+
* @name EventHandler#on
|
|
34
|
+
* @description Attach an event handler to an event.
|
|
35
|
+
* @param {string} name - Name of the event to bind the callback to.
|
|
36
|
+
* @param {callbacks.HandleEvent} callback - Function that is called when event is fired. Note the callback is limited to 8 arguments.
|
|
37
|
+
* @param {object} [scope] - Object to use as 'this' when the event is fired, defaults to current this.
|
|
38
|
+
* @returns {EventHandler} Self for chaining.
|
|
39
|
+
* @example
|
|
40
|
+
* obj.on('test', function (a, b) {
|
|
41
|
+
* console.log(a + b);
|
|
42
|
+
* });
|
|
43
|
+
* obj.fire('test', 1, 2); // prints 3 to the console
|
|
44
|
+
*/
|
|
45
|
+
EventHandler.prototype.on = function (name, callback, scope) {
|
|
46
|
+
this._addCallback(name, callback, scope, false);
|
|
47
|
+
return this;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* @function
|
|
51
|
+
* @name EventHandler#off
|
|
52
|
+
* @description Detach an event handler from an event. If callback is not provided then all callbacks are unbound from the event,
|
|
53
|
+
* if scope is not provided then all events with the callback will be unbound.
|
|
54
|
+
* @param {string} [name] - Name of the event to unbind.
|
|
55
|
+
* @param {callbacks.HandleEvent} [callback] - Function to be unbound.
|
|
56
|
+
* @param {object} [scope] - Scope that was used as the this when the event is fired.
|
|
57
|
+
* @returns {EventHandler} Self for chaining.
|
|
58
|
+
* @example
|
|
59
|
+
* var handler = function () {
|
|
60
|
+
* };
|
|
61
|
+
* obj.on('test', handler);
|
|
62
|
+
*
|
|
63
|
+
* obj.off(); // Removes all events
|
|
64
|
+
* obj.off('test'); // Removes all events called 'test'
|
|
65
|
+
* obj.off('test', handler); // Removes all handler functions, called 'test'
|
|
66
|
+
* obj.off('test', handler, this); // Removes all hander functions, called 'test' with scope this
|
|
67
|
+
*/
|
|
68
|
+
EventHandler.prototype.off = function (name, callback, scope) {
|
|
69
|
+
if (name) {
|
|
70
|
+
if (this._callbackActive[name] && this._callbackActive[name] === this._callbacks[name])
|
|
71
|
+
this._callbackActive[name] = this._callbackActive[name].slice();
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
for (var key in this._callbackActive) {
|
|
75
|
+
if (!this._callbacks[key])
|
|
76
|
+
continue;
|
|
77
|
+
if (this._callbacks[key] !== this._callbackActive[key])
|
|
78
|
+
continue;
|
|
79
|
+
this._callbackActive[key] = this._callbackActive[key].slice();
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
if (!name) {
|
|
83
|
+
this._callbacks = {};
|
|
84
|
+
}
|
|
85
|
+
else if (!callback) {
|
|
86
|
+
if (this._callbacks[name])
|
|
87
|
+
this._callbacks[name] = [];
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
var events = this._callbacks[name];
|
|
91
|
+
if (!events)
|
|
92
|
+
return this;
|
|
93
|
+
var count = events.length;
|
|
94
|
+
for (var i = 0; i < count; i++) {
|
|
95
|
+
if (events[i].callback !== callback)
|
|
96
|
+
continue;
|
|
97
|
+
if (scope && events[i].scope !== scope)
|
|
98
|
+
continue;
|
|
99
|
+
events[i--] = events[--count];
|
|
100
|
+
}
|
|
101
|
+
events.length = count;
|
|
102
|
+
}
|
|
103
|
+
return this;
|
|
104
|
+
};
|
|
105
|
+
// ESLint rule disabled here as documenting arg1, arg2...argN as [...] rest
|
|
106
|
+
// arguments is preferable to documenting each one individually.
|
|
107
|
+
/* eslint-disable valid-jsdoc */
|
|
108
|
+
/**
|
|
109
|
+
* @function
|
|
110
|
+
* @name EventHandler#fire
|
|
111
|
+
* @description Fire an event, all additional arguments are passed on to the event listener.
|
|
112
|
+
* @param {object} name - Name of event to fire.
|
|
113
|
+
* @param {*} [args] - arguments that is passed to the event handler.
|
|
114
|
+
* obj.fire('test', 'This is the message');
|
|
115
|
+
*/
|
|
116
|
+
/* eslint-enable valid-jsdoc */
|
|
117
|
+
EventHandler.prototype.fire = function (name) {
|
|
118
|
+
var _a;
|
|
119
|
+
var args = [];
|
|
120
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
121
|
+
args[_i - 1] = arguments[_i];
|
|
122
|
+
}
|
|
123
|
+
if (!name || !this._callbacks[name])
|
|
124
|
+
return this;
|
|
125
|
+
var callbacks;
|
|
126
|
+
if (!this._callbackActive[name]) {
|
|
127
|
+
this._callbackActive[name] = this._callbacks[name];
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
if (this._callbackActive[name] === this._callbacks[name])
|
|
131
|
+
this._callbackActive[name] = this._callbackActive[name].slice();
|
|
132
|
+
callbacks = this._callbacks[name].slice();
|
|
133
|
+
}
|
|
134
|
+
// TODO: What does callbacks do here?
|
|
135
|
+
// In particular this condition check looks wrong: (i < (callbacks || this._callbackActive[name]).length)
|
|
136
|
+
// Because callbacks is not an integer
|
|
137
|
+
// eslint-disable-next-line no-unmodified-loop-condition
|
|
138
|
+
for (var i = 0; (callbacks || this._callbackActive[name]) && (i < (callbacks || this._callbackActive[name]).length); i++) {
|
|
139
|
+
var evt = (callbacks || this._callbackActive[name])[i];
|
|
140
|
+
(_a = evt.callback).call.apply(_a, __spreadArray([evt.scope], args, false));
|
|
141
|
+
if (evt.once) {
|
|
142
|
+
var ind = this._callbacks[name].indexOf(evt);
|
|
143
|
+
if (ind !== -1) {
|
|
144
|
+
if (this._callbackActive[name] === this._callbacks[name])
|
|
145
|
+
this._callbackActive[name] = this._callbackActive[name].slice();
|
|
146
|
+
this._callbacks[name].splice(ind, 1);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
if (!callbacks)
|
|
151
|
+
this._callbackActive[name] = null;
|
|
152
|
+
return this;
|
|
153
|
+
};
|
|
154
|
+
/**
|
|
155
|
+
* @function
|
|
156
|
+
* @name EventHandler#once
|
|
157
|
+
* @description Attach an event handler to an event. This handler will be removed after being fired once.
|
|
158
|
+
* @param {string} name - Name of the event to bind the callback to.
|
|
159
|
+
* @param {callbacks.HandleEvent} callback - Function that is called when event is fired. Note the callback is limited to 8 arguments.
|
|
160
|
+
* @param {object} [scope] - Object to use as 'this' when the event is fired, defaults to current this.
|
|
161
|
+
* @returns {EventHandler} Self for chaining.
|
|
162
|
+
* @example
|
|
163
|
+
* obj.once('test', function (a, b) {
|
|
164
|
+
* console.log(a + b);
|
|
165
|
+
* });
|
|
166
|
+
* obj.fire('test', 1, 2); // prints 3 to the console
|
|
167
|
+
* obj.fire('test', 1, 2); // not going to get handled
|
|
168
|
+
*/
|
|
169
|
+
EventHandler.prototype.once = function (name, callback, scope) {
|
|
170
|
+
this._addCallback(name, callback, scope, true);
|
|
171
|
+
return this;
|
|
172
|
+
};
|
|
173
|
+
/**
|
|
174
|
+
* @function
|
|
175
|
+
* @name EventHandler#hasEvent
|
|
176
|
+
* @description Test if there are any handlers bound to an event name.
|
|
177
|
+
* @param {string} name - The name of the event to test.
|
|
178
|
+
* @returns {boolean} True if the object has handlers bound to the specified event name.
|
|
179
|
+
* @example
|
|
180
|
+
* obj.on('test', function () { }); // bind an event to 'test'
|
|
181
|
+
* obj.hasEvent('test'); // returns true
|
|
182
|
+
* obj.hasEvent('hello'); // returns false
|
|
183
|
+
*/
|
|
184
|
+
EventHandler.prototype.hasEvent = function (name) {
|
|
185
|
+
return (this._callbacks[name] && this._callbacks[name].length !== 0) || false;
|
|
186
|
+
};
|
|
187
|
+
return EventHandler;
|
|
188
|
+
}());
|
|
189
|
+
exports.EventHandler = EventHandler;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { Mat4 } from "../math/Mat4";
|
|
2
|
+
import { Vec3 } from "../math/Vec3";
|
|
3
|
+
import { Box } from "../struct/3d/Box";
|
|
4
|
+
import { Sphere } from "../struct/3d/Sphere";
|
|
5
|
+
import { BufferAttribute } from "./buffer-attribute";
|
|
6
|
+
import { TypedArray } from "./types";
|
|
7
|
+
import { Vec2 } from "../math/Vec2";
|
|
8
|
+
import { Vec4 } from "../math/Vec4";
|
|
9
|
+
export interface IGeometry {
|
|
10
|
+
position: number[];
|
|
11
|
+
normal?: number[];
|
|
12
|
+
index?: number[];
|
|
13
|
+
uv?: number[];
|
|
14
|
+
uv2?: number[];
|
|
15
|
+
tangent?: number[];
|
|
16
|
+
}
|
|
17
|
+
export interface IBufferGeometry {
|
|
18
|
+
position: Float32Array | undefined;
|
|
19
|
+
index?: Uint32Array | Uint16Array;
|
|
20
|
+
normal?: Float32Array;
|
|
21
|
+
uv?: Float32Array;
|
|
22
|
+
uv2?: Float32Array;
|
|
23
|
+
tangent?: Float32Array;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* BufferType 几何体,用于独立计算几何体
|
|
27
|
+
*/
|
|
28
|
+
export declare class BufferGeometry {
|
|
29
|
+
name: string;
|
|
30
|
+
index: BufferAttribute | undefined;
|
|
31
|
+
morphAttributes: any;
|
|
32
|
+
morphTargetsRelative: boolean;
|
|
33
|
+
groups: {
|
|
34
|
+
start: number;
|
|
35
|
+
count: number;
|
|
36
|
+
materialIndex?: number;
|
|
37
|
+
}[];
|
|
38
|
+
boundingBox: Box | undefined;
|
|
39
|
+
boundingSphere: Sphere | undefined;
|
|
40
|
+
drawRange: {
|
|
41
|
+
start: number;
|
|
42
|
+
count: number;
|
|
43
|
+
};
|
|
44
|
+
attributes: {
|
|
45
|
+
[key: string]: BufferAttribute;
|
|
46
|
+
};
|
|
47
|
+
parameters: any;
|
|
48
|
+
readonly isBufferGeometry: true;
|
|
49
|
+
uuid: string;
|
|
50
|
+
type: string;
|
|
51
|
+
constructor();
|
|
52
|
+
/**
|
|
53
|
+
* 转化成BufferArray来计算
|
|
54
|
+
* @param geo
|
|
55
|
+
*/
|
|
56
|
+
setFromGeometry(geo: IGeometry): this;
|
|
57
|
+
getIndex(): BufferAttribute | undefined;
|
|
58
|
+
setIndex(index: BufferAttribute | TypedArray | number[]): void;
|
|
59
|
+
getAttribute(name: string): BufferAttribute;
|
|
60
|
+
setAttribute(name: string, attribute: BufferAttribute): this;
|
|
61
|
+
addAttribute(name: string, attribute: BufferAttribute | TypedArray | Array<number | Vec2 | Vec3 | Vec4>, itemSize?: number): this;
|
|
62
|
+
deleteAttribute(name: string): this;
|
|
63
|
+
addGroup(start: number, count: number, materialIndex?: number): void;
|
|
64
|
+
clearGroups(): void;
|
|
65
|
+
setDrawRange(start: number, count: number): void;
|
|
66
|
+
applyMat4(matrix: Mat4): this;
|
|
67
|
+
rotateX(angle: number): this;
|
|
68
|
+
rotateY(angle: number): this;
|
|
69
|
+
rotateZ(angle: number): this;
|
|
70
|
+
translate(x: number, y: number, z: number): this;
|
|
71
|
+
scale(x: number, y: number, z: number): this;
|
|
72
|
+
lookAt(vector: Vec3): this;
|
|
73
|
+
center(): this;
|
|
74
|
+
setFromObject(object: any): this;
|
|
75
|
+
setFromPoints(points: Vec3[]): this;
|
|
76
|
+
updateFromObject(object: any): this;
|
|
77
|
+
computeBoundingBox(): void;
|
|
78
|
+
computeBoundingSphere(): void;
|
|
79
|
+
computeFaceNormals(): void;
|
|
80
|
+
computeVertexNormals(): void;
|
|
81
|
+
merge(geometry: BufferGeometry, offset: number): this | undefined;
|
|
82
|
+
normalizeNormals(): void;
|
|
83
|
+
toFlat(): BufferGeometry;
|
|
84
|
+
toNonIndexed(): BufferGeometry;
|
|
85
|
+
toJSON(): any;
|
|
86
|
+
userData(userData: any): void;
|
|
87
|
+
clone(): BufferGeometry;
|
|
88
|
+
copy(source: BufferGeometry): this;
|
|
89
|
+
}
|