cesium 0.13.0
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.
- data/LICENSE.md +259 -0
- data/README.rdoc +90 -0
- data/Rakefile +40 -0
- data/app/assets/javascripts/Assets/Assets.profile.js +8 -0
- data/app/assets/javascripts/Assets/IAU2006_XYS/IAU2006_XYS_0.json +1 -0
- data/app/assets/javascripts/Assets/IAU2006_XYS/IAU2006_XYS_1.json +1 -0
- data/app/assets/javascripts/Assets/IAU2006_XYS/IAU2006_XYS_10.json +1 -0
- data/app/assets/javascripts/Assets/IAU2006_XYS/IAU2006_XYS_11.json +1 -0
- data/app/assets/javascripts/Assets/IAU2006_XYS/IAU2006_XYS_12.json +1 -0
- data/app/assets/javascripts/Assets/IAU2006_XYS/IAU2006_XYS_13.json +1 -0
- data/app/assets/javascripts/Assets/IAU2006_XYS/IAU2006_XYS_14.json +1 -0
- data/app/assets/javascripts/Assets/IAU2006_XYS/IAU2006_XYS_15.json +1 -0
- data/app/assets/javascripts/Assets/IAU2006_XYS/IAU2006_XYS_16.json +1 -0
- data/app/assets/javascripts/Assets/IAU2006_XYS/IAU2006_XYS_17.json +1 -0
- data/app/assets/javascripts/Assets/IAU2006_XYS/IAU2006_XYS_18.json +1 -0
- data/app/assets/javascripts/Assets/IAU2006_XYS/IAU2006_XYS_19.json +1 -0
- data/app/assets/javascripts/Assets/IAU2006_XYS/IAU2006_XYS_2.json +1 -0
- data/app/assets/javascripts/Assets/IAU2006_XYS/IAU2006_XYS_20.json +1 -0
- data/app/assets/javascripts/Assets/IAU2006_XYS/IAU2006_XYS_21.json +1 -0
- data/app/assets/javascripts/Assets/IAU2006_XYS/IAU2006_XYS_22.json +1 -0
- data/app/assets/javascripts/Assets/IAU2006_XYS/IAU2006_XYS_23.json +1 -0
- data/app/assets/javascripts/Assets/IAU2006_XYS/IAU2006_XYS_24.json +1 -0
- data/app/assets/javascripts/Assets/IAU2006_XYS/IAU2006_XYS_25.json +1 -0
- data/app/assets/javascripts/Assets/IAU2006_XYS/IAU2006_XYS_26.json +1 -0
- data/app/assets/javascripts/Assets/IAU2006_XYS/IAU2006_XYS_27.json +1 -0
- data/app/assets/javascripts/Assets/IAU2006_XYS/IAU2006_XYS_3.json +1 -0
- data/app/assets/javascripts/Assets/IAU2006_XYS/IAU2006_XYS_4.json +1 -0
- data/app/assets/javascripts/Assets/IAU2006_XYS/IAU2006_XYS_5.json +1 -0
- data/app/assets/javascripts/Assets/IAU2006_XYS/IAU2006_XYS_6.json +1 -0
- data/app/assets/javascripts/Assets/IAU2006_XYS/IAU2006_XYS_7.json +1 -0
- data/app/assets/javascripts/Assets/IAU2006_XYS/IAU2006_XYS_8.json +1 -0
- data/app/assets/javascripts/Assets/IAU2006_XYS/IAU2006_XYS_9.json +1 -0
- data/app/assets/javascripts/Assets/Textures/NE2_LR_LC_SR_W_DR_2048.jpg +0 -0
- data/app/assets/javascripts/Assets/Textures/SkyBox/tycho2t3_80_mx.jpg +0 -0
- data/app/assets/javascripts/Assets/Textures/SkyBox/tycho2t3_80_my.jpg +0 -0
- data/app/assets/javascripts/Assets/Textures/SkyBox/tycho2t3_80_mz.jpg +0 -0
- data/app/assets/javascripts/Assets/Textures/SkyBox/tycho2t3_80_px.jpg +0 -0
- data/app/assets/javascripts/Assets/Textures/SkyBox/tycho2t3_80_py.jpg +0 -0
- data/app/assets/javascripts/Assets/Textures/SkyBox/tycho2t3_80_pz.jpg +0 -0
- data/app/assets/javascripts/Assets/Textures/waterNormals.jpg +0 -0
- data/app/assets/javascripts/Assets/package.json +6 -0
- data/app/assets/javascripts/Cesium.js +320 -0
- data/app/assets/javascripts/Core/AnimationController.js +148 -0
- data/app/assets/javascripts/Core/AxisAlignedBoundingBox.js +243 -0
- data/app/assets/javascripts/Core/BoundingRectangle.js +364 -0
- data/app/assets/javascripts/Core/BoundingSphere.js +819 -0
- data/app/assets/javascripts/Core/BoxTessellator.js +93 -0
- data/app/assets/javascripts/Core/Cartesian2.js +762 -0
- data/app/assets/javascripts/Core/Cartesian3.js +861 -0
- data/app/assets/javascripts/Core/Cartesian4.js +762 -0
- data/app/assets/javascripts/Core/Cartographic.js +211 -0
- data/app/assets/javascripts/Core/CatmullRomSpline.js +232 -0
- data/app/assets/javascripts/Core/Clock.js +195 -0
- data/app/assets/javascripts/Core/ClockRange.js +37 -0
- data/app/assets/javascripts/Core/ClockStep.js +32 -0
- data/app/assets/javascripts/Core/Color.js +1629 -0
- data/app/assets/javascripts/Core/ComponentDatatype.js +119 -0
- data/app/assets/javascripts/Core/Core.profile.js +8 -0
- data/app/assets/javascripts/Core/CubeMapEllipsoidTessellator.js +198 -0
- data/app/assets/javascripts/Core/CubicRealPolynomial.js +251 -0
- data/app/assets/javascripts/Core/DefaultProxy.js +30 -0
- data/app/assets/javascripts/Core/DeveloperError.js +60 -0
- data/app/assets/javascripts/Core/EarthOrientationParameters.js +383 -0
- data/app/assets/javascripts/Core/EarthOrientationParametersSample.js +50 -0
- data/app/assets/javascripts/Core/Ellipsoid.js +539 -0
- data/app/assets/javascripts/Core/EllipsoidTangentPlane.js +207 -0
- data/app/assets/javascripts/Core/EllipsoidalOccluder.js +151 -0
- data/app/assets/javascripts/Core/EncodedCartesian3.js +197 -0
- data/app/assets/javascripts/Core/Enumeration.js +67 -0
- data/app/assets/javascripts/Core/Event.js +122 -0
- data/app/assets/javascripts/Core/Extent.js +383 -0
- data/app/assets/javascripts/Core/ExtentTessellator.js +384 -0
- data/app/assets/javascripts/Core/FAR.js +13 -0
- data/app/assets/javascripts/Core/FeatureDetection.js +126 -0
- data/app/assets/javascripts/Core/Fullscreen.js +235 -0
- data/app/assets/javascripts/Core/GeographicProjection.js +107 -0
- data/app/assets/javascripts/Core/HermitePolynomialApproximation.js +176 -0
- data/app/assets/javascripts/Core/HermiteSpline.js +234 -0
- data/app/assets/javascripts/Core/Iau2006XysData.js +259 -0
- data/app/assets/javascripts/Core/Iau2006XysSample.js +36 -0
- data/app/assets/javascripts/Core/IndexDatatype.js +28 -0
- data/app/assets/javascripts/Core/Intersect.js +40 -0
- data/app/assets/javascripts/Core/IntersectionTests.js +359 -0
- data/app/assets/javascripts/Core/Interval.js +27 -0
- data/app/assets/javascripts/Core/Iso8601.js +46 -0
- data/app/assets/javascripts/Core/JulianDate.js +1228 -0
- data/app/assets/javascripts/Core/KeyboardEventModifier.js +38 -0
- data/app/assets/javascripts/Core/LagrangePolynomialApproximation.js +96 -0
- data/app/assets/javascripts/Core/LeapSecond.js +158 -0
- data/app/assets/javascripts/Core/LinearApproximation.js +98 -0
- data/app/assets/javascripts/Core/Math.js +532 -0
- data/app/assets/javascripts/Core/Matrix2.js +833 -0
- data/app/assets/javascripts/Core/Matrix3.js +1099 -0
- data/app/assets/javascripts/Core/Matrix4.js +2164 -0
- data/app/assets/javascripts/Core/MeshFilters.js +568 -0
- data/app/assets/javascripts/Core/Occluder.js +474 -0
- data/app/assets/javascripts/Core/OrientationInterpolator.js +109 -0
- data/app/assets/javascripts/Core/PlaneTessellator.js +74 -0
- data/app/assets/javascripts/Core/PolygonPipeline.js +792 -0
- data/app/assets/javascripts/Core/PolylinePipeline.js +90 -0
- data/app/assets/javascripts/Core/PrimitiveType.js +80 -0
- data/app/assets/javascripts/Core/QuadraticRealPolynomial.js +146 -0
- data/app/assets/javascripts/Core/QuarticRealPolynomial.js +339 -0
- data/app/assets/javascripts/Core/Quaternion.js +947 -0
- data/app/assets/javascripts/Core/Queue.js +95 -0
- data/app/assets/javascripts/Core/Ray.js +64 -0
- data/app/assets/javascripts/Core/ReferenceFrame.js +25 -0
- data/app/assets/javascripts/Core/RequestErrorEvent.js +35 -0
- data/app/assets/javascripts/Core/RuntimeError.js +59 -0
- data/app/assets/javascripts/Core/ScreenSpaceEventHandler.js +658 -0
- data/app/assets/javascripts/Core/ScreenSpaceEventType.js +149 -0
- data/app/assets/javascripts/Core/Shapes.js +230 -0
- data/app/assets/javascripts/Core/Spherical.js +192 -0
- data/app/assets/javascripts/Core/TaskProcessor.js +131 -0
- data/app/assets/javascripts/Core/TimeConstants.js +85 -0
- data/app/assets/javascripts/Core/TimeInterval.js +305 -0
- data/app/assets/javascripts/Core/TimeIntervalCollection.js +543 -0
- data/app/assets/javascripts/Core/TimeStandard.js +31 -0
- data/app/assets/javascripts/Core/Tipsify.js +285 -0
- data/app/assets/javascripts/Core/Transforms.js +614 -0
- data/app/assets/javascripts/Core/TridiagonalSystemSolver.js +102 -0
- data/app/assets/javascripts/Core/Visibility.js +38 -0
- data/app/assets/javascripts/Core/WebMercatorProjection.js +154 -0
- data/app/assets/javascripts/Core/WindingOrder.js +40 -0
- data/app/assets/javascripts/Core/binarySearch.js +69 -0
- data/app/assets/javascripts/Core/buildModuleUrl.js +77 -0
- data/app/assets/javascripts/Core/clone.js +21 -0
- data/app/assets/javascripts/Core/combine.js +81 -0
- data/app/assets/javascripts/Core/computeSunPosition.js +116 -0
- data/app/assets/javascripts/Core/createGuid.js +25 -0
- data/app/assets/javascripts/Core/defaultValue.js +22 -0
- data/app/assets/javascripts/Core/destroyObject.js +61 -0
- data/app/assets/javascripts/Core/freezeObject.js +20 -0
- data/app/assets/javascripts/Core/getImagePixels.js +46 -0
- data/app/assets/javascripts/Core/isLeapYear.js +30 -0
- data/app/assets/javascripts/Core/jsonp.js +116 -0
- data/app/assets/javascripts/Core/loadArrayBuffer.js +76 -0
- data/app/assets/javascripts/Core/loadImage.js +85 -0
- data/app/assets/javascripts/Core/loadJson.js +54 -0
- data/app/assets/javascripts/Core/loadText.js +78 -0
- data/app/assets/javascripts/Core/loadXML.js +76 -0
- data/app/assets/javascripts/Core/package.json +6 -0
- data/app/assets/javascripts/Core/pointInsideTriangle2D.js +41 -0
- data/app/assets/javascripts/Core/requestAnimationFrame.js +61 -0
- data/app/assets/javascripts/Core/throttleRequestByServer.js +74 -0
- data/app/assets/javascripts/Core/writeTextToCanvas.js +92 -0
- data/app/assets/javascripts/DynamicScene/CompositeDynamicObjectCollection.js +254 -0
- data/app/assets/javascripts/DynamicScene/CzmlBoolean.js +57 -0
- data/app/assets/javascripts/DynamicScene/CzmlCartesian2.js +96 -0
- data/app/assets/javascripts/DynamicScene/CzmlCartesian3.js +99 -0
- data/app/assets/javascripts/DynamicScene/CzmlCartographic.js +125 -0
- data/app/assets/javascripts/DynamicScene/CzmlColor.js +127 -0
- data/app/assets/javascripts/DynamicScene/CzmlDefaults.js +135 -0
- data/app/assets/javascripts/DynamicScene/CzmlHorizontalOrigin.js +59 -0
- data/app/assets/javascripts/DynamicScene/CzmlImage.js +61 -0
- data/app/assets/javascripts/DynamicScene/CzmlLabelStyle.js +59 -0
- data/app/assets/javascripts/DynamicScene/CzmlNumber.js +82 -0
- data/app/assets/javascripts/DynamicScene/CzmlString.js +56 -0
- data/app/assets/javascripts/DynamicScene/CzmlUnitCartesian3.js +99 -0
- data/app/assets/javascripts/DynamicScene/CzmlUnitQuaternion.js +172 -0
- data/app/assets/javascripts/DynamicScene/CzmlUnitSpherical.js +98 -0
- data/app/assets/javascripts/DynamicScene/CzmlVerticalOrigin.js +59 -0
- data/app/assets/javascripts/DynamicScene/DynamicBillboard.js +245 -0
- data/app/assets/javascripts/DynamicScene/DynamicBillboardVisualizer.js +347 -0
- data/app/assets/javascripts/DynamicScene/DynamicColorMaterial.js +78 -0
- data/app/assets/javascripts/DynamicScene/DynamicCone.js +291 -0
- data/app/assets/javascripts/DynamicScene/DynamicConeVisualizer.js +350 -0
- data/app/assets/javascripts/DynamicScene/DynamicConeVisualizerUsingCustomSensor.js +389 -0
- data/app/assets/javascripts/DynamicScene/DynamicDirectionsProperty.js +163 -0
- data/app/assets/javascripts/DynamicScene/DynamicEllipsoid.js +158 -0
- data/app/assets/javascripts/DynamicScene/DynamicEllipsoidVisualizer.js +277 -0
- data/app/assets/javascripts/DynamicScene/DynamicImageMaterial.js +136 -0
- data/app/assets/javascripts/DynamicScene/DynamicLabel.js +286 -0
- data/app/assets/javascripts/DynamicScene/DynamicLabelVisualizer.js +341 -0
- data/app/assets/javascripts/DynamicScene/DynamicMaterialProperty.js +125 -0
- data/app/assets/javascripts/DynamicScene/DynamicObject.js +364 -0
- data/app/assets/javascripts/DynamicScene/DynamicObjectCollection.js +137 -0
- data/app/assets/javascripts/DynamicScene/DynamicObjectView.js +299 -0
- data/app/assets/javascripts/DynamicScene/DynamicPath.js +214 -0
- data/app/assets/javascripts/DynamicScene/DynamicPathVisualizer.js +402 -0
- data/app/assets/javascripts/DynamicScene/DynamicPoint.js +184 -0
- data/app/assets/javascripts/DynamicScene/DynamicPointVisualizer.js +323 -0
- data/app/assets/javascripts/DynamicScene/DynamicPolygon.js +138 -0
- data/app/assets/javascripts/DynamicScene/DynamicPolygonVisualizer.js +251 -0
- data/app/assets/javascripts/DynamicScene/DynamicPolyline.js +183 -0
- data/app/assets/javascripts/DynamicScene/DynamicPolylineVisualizer.js +268 -0
- data/app/assets/javascripts/DynamicScene/DynamicPositionProperty.js +525 -0
- data/app/assets/javascripts/DynamicScene/DynamicProperty.js +352 -0
- data/app/assets/javascripts/DynamicScene/DynamicPyramid.js +204 -0
- data/app/assets/javascripts/DynamicScene/DynamicPyramidVisualizer.js +302 -0
- data/app/assets/javascripts/DynamicScene/DynamicScene.profile.js +8 -0
- data/app/assets/javascripts/DynamicScene/DynamicVertexPositionsProperty.js +199 -0
- data/app/assets/javascripts/DynamicScene/ReferenceProperty.js +155 -0
- data/app/assets/javascripts/DynamicScene/VisualizerCollection.js +181 -0
- data/app/assets/javascripts/DynamicScene/package.json +6 -0
- data/app/assets/javascripts/DynamicScene/processCzml.js +77 -0
- data/app/assets/javascripts/Renderer/BlendEquation.js +52 -0
- data/app/assets/javascripts/Renderer/BlendFunction.js +158 -0
- data/app/assets/javascripts/Renderer/BlendingState.js +64 -0
- data/app/assets/javascripts/Renderer/Buffer.js +141 -0
- data/app/assets/javascripts/Renderer/BufferUsage.js +48 -0
- data/app/assets/javascripts/Renderer/ClearCommand.js +40 -0
- data/app/assets/javascripts/Renderer/CommandLists.js +42 -0
- data/app/assets/javascripts/Renderer/Context.js +2805 -0
- data/app/assets/javascripts/Renderer/CubeMap.js +358 -0
- data/app/assets/javascripts/Renderer/CubeMapFace.js +202 -0
- data/app/assets/javascripts/Renderer/CullFace.js +50 -0
- data/app/assets/javascripts/Renderer/DepthFunction.js +95 -0
- data/app/assets/javascripts/Renderer/DrawCommand.js +96 -0
- data/app/assets/javascripts/Renderer/Framebuffer.js +435 -0
- data/app/assets/javascripts/Renderer/MipmapHint.js +50 -0
- data/app/assets/javascripts/Renderer/PickFramebuffer.js +178 -0
- data/app/assets/javascripts/Renderer/PixelDatatype.js +86 -0
- data/app/assets/javascripts/Renderer/PixelFormat.js +113 -0
- data/app/assets/javascripts/Renderer/Renderbuffer.js +102 -0
- data/app/assets/javascripts/Renderer/RenderbufferFormat.js +77 -0
- data/app/assets/javascripts/Renderer/Renderer.profile.js +8 -0
- data/app/assets/javascripts/Renderer/ShaderCache.js +121 -0
- data/app/assets/javascripts/Renderer/ShaderProgram.js +2402 -0
- data/app/assets/javascripts/Renderer/StencilFunction.js +95 -0
- data/app/assets/javascripts/Renderer/StencilOperation.js +95 -0
- data/app/assets/javascripts/Renderer/Texture.js +395 -0
- data/app/assets/javascripts/Renderer/TextureAtlas.js +472 -0
- data/app/assets/javascripts/Renderer/TextureAtlasBuilder.js +133 -0
- data/app/assets/javascripts/Renderer/TextureMagnificationFilter.js +41 -0
- data/app/assets/javascripts/Renderer/TextureMinificationFilter.js +77 -0
- data/app/assets/javascripts/Renderer/TextureWrap.js +50 -0
- data/app/assets/javascripts/Renderer/UniformDatatype.js +218 -0
- data/app/assets/javascripts/Renderer/UniformState.js +799 -0
- data/app/assets/javascripts/Renderer/VertexArray.js +365 -0
- data/app/assets/javascripts/Renderer/VertexArrayFacade.js +574 -0
- data/app/assets/javascripts/Renderer/VertexLayout.js +49 -0
- data/app/assets/javascripts/Renderer/loadCubeMap.js +92 -0
- data/app/assets/javascripts/Renderer/package.json +6 -0
- data/app/assets/javascripts/Scene/AnimationCollection.js +249 -0
- data/app/assets/javascripts/Scene/ArcGisMapServerImageryProvider.js +384 -0
- data/app/assets/javascripts/Scene/Billboard.js +680 -0
- data/app/assets/javascripts/Scene/BillboardCollection.js +1209 -0
- data/app/assets/javascripts/Scene/BingMapsImageryProvider.js +460 -0
- data/app/assets/javascripts/Scene/BingMapsStyle.js +55 -0
- data/app/assets/javascripts/Scene/Camera.js +358 -0
- data/app/assets/javascripts/Scene/CameraColumbusViewMode.js +30 -0
- data/app/assets/javascripts/Scene/CameraController.js +1258 -0
- data/app/assets/javascripts/Scene/CameraEventAggregator.js +270 -0
- data/app/assets/javascripts/Scene/CameraEventType.js +53 -0
- data/app/assets/javascripts/Scene/CameraFlightPath.js +495 -0
- data/app/assets/javascripts/Scene/CentralBody.js +817 -0
- data/app/assets/javascripts/Scene/CentralBodySurface.js +1120 -0
- data/app/assets/javascripts/Scene/CentralBodySurfaceShaderSet.js +107 -0
- data/app/assets/javascripts/Scene/ComplexConicSensorVolume.js +511 -0
- data/app/assets/javascripts/Scene/CompositePrimitive.js +454 -0
- data/app/assets/javascripts/Scene/CullingVolume.js +59 -0
- data/app/assets/javascripts/Scene/CustomSensorVolume.js +440 -0
- data/app/assets/javascripts/Scene/DiscardMissingTileImagePolicy.js +134 -0
- data/app/assets/javascripts/Scene/EllipsoidPrimitive.js +412 -0
- data/app/assets/javascripts/Scene/EllipsoidTerrainProvider.js +182 -0
- data/app/assets/javascripts/Scene/FrameState.js +86 -0
- data/app/assets/javascripts/Scene/FrustumCommands.js +32 -0
- data/app/assets/javascripts/Scene/GeographicTilingScheme.js +265 -0
- data/app/assets/javascripts/Scene/HorizontalOrigin.js +39 -0
- data/app/assets/javascripts/Scene/Imagery.js +85 -0
- data/app/assets/javascripts/Scene/ImageryLayer.js +876 -0
- data/app/assets/javascripts/Scene/ImageryLayerCollection.js +403 -0
- data/app/assets/javascripts/Scene/ImageryProvider.js +185 -0
- data/app/assets/javascripts/Scene/ImageryProviderError.js +149 -0
- data/app/assets/javascripts/Scene/ImageryState.js +20 -0
- data/app/assets/javascripts/Scene/Label.js +706 -0
- data/app/assets/javascripts/Scene/LabelCollection.js +697 -0
- data/app/assets/javascripts/Scene/LabelStyle.js +39 -0
- data/app/assets/javascripts/Scene/Material.js +1177 -0
- data/app/assets/javascripts/Scene/NeverTileDiscardPolicy.js +38 -0
- data/app/assets/javascripts/Scene/OpenStreetMapImageryProvider.js +282 -0
- data/app/assets/javascripts/Scene/OrthographicFrustum.js +345 -0
- data/app/assets/javascripts/Scene/PerformanceDisplay.js +183 -0
- data/app/assets/javascripts/Scene/PerspectiveFrustum.js +239 -0
- data/app/assets/javascripts/Scene/PerspectiveOffCenterFrustum.js +394 -0
- data/app/assets/javascripts/Scene/Polygon.js +886 -0
- data/app/assets/javascripts/Scene/Polyline.js +441 -0
- data/app/assets/javascripts/Scene/PolylineCollection.js +1532 -0
- data/app/assets/javascripts/Scene/Projections.js +93 -0
- data/app/assets/javascripts/Scene/RectangularPyramidSensorVolume.js +224 -0
- data/app/assets/javascripts/Scene/Scene.js +632 -0
- data/app/assets/javascripts/Scene/Scene.profile.js +8 -0
- data/app/assets/javascripts/Scene/SceneMode.js +51 -0
- data/app/assets/javascripts/Scene/SceneTransitioner.js +776 -0
- data/app/assets/javascripts/Scene/ScreenSpaceCameraController.js +1063 -0
- data/app/assets/javascripts/Scene/SensorVolumeCollection.js +192 -0
- data/app/assets/javascripts/Scene/SingleTileImageryProvider.js +295 -0
- data/app/assets/javascripts/Scene/SkyAtmosphere.js +239 -0
- data/app/assets/javascripts/Scene/SkyBox.js +231 -0
- data/app/assets/javascripts/Scene/TerrainProvider.js +229 -0
- data/app/assets/javascripts/Scene/TexturePool.js +154 -0
- data/app/assets/javascripts/Scene/Tile.js +322 -0
- data/app/assets/javascripts/Scene/TileDiscardPolicy.js +42 -0
- data/app/assets/javascripts/Scene/TileImagery.js +36 -0
- data/app/assets/javascripts/Scene/TileLoadQueue.js +123 -0
- data/app/assets/javascripts/Scene/TileMapServiceImageryProvider.js +337 -0
- data/app/assets/javascripts/Scene/TileReplacementQueue.js +139 -0
- data/app/assets/javascripts/Scene/TileState.js +19 -0
- data/app/assets/javascripts/Scene/TilingScheme.js +213 -0
- data/app/assets/javascripts/Scene/VerticalOrigin.js +39 -0
- data/app/assets/javascripts/Scene/ViewportQuad.js +256 -0
- data/app/assets/javascripts/Scene/WebMapServiceImageryProvider.js +374 -0
- data/app/assets/javascripts/Scene/WebMercatorTilingScheme.js +291 -0
- data/app/assets/javascripts/Scene/package.json +6 -0
- data/app/assets/javascripts/Shaders/BillboardCollectionFS.glsl +30 -0
- data/app/assets/javascripts/Shaders/BillboardCollectionFS.js +31 -0
- data/app/assets/javascripts/Shaders/BillboardCollectionVS.glsl +68 -0
- data/app/assets/javascripts/Shaders/BillboardCollectionVS.js +54 -0
- data/app/assets/javascripts/Shaders/BuiltinFunctions.glsl +927 -0
- data/app/assets/javascripts/Shaders/BuiltinFunctions.js +322 -0
- data/app/assets/javascripts/Shaders/CentralBodyFS.glsl +106 -0
- data/app/assets/javascripts/Shaders/CentralBodyFS.js +82 -0
- data/app/assets/javascripts/Shaders/CentralBodyFSDepth.glsl +20 -0
- data/app/assets/javascripts/Shaders/CentralBodyFSDepth.js +22 -0
- data/app/assets/javascripts/Shaders/CentralBodyFSPole.glsl +29 -0
- data/app/assets/javascripts/Shaders/CentralBodyFSPole.js +28 -0
- data/app/assets/javascripts/Shaders/CentralBodyVS.glsl +88 -0
- data/app/assets/javascripts/Shaders/CentralBodyVS.js +69 -0
- data/app/assets/javascripts/Shaders/CentralBodyVSDepth.glsl +9 -0
- data/app/assets/javascripts/Shaders/CentralBodyVSDepth.js +13 -0
- data/app/assets/javascripts/Shaders/CentralBodyVSPole.glsl +12 -0
- data/app/assets/javascripts/Shaders/CentralBodyVSPole.js +15 -0
- data/app/assets/javascripts/Shaders/ComplexConicSensorVolumeFS.glsl +448 -0
- data/app/assets/javascripts/Shaders/ComplexConicSensorVolumeFS.js +361 -0
- data/app/assets/javascripts/Shaders/ComplexConicSensorVolumeVS.glsl +19 -0
- data/app/assets/javascripts/Shaders/ComplexConicSensorVolumeVS.js +20 -0
- data/app/assets/javascripts/Shaders/ConstructiveSolidGeometry.glsl +886 -0
- data/app/assets/javascripts/Shaders/ConstructiveSolidGeometry.js +586 -0
- data/app/assets/javascripts/Shaders/CustomSensorVolumeFS.glsl +126 -0
- data/app/assets/javascripts/Shaders/CustomSensorVolumeFS.js +95 -0
- data/app/assets/javascripts/Shaders/CustomSensorVolumeVS.glsl +14 -0
- data/app/assets/javascripts/Shaders/CustomSensorVolumeVS.js +18 -0
- data/app/assets/javascripts/Shaders/EllipsoidFS.glsl +40 -0
- data/app/assets/javascripts/Shaders/EllipsoidFS.js +38 -0
- data/app/assets/javascripts/Shaders/EllipsoidVS.glsl +26 -0
- data/app/assets/javascripts/Shaders/EllipsoidVS.js +16 -0
- data/app/assets/javascripts/Shaders/Materials/AsphaltMaterial.glsl +25 -0
- data/app/assets/javascripts/Shaders/Materials/AsphaltMaterial.js +23 -0
- data/app/assets/javascripts/Shaders/Materials/BlobMaterial.glsl +18 -0
- data/app/assets/javascripts/Shaders/Materials/BlobMaterial.js +19 -0
- data/app/assets/javascripts/Shaders/Materials/BrickMaterial.glsl +42 -0
- data/app/assets/javascripts/Shaders/Materials/BrickMaterial.js +36 -0
- data/app/assets/javascripts/Shaders/Materials/BumpMapMaterial.glsl +29 -0
- data/app/assets/javascripts/Shaders/Materials/BumpMapMaterial.js +27 -0
- data/app/assets/javascripts/Shaders/Materials/CementMaterial.glsl +19 -0
- data/app/assets/javascripts/Shaders/Materials/CementMaterial.js +20 -0
- data/app/assets/javascripts/Shaders/Materials/CheckerboardMaterial.glsl +38 -0
- data/app/assets/javascripts/Shaders/Materials/CheckerboardMaterial.js +32 -0
- data/app/assets/javascripts/Shaders/Materials/DotMaterial.glsl +17 -0
- data/app/assets/javascripts/Shaders/Materials/DotMaterial.js +18 -0
- data/app/assets/javascripts/Shaders/Materials/ErosionMaterial.glsl +23 -0
- data/app/assets/javascripts/Shaders/Materials/ErosionMaterial.js +24 -0
- data/app/assets/javascripts/Shaders/Materials/FacetMaterial.glsl +18 -0
- data/app/assets/javascripts/Shaders/Materials/FacetMaterial.js +19 -0
- data/app/assets/javascripts/Shaders/Materials/FresnelMaterial.glsl +12 -0
- data/app/assets/javascripts/Shaders/Materials/FresnelMaterial.js +15 -0
- data/app/assets/javascripts/Shaders/Materials/GrassMaterial.glsl +28 -0
- data/app/assets/javascripts/Shaders/Materials/GrassMaterial.js +26 -0
- data/app/assets/javascripts/Shaders/Materials/NormalMapMaterial.glsl +19 -0
- data/app/assets/javascripts/Shaders/Materials/NormalMapMaterial.js +21 -0
- data/app/assets/javascripts/Shaders/Materials/ReflectionMaterial.glsl +13 -0
- data/app/assets/javascripts/Shaders/Materials/ReflectionMaterial.js +16 -0
- data/app/assets/javascripts/Shaders/Materials/RefractionMaterial.glsl +14 -0
- data/app/assets/javascripts/Shaders/Materials/RefractionMaterial.js +17 -0
- data/app/assets/javascripts/Shaders/Materials/RimLightingMaterial.glsl +18 -0
- data/app/assets/javascripts/Shaders/Materials/RimLightingMaterial.js +19 -0
- data/app/assets/javascripts/Shaders/Materials/StripeMaterial.glsl +29 -0
- data/app/assets/javascripts/Shaders/Materials/StripeMaterial.js +26 -0
- data/app/assets/javascripts/Shaders/Materials/TieDyeMaterial.glsl +17 -0
- data/app/assets/javascripts/Shaders/Materials/TieDyeMaterial.js +19 -0
- data/app/assets/javascripts/Shaders/Materials/Water.glsl +91 -0
- data/app/assets/javascripts/Shaders/Materials/Water.js +60 -0
- data/app/assets/javascripts/Shaders/Materials/WoodMaterial.glsl +36 -0
- data/app/assets/javascripts/Shaders/Materials/WoodMaterial.js +31 -0
- data/app/assets/javascripts/Shaders/Noise.glsl +453 -0
- data/app/assets/javascripts/Shaders/Noise.js +242 -0
- data/app/assets/javascripts/Shaders/PolygonFS.glsl +27 -0
- data/app/assets/javascripts/Shaders/PolygonFS.js +23 -0
- data/app/assets/javascripts/Shaders/PolygonFSPick.glsl +6 -0
- data/app/assets/javascripts/Shaders/PolygonFSPick.js +11 -0
- data/app/assets/javascripts/Shaders/PolygonVS.glsl +38 -0
- data/app/assets/javascripts/Shaders/PolygonVS.js +39 -0
- data/app/assets/javascripts/Shaders/PolygonVSPick.glsl +30 -0
- data/app/assets/javascripts/Shaders/PolygonVSPick.js +32 -0
- data/app/assets/javascripts/Shaders/PolylineFS.glsl +6 -0
- data/app/assets/javascripts/Shaders/PolylineFS.js +11 -0
- data/app/assets/javascripts/Shaders/PolylineVS.glsl +34 -0
- data/app/assets/javascripts/Shaders/PolylineVS.js +35 -0
- data/app/assets/javascripts/Shaders/Ray.glsl +532 -0
- data/app/assets/javascripts/Shaders/Ray.js +357 -0
- data/app/assets/javascripts/Shaders/ReprojectWebMercatorFS.glsl +26 -0
- data/app/assets/javascripts/Shaders/ReprojectWebMercatorFS.js +22 -0
- data/app/assets/javascripts/Shaders/ReprojectWebMercatorVS.glsl +11 -0
- data/app/assets/javascripts/Shaders/ReprojectWebMercatorVS.js +14 -0
- data/app/assets/javascripts/Shaders/SensorVolume.glsl +43 -0
- data/app/assets/javascripts/Shaders/SensorVolume.js +31 -0
- data/app/assets/javascripts/Shaders/Shaders.profile.js +8 -0
- data/app/assets/javascripts/Shaders/SkyAtmosphereFS.glsl +70 -0
- data/app/assets/javascripts/Shaders/SkyAtmosphereFS.js +62 -0
- data/app/assets/javascripts/Shaders/SkyAtmosphereVS.glsl +131 -0
- data/app/assets/javascripts/Shaders/SkyAtmosphereVS.js +115 -0
- data/app/assets/javascripts/Shaders/SkyBoxFS.glsl +10 -0
- data/app/assets/javascripts/Shaders/SkyBoxFS.js +14 -0
- data/app/assets/javascripts/Shaders/SkyBoxVS.glsl +10 -0
- data/app/assets/javascripts/Shaders/SkyBoxVS.js +14 -0
- data/app/assets/javascripts/Shaders/ViewportQuadFS.glsl +16 -0
- data/app/assets/javascripts/Shaders/ViewportQuadFS.js +17 -0
- data/app/assets/javascripts/Shaders/ViewportQuadVS.glsl +10 -0
- data/app/assets/javascripts/Shaders/ViewportQuadVS.js +14 -0
- data/app/assets/javascripts/Shaders/package.json +6 -0
- data/app/assets/javascripts/ThirdParty/ThirdParty.profile.js +8 -0
- data/app/assets/javascripts/ThirdParty/Tween.js +678 -0
- data/app/assets/javascripts/ThirdParty/Uri.js +277 -0
- data/app/assets/javascripts/ThirdParty/measureText.js +197 -0
- data/app/assets/javascripts/ThirdParty/package.json +6 -0
- data/app/assets/javascripts/ThirdParty/sprintf.js +319 -0
- data/app/assets/javascripts/ThirdParty/when.js +748 -0
- data/app/assets/javascripts/Widgets/Dojo/CesiumViewerWidget.css +175 -0
- data/app/assets/javascripts/Widgets/Dojo/CesiumViewerWidget.html +52 -0
- data/app/assets/javascripts/Widgets/Dojo/CesiumViewerWidget.js +1237 -0
- data/app/assets/javascripts/Widgets/Dojo/CesiumWidget.html +4 -0
- data/app/assets/javascripts/Widgets/Dojo/CesiumWidget.js +349 -0
- data/app/assets/javascripts/Widgets/Dojo/TimelineWidget.css +1 -0
- data/app/assets/javascripts/Widgets/Dojo/TimelineWidget.js +47 -0
- data/app/assets/javascripts/Widgets/Dojo/checkForChromeFrame.js +71 -0
- data/app/assets/javascripts/Widgets/Images/Bing_Logo_51x19_White.png +0 -0
- data/app/assets/javascripts/Widgets/Images/Cesium_Logo_overlay.png +0 -0
- data/app/assets/javascripts/Widgets/Images/TimelineIcons.png +0 -0
- data/app/assets/javascripts/Widgets/Images/ajax-loader.gif +0 -0
- data/app/assets/javascripts/Widgets/Images/animationBar.png +0 -0
- data/app/assets/javascripts/Widgets/Images/viewControlBar.png +0 -0
- data/app/assets/javascripts/Widgets/Timeline.css +113 -0
- data/app/assets/javascripts/Widgets/Timeline.js +629 -0
- data/app/assets/javascripts/Widgets/TimelineHighlightRange.js +51 -0
- data/app/assets/javascripts/Widgets/TimelineTrack.js +54 -0
- data/app/assets/javascripts/Widgets/Widgets.profile.js +8 -0
- data/app/assets/javascripts/Widgets/package.json +6 -0
- data/app/assets/javascripts/Workers/Workers.profile.js +8 -0
- data/app/assets/javascripts/Workers/cesiumWorkerBootstrapper.js +2015 -0
- data/app/assets/javascripts/Workers/createTaskProcessorWorker.js +55 -0
- data/app/assets/javascripts/Workers/createVerticesFromExtent.js +24 -0
- data/app/assets/javascripts/Workers/package.json +6 -0
- data/app/assets/javascripts/copyrightHeader.js +22 -0
- data/app/assets/javascripts/main.js +10 -0
- data/app/assets/stylesheets/cesium.css +4 -0
- data/app/controllers/cesium_controller.rb +4 -0
- data/app/helpers/cesium_helper.rb +2 -0
- data/app/views/cesium/index.html.erb +3 -0
- data/config/routes.rb +3 -0
- data/lib/cesium.rb +4 -0
- data/lib/cesium/engine.rb +4 -0
- data/lib/cesium/version.rb +3 -0
- data/lib/tasks/cesium_tasks.rake +4 -0
- data/test/cesium_test.rb +7 -0
- data/test/dummy/README.rdoc +261 -0
- data/test/dummy/Rakefile +7 -0
- data/test/dummy/app/assets/javascripts/adapters/jquery-adapter.js.coffee +4 -0
- data/test/dummy/app/assets/javascripts/app.js.coffee +11 -0
- data/test/dummy/app/assets/javascripts/application.js.coffee +73 -0
- data/test/dummy/app/assets/stylesheets/application.css +12 -0
- data/test/dummy/app/controllers/application_controller.rb +4 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/views/layouts/application.html.erb +21 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/config/application.rb +59 -0
- data/test/dummy/config/boot.rb +10 -0
- data/test/dummy/config/database.yml +25 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +37 -0
- data/test/dummy/config/environments/production.rb +67 -0
- data/test/dummy/config/environments/test.rb +37 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/inflections.rb +15 -0
- data/test/dummy/config/initializers/mime_types.rb +5 -0
- data/test/dummy/config/initializers/secret_token.rb +7 -0
- data/test/dummy/config/initializers/session_store.rb +8 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy/config/locales/en.yml +5 -0
- data/test/dummy/config/requirejs.yml +10 -0
- data/test/dummy/config/routes.rb +3 -0
- data/test/dummy/public/404.html +26 -0
- data/test/dummy/public/422.html +26 -0
- data/test/dummy/public/500.html +25 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/script/rails +6 -0
- data/test/functional/cesium_controller_test.rb +9 -0
- data/test/integration/navigation_test.rb +10 -0
- data/test/test_helper.rb +15 -0
- data/test/unit/helpers/cesium_helper_test.rb +4 -0
- metadata +641 -0
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/*global define*/
|
|
2
|
+
define([
|
|
3
|
+
'./DeveloperError',
|
|
4
|
+
'./Cartesian3',
|
|
5
|
+
'./ComponentDatatype',
|
|
6
|
+
'./PrimitiveType'
|
|
7
|
+
], function(
|
|
8
|
+
DeveloperError,
|
|
9
|
+
Cartesian3,
|
|
10
|
+
ComponentDatatype,
|
|
11
|
+
PrimitiveType) {
|
|
12
|
+
"use strict";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* DOC_TBA
|
|
16
|
+
*
|
|
17
|
+
* @alias BoxTessellator
|
|
18
|
+
* @exports BoxTessellator
|
|
19
|
+
*
|
|
20
|
+
* @see CubeMapEllipsoidTessellator
|
|
21
|
+
* @see PlaneTessellator
|
|
22
|
+
*/
|
|
23
|
+
var BoxTessellator = {
|
|
24
|
+
/**
|
|
25
|
+
* DOC_TBA
|
|
26
|
+
*
|
|
27
|
+
* @exception {DeveloperError} All dimensions' components must be greater than or equal to zero.
|
|
28
|
+
*/
|
|
29
|
+
compute : function(template) {
|
|
30
|
+
template = template || {};
|
|
31
|
+
var minimumCorner;
|
|
32
|
+
var maximumCorner;
|
|
33
|
+
|
|
34
|
+
if (template.minimumCorner && template.maximumCorner) {
|
|
35
|
+
minimumCorner = template.minimumCorner;
|
|
36
|
+
maximumCorner = template.maximumCorner;
|
|
37
|
+
} else {
|
|
38
|
+
var dimensions = template.dimensions || new Cartesian3(1.0, 1.0, 1.0);
|
|
39
|
+
|
|
40
|
+
if (dimensions.x < 0 || dimensions.y < 0 || dimensions.z < 0) {
|
|
41
|
+
throw new DeveloperError('All dimensions components must be greater than or equal to zero.');
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
var corner = dimensions.multiplyByScalar(0.5);
|
|
45
|
+
minimumCorner = corner.negate();
|
|
46
|
+
maximumCorner = corner;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
var mesh = {};
|
|
50
|
+
mesh.attributes = {};
|
|
51
|
+
mesh.indexLists = [];
|
|
52
|
+
|
|
53
|
+
// 8 corner points.
|
|
54
|
+
mesh.attributes.position = {
|
|
55
|
+
componentDatatype : ComponentDatatype.FLOAT,
|
|
56
|
+
componentsPerAttribute : 3,
|
|
57
|
+
values : [
|
|
58
|
+
minimumCorner.x, minimumCorner.y, minimumCorner.z,
|
|
59
|
+
maximumCorner.x, minimumCorner.y, minimumCorner.z,
|
|
60
|
+
maximumCorner.x, maximumCorner.y, minimumCorner.z,
|
|
61
|
+
minimumCorner.x, maximumCorner.y, minimumCorner.z,
|
|
62
|
+
minimumCorner.x, minimumCorner.y, maximumCorner.z,
|
|
63
|
+
maximumCorner.x, minimumCorner.y, maximumCorner.z,
|
|
64
|
+
maximumCorner.x, maximumCorner.y, maximumCorner.z,
|
|
65
|
+
minimumCorner.x, maximumCorner.y, maximumCorner.z
|
|
66
|
+
]
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
// 12 triangles: 6 faces, 2 triangles each.
|
|
70
|
+
mesh.indexLists.push({
|
|
71
|
+
primitiveType : PrimitiveType.TRIANGLES,
|
|
72
|
+
values : [
|
|
73
|
+
4, 5, 6, // Top: plane z = corner.Z
|
|
74
|
+
4, 6, 7,
|
|
75
|
+
1, 0, 3, // Bottom: plane z = -corner.Z
|
|
76
|
+
1, 3, 2,
|
|
77
|
+
1, 6, 5, // Side: plane x = corner.X
|
|
78
|
+
1, 2, 6,
|
|
79
|
+
2, 3, 7, // Side: plane y = corner.Y
|
|
80
|
+
2, 7, 6,
|
|
81
|
+
3, 0, 4, // Side: plane x = -corner.X
|
|
82
|
+
3, 4, 7,
|
|
83
|
+
0, 1, 5, // Side: plane y = -corner.Y
|
|
84
|
+
0, 5, 4
|
|
85
|
+
]
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
return mesh;
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
return BoxTessellator;
|
|
93
|
+
});
|
|
@@ -0,0 +1,762 @@
|
|
|
1
|
+
/*global define*/
|
|
2
|
+
define([
|
|
3
|
+
'./defaultValue',
|
|
4
|
+
'./DeveloperError',
|
|
5
|
+
'./freezeObject'
|
|
6
|
+
], function(
|
|
7
|
+
defaultValue,
|
|
8
|
+
DeveloperError,
|
|
9
|
+
freezeObject) {
|
|
10
|
+
"use strict";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* A 2D Cartesian point.
|
|
14
|
+
* @alias Cartesian2
|
|
15
|
+
* @constructor
|
|
16
|
+
*
|
|
17
|
+
* @param {Number} [x=0.0] The X component.
|
|
18
|
+
* @param {Number} [y=0.0] The Y component.
|
|
19
|
+
*
|
|
20
|
+
* @see Cartesian3
|
|
21
|
+
* @see Cartesian4
|
|
22
|
+
*/
|
|
23
|
+
var Cartesian2 = function(x, y) {
|
|
24
|
+
/**
|
|
25
|
+
* The Y component.
|
|
26
|
+
* @type Number
|
|
27
|
+
*/
|
|
28
|
+
this.x = defaultValue(x, 0.0);
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* The X component.
|
|
32
|
+
* @type Number
|
|
33
|
+
*/
|
|
34
|
+
this.y = defaultValue(y, 0.0);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Duplicates a Cartesian2 instance.
|
|
39
|
+
* @memberof Cartesian2
|
|
40
|
+
*
|
|
41
|
+
* @param {Cartesian2} cartesian The Cartesian to duplicate.
|
|
42
|
+
* @param {Cartesian2} [result] The object onto which to store the result.
|
|
43
|
+
* @return {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided.
|
|
44
|
+
*
|
|
45
|
+
* @exception {DeveloperError} cartesian is required.
|
|
46
|
+
*/
|
|
47
|
+
Cartesian2.clone = function(cartesian, result) {
|
|
48
|
+
if (typeof cartesian === 'undefined') {
|
|
49
|
+
throw new DeveloperError('cartesian is required');
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (typeof result === 'undefined') {
|
|
53
|
+
return new Cartesian2(cartesian.x, cartesian.y);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
result.x = cartesian.x;
|
|
57
|
+
result.y = cartesian.y;
|
|
58
|
+
return result;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Creates a Cartesian2 instance from an existing Cartesian3. This simply takes the
|
|
63
|
+
* x and y properties of the Cartesian3 and drops z.
|
|
64
|
+
* @memberof Cartesian2
|
|
65
|
+
* @function
|
|
66
|
+
*
|
|
67
|
+
* @param {Cartesian3} cartesian The Cartesian3 instance to create a Cartesian2 instance from.
|
|
68
|
+
* @param {Cartesian2} [result] The object onto which to store the result.
|
|
69
|
+
* @return {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided.
|
|
70
|
+
*
|
|
71
|
+
* @exception {DeveloperError} cartesian is required.
|
|
72
|
+
*/
|
|
73
|
+
Cartesian2.fromCartesian3 = Cartesian2.clone;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Creates a Cartesian2 instance from an existing Cartesian4. This simply takes the
|
|
77
|
+
* x and y properties of the Cartesian4 and drops z and w.
|
|
78
|
+
* @function
|
|
79
|
+
*
|
|
80
|
+
* @param {Cartesian4} cartesian The Cartesian4 instance to create a Cartesian2 instance from.
|
|
81
|
+
* @param {Cartesian2} [result] The object onto which to store the result.
|
|
82
|
+
* @return {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided.
|
|
83
|
+
*
|
|
84
|
+
* @exception {DeveloperError} cartesian is required.
|
|
85
|
+
*/
|
|
86
|
+
Cartesian2.fromCartesian4 = Cartesian2.clone;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Computes the value of the maximum component for the supplied Cartesian.
|
|
90
|
+
* @memberof Cartesian2
|
|
91
|
+
*
|
|
92
|
+
* @param {Cartesian2} The cartesian to use.
|
|
93
|
+
* @return {Number} The value of the maximum component.
|
|
94
|
+
*
|
|
95
|
+
* @exception {DeveloperError} cartesian is required.
|
|
96
|
+
*/
|
|
97
|
+
Cartesian2.getMaximumComponent = function(cartesian) {
|
|
98
|
+
if (typeof cartesian === 'undefined') {
|
|
99
|
+
throw new DeveloperError('cartesian is required');
|
|
100
|
+
}
|
|
101
|
+
return Math.max(cartesian.x, cartesian.y);
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Computes the value of the minimum component for the supplied Cartesian.
|
|
106
|
+
* @memberof Cartesian2
|
|
107
|
+
*
|
|
108
|
+
* @param {Cartesian2} The cartesian to use.
|
|
109
|
+
* @return {Number} The value of the minimum component.
|
|
110
|
+
*
|
|
111
|
+
* @exception {DeveloperError} cartesian is required.
|
|
112
|
+
*/
|
|
113
|
+
Cartesian2.getMinimumComponent = function(cartesian) {
|
|
114
|
+
if (typeof cartesian === 'undefined') {
|
|
115
|
+
throw new DeveloperError('cartesian is required');
|
|
116
|
+
}
|
|
117
|
+
return Math.min(cartesian.x, cartesian.y);
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Computes the provided Cartesian's squared magnitude.
|
|
122
|
+
* @memberof Cartesian2
|
|
123
|
+
*
|
|
124
|
+
* @param {Cartesian2} cartesian The Cartesian instance whose squared magnitude is to be computed.
|
|
125
|
+
* @return {Number} The squared magnitude.
|
|
126
|
+
*
|
|
127
|
+
* @exception {DeveloperError} cartesian is required.
|
|
128
|
+
*/
|
|
129
|
+
Cartesian2.magnitudeSquared = function(cartesian) {
|
|
130
|
+
if (typeof cartesian === 'undefined') {
|
|
131
|
+
throw new DeveloperError('cartesian is required');
|
|
132
|
+
}
|
|
133
|
+
return cartesian.x * cartesian.x + cartesian.y * cartesian.y;
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Computes the Cartesian's magnitude (length).
|
|
138
|
+
* @memberof Cartesian2
|
|
139
|
+
*
|
|
140
|
+
* @param {Cartesian2} cartesian The Cartesian instance whose magnitude is to be computed.
|
|
141
|
+
* @return {Number} The magnitude.
|
|
142
|
+
*
|
|
143
|
+
* @exception {DeveloperError} cartesian is required.
|
|
144
|
+
*/
|
|
145
|
+
Cartesian2.magnitude = function(cartesian) {
|
|
146
|
+
return Math.sqrt(Cartesian2.magnitudeSquared(cartesian));
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Computes the normalized form of the supplied Cartesian.
|
|
151
|
+
* @memberof Cartesian2
|
|
152
|
+
*
|
|
153
|
+
* @param {Cartesian2} cartesian The Cartesian to be normalized.
|
|
154
|
+
* @param {Cartesian2} [result] The object onto which to store the result.
|
|
155
|
+
* @return {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided.
|
|
156
|
+
*
|
|
157
|
+
* @exception {DeveloperError} cartesian is required.
|
|
158
|
+
*/
|
|
159
|
+
Cartesian2.normalize = function(cartesian, result) {
|
|
160
|
+
if (typeof cartesian === 'undefined') {
|
|
161
|
+
throw new DeveloperError('cartesian is required');
|
|
162
|
+
}
|
|
163
|
+
var magnitude = Cartesian2.magnitude(cartesian);
|
|
164
|
+
if (typeof result === 'undefined') {
|
|
165
|
+
return new Cartesian2(cartesian.x / magnitude, cartesian.y / magnitude);
|
|
166
|
+
}
|
|
167
|
+
result.x = cartesian.x / magnitude;
|
|
168
|
+
result.y = cartesian.y / magnitude;
|
|
169
|
+
return result;
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Computes the dot (scalar) product of two Cartesians.
|
|
174
|
+
* @memberof Cartesian2
|
|
175
|
+
*
|
|
176
|
+
* @param {Cartesian2} left The first Cartesian.
|
|
177
|
+
* @param {Cartesian2} right The second Cartesian.
|
|
178
|
+
* @return {Number} The dot product.
|
|
179
|
+
*
|
|
180
|
+
* @exception {DeveloperError} left is required.
|
|
181
|
+
* @exception {DeveloperError} right is required.
|
|
182
|
+
*/
|
|
183
|
+
Cartesian2.dot = function(left, right) {
|
|
184
|
+
if (typeof left === 'undefined') {
|
|
185
|
+
throw new DeveloperError('left is required');
|
|
186
|
+
}
|
|
187
|
+
if (typeof right === 'undefined') {
|
|
188
|
+
throw new DeveloperError('right is required');
|
|
189
|
+
}
|
|
190
|
+
return left.x * right.x + left.y * right.y;
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Computes the componentwise product of two Cartesians.
|
|
195
|
+
* @memberof Cartesian2
|
|
196
|
+
*
|
|
197
|
+
* @param {Cartesian2} left The first Cartesian.
|
|
198
|
+
* @param {Cartesian2} right The second Cartesian.
|
|
199
|
+
* @param {Cartesian2} [result] The object onto which to store the result.
|
|
200
|
+
* @return {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided.
|
|
201
|
+
*
|
|
202
|
+
* @exception {DeveloperError} left is required.
|
|
203
|
+
* @exception {DeveloperError} right is required.
|
|
204
|
+
*/
|
|
205
|
+
Cartesian2.multiplyComponents = function(left, right, result) {
|
|
206
|
+
if (typeof left === 'undefined') {
|
|
207
|
+
throw new DeveloperError('left is required');
|
|
208
|
+
}
|
|
209
|
+
if (typeof right === 'undefined') {
|
|
210
|
+
throw new DeveloperError('right is required');
|
|
211
|
+
}
|
|
212
|
+
if (typeof result === 'undefined') {
|
|
213
|
+
return new Cartesian2(left.x * right.x, left.y * right.y);
|
|
214
|
+
}
|
|
215
|
+
result.x = left.x * right.x;
|
|
216
|
+
result.y = left.y * right.y;
|
|
217
|
+
return result;
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Computes the componentwise sum of two Cartesians.
|
|
222
|
+
* @memberof Cartesian2
|
|
223
|
+
*
|
|
224
|
+
* @param {Cartesian2} left The first Cartesian.
|
|
225
|
+
* @param {Cartesian2} right The second Cartesian.
|
|
226
|
+
* @param {Cartesian2} [result] The object onto which to store the result.
|
|
227
|
+
* @return {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided.
|
|
228
|
+
*
|
|
229
|
+
* @exception {DeveloperError} left is required.
|
|
230
|
+
* @exception {DeveloperError} right is required.
|
|
231
|
+
*/
|
|
232
|
+
Cartesian2.add = function(left, right, result) {
|
|
233
|
+
if (typeof left === 'undefined') {
|
|
234
|
+
throw new DeveloperError('left is required');
|
|
235
|
+
}
|
|
236
|
+
if (typeof right === 'undefined') {
|
|
237
|
+
throw new DeveloperError('right is required');
|
|
238
|
+
}
|
|
239
|
+
if (typeof result === 'undefined') {
|
|
240
|
+
return new Cartesian2(left.x + right.x, left.y + right.y);
|
|
241
|
+
}
|
|
242
|
+
result.x = left.x + right.x;
|
|
243
|
+
result.y = left.y + right.y;
|
|
244
|
+
return result;
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* Computes the componentwise difference of two Cartesians.
|
|
249
|
+
* @memberof Cartesian2
|
|
250
|
+
*
|
|
251
|
+
* @param {Cartesian2} left The first Cartesian.
|
|
252
|
+
* @param {Cartesian2} right The second Cartesian.
|
|
253
|
+
* @param {Cartesian2} [result] The object onto which to store the result.
|
|
254
|
+
* @return {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided.
|
|
255
|
+
*
|
|
256
|
+
* @exception {DeveloperError} left is required.
|
|
257
|
+
* @exception {DeveloperError} right is required.
|
|
258
|
+
*/
|
|
259
|
+
Cartesian2.subtract = function(left, right, result) {
|
|
260
|
+
if (typeof left === 'undefined') {
|
|
261
|
+
throw new DeveloperError('left is required');
|
|
262
|
+
}
|
|
263
|
+
if (typeof right === 'undefined') {
|
|
264
|
+
throw new DeveloperError('right is required');
|
|
265
|
+
}
|
|
266
|
+
if (typeof result === 'undefined') {
|
|
267
|
+
return new Cartesian2(left.x - right.x, left.y - right.y);
|
|
268
|
+
}
|
|
269
|
+
result.x = left.x - right.x;
|
|
270
|
+
result.y = left.y - right.y;
|
|
271
|
+
return result;
|
|
272
|
+
};
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* Multiplies the provided Cartesian componentwise by the provided scalar.
|
|
276
|
+
* @memberof Cartesian2
|
|
277
|
+
*
|
|
278
|
+
* @param {Cartesian2} cartesian The Cartesian to be scaled.
|
|
279
|
+
* @param {Number} scalar The scalar to multiply with.
|
|
280
|
+
* @param {Cartesian2} [result] The object onto which to store the result.
|
|
281
|
+
* @return {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided.
|
|
282
|
+
*
|
|
283
|
+
* @exception {DeveloperError} cartesian is required.
|
|
284
|
+
* @exception {DeveloperError} scalar is required and must be a number.
|
|
285
|
+
*/
|
|
286
|
+
Cartesian2.multiplyByScalar = function(cartesian, scalar, result) {
|
|
287
|
+
if (typeof cartesian === 'undefined') {
|
|
288
|
+
throw new DeveloperError('cartesian is required');
|
|
289
|
+
}
|
|
290
|
+
if (typeof scalar !== 'number') {
|
|
291
|
+
throw new DeveloperError('scalar is required and must be a number.');
|
|
292
|
+
}
|
|
293
|
+
if (typeof result === 'undefined') {
|
|
294
|
+
return new Cartesian2(cartesian.x * scalar, cartesian.y * scalar);
|
|
295
|
+
}
|
|
296
|
+
result.x = cartesian.x * scalar;
|
|
297
|
+
result.y = cartesian.y * scalar;
|
|
298
|
+
return result;
|
|
299
|
+
};
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* Divides the provided Cartesian componentwise by the provided scalar.
|
|
303
|
+
* @memberof Cartesian2
|
|
304
|
+
*
|
|
305
|
+
* @param {Cartesian2} cartesian The Cartesian to be divided.
|
|
306
|
+
* @param {Number} scalar The scalar to divide by.
|
|
307
|
+
* @param {Cartesian2} [result] The object onto which to store the result.
|
|
308
|
+
* @return {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided.
|
|
309
|
+
*
|
|
310
|
+
* @exception {DeveloperError} cartesian is required.
|
|
311
|
+
* @exception {DeveloperError} scalar is required and must be a number.
|
|
312
|
+
*/
|
|
313
|
+
Cartesian2.divideByScalar = function(cartesian, scalar, result) {
|
|
314
|
+
if (typeof cartesian === 'undefined') {
|
|
315
|
+
throw new DeveloperError('cartesian is required');
|
|
316
|
+
}
|
|
317
|
+
if (typeof scalar !== 'number') {
|
|
318
|
+
throw new DeveloperError('scalar is required and must be a number.');
|
|
319
|
+
}
|
|
320
|
+
if (typeof result === 'undefined') {
|
|
321
|
+
return new Cartesian2(cartesian.x / scalar, cartesian.y / scalar);
|
|
322
|
+
}
|
|
323
|
+
result.x = cartesian.x / scalar;
|
|
324
|
+
result.y = cartesian.y / scalar;
|
|
325
|
+
return result;
|
|
326
|
+
};
|
|
327
|
+
|
|
328
|
+
/**
|
|
329
|
+
* Negates the provided Cartesian.
|
|
330
|
+
* @memberof Cartesian2
|
|
331
|
+
*
|
|
332
|
+
* @param {Cartesian2} cartesian The Cartesian to be negated.
|
|
333
|
+
* @param {Cartesian2} [result] The object onto which to store the result.
|
|
334
|
+
* @return {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided.
|
|
335
|
+
*
|
|
336
|
+
* @exception {DeveloperError} cartesian is required.
|
|
337
|
+
*/
|
|
338
|
+
Cartesian2.negate = function(cartesian, result) {
|
|
339
|
+
if (typeof cartesian === 'undefined') {
|
|
340
|
+
throw new DeveloperError('cartesian is required');
|
|
341
|
+
}
|
|
342
|
+
if (typeof result === 'undefined') {
|
|
343
|
+
return new Cartesian2(-cartesian.x, -cartesian.y);
|
|
344
|
+
}
|
|
345
|
+
result.x = -cartesian.x;
|
|
346
|
+
result.y = -cartesian.y;
|
|
347
|
+
return result;
|
|
348
|
+
};
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
* Computes the absolute value of the provided Cartesian.
|
|
352
|
+
* @memberof Cartesian2
|
|
353
|
+
*
|
|
354
|
+
* @param {Cartesian2} cartesian The Cartesian whose absolute value is to be computed.
|
|
355
|
+
* @param {Cartesian2} [result] The object onto which to store the result.
|
|
356
|
+
* @return {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided.
|
|
357
|
+
*
|
|
358
|
+
* @exception {DeveloperError} cartesian is required.
|
|
359
|
+
*/
|
|
360
|
+
Cartesian2.abs = function(cartesian, result) {
|
|
361
|
+
if (typeof cartesian === 'undefined') {
|
|
362
|
+
throw new DeveloperError('cartesian is required');
|
|
363
|
+
}
|
|
364
|
+
if (typeof result === 'undefined') {
|
|
365
|
+
return new Cartesian2(Math.abs(cartesian.x), Math.abs(cartesian.y));
|
|
366
|
+
}
|
|
367
|
+
result.x = Math.abs(cartesian.x);
|
|
368
|
+
result.y = Math.abs(cartesian.y);
|
|
369
|
+
return result;
|
|
370
|
+
};
|
|
371
|
+
|
|
372
|
+
var lerpScratch = new Cartesian2();
|
|
373
|
+
/**
|
|
374
|
+
* Computes the linear interpolation or extrapolation at t using the provided cartesians.
|
|
375
|
+
* @memberof Cartesian2
|
|
376
|
+
*
|
|
377
|
+
* @param start The value corresponding to t at 0.0.
|
|
378
|
+
* @param end The value corresponding to t at 1.0.
|
|
379
|
+
* @param t The point along t at which to interpolate.
|
|
380
|
+
* @param {Cartesian2} [result] The object onto which to store the result.
|
|
381
|
+
* @return {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided.
|
|
382
|
+
*
|
|
383
|
+
* @exception {DeveloperError} start is required.
|
|
384
|
+
* @exception {DeveloperError} end is required.
|
|
385
|
+
* @exception {DeveloperError} t is required and must be a number.
|
|
386
|
+
*/
|
|
387
|
+
Cartesian2.lerp = function(start, end, t, result) {
|
|
388
|
+
if (typeof start === 'undefined') {
|
|
389
|
+
throw new DeveloperError('start is required.');
|
|
390
|
+
}
|
|
391
|
+
if (typeof end === 'undefined') {
|
|
392
|
+
throw new DeveloperError('end is required.');
|
|
393
|
+
}
|
|
394
|
+
if (typeof t !== 'number') {
|
|
395
|
+
throw new DeveloperError('t is required and must be a number.');
|
|
396
|
+
}
|
|
397
|
+
Cartesian2.multiplyByScalar(end, t, lerpScratch);
|
|
398
|
+
result = Cartesian2.multiplyByScalar(start, 1.0 - t, result);
|
|
399
|
+
return Cartesian2.add(lerpScratch, result, result);
|
|
400
|
+
};
|
|
401
|
+
|
|
402
|
+
var angleBetweenScratch = new Cartesian2();
|
|
403
|
+
var angleBetweenScratch2 = new Cartesian2();
|
|
404
|
+
/**
|
|
405
|
+
* Returns the angle, in radians, between the provided Cartesians.
|
|
406
|
+
* @memberof Cartesian2
|
|
407
|
+
*
|
|
408
|
+
* @param {Cartesian2} left The first Cartesian.
|
|
409
|
+
* @param {Cartesian2} right The second Cartesian.
|
|
410
|
+
* @return {Number} The angle between the Cartesians.
|
|
411
|
+
*
|
|
412
|
+
* @exception {DeveloperError} left is required.
|
|
413
|
+
* @exception {DeveloperError} right is required.
|
|
414
|
+
*/
|
|
415
|
+
Cartesian2.angleBetween = function(left, right) {
|
|
416
|
+
if (typeof left === 'undefined') {
|
|
417
|
+
throw new DeveloperError('left is required');
|
|
418
|
+
}
|
|
419
|
+
if (typeof right === 'undefined') {
|
|
420
|
+
throw new DeveloperError('right is required');
|
|
421
|
+
}
|
|
422
|
+
Cartesian2.normalize(left, angleBetweenScratch);
|
|
423
|
+
Cartesian2.normalize(right, angleBetweenScratch2);
|
|
424
|
+
return Math.acos(Cartesian2.dot(angleBetweenScratch, angleBetweenScratch2));
|
|
425
|
+
};
|
|
426
|
+
|
|
427
|
+
var mostOrthogonalAxisScratch = new Cartesian2();
|
|
428
|
+
/**
|
|
429
|
+
* Returns the axis that is most orthogonal to the provided Cartesian.
|
|
430
|
+
* @memberof Cartesian2
|
|
431
|
+
*
|
|
432
|
+
* @param {Cartesian2} cartesian The Cartesian on which to find the most orthogonal axis.
|
|
433
|
+
* @param {Cartesian2} [result] The object onto which to store the result.
|
|
434
|
+
* @return {Cartesian2} The most orthogonal axis.
|
|
435
|
+
*
|
|
436
|
+
* @exception {DeveloperError} cartesian is required.
|
|
437
|
+
*/
|
|
438
|
+
Cartesian2.mostOrthogonalAxis = function(cartesian, result) {
|
|
439
|
+
if (typeof cartesian === 'undefined') {
|
|
440
|
+
throw new DeveloperError('cartesian is required.');
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
var f = Cartesian2.normalize(cartesian, mostOrthogonalAxisScratch);
|
|
444
|
+
Cartesian2.abs(f, f);
|
|
445
|
+
|
|
446
|
+
if (f.x <= f.y) {
|
|
447
|
+
result = Cartesian2.clone(Cartesian2.UNIT_X, result);
|
|
448
|
+
} else {
|
|
449
|
+
result = Cartesian2.clone(Cartesian2.UNIT_Y, result);
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
return result;
|
|
453
|
+
};
|
|
454
|
+
|
|
455
|
+
/**
|
|
456
|
+
* Compares the provided Cartesians componentwise and returns
|
|
457
|
+
* <code>true</code> if they are equal, <code>false</code> otherwise.
|
|
458
|
+
* @memberof Cartesian2
|
|
459
|
+
*
|
|
460
|
+
* @param {Cartesian2} [left] The first Cartesian.
|
|
461
|
+
* @param {Cartesian2} [right] The second Cartesian.
|
|
462
|
+
* @return {Boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.
|
|
463
|
+
*/
|
|
464
|
+
Cartesian2.equals = function(left, right) {
|
|
465
|
+
return (left === right) ||
|
|
466
|
+
((typeof left !== 'undefined') &&
|
|
467
|
+
(typeof right !== 'undefined') &&
|
|
468
|
+
(left.x === right.x) &&
|
|
469
|
+
(left.y === right.y));
|
|
470
|
+
};
|
|
471
|
+
|
|
472
|
+
/**
|
|
473
|
+
* Compares the provided Cartesians componentwise and returns
|
|
474
|
+
* <code>true</code> if they are within the provided epsilon,
|
|
475
|
+
* <code>false</code> otherwise.
|
|
476
|
+
* @memberof Cartesian2
|
|
477
|
+
*
|
|
478
|
+
* @param {Cartesian2} [left] The first Cartesian.
|
|
479
|
+
* @param {Cartesian2} [right] The second Cartesian.
|
|
480
|
+
* @param {Number} epsilon The epsilon to use for equality testing.
|
|
481
|
+
* @return {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
|
|
482
|
+
*
|
|
483
|
+
* @exception {DeveloperError} epsilon is required and must be a number.
|
|
484
|
+
*/
|
|
485
|
+
Cartesian2.equalsEpsilon = function(left, right, epsilon) {
|
|
486
|
+
if (typeof epsilon !== 'number') {
|
|
487
|
+
throw new DeveloperError('epsilon is required and must be a number.');
|
|
488
|
+
}
|
|
489
|
+
return (left === right) ||
|
|
490
|
+
((typeof left !== 'undefined') &&
|
|
491
|
+
(typeof right !== 'undefined') &&
|
|
492
|
+
(Math.abs(left.x - right.x) <= epsilon) &&
|
|
493
|
+
(Math.abs(left.y - right.y) <= epsilon));
|
|
494
|
+
};
|
|
495
|
+
|
|
496
|
+
/**
|
|
497
|
+
* An immutable Cartesian2 instance initialized to (0.0, 0.0).
|
|
498
|
+
* @memberof Cartesian2
|
|
499
|
+
*/
|
|
500
|
+
Cartesian2.ZERO = freezeObject(new Cartesian2(0.0, 0.0));
|
|
501
|
+
|
|
502
|
+
/**
|
|
503
|
+
* An immutable Cartesian2 instance initialized to (1.0, 0.0).
|
|
504
|
+
* @memberof Cartesian2
|
|
505
|
+
*/
|
|
506
|
+
Cartesian2.UNIT_X = freezeObject(new Cartesian2(1.0, 0.0));
|
|
507
|
+
|
|
508
|
+
/**
|
|
509
|
+
* An immutable Cartesian2 instance initialized to (0.0, 1.0).
|
|
510
|
+
* @memberof Cartesian2
|
|
511
|
+
*/
|
|
512
|
+
Cartesian2.UNIT_Y = freezeObject(new Cartesian2(0.0, 1.0));
|
|
513
|
+
|
|
514
|
+
/**
|
|
515
|
+
* Computes the value of the maximum component for this Cartesian.
|
|
516
|
+
* @memberof Cartesian2
|
|
517
|
+
*
|
|
518
|
+
* @return {Number} The value of the maximum component.
|
|
519
|
+
*/
|
|
520
|
+
Cartesian2.prototype.getMaximumComponent = function() {
|
|
521
|
+
return Cartesian2.getMaximumComponent(this);
|
|
522
|
+
};
|
|
523
|
+
|
|
524
|
+
/**
|
|
525
|
+
* Computes the value of the minimum component for this Cartesian.
|
|
526
|
+
* @memberof Cartesian2
|
|
527
|
+
*
|
|
528
|
+
* @return {Number} The value of the minimum component.
|
|
529
|
+
*/
|
|
530
|
+
Cartesian2.prototype.getMinimumComponent = function() {
|
|
531
|
+
return Cartesian2.getMinimumComponent(this);
|
|
532
|
+
};
|
|
533
|
+
|
|
534
|
+
/**
|
|
535
|
+
* Duplicates this Cartesian2 instance.
|
|
536
|
+
* @memberof Cartesian2
|
|
537
|
+
*
|
|
538
|
+
* @param {Cartesian2} [result] The object onto which to store the result.
|
|
539
|
+
* @return {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided.
|
|
540
|
+
*/
|
|
541
|
+
Cartesian2.prototype.clone = function(result) {
|
|
542
|
+
return Cartesian2.clone(this, result);
|
|
543
|
+
};
|
|
544
|
+
|
|
545
|
+
/**
|
|
546
|
+
* Computes this Cartesian's squared magnitude.
|
|
547
|
+
* @memberof Cartesian2
|
|
548
|
+
*
|
|
549
|
+
* @return {Number} The squared magnitude.
|
|
550
|
+
*/
|
|
551
|
+
Cartesian2.prototype.magnitudeSquared = function() {
|
|
552
|
+
return Cartesian2.magnitudeSquared(this);
|
|
553
|
+
};
|
|
554
|
+
|
|
555
|
+
/**
|
|
556
|
+
* Computes this Cartesian's magnitude (length).
|
|
557
|
+
* @memberof Cartesian2
|
|
558
|
+
*
|
|
559
|
+
* @return {Number} The magnitude.
|
|
560
|
+
*/
|
|
561
|
+
Cartesian2.prototype.magnitude = function() {
|
|
562
|
+
return Cartesian2.magnitude(this);
|
|
563
|
+
};
|
|
564
|
+
|
|
565
|
+
/**
|
|
566
|
+
* Computes the normalized form of this Cartesian.
|
|
567
|
+
* @memberof Cartesian2
|
|
568
|
+
*
|
|
569
|
+
* @param {Cartesian2} [result] The object onto which to store the result.
|
|
570
|
+
* @return {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided.
|
|
571
|
+
*/
|
|
572
|
+
Cartesian2.prototype.normalize = function(result) {
|
|
573
|
+
return Cartesian2.normalize(this, result);
|
|
574
|
+
};
|
|
575
|
+
|
|
576
|
+
/**
|
|
577
|
+
* Computes the dot (scalar) product of this Cartesian and a supplied cartesian.
|
|
578
|
+
* @memberof Cartesian2
|
|
579
|
+
*
|
|
580
|
+
* @param {Cartesian2} right The right hand side Cartesian.
|
|
581
|
+
* @return {Number} The dot product.
|
|
582
|
+
*
|
|
583
|
+
* @exception {DeveloperError} right is required.
|
|
584
|
+
*/
|
|
585
|
+
Cartesian2.prototype.dot = function(right) {
|
|
586
|
+
return Cartesian2.dot(this, right);
|
|
587
|
+
};
|
|
588
|
+
|
|
589
|
+
/**
|
|
590
|
+
* Computes the componentwise product of this Cartesian and the provided Cartesian.
|
|
591
|
+
* @memberof Cartesian2
|
|
592
|
+
*
|
|
593
|
+
* @param {Cartesian2} right The right hand side Cartesian.
|
|
594
|
+
* @param {Cartesian2} [result] The object onto which to store the result.
|
|
595
|
+
* @return {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided.
|
|
596
|
+
*
|
|
597
|
+
* @exception {DeveloperError} right is required.
|
|
598
|
+
*/
|
|
599
|
+
Cartesian2.prototype.multiplyComponents = function(right, result) {
|
|
600
|
+
return Cartesian2.multiplyComponents(this, right, result);
|
|
601
|
+
};
|
|
602
|
+
|
|
603
|
+
/**
|
|
604
|
+
* Computes the componentwise sum of this Cartesian and the provided Cartesian.
|
|
605
|
+
* @memberof Cartesian2
|
|
606
|
+
*
|
|
607
|
+
* @param {Cartesian2} right The right hand side Cartesian.
|
|
608
|
+
* @param {Cartesian2} [result] The object onto which to store the result.
|
|
609
|
+
* @return {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided.
|
|
610
|
+
*
|
|
611
|
+
* @exception {DeveloperError} right is required.
|
|
612
|
+
*/
|
|
613
|
+
Cartesian2.prototype.add = function(right, result) {
|
|
614
|
+
return Cartesian2.add(this, right, result);
|
|
615
|
+
};
|
|
616
|
+
|
|
617
|
+
/**
|
|
618
|
+
* Computes the componentwise difference of this Cartesian and the provided Cartesian.
|
|
619
|
+
* @memberof Cartesian2
|
|
620
|
+
*
|
|
621
|
+
* @param {Cartesian2} right The right hand side Cartesian.
|
|
622
|
+
* @param {Cartesian2} [result] The object onto which to store the result.
|
|
623
|
+
* @return {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided.
|
|
624
|
+
*
|
|
625
|
+
* @exception {DeveloperError} right is required.
|
|
626
|
+
*/
|
|
627
|
+
Cartesian2.prototype.subtract = function(right, result) {
|
|
628
|
+
return Cartesian2.subtract(this, right, result);
|
|
629
|
+
};
|
|
630
|
+
|
|
631
|
+
/**
|
|
632
|
+
* Multiplies this Cartesian componentwise by the provided scalar.
|
|
633
|
+
* @memberof Cartesian2
|
|
634
|
+
*
|
|
635
|
+
* @param {Number} scalar The scalar to multiply with.
|
|
636
|
+
* @param {Cartesian2} [result] The object onto which to store the result.
|
|
637
|
+
* @return {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided.
|
|
638
|
+
*
|
|
639
|
+
* @exception {DeveloperError} scalar is required and must be a number.
|
|
640
|
+
*/
|
|
641
|
+
Cartesian2.prototype.multiplyByScalar = function(scalar, result) {
|
|
642
|
+
return Cartesian2.multiplyByScalar(this, scalar, result);
|
|
643
|
+
};
|
|
644
|
+
|
|
645
|
+
/**
|
|
646
|
+
* Divides this Cartesian componentwise by the provided scalar.
|
|
647
|
+
* @memberof Cartesian2
|
|
648
|
+
*
|
|
649
|
+
* @param {Number} scalar The scalar to divide by.
|
|
650
|
+
* @param {Cartesian2} [result] The object onto which to store the result.
|
|
651
|
+
* @return {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided.
|
|
652
|
+
*
|
|
653
|
+
* @exception {DeveloperError} scalar is required and must be a number.
|
|
654
|
+
*/
|
|
655
|
+
Cartesian2.prototype.divideByScalar = function(scalar, result) {
|
|
656
|
+
return Cartesian2.divideByScalar(this, scalar, result);
|
|
657
|
+
};
|
|
658
|
+
|
|
659
|
+
/**
|
|
660
|
+
* Negates this Cartesian.
|
|
661
|
+
* @memberof Cartesian2
|
|
662
|
+
*
|
|
663
|
+
* @param {Cartesian2} [result] The object onto which to store the result.
|
|
664
|
+
* @return {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided.
|
|
665
|
+
*/
|
|
666
|
+
Cartesian2.prototype.negate = function(result) {
|
|
667
|
+
return Cartesian2.negate(this, result);
|
|
668
|
+
};
|
|
669
|
+
|
|
670
|
+
/**
|
|
671
|
+
* Computes the absolute value of this Cartesian.
|
|
672
|
+
* @memberof Cartesian2
|
|
673
|
+
*
|
|
674
|
+
* @param {Cartesian2} [result] The object onto which to store the result.
|
|
675
|
+
* @return {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided.
|
|
676
|
+
*/
|
|
677
|
+
Cartesian2.prototype.abs = function(result) {
|
|
678
|
+
return Cartesian2.abs(this, result);
|
|
679
|
+
};
|
|
680
|
+
|
|
681
|
+
/**
|
|
682
|
+
* Computes the linear interpolation or extrapolation at t using this Cartesian
|
|
683
|
+
* and the provided cartesian. This cartesian is assumed to be t at 0.0.
|
|
684
|
+
* @memberof Cartesian2
|
|
685
|
+
*
|
|
686
|
+
* @param end The value corresponding to t at 1.0.
|
|
687
|
+
* @param t The point along t at which to interpolate.
|
|
688
|
+
* @param {Cartesian2} [result] The object onto which to store the result.
|
|
689
|
+
* @return {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided.
|
|
690
|
+
*
|
|
691
|
+
* @exception {DeveloperError} end is required.
|
|
692
|
+
* @exception {DeveloperError} t is required and must be a number.
|
|
693
|
+
*/
|
|
694
|
+
Cartesian2.prototype.lerp = function(end, t, result) {
|
|
695
|
+
return Cartesian2.lerp(this, end, t, result);
|
|
696
|
+
};
|
|
697
|
+
|
|
698
|
+
/**
|
|
699
|
+
* Returns the angle, in radians, between this Cartesian and the provided Cartesian.
|
|
700
|
+
* @memberof Cartesian2
|
|
701
|
+
*
|
|
702
|
+
* @param {Cartesian2} right The right hand side Cartesian.
|
|
703
|
+
* @return {Number} The angle between the Cartesians.
|
|
704
|
+
*
|
|
705
|
+
* @exception {DeveloperError} left is required.
|
|
706
|
+
* @exception {DeveloperError} right is required.
|
|
707
|
+
*/
|
|
708
|
+
Cartesian2.prototype.angleBetween = function(right) {
|
|
709
|
+
return Cartesian2.angleBetween(this, right);
|
|
710
|
+
};
|
|
711
|
+
|
|
712
|
+
/**
|
|
713
|
+
* Returns the axis that is most orthogonal to the this Cartesian.
|
|
714
|
+
* @memberof Cartesian2
|
|
715
|
+
*
|
|
716
|
+
* @param {Cartesian2} [result] The object onto which to store the result.
|
|
717
|
+
* @return {Cartesian2} The most orthogonal axis.
|
|
718
|
+
*/
|
|
719
|
+
Cartesian2.prototype.mostOrthogonalAxis = function(result) {
|
|
720
|
+
return Cartesian2.mostOrthogonalAxis(this, result);
|
|
721
|
+
};
|
|
722
|
+
|
|
723
|
+
/**
|
|
724
|
+
* Compares this Cartesian against the provided Cartesian componentwise and returns
|
|
725
|
+
* <code>true</code> if they are equal, <code>false</code> otherwise.
|
|
726
|
+
* @memberof Cartesian2
|
|
727
|
+
*
|
|
728
|
+
* @param {Cartesian2} [right] The right hand side Cartesian.
|
|
729
|
+
* @return {Boolean} <code>true</code> if they are equal, <code>false</code> otherwise.
|
|
730
|
+
*/
|
|
731
|
+
Cartesian2.prototype.equals = function(right) {
|
|
732
|
+
return Cartesian2.equals(this, right);
|
|
733
|
+
};
|
|
734
|
+
|
|
735
|
+
/**
|
|
736
|
+
* Compares this Cartesian against the provided Cartesian componentwise and returns
|
|
737
|
+
* <code>true</code> if they are within the provided epsilon,
|
|
738
|
+
* <code>false</code> otherwise.
|
|
739
|
+
* @memberof Cartesian2
|
|
740
|
+
*
|
|
741
|
+
* @param {Cartesian2} [right] The right hand side Cartesian.
|
|
742
|
+
* @param {Number} epsilon The epsilon to use for equality testing.
|
|
743
|
+
* @return {Boolean} <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise.
|
|
744
|
+
*
|
|
745
|
+
* @exception {DeveloperError} epsilon is required and must be a number.
|
|
746
|
+
*/
|
|
747
|
+
Cartesian2.prototype.equalsEpsilon = function(right, epsilon) {
|
|
748
|
+
return Cartesian2.equalsEpsilon(this, right, epsilon);
|
|
749
|
+
};
|
|
750
|
+
|
|
751
|
+
/**
|
|
752
|
+
* Creates a string representing this Cartesian in the format '(x, y)'.
|
|
753
|
+
* @memberof Cartesian2
|
|
754
|
+
*
|
|
755
|
+
* @return {String} A string representing the provided Cartesian in the format '(x, y)'.
|
|
756
|
+
*/
|
|
757
|
+
Cartesian2.prototype.toString = function() {
|
|
758
|
+
return '(' + this.x + ', ' + this.y + ')';
|
|
759
|
+
};
|
|
760
|
+
|
|
761
|
+
return Cartesian2;
|
|
762
|
+
});
|