@itwin/core-common 3.0.0-extension.1 → 3.1.0-dev.6
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/CHANGELOG.md +84 -1
- package/LICENSE.md +1 -1
- package/lib/cjs/BackgroundMapSettings.d.ts +1 -1
- package/lib/cjs/BackgroundMapSettings.d.ts.map +1 -1
- package/lib/cjs/BackgroundMapSettings.js.map +1 -1
- package/lib/cjs/ConcurrentQuery.d.ts +28 -11
- package/lib/cjs/ConcurrentQuery.d.ts.map +1 -1
- package/lib/cjs/ConcurrentQuery.js +26 -12
- package/lib/cjs/ConcurrentQuery.js.map +1 -1
- package/lib/cjs/ContextRealityModel.d.ts +36 -16
- package/lib/cjs/ContextRealityModel.d.ts.map +1 -1
- package/lib/cjs/ContextRealityModel.js +46 -7
- package/lib/cjs/ContextRealityModel.js.map +1 -1
- package/lib/cjs/DisplayStyleSettings.d.ts +30 -24
- package/lib/cjs/DisplayStyleSettings.d.ts.map +1 -1
- package/lib/cjs/DisplayStyleSettings.js +43 -16
- package/lib/cjs/DisplayStyleSettings.js.map +1 -1
- package/lib/cjs/ECSqlReader.d.ts +17 -5
- package/lib/cjs/ECSqlReader.d.ts.map +1 -1
- package/lib/cjs/ECSqlReader.js +55 -22
- package/lib/cjs/ECSqlReader.js.map +1 -1
- package/lib/cjs/ECSqlTypes.d.ts +3 -3
- package/lib/cjs/ECSqlTypes.js +3 -3
- package/lib/cjs/ECSqlTypes.js.map +1 -1
- package/lib/cjs/ElementProps.d.ts +9 -0
- package/lib/cjs/ElementProps.d.ts.map +1 -1
- package/lib/cjs/ElementProps.js.map +1 -1
- package/lib/cjs/EntityProps.d.ts +8 -1
- package/lib/cjs/EntityProps.d.ts.map +1 -1
- package/lib/cjs/EntityProps.js.map +1 -1
- package/lib/cjs/Environment.d.ts +61 -0
- package/lib/cjs/Environment.d.ts.map +1 -0
- package/lib/cjs/Environment.js +74 -0
- package/lib/cjs/Environment.js.map +1 -0
- package/lib/cjs/FeatureSymbology.d.ts +97 -18
- package/lib/cjs/FeatureSymbology.d.ts.map +1 -1
- package/lib/cjs/FeatureSymbology.js +83 -27
- package/lib/cjs/FeatureSymbology.js.map +1 -1
- package/lib/cjs/GeoCoordinateServices.d.ts +66 -1
- package/lib/cjs/GeoCoordinateServices.d.ts.map +1 -1
- package/lib/cjs/GeoCoordinateServices.js +39 -1
- package/lib/cjs/GeoCoordinateServices.js.map +1 -1
- package/lib/cjs/Gradient.d.ts.map +1 -1
- package/lib/cjs/Gradient.js +10 -0
- package/lib/cjs/Gradient.js.map +1 -1
- package/lib/cjs/GroundPlane.d.ts +26 -15
- package/lib/cjs/GroundPlane.d.ts.map +1 -1
- package/lib/cjs/GroundPlane.js +40 -39
- package/lib/cjs/GroundPlane.js.map +1 -1
- package/lib/cjs/IModel.d.ts +33 -4
- package/lib/cjs/IModel.d.ts.map +1 -1
- package/lib/cjs/IModel.js +27 -10
- package/lib/cjs/IModel.js.map +1 -1
- package/lib/cjs/Localization.d.ts +1 -1
- package/lib/cjs/Localization.js.map +1 -1
- package/lib/cjs/MapLayerSettings.d.ts +2 -2
- package/lib/cjs/MapLayerSettings.js +2 -2
- package/lib/cjs/MapLayerSettings.js.map +1 -1
- package/lib/cjs/NativeAppProps.d.ts +2 -36
- package/lib/cjs/NativeAppProps.d.ts.map +1 -1
- package/lib/cjs/NativeAppProps.js.map +1 -1
- package/lib/cjs/PlanarClipMask.d.ts +73 -8
- package/lib/cjs/PlanarClipMask.d.ts.map +1 -1
- package/lib/cjs/PlanarClipMask.js +17 -24
- package/lib/cjs/PlanarClipMask.js.map +1 -1
- package/lib/cjs/RealityDataAccessProps.d.ts +42 -0
- package/lib/cjs/RealityDataAccessProps.d.ts.map +1 -0
- package/lib/cjs/RealityDataAccessProps.js +20 -0
- package/lib/cjs/RealityDataAccessProps.js.map +1 -0
- package/lib/cjs/RenderMaterial.d.ts +7 -7
- package/lib/cjs/RenderMaterial.d.ts.map +1 -1
- package/lib/cjs/RenderMaterial.js +10 -5
- package/lib/cjs/RenderMaterial.js.map +1 -1
- package/lib/cjs/RenderSchedule.d.ts +4 -0
- package/lib/cjs/RenderSchedule.d.ts.map +1 -1
- package/lib/cjs/RenderSchedule.js +5 -1
- package/lib/cjs/RenderSchedule.js.map +1 -1
- package/lib/cjs/RenderTexture.d.ts +8 -1
- package/lib/cjs/RenderTexture.d.ts.map +1 -1
- package/lib/cjs/RenderTexture.js.map +1 -1
- package/lib/cjs/SkyBox.d.ts +142 -34
- package/lib/cjs/SkyBox.d.ts.map +1 -1
- package/lib/cjs/SkyBox.js +192 -6
- package/lib/cjs/SkyBox.js.map +1 -1
- package/lib/cjs/TextureMapping.d.ts +3 -1
- package/lib/cjs/TextureMapping.d.ts.map +1 -1
- package/lib/cjs/TextureMapping.js +9 -6
- package/lib/cjs/TextureMapping.js.map +1 -1
- package/lib/cjs/TextureProps.d.ts +21 -2
- package/lib/cjs/TextureProps.d.ts.map +1 -1
- package/lib/cjs/TextureProps.js +19 -0
- package/lib/cjs/TextureProps.js.map +1 -1
- package/lib/cjs/ThematicDisplay.d.ts +6 -0
- package/lib/cjs/ThematicDisplay.d.ts.map +1 -1
- package/lib/cjs/ThematicDisplay.js +26 -0
- package/lib/cjs/ThematicDisplay.js.map +1 -1
- package/lib/cjs/TileProps.d.ts +6 -0
- package/lib/cjs/TileProps.d.ts.map +1 -1
- package/lib/cjs/TileProps.js.map +1 -1
- package/lib/cjs/ViewFlags.d.ts +8 -0
- package/lib/cjs/ViewFlags.d.ts.map +1 -1
- package/lib/cjs/ViewFlags.js +30 -10
- package/lib/cjs/ViewFlags.js.map +1 -1
- package/lib/cjs/core-common.d.ts +7 -0
- package/lib/cjs/core-common.d.ts.map +1 -1
- package/lib/cjs/core-common.js +7 -0
- package/lib/cjs/core-common.js.map +1 -1
- package/lib/cjs/geometry/ElementGeometry.d.ts +12 -8
- package/lib/cjs/geometry/ElementGeometry.d.ts.map +1 -1
- package/lib/cjs/geometry/ElementGeometry.js.map +1 -1
- package/lib/cjs/geometry/FrustumPlanes.d.ts +1 -1
- package/lib/cjs/geometry/FrustumPlanes.d.ts.map +1 -1
- package/lib/cjs/geometry/FrustumPlanes.js +26 -13
- package/lib/cjs/geometry/FrustumPlanes.js.map +1 -1
- package/lib/cjs/geometry/GeometryStream.d.ts +3 -3
- package/lib/cjs/geometry/GeometryStream.d.ts.map +1 -1
- package/lib/cjs/geometry/GeometryStream.js.map +1 -1
- package/lib/cjs/ipc/IpcWebSocket.d.ts +12 -5
- package/lib/cjs/ipc/IpcWebSocket.d.ts.map +1 -1
- package/lib/cjs/ipc/IpcWebSocket.js +32 -8
- package/lib/cjs/ipc/IpcWebSocket.js.map +1 -1
- package/lib/cjs/ipc/IpcWebSocketTransport.d.ts +15 -0
- package/lib/cjs/ipc/IpcWebSocketTransport.d.ts.map +1 -0
- package/lib/cjs/ipc/IpcWebSocketTransport.js +142 -0
- package/lib/cjs/ipc/IpcWebSocketTransport.js.map +1 -0
- package/lib/cjs/rpc/core/RpcInvocation.d.ts +4 -4
- package/lib/cjs/rpc/core/RpcInvocation.d.ts.map +1 -1
- package/lib/cjs/rpc/core/RpcInvocation.js +3 -1
- package/lib/cjs/rpc/core/RpcInvocation.js.map +1 -1
- package/lib/cjs/rpc/web/BentleyCloudRpcProtocol.d.ts.map +1 -1
- package/lib/cjs/rpc/web/BentleyCloudRpcProtocol.js +3 -2
- package/lib/cjs/rpc/web/BentleyCloudRpcProtocol.js.map +1 -1
- package/lib/cjs/tile/ElementGraphics.d.ts +5 -1
- package/lib/cjs/tile/ElementGraphics.d.ts.map +1 -1
- package/lib/cjs/tile/ElementGraphics.js.map +1 -1
- package/lib/cjs/tile/GltfTileIO.d.ts +16 -79
- package/lib/cjs/tile/GltfTileIO.d.ts.map +1 -1
- package/lib/cjs/tile/GltfTileIO.js +72 -153
- package/lib/cjs/tile/GltfTileIO.js.map +1 -1
- package/lib/cjs/tile/TileMetadata.d.ts +20 -8
- package/lib/cjs/tile/TileMetadata.d.ts.map +1 -1
- package/lib/cjs/tile/TileMetadata.js +50 -53
- package/lib/cjs/tile/TileMetadata.js.map +1 -1
- package/lib/esm/BackgroundMapSettings.d.ts +1 -1
- package/lib/esm/BackgroundMapSettings.d.ts.map +1 -1
- package/lib/esm/BackgroundMapSettings.js.map +1 -1
- package/lib/esm/ConcurrentQuery.d.ts +28 -11
- package/lib/esm/ConcurrentQuery.d.ts.map +1 -1
- package/lib/esm/ConcurrentQuery.js +26 -12
- package/lib/esm/ConcurrentQuery.js.map +1 -1
- package/lib/esm/ContextRealityModel.d.ts +36 -16
- package/lib/esm/ContextRealityModel.d.ts.map +1 -1
- package/lib/esm/ContextRealityModel.js +45 -6
- package/lib/esm/ContextRealityModel.js.map +1 -1
- package/lib/esm/DisplayStyleSettings.d.ts +30 -24
- package/lib/esm/DisplayStyleSettings.d.ts.map +1 -1
- package/lib/esm/DisplayStyleSettings.js +43 -16
- package/lib/esm/DisplayStyleSettings.js.map +1 -1
- package/lib/esm/ECSqlReader.d.ts +17 -5
- package/lib/esm/ECSqlReader.d.ts.map +1 -1
- package/lib/esm/ECSqlReader.js +56 -23
- package/lib/esm/ECSqlReader.js.map +1 -1
- package/lib/esm/ECSqlTypes.d.ts +3 -3
- package/lib/esm/ECSqlTypes.js +3 -3
- package/lib/esm/ECSqlTypes.js.map +1 -1
- package/lib/esm/ElementProps.d.ts +9 -0
- package/lib/esm/ElementProps.d.ts.map +1 -1
- package/lib/esm/ElementProps.js.map +1 -1
- package/lib/esm/EntityProps.d.ts +8 -1
- package/lib/esm/EntityProps.d.ts.map +1 -1
- package/lib/esm/EntityProps.js.map +1 -1
- package/lib/esm/Environment.d.ts +61 -0
- package/lib/esm/Environment.d.ts.map +1 -0
- package/lib/esm/Environment.js +70 -0
- package/lib/esm/Environment.js.map +1 -0
- package/lib/esm/FeatureSymbology.d.ts +97 -18
- package/lib/esm/FeatureSymbology.d.ts.map +1 -1
- package/lib/esm/FeatureSymbology.js +84 -28
- package/lib/esm/FeatureSymbology.js.map +1 -1
- package/lib/esm/GeoCoordinateServices.d.ts +66 -1
- package/lib/esm/GeoCoordinateServices.d.ts.map +1 -1
- package/lib/esm/GeoCoordinateServices.js +39 -1
- package/lib/esm/GeoCoordinateServices.js.map +1 -1
- package/lib/esm/Gradient.d.ts.map +1 -1
- package/lib/esm/Gradient.js +10 -0
- package/lib/esm/Gradient.js.map +1 -1
- package/lib/esm/GroundPlane.d.ts +26 -15
- package/lib/esm/GroundPlane.d.ts.map +1 -1
- package/lib/esm/GroundPlane.js +40 -39
- package/lib/esm/GroundPlane.js.map +1 -1
- package/lib/esm/IModel.d.ts +33 -4
- package/lib/esm/IModel.d.ts.map +1 -1
- package/lib/esm/IModel.js +27 -10
- package/lib/esm/IModel.js.map +1 -1
- package/lib/esm/Localization.d.ts +1 -1
- package/lib/esm/Localization.js.map +1 -1
- package/lib/esm/MapLayerSettings.d.ts +2 -2
- package/lib/esm/MapLayerSettings.js +2 -2
- package/lib/esm/MapLayerSettings.js.map +1 -1
- package/lib/esm/NativeAppProps.d.ts +2 -36
- package/lib/esm/NativeAppProps.d.ts.map +1 -1
- package/lib/esm/NativeAppProps.js.map +1 -1
- package/lib/esm/PlanarClipMask.d.ts +73 -8
- package/lib/esm/PlanarClipMask.d.ts.map +1 -1
- package/lib/esm/PlanarClipMask.js +17 -24
- package/lib/esm/PlanarClipMask.js.map +1 -1
- package/lib/esm/RealityDataAccessProps.d.ts +42 -0
- package/lib/esm/RealityDataAccessProps.d.ts.map +1 -0
- package/lib/esm/RealityDataAccessProps.js +17 -0
- package/lib/esm/RealityDataAccessProps.js.map +1 -0
- package/lib/esm/RenderMaterial.d.ts +7 -7
- package/lib/esm/RenderMaterial.d.ts.map +1 -1
- package/lib/esm/RenderMaterial.js +10 -5
- package/lib/esm/RenderMaterial.js.map +1 -1
- package/lib/esm/RenderSchedule.d.ts +4 -0
- package/lib/esm/RenderSchedule.d.ts.map +1 -1
- package/lib/esm/RenderSchedule.js +5 -1
- package/lib/esm/RenderSchedule.js.map +1 -1
- package/lib/esm/RenderTexture.d.ts +8 -1
- package/lib/esm/RenderTexture.d.ts.map +1 -1
- package/lib/esm/RenderTexture.js.map +1 -1
- package/lib/esm/SkyBox.d.ts +142 -34
- package/lib/esm/SkyBox.d.ts.map +1 -1
- package/lib/esm/SkyBox.js +187 -5
- package/lib/esm/SkyBox.js.map +1 -1
- package/lib/esm/TextureMapping.d.ts +3 -1
- package/lib/esm/TextureMapping.d.ts.map +1 -1
- package/lib/esm/TextureMapping.js +9 -6
- package/lib/esm/TextureMapping.js.map +1 -1
- package/lib/esm/TextureProps.d.ts +21 -2
- package/lib/esm/TextureProps.d.ts.map +1 -1
- package/lib/esm/TextureProps.js +18 -1
- package/lib/esm/TextureProps.js.map +1 -1
- package/lib/esm/ThematicDisplay.d.ts +6 -0
- package/lib/esm/ThematicDisplay.d.ts.map +1 -1
- package/lib/esm/ThematicDisplay.js +26 -0
- package/lib/esm/ThematicDisplay.js.map +1 -1
- package/lib/esm/TileProps.d.ts +6 -0
- package/lib/esm/TileProps.d.ts.map +1 -1
- package/lib/esm/TileProps.js.map +1 -1
- package/lib/esm/ViewFlags.d.ts +8 -0
- package/lib/esm/ViewFlags.d.ts.map +1 -1
- package/lib/esm/ViewFlags.js +30 -10
- package/lib/esm/ViewFlags.js.map +1 -1
- package/lib/esm/core-common.d.ts +7 -0
- package/lib/esm/core-common.d.ts.map +1 -1
- package/lib/esm/core-common.js +7 -0
- package/lib/esm/core-common.js.map +1 -1
- package/lib/esm/geometry/ElementGeometry.d.ts +12 -8
- package/lib/esm/geometry/ElementGeometry.d.ts.map +1 -1
- package/lib/esm/geometry/ElementGeometry.js.map +1 -1
- package/lib/esm/geometry/FrustumPlanes.d.ts +1 -1
- package/lib/esm/geometry/FrustumPlanes.d.ts.map +1 -1
- package/lib/esm/geometry/FrustumPlanes.js +26 -13
- package/lib/esm/geometry/FrustumPlanes.js.map +1 -1
- package/lib/esm/geometry/GeometryStream.d.ts +3 -3
- package/lib/esm/geometry/GeometryStream.d.ts.map +1 -1
- package/lib/esm/geometry/GeometryStream.js.map +1 -1
- package/lib/esm/ipc/IpcWebSocket.d.ts +12 -5
- package/lib/esm/ipc/IpcWebSocket.d.ts.map +1 -1
- package/lib/esm/ipc/IpcWebSocket.js +31 -6
- package/lib/esm/ipc/IpcWebSocket.js.map +1 -1
- package/lib/esm/ipc/IpcWebSocketTransport.d.ts +15 -0
- package/lib/esm/ipc/IpcWebSocketTransport.d.ts.map +1 -0
- package/lib/esm/ipc/IpcWebSocketTransport.js +138 -0
- package/lib/esm/ipc/IpcWebSocketTransport.js.map +1 -0
- package/lib/esm/rpc/core/RpcInvocation.d.ts +4 -4
- package/lib/esm/rpc/core/RpcInvocation.d.ts.map +1 -1
- package/lib/esm/rpc/core/RpcInvocation.js +3 -1
- package/lib/esm/rpc/core/RpcInvocation.js.map +1 -1
- package/lib/esm/rpc/web/BentleyCloudRpcProtocol.d.ts.map +1 -1
- package/lib/esm/rpc/web/BentleyCloudRpcProtocol.js +2 -1
- package/lib/esm/rpc/web/BentleyCloudRpcProtocol.js.map +1 -1
- package/lib/esm/tile/ElementGraphics.d.ts +5 -1
- package/lib/esm/tile/ElementGraphics.d.ts.map +1 -1
- package/lib/esm/tile/ElementGraphics.js.map +1 -1
- package/lib/esm/tile/GltfTileIO.d.ts +16 -79
- package/lib/esm/tile/GltfTileIO.d.ts.map +1 -1
- package/lib/esm/tile/GltfTileIO.js +70 -149
- package/lib/esm/tile/GltfTileIO.js.map +1 -1
- package/lib/esm/tile/TileMetadata.d.ts +20 -8
- package/lib/esm/tile/TileMetadata.d.ts.map +1 -1
- package/lib/esm/tile/TileMetadata.js +50 -53
- package/lib/esm/tile/TileMetadata.js.map +1 -1
- package/package.json +9 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenderTexture.d.ts","sourceRoot":"","sources":["../../src/RenderTexture.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAA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5F,IAAW,OAAO,IAAI,OAAO,CAAmD;QAChF,IAAW,QAAQ,IAAI,OAAO,CAAoD;KACnF;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenderTexture.js","sourceRoot":"","sources":["../../src/RenderTexture.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;
|
|
1
|
+
{"version":3,"file":"RenderTexture.js","sourceRoot":"","sources":["../../src/RenderTexture.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAYH;;;;;GAKG;AACH,MAAM,OAAgB,aAAa;IASjC,YAAsB,IAAwB;QAC5C,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAPD,IAAW,aAAa,KAAc,OAAO,aAAa,CAAC,IAAI,CAAC,WAAW,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAC5F,IAAW,OAAO,KAAc,OAAO,aAAa,CAAC,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAChF,IAAW,QAAQ,KAAc,OAAO,aAAa,CAAC,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;CAanF;AAED,cAAc;AACd,WAAiB,aAAa;IAC5B,0FAA0F;IAC1F,IAAY,IAaX;IAbD,WAAY,IAAI;QACd,kFAAkF;QAClF,mCAAM,CAAA;QACN,yGAAyG;QACzG,iCAAK,CAAA;QACL,mFAAmF;QACnF,6CAAW,CAAA;QACX,+DAA+D;QAC/D,mCAAM,CAAA;QACN,oHAAoH;QACpH,6DAAmB,CAAA;QACnB,kDAAkD;QAClD,uDAAgB,CAAA;IAClB,CAAC,EAbW,IAAI,GAAJ,kBAAI,KAAJ,kBAAI,QAaf;IAED;;;OAGG;IACH,MAAa,MAAM;QAYjB,YAAmB,GAAY,EAAE,OAA2B,aAAa,CAAC,IAAI,CAAC,MAAM,EAAE,UAAmB,KAAK;YAC7G,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;YACf,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;YACjB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACzB,CAAC;QAED,IAAW,aAAa,KAAc,OAAO,aAAa,CAAC,IAAI,CAAC,WAAW,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAC5F,IAAW,OAAO,KAAc,OAAO,aAAa,CAAC,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAChF,IAAW,QAAQ,KAAc,OAAO,aAAa,CAAC,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;KACnF;IArBY,oBAAM,SAqBlB,CAAA;AACH,CAAC,EA3CgB,aAAa,KAAb,aAAa,QA2C7B","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Rendering\r\n */\r\n\r\nimport { Id64String, IDisposable } from \"@itwin/core-bentley\";\r\n\r\n/** Identifies an image to be used to produce a [[RenderTexture]] for a given purpose - for example,\r\n * as part of a [[SkyBox]]. If the string is a valid `Id64String`, it refers to a persistent [Texture]($backend) element stored in an iModel.\r\n * Otherwise, it is interpreted as a Url resolving to an HTMLImageElement.\r\n * @see [[SkySphereImageProps.texture]] and [[SkyCubeImageProps]].\r\n * @public\r\n */\r\nexport type TextureImageSpec = Id64String | string;\r\n\r\n/** Represents a texture image applied to a surface during rendering.\r\n * A RenderTexture is typically - but not always - associated with a [[RenderMaterial]].\r\n * @see [RenderSystem.createTextureFromImage]($frontend) to obtain a texture from an HTML image.\r\n * @see [RenderSystem.createTextureFromElement]($frontend) to obtain a texture from a [Texture]($backend) element.\r\n * @public\r\n */\r\nexport abstract class RenderTexture implements IDisposable {\r\n /** Indicates the type of texture. */\r\n public readonly type: RenderTexture.Type;\r\n\r\n public get isTileSection(): boolean { return RenderTexture.Type.TileSection === this.type; }\r\n public get isGlyph(): boolean { return RenderTexture.Type.Glyph === this.type; }\r\n public get isSkyBox(): boolean { return RenderTexture.Type.SkyBox === this.type; }\r\n public abstract get bytesUsed(): number;\r\n\r\n protected constructor(type: RenderTexture.Type) {\r\n this.type = type;\r\n }\r\n\r\n /** Releases any WebGL resources owned by this texture.\r\n * For a texture created by a [RenderSystem]($frontend) for which [CreateTextureArgs.ownership]($frontend) was specified as \"external\",\r\n * the caller is responsible for invoking this method when it is finished using the texture; otherwise, the [RenderSystem]($frontend) will handle\r\n * its disposal.\r\n */\r\n public abstract dispose(): void;\r\n}\r\n\r\n/** @public */\r\nexport namespace RenderTexture { // eslint-disable-line no-redeclare\r\n /** The types of [[RenderTexture]]s that can be created by a [RenderSystem]($frontend). */\r\n export enum Type {\r\n /** An image applied to a surface, with support for mip-mapping and repetition. */\r\n Normal,\r\n /** An image containing any number of text glyphs, used for efficiently rendering readable small text. */\r\n Glyph,\r\n /** A non-repeating image with no mip-maps, used for example for reality models. */\r\n TileSection,\r\n /** A three-dimensional texture used for rendering a skybox. */\r\n SkyBox,\r\n /** A non-repeating image with mip-maps and and anisotropic filtering, used for map tiles when draped on terrain. */\r\n FilteredTileSection,\r\n /** A gradient image used for thematic display. */\r\n ThematicGradient,\r\n }\r\n\r\n /** Parameters used to construct a [[RenderTexture]].\r\n * @deprecated use RenderSystem.createTexture and TextureCreateArgs.\r\n * @public\r\n */\r\n export class Params {\r\n /** A string uniquely identifying this texture within the context of an [[IModel]]. Typically this is the element Id of the corresponding [Texture]($backend) element.\r\n * Textures created on the front-end generally have no key.\r\n */\r\n public readonly key?: string;\r\n /** Indicates the type of texture. */\r\n public readonly type: RenderTexture.Type;\r\n /** Indicates that some object is managing the lifetime of this texture and will take care of calling its dispose function appropriately.\r\n * An unowned texture associated with a [RenderGraphic]($frontend) will be disposed when the RenderGraphic is disposed.\r\n */\r\n public readonly isOwned: boolean;\r\n\r\n public constructor(key?: string, type: RenderTexture.Type = RenderTexture.Type.Normal, isOwned: boolean = false) {\r\n this.key = key;\r\n this.type = type;\r\n this.isOwned = isOwned;\r\n }\r\n\r\n public get isTileSection(): boolean { return RenderTexture.Type.TileSection === this.type; }\r\n public get isGlyph(): boolean { return RenderTexture.Type.Glyph === this.type; }\r\n public get isSkyBox(): boolean { return RenderTexture.Type.SkyBox === this.type; }\r\n }\r\n}\r\n"]}
|
package/lib/esm/SkyBox.d.ts
CHANGED
|
@@ -1,49 +1,70 @@
|
|
|
1
1
|
/** @packageDocumentation
|
|
2
2
|
* @module DisplayStyles
|
|
3
3
|
*/
|
|
4
|
-
import { Id64String } from "@itwin/core-bentley";
|
|
5
|
-
import { ColorDefProps } from "./ColorDef";
|
|
6
|
-
|
|
4
|
+
import { Id64String, NonFunctionPropertiesOf } from "@itwin/core-bentley";
|
|
5
|
+
import { ColorDef, ColorDefProps } from "./ColorDef";
|
|
6
|
+
import { TextureImageSpec } from "./RenderTexture";
|
|
7
|
+
/** Supported types of [[SkyBox]] images.
|
|
8
|
+
* @see [[SkyBoxImageProps]].
|
|
7
9
|
* @public
|
|
8
10
|
*/
|
|
9
11
|
export declare enum SkyBoxImageType {
|
|
12
|
+
/** No image, indicating a [[SkyGradient]] should be displayed. */
|
|
10
13
|
None = 0,
|
|
11
|
-
/** A single image mapped to the surface of a sphere.
|
|
14
|
+
/** A single image mapped to the surface of a sphere.
|
|
15
|
+
* @see [[SkySphere]].
|
|
16
|
+
*/
|
|
12
17
|
Spherical = 1,
|
|
13
|
-
/** 6 images mapped to the faces of a cube. @see [SkyCube]($frontend) */
|
|
14
|
-
Cube = 2,
|
|
15
18
|
/** @internal not yet supported */
|
|
16
|
-
Cylindrical =
|
|
19
|
+
Cylindrical = 2,
|
|
20
|
+
/** Six images mapped to the faces of a cube.
|
|
21
|
+
* @see [[SkyCube]].
|
|
22
|
+
*/
|
|
23
|
+
Cube = 3
|
|
17
24
|
}
|
|
18
|
-
/** JSON representation of
|
|
25
|
+
/** JSON representation of the six images used by a [[SkyCube]].
|
|
26
|
+
* Each property specifies the image for a face of the cube as either an image URL, or the Id of a [Texture]($backend) element.
|
|
27
|
+
* Each image must be square and have the same dimensions as all the other images.
|
|
19
28
|
* @public
|
|
20
29
|
*/
|
|
21
30
|
export interface SkyCubeProps {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
/** Id of a persistent texture element stored in the iModel to use for the bottom of the skybox cube. */
|
|
29
|
-
bottom?: Id64String;
|
|
30
|
-
/** Id of a persistent texture element stored in the iModel to use for the right side of the skybox cube. */
|
|
31
|
-
right?: Id64String;
|
|
32
|
-
/** Id of a persistent texture element stored in the iModel to use for the left side of the skybox cube. */
|
|
33
|
-
left?: Id64String;
|
|
31
|
+
front: TextureImageSpec;
|
|
32
|
+
back: TextureImageSpec;
|
|
33
|
+
top: TextureImageSpec;
|
|
34
|
+
bottom: TextureImageSpec;
|
|
35
|
+
right: TextureImageSpec;
|
|
36
|
+
left: TextureImageSpec;
|
|
34
37
|
}
|
|
35
|
-
/** JSON representation of
|
|
38
|
+
/** JSON representation of the image used for a [[SkySphere]].
|
|
39
|
+
* @see [[SkyBoxProps.image]].
|
|
36
40
|
* @public
|
|
37
41
|
*/
|
|
38
|
-
export interface
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
|
|
43
|
-
/** For [[SkyBoxImageType.Cube]], the Ids of persistent texture elements stored in the iModel drawn on each face of the cube. */
|
|
44
|
-
textures?: SkyCubeProps;
|
|
42
|
+
export interface SkySphereImageProps {
|
|
43
|
+
type: SkyBoxImageType.Spherical;
|
|
44
|
+
texture: TextureImageSpec;
|
|
45
|
+
/** @internal */
|
|
46
|
+
textures?: never;
|
|
45
47
|
}
|
|
46
|
-
/** JSON representation of
|
|
48
|
+
/** JSON representation of the images used for a [[SkyCube]].
|
|
49
|
+
* @see [[SkyBoxProps.image]].
|
|
50
|
+
* @public
|
|
51
|
+
*/
|
|
52
|
+
export interface SkyCubeImageProps {
|
|
53
|
+
type: SkyBoxImageType.Cube;
|
|
54
|
+
textures: SkyCubeProps;
|
|
55
|
+
/** @internal */
|
|
56
|
+
texture?: never;
|
|
57
|
+
}
|
|
58
|
+
/** JSON representation of the image(s) to be mapped to the surfaces of a [[SkyBox]].
|
|
59
|
+
* @see [[SkyBoxProps.image]].
|
|
60
|
+
* @public
|
|
61
|
+
*/
|
|
62
|
+
export declare type SkyBoxImageProps = SkySphereImageProps | SkyCubeImageProps | {
|
|
63
|
+
type?: SkyBoxImageType;
|
|
64
|
+
texture?: never;
|
|
65
|
+
textures?: never;
|
|
66
|
+
};
|
|
67
|
+
/** JSON representation of a [[SkyBox]] that can be drawn as the background of a [ViewState3d]($frontend).
|
|
47
68
|
* An object of this type can describe one of several types of sky box:
|
|
48
69
|
* - A cube with a texture image mapped to each face; or
|
|
49
70
|
* - A sphere with a single texture image mapped to its surface; or
|
|
@@ -68,15 +89,15 @@ export interface SkyBoxProps {
|
|
|
68
89
|
* Default: false.
|
|
69
90
|
*/
|
|
70
91
|
display?: boolean;
|
|
71
|
-
/** For a [SkyGradient]
|
|
92
|
+
/** For a [[SkyGradient]], if true, a 2-color gradient skybox is used instead of a 4-color.
|
|
72
93
|
* Default: false.
|
|
73
94
|
*/
|
|
74
95
|
twoColor?: boolean;
|
|
75
|
-
/** The color of the sky at the horizon. Unused unless this is a four-color [SkyGradient]
|
|
96
|
+
/** The color of the sky at the horizon. Unused unless this is a four-color [[SkyGradient]].
|
|
76
97
|
* Default: (143, 205, 255).
|
|
77
98
|
*/
|
|
78
99
|
skyColor?: ColorDefProps;
|
|
79
|
-
/** The color of the ground at the horizon. Unused unless this is a four-color [SkyGradient]
|
|
100
|
+
/** The color of the ground at the horizon. Unused unless this is a four-color [[SkyGradient]].
|
|
80
101
|
* Default: (120, 143, 125).
|
|
81
102
|
*/
|
|
82
103
|
groundColor?: ColorDefProps;
|
|
@@ -88,11 +109,11 @@ export interface SkyBoxProps {
|
|
|
88
109
|
* Default: (40, 15, 0).
|
|
89
110
|
*/
|
|
90
111
|
nadirColor?: ColorDefProps;
|
|
91
|
-
/** For a 4-color [SkyGradient]
|
|
112
|
+
/** For a 4-color [[SkyGradient]], controls speed of change from sky color to zenith color; otherwise unused.
|
|
92
113
|
* Default: 4.0.
|
|
93
114
|
*/
|
|
94
115
|
skyExponent?: number;
|
|
95
|
-
/** For a 4-color [SkyGradient]
|
|
116
|
+
/** For a 4-color [[SkyGradient]], controls speed of change from ground color to nadir color; otherwise unused.
|
|
96
117
|
* Default: 4.0.
|
|
97
118
|
*/
|
|
98
119
|
groundExponent?: number;
|
|
@@ -101,4 +122,91 @@ export interface SkyBoxProps {
|
|
|
101
122
|
*/
|
|
102
123
|
image?: SkyBoxImageProps;
|
|
103
124
|
}
|
|
125
|
+
/** A type containing all of the properties and none of the methods of [[SkyGradient]] with `readonly` modifiers removed.
|
|
126
|
+
* @see [[SkyGradient.create]] and [[SkyGradient.clone]].
|
|
127
|
+
* @public
|
|
128
|
+
*/
|
|
129
|
+
export declare type SkyGradientProperties = NonFunctionPropertiesOf<SkyGradient>;
|
|
130
|
+
/** Describes how to map a two- or four-color [[Gradient]] to the interior of a sphere to produce a [[SkyBox]].
|
|
131
|
+
* @see [[SkyBox.gradient]].
|
|
132
|
+
* @public
|
|
133
|
+
*/
|
|
134
|
+
export declare class SkyGradient {
|
|
135
|
+
readonly twoColor: boolean;
|
|
136
|
+
readonly skyColor: ColorDef;
|
|
137
|
+
readonly groundColor: ColorDef;
|
|
138
|
+
readonly zenithColor: ColorDef;
|
|
139
|
+
readonly nadirColor: ColorDef;
|
|
140
|
+
readonly skyExponent: number;
|
|
141
|
+
readonly groundExponent: number;
|
|
142
|
+
private constructor();
|
|
143
|
+
/** Default settings for a four-color gradient. */
|
|
144
|
+
static readonly defaults: SkyGradient;
|
|
145
|
+
/** Create a new gradient. Any properties not specified by `props` are initialized to their default values. */
|
|
146
|
+
static create(props?: Partial<SkyGradientProperties>): SkyGradient;
|
|
147
|
+
/** Create from JSON representation. */
|
|
148
|
+
static fromJSON(props?: SkyBoxProps): SkyGradient;
|
|
149
|
+
/** Create ea copy of this gradient, identical except for any properties explicitly specified by `changedProps`.
|
|
150
|
+
* Any properties of `changedProps` explicitly set to `undefined` will be reset to their default values.
|
|
151
|
+
*/
|
|
152
|
+
clone(changedProps: SkyGradientProperties): SkyGradient;
|
|
153
|
+
/** Convert to JSON representation. */
|
|
154
|
+
toJSON(): SkyBoxProps;
|
|
155
|
+
/** Returns true if this gradient is equivalent to the supplied gradient. */
|
|
156
|
+
equals(other: SkyGradient): boolean;
|
|
157
|
+
}
|
|
158
|
+
/** Describes how to draw a representation of a sky, as part of an [[Environment]].
|
|
159
|
+
* @see [[SkyBoxProps]].
|
|
160
|
+
* @public
|
|
161
|
+
*/
|
|
162
|
+
export declare class SkyBox {
|
|
163
|
+
/** The gradient settings, used if no cube or sphere images are supplied, or if the images cannot be loaded. */
|
|
164
|
+
readonly gradient: SkyGradient;
|
|
165
|
+
protected constructor(gradient: SkyGradient);
|
|
166
|
+
/** Default settings for a four-color gradient. */
|
|
167
|
+
static readonly defaults: SkyBox;
|
|
168
|
+
/** Create a skybox that displays the specified gradient, or the default gradient if none is supplied. */
|
|
169
|
+
static createGradient(gradient?: SkyGradient): SkyBox;
|
|
170
|
+
/** Create from JSON representation. */
|
|
171
|
+
static fromJSON(props?: SkyBoxProps): SkyBox;
|
|
172
|
+
/** Convert to JSON representation.
|
|
173
|
+
* @param display If defined, the value to use for [[SkyBoxProps.display]]; otherwise, that property will be left undefined.
|
|
174
|
+
*/
|
|
175
|
+
toJSON(display?: boolean): SkyBoxProps;
|
|
176
|
+
/** @internal */
|
|
177
|
+
get textureIds(): Iterable<Id64String>;
|
|
178
|
+
}
|
|
179
|
+
/** Describes how to draw a representation of a sky by mapping a single image to the interior of a sphere.
|
|
180
|
+
* @public
|
|
181
|
+
*/
|
|
182
|
+
export declare class SkySphere extends SkyBox {
|
|
183
|
+
/** The image to map to the interior of the sphere. */
|
|
184
|
+
readonly image: TextureImageSpec;
|
|
185
|
+
/** Create a new sky sphere using the specified image.
|
|
186
|
+
* @param image The image to map to the interior of the sphere.
|
|
187
|
+
* @param gradient Optionally overrides the default gradient settings used if the image cannot be obtained.
|
|
188
|
+
*/
|
|
189
|
+
constructor(image: TextureImageSpec, gradient?: SkyGradient);
|
|
190
|
+
/** @internal override */
|
|
191
|
+
toJSON(display?: boolean): SkyBoxProps;
|
|
192
|
+
/** @internal */
|
|
193
|
+
get textureIds(): Iterable<Id64String>;
|
|
194
|
+
}
|
|
195
|
+
/** Describes how to draw a representation of a sky by mapping images to the interior faces of a cube.
|
|
196
|
+
* The images are required to be *square*, and each image must have the same dimensions as the other images.
|
|
197
|
+
* @public
|
|
198
|
+
*/
|
|
199
|
+
export declare class SkyCube extends SkyBox {
|
|
200
|
+
/** The images to map to each face of the cube. */
|
|
201
|
+
readonly images: SkyCubeProps;
|
|
202
|
+
/** Create a new sky cube using the specified images.
|
|
203
|
+
* @param images The images to map to each face of the cube.
|
|
204
|
+
* @param Optionally overrides the default gradient settings used if the images cannot be obtained.
|
|
205
|
+
*/
|
|
206
|
+
constructor(images: SkyCubeProps, gradient?: SkyGradient);
|
|
207
|
+
/** @internal override */
|
|
208
|
+
toJSON(display?: boolean): SkyBoxProps;
|
|
209
|
+
/** @internal */
|
|
210
|
+
get textureIds(): Iterable<Id64String>;
|
|
211
|
+
}
|
|
104
212
|
//# sourceMappingURL=SkyBox.d.ts.map
|
package/lib/esm/SkyBox.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SkyBox.d.ts","sourceRoot":"","sources":["../../src/SkyBox.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"SkyBox.d.ts","sourceRoot":"","sources":["../../src/SkyBox.ts"],"names":[],"m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orDef";
|
|
10
|
+
/** Supported types of [[SkyBox]] images.
|
|
11
|
+
* @see [[SkyBoxImageProps]].
|
|
9
12
|
* @public
|
|
10
13
|
*/
|
|
11
14
|
export var SkyBoxImageType;
|
|
12
15
|
(function (SkyBoxImageType) {
|
|
16
|
+
/** No image, indicating a [[SkyGradient]] should be displayed. */
|
|
13
17
|
SkyBoxImageType[SkyBoxImageType["None"] = 0] = "None";
|
|
14
|
-
/** A single image mapped to the surface of a sphere.
|
|
18
|
+
/** A single image mapped to the surface of a sphere.
|
|
19
|
+
* @see [[SkySphere]].
|
|
20
|
+
*/
|
|
15
21
|
SkyBoxImageType[SkyBoxImageType["Spherical"] = 1] = "Spherical";
|
|
16
|
-
/** 6 images mapped to the faces of a cube. @see [SkyCube]($frontend) */
|
|
17
|
-
SkyBoxImageType[SkyBoxImageType["Cube"] = 2] = "Cube";
|
|
18
22
|
/** @internal not yet supported */
|
|
19
|
-
SkyBoxImageType[SkyBoxImageType["Cylindrical"] =
|
|
23
|
+
SkyBoxImageType[SkyBoxImageType["Cylindrical"] = 2] = "Cylindrical";
|
|
24
|
+
/** Six images mapped to the faces of a cube.
|
|
25
|
+
* @see [[SkyCube]].
|
|
26
|
+
*/
|
|
27
|
+
SkyBoxImageType[SkyBoxImageType["Cube"] = 3] = "Cube";
|
|
20
28
|
})(SkyBoxImageType || (SkyBoxImageType = {}));
|
|
29
|
+
const defaultGroundColor = ColorDef.from(143, 205, 125);
|
|
30
|
+
const defaultZenithColor = ColorDef.from(54, 117, 255);
|
|
31
|
+
const defaultNadirColor = ColorDef.from(40, 125, 0);
|
|
32
|
+
const defaultSkyColor = ColorDef.from(142, 205, 255);
|
|
33
|
+
const defaultExponent = 4.0;
|
|
34
|
+
function colorDefFromJson(props) {
|
|
35
|
+
return undefined !== props ? ColorDef.fromJSON(props) : undefined;
|
|
36
|
+
}
|
|
37
|
+
/** Describes how to map a two- or four-color [[Gradient]] to the interior of a sphere to produce a [[SkyBox]].
|
|
38
|
+
* @see [[SkyBox.gradient]].
|
|
39
|
+
* @public
|
|
40
|
+
*/
|
|
41
|
+
export class SkyGradient {
|
|
42
|
+
constructor(args) {
|
|
43
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
44
|
+
this.twoColor = (_a = args.twoColor) !== null && _a !== void 0 ? _a : false;
|
|
45
|
+
this.skyColor = (_b = args.skyColor) !== null && _b !== void 0 ? _b : defaultSkyColor;
|
|
46
|
+
this.groundColor = (_c = args.groundColor) !== null && _c !== void 0 ? _c : defaultGroundColor;
|
|
47
|
+
this.nadirColor = (_d = args.nadirColor) !== null && _d !== void 0 ? _d : defaultNadirColor;
|
|
48
|
+
this.zenithColor = (_e = args.zenithColor) !== null && _e !== void 0 ? _e : defaultZenithColor;
|
|
49
|
+
this.skyExponent = (_f = args.skyExponent) !== null && _f !== void 0 ? _f : defaultExponent;
|
|
50
|
+
this.groundExponent = (_g = args.groundExponent) !== null && _g !== void 0 ? _g : defaultExponent;
|
|
51
|
+
}
|
|
52
|
+
/** Create a new gradient. Any properties not specified by `props` are initialized to their default values. */
|
|
53
|
+
static create(props) {
|
|
54
|
+
return props ? new this(props) : this.defaults;
|
|
55
|
+
}
|
|
56
|
+
/** Create from JSON representation. */
|
|
57
|
+
static fromJSON(props) {
|
|
58
|
+
if (!props)
|
|
59
|
+
return this.defaults;
|
|
60
|
+
return new this({
|
|
61
|
+
twoColor: props.twoColor,
|
|
62
|
+
skyExponent: props.skyExponent,
|
|
63
|
+
groundExponent: props.groundExponent,
|
|
64
|
+
skyColor: colorDefFromJson(props.skyColor),
|
|
65
|
+
groundColor: colorDefFromJson(props.groundColor),
|
|
66
|
+
nadirColor: colorDefFromJson(props.nadirColor),
|
|
67
|
+
zenithColor: colorDefFromJson(props.zenithColor),
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
/** Create ea copy of this gradient, identical except for any properties explicitly specified by `changedProps`.
|
|
71
|
+
* Any properties of `changedProps` explicitly set to `undefined` will be reset to their default values.
|
|
72
|
+
*/
|
|
73
|
+
clone(changedProps) {
|
|
74
|
+
return new SkyGradient({ ...this, ...changedProps });
|
|
75
|
+
}
|
|
76
|
+
/** Convert to JSON representation. */
|
|
77
|
+
toJSON() {
|
|
78
|
+
const props = {
|
|
79
|
+
skyColor: this.skyColor.toJSON(),
|
|
80
|
+
groundColor: this.groundColor.toJSON(),
|
|
81
|
+
nadirColor: this.nadirColor.toJSON(),
|
|
82
|
+
zenithColor: this.zenithColor.toJSON(),
|
|
83
|
+
};
|
|
84
|
+
if (this.groundExponent !== defaultExponent)
|
|
85
|
+
props.groundExponent = this.groundExponent;
|
|
86
|
+
if (this.skyExponent !== defaultExponent)
|
|
87
|
+
props.skyExponent = this.skyExponent;
|
|
88
|
+
if (this.twoColor)
|
|
89
|
+
props.twoColor = this.twoColor;
|
|
90
|
+
return props;
|
|
91
|
+
}
|
|
92
|
+
/** Returns true if this gradient is equivalent to the supplied gradient. */
|
|
93
|
+
equals(other) {
|
|
94
|
+
if (this === other)
|
|
95
|
+
return true;
|
|
96
|
+
return this.twoColor === other.twoColor && this.skyColor.equals(other.skyColor) && this.groundColor.equals(other.groundColor) &&
|
|
97
|
+
this.zenithColor.equals(other.zenithColor) && this.nadirColor.equals(other.nadirColor);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
/** Default settings for a four-color gradient. */
|
|
101
|
+
SkyGradient.defaults = new SkyGradient({});
|
|
102
|
+
/** Describes how to draw a representation of a sky, as part of an [[Environment]].
|
|
103
|
+
* @see [[SkyBoxProps]].
|
|
104
|
+
* @public
|
|
105
|
+
*/
|
|
106
|
+
export class SkyBox {
|
|
107
|
+
constructor(gradient) {
|
|
108
|
+
this.gradient = gradient;
|
|
109
|
+
}
|
|
110
|
+
/** Create a skybox that displays the specified gradient, or the default gradient if none is supplied. */
|
|
111
|
+
static createGradient(gradient) {
|
|
112
|
+
return gradient ? new this(gradient) : this.defaults;
|
|
113
|
+
}
|
|
114
|
+
/** Create from JSON representation. */
|
|
115
|
+
static fromJSON(props) {
|
|
116
|
+
const gradient = SkyGradient.fromJSON(props);
|
|
117
|
+
if (props === null || props === void 0 ? void 0 : props.image) {
|
|
118
|
+
switch (props.image.type) {
|
|
119
|
+
case SkyBoxImageType.Spherical:
|
|
120
|
+
if (undefined !== props.image.texture)
|
|
121
|
+
return new SkySphere(props.image.texture, gradient);
|
|
122
|
+
break;
|
|
123
|
+
case SkyBoxImageType.Cube: {
|
|
124
|
+
const tx = props.image.textures;
|
|
125
|
+
if (tx && undefined !== tx.top && undefined !== tx.bottom && undefined !== tx.right && undefined !== tx.left && undefined !== tx.front && undefined !== tx.back)
|
|
126
|
+
return new SkyCube(tx, gradient);
|
|
127
|
+
break;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
return this.createGradient(gradient);
|
|
132
|
+
}
|
|
133
|
+
/** Convert to JSON representation.
|
|
134
|
+
* @param display If defined, the value to use for [[SkyBoxProps.display]]; otherwise, that property will be left undefined.
|
|
135
|
+
*/
|
|
136
|
+
toJSON(display) {
|
|
137
|
+
const props = this.gradient.toJSON();
|
|
138
|
+
if (undefined !== display)
|
|
139
|
+
props.display = display;
|
|
140
|
+
return props;
|
|
141
|
+
}
|
|
142
|
+
/** @internal */
|
|
143
|
+
get textureIds() {
|
|
144
|
+
return [];
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
/** Default settings for a four-color gradient. */
|
|
148
|
+
SkyBox.defaults = new SkyBox(SkyGradient.defaults);
|
|
149
|
+
/** Describes how to draw a representation of a sky by mapping a single image to the interior of a sphere.
|
|
150
|
+
* @public
|
|
151
|
+
*/
|
|
152
|
+
export class SkySphere extends SkyBox {
|
|
153
|
+
/** Create a new sky sphere using the specified image.
|
|
154
|
+
* @param image The image to map to the interior of the sphere.
|
|
155
|
+
* @param gradient Optionally overrides the default gradient settings used if the image cannot be obtained.
|
|
156
|
+
*/
|
|
157
|
+
constructor(image, gradient) {
|
|
158
|
+
super(gradient !== null && gradient !== void 0 ? gradient : SkyGradient.defaults);
|
|
159
|
+
this.image = image;
|
|
160
|
+
}
|
|
161
|
+
/** @internal override */
|
|
162
|
+
toJSON(display) {
|
|
163
|
+
const props = super.toJSON(display);
|
|
164
|
+
props.image = {
|
|
165
|
+
type: SkyBoxImageType.Spherical,
|
|
166
|
+
texture: this.image,
|
|
167
|
+
};
|
|
168
|
+
return props;
|
|
169
|
+
}
|
|
170
|
+
/** @internal */
|
|
171
|
+
get textureIds() {
|
|
172
|
+
return Id64.isValidId64(this.image) ? [this.image] : [];
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
/** Describes how to draw a representation of a sky by mapping images to the interior faces of a cube.
|
|
176
|
+
* The images are required to be *square*, and each image must have the same dimensions as the other images.
|
|
177
|
+
* @public
|
|
178
|
+
*/
|
|
179
|
+
export class SkyCube extends SkyBox {
|
|
180
|
+
/** Create a new sky cube using the specified images.
|
|
181
|
+
* @param images The images to map to each face of the cube.
|
|
182
|
+
* @param Optionally overrides the default gradient settings used if the images cannot be obtained.
|
|
183
|
+
*/
|
|
184
|
+
constructor(images, gradient) {
|
|
185
|
+
super(gradient !== null && gradient !== void 0 ? gradient : SkyGradient.defaults);
|
|
186
|
+
this.images = { ...images };
|
|
187
|
+
}
|
|
188
|
+
/** @internal override */
|
|
189
|
+
toJSON(display) {
|
|
190
|
+
const props = super.toJSON(display);
|
|
191
|
+
props.image = {
|
|
192
|
+
type: SkyBoxImageType.Cube,
|
|
193
|
+
textures: { ...this.images },
|
|
194
|
+
};
|
|
195
|
+
return props;
|
|
196
|
+
}
|
|
197
|
+
/** @internal */
|
|
198
|
+
get textureIds() {
|
|
199
|
+
const imgs = this.images;
|
|
200
|
+
return [imgs.front, imgs.back, imgs.top, imgs.bottom, imgs.left, imgs.right].filter((x) => Id64.isValidId64(x));
|
|
201
|
+
}
|
|
202
|
+
}
|
|
21
203
|
//# sourceMappingURL=SkyBox.js.map
|
package/lib/esm/SkyBox.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SkyBox.js","sourceRoot":"","sources":["../../src/SkyBox.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAKH;;GAEG;AACH,MAAM,CAAN,IAAY,eAQX;AARD,WAAY,eAAe;IACzB,qDAAI,CAAA;IACJ,oFAAoF;IACpF,+DAAS,CAAA;IACT,wEAAwE;IACxE,qDAAI,CAAA;IACJ,kCAAkC;IAClC,mEAAW,CAAA;AACb,CAAC,EARW,eAAe,KAAf,eAAe,QAQ1B","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module DisplayStyles\r\n */\r\n\r\nimport { Id64String } from \"@itwin/core-bentley\";\r\nimport { ColorDefProps } from \"./ColorDef\";\r\n\r\n/** Enumerates the supported types of [SkyBox]($frontend) images.\r\n * @public\r\n */\r\nexport enum SkyBoxImageType {\r\n None,\r\n /** A single image mapped to the surface of a sphere. @see [SkySphere]($frontend) */\r\n Spherical,\r\n /** 6 images mapped to the faces of a cube. @see [SkyCube]($frontend) */\r\n Cube,\r\n /** @internal not yet supported */\r\n Cylindrical,\r\n}\r\n\r\n/** JSON representation of a set of images used by a [SkyCube]($frontend). Each property specifies the element ID of a texture associated with one face of the cube.\r\n * @public\r\n */\r\nexport interface SkyCubeProps {\r\n /** Id of a persistent texture element stored in the iModel to use for the front side of the skybox cube. */\r\n front?: Id64String;\r\n /** Id of a persistent texture element stored in the iModel to use for the back side of the skybox cube. */\r\n back?: Id64String;\r\n /** Id of a persistent texture element stored in the iModel to use for the top of the skybox cube. */\r\n top?: Id64String;\r\n /** Id of a persistent texture element stored in the iModel to use for the bottom of the skybox cube. */\r\n bottom?: Id64String;\r\n /** Id of a persistent texture element stored in the iModel to use for the right side of the skybox cube. */\r\n right?: Id64String;\r\n /** Id of a persistent texture element stored in the iModel to use for the left side of the skybox cube. */\r\n left?: Id64String;\r\n}\r\n\r\n/** JSON representation of an image or images used by a [SkySphere]($frontend) or [SkyCube]($frontend).\r\n * @public\r\n */\r\nexport interface SkyBoxImageProps {\r\n /** The type of skybox image. */\r\n type?: SkyBoxImageType;\r\n /** For [[SkyBoxImageType.Spherical]], the Id of a persistent texture element stored in the iModel to be drawn as the \"sky\". */\r\n texture?: Id64String;\r\n /** For [[SkyBoxImageType.Cube]], the Ids of persistent texture elements stored in the iModel drawn on each face of the cube. */\r\n textures?: SkyCubeProps;\r\n}\r\n\r\n/** JSON representation of a [SkyBox]($frontend) that can be drawn as the background of a [ViewState3d]($frontend).\r\n * An object of this type can describe one of several types of sky box:\r\n * - A cube with a texture image mapped to each face; or\r\n * - A sphere with a single texture image mapped to its surface; or\r\n * - A sphere with a two- or four-color vertical [[Gradient]] mapped to its surface.\r\n *\r\n * Whether cuboid or spherical, the skybox is drawn as if the viewer and the contents of the view are contained within its interior.\r\n *\r\n * For a two-color gradient, the gradient transitions smoothly from the nadir color at the bottom of the sphere to the zenith color at the top of the sphere.\r\n * The sky and ground colors are unused, as are the sky and ground exponents.\r\n *\r\n * For a four-color gradient, a \"horizon\" is produced on the equator of the sphere, where the ground color and sky color meet. The lower half of the sphere transitions\r\n * smoothly from the ground color at the equator to the nadir color at the bottom, and the upper half transitions from the sky color at the equator to the zenith color at\r\n * the top of the sphere.\r\n *\r\n * The color and exponent properties are unused if one or more texture images are supplied.\r\n *\r\n * @see [[DisplayStyle3dSettings.environment]] to define the skybox for a display style.\r\n * @public\r\n */\r\nexport interface SkyBoxProps {\r\n /** Whether or not the skybox should be displayed.\r\n * Default: false.\r\n */\r\n display?: boolean;\r\n /** For a [SkyGradient]($frontend), if true, a 2-color gradient skybox is used instead of a 4-color.\r\n * Default: false.\r\n */\r\n twoColor?: boolean;\r\n /** The color of the sky at the horizon. Unused unless this is a four-color [SkyGradient]($frontend).\r\n * Default: (143, 205, 255).\r\n */\r\n skyColor?: ColorDefProps;\r\n /** The color of the ground at the horizon. Unused unless this is a four-color [SkyGradient]($frontend).\r\n * Default: (120, 143, 125).\r\n */\r\n groundColor?: ColorDefProps;\r\n /** The color of the top of the sphere.\r\n * Default: (54, 117, 255).\r\n */\r\n zenithColor?: ColorDefProps;\r\n /** The color of the bottom of the sphere.\r\n * Default: (40, 15, 0).\r\n */\r\n nadirColor?: ColorDefProps;\r\n /** For a 4-color [SkyGradient]($frontend), controls speed of change from sky color to zenith color; otherwise unused.\r\n * Default: 4.0.\r\n */\r\n skyExponent?: number;\r\n /** For a 4-color [SkyGradient]($frontend), controls speed of change from ground color to nadir color; otherwise unused.\r\n * Default: 4.0.\r\n */\r\n groundExponent?: number;\r\n /** The image(s), if any, to be mapped to the surfaces of the sphere or cube. If undefined, the skybox will be displayed as a gradient instead.\r\n * Default: undefined.\r\n */\r\n image?: SkyBoxImageProps;\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"SkyBox.js","sourceRoot":"","sources":["../../src/SkyBox.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,IAAI,EAAuC,MAAM,qBAAqB,CAAC;AAChF,OAAO,EAAE,QAAQ,EAAiB,MAAM,YAAY,CAAC;AAGrD;;;GAGG;AACH,MAAM,CAAN,IAAY,eAaX;AAbD,WAAY,eAAe;IACzB,kEAAkE;IAClE,qDAAQ,CAAA;IACR;;OAEG;IACH,+DAAa,CAAA;IACb,kCAAkC;IAClC,mEAAe,CAAA;IACf;;OAEG;IACH,qDAAQ,CAAA;AACV,CAAC,EAbW,eAAe,KAAf,eAAe,QAa1B;AAuGD,MAAM,kBAAkB,GAAG,QAAQ,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AACxD,MAAM,kBAAkB,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AACvD,MAAM,iBAAiB,G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;SACpB,CAAC;QAEF,OAAO,KAAK,CAAC;IACf,CAAC;IAED,gBAAgB;IAChB,IAAoB,UAAU;QAC5B,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC1D,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAO,OAAQ,SAAQ,MAAM;IAIjC;;;OAGG;IACH,YAAmB,MAAoB,EAAE,QAAsB;QAC7D,KAAK,CAAC,QAAQ,aAAR,QAAQ,cAAR,QAAQ,GAAI,WAAW,CAAC,QAAQ,CAAC,CAAC;QACxC,IAAI,CAAC,MAAM,GAAG,EAAE,GAAG,MAAM,EAAE,CAAC;IAC9B,CAAC;IAED,yBAAyB;IACT,MAAM,CAAC,OAAiB;QACtC,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACpC,KAAK,CAAC,KAAK,GAAG;YACZ,IAAI,EAAE,eAAe,CAAC,IAAI;YAC1B,QAAQ,EAAE,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE;SAC7B,CAAC;QAEF,OAAO,KAAK,CAAC;IACf,CAAC;IAED,gBAAgB;IAChB,IAAoB,UAAU;QAC5B,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC;QACzB,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;IAClH,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module DisplayStyles\r\n */\r\n\r\nimport { Id64, Id64String, NonFunctionPropertiesOf } from \"@itwin/core-bentley\";\r\nimport { ColorDef, ColorDefProps } from \"./ColorDef\";\r\nimport { TextureImageSpec } from \"./RenderTexture\";\r\n\r\n/** Supported types of [[SkyBox]] images.\r\n * @see [[SkyBoxImageProps]].\r\n * @public\r\n */\r\nexport enum SkyBoxImageType {\r\n /** No image, indicating a [[SkyGradient]] should be displayed. */\r\n None = 0,\r\n /** A single image mapped to the surface of a sphere.\r\n * @see [[SkySphere]].\r\n */\r\n Spherical = 1,\r\n /** @internal not yet supported */\r\n Cylindrical = 2,\r\n /** Six images mapped to the faces of a cube.\r\n * @see [[SkyCube]].\r\n */\r\n Cube = 3,\r\n}\r\n\r\n/** JSON representation of the six images used by a [[SkyCube]].\r\n * Each property specifies the image for a face of the cube as either an image URL, or the Id of a [Texture]($backend) element.\r\n * Each image must be square and have the same dimensions as all the other images.\r\n * @public\r\n */\r\nexport interface SkyCubeProps {\r\n front: TextureImageSpec;\r\n back: TextureImageSpec;\r\n top: TextureImageSpec;\r\n bottom: TextureImageSpec;\r\n right: TextureImageSpec;\r\n left: TextureImageSpec;\r\n}\r\n\r\n/** JSON representation of the image used for a [[SkySphere]].\r\n * @see [[SkyBoxProps.image]].\r\n * @public\r\n */\r\nexport interface SkySphereImageProps {\r\n type: SkyBoxImageType.Spherical;\r\n texture: TextureImageSpec;\r\n /** @internal */\r\n textures?: never;\r\n}\r\n\r\n/** JSON representation of the images used for a [[SkyCube]].\r\n * @see [[SkyBoxProps.image]].\r\n * @public\r\n */\r\nexport interface SkyCubeImageProps {\r\n type: SkyBoxImageType.Cube;\r\n textures: SkyCubeProps;\r\n /** @internal */\r\n texture?: never;\r\n}\r\n\r\n/** JSON representation of the image(s) to be mapped to the surfaces of a [[SkyBox]].\r\n * @see [[SkyBoxProps.image]].\r\n * @public\r\n */\r\nexport type SkyBoxImageProps = SkySphereImageProps | SkyCubeImageProps | { type?: SkyBoxImageType, texture?: never, textures?: never };\r\n\r\n/** JSON representation of a [[SkyBox]] that can be drawn as the background of a [ViewState3d]($frontend).\r\n * An object of this type can describe one of several types of sky box:\r\n * - A cube with a texture image mapped to each face; or\r\n * - A sphere with a single texture image mapped to its surface; or\r\n * - A sphere with a two- or four-color vertical [[Gradient]] mapped to its surface.\r\n *\r\n * Whether cuboid or spherical, the skybox is drawn as if the viewer and the contents of the view are contained within its interior.\r\n *\r\n * For a two-color gradient, the gradient transitions smoothly from the nadir color at the bottom of the sphere to the zenith color at the top of the sphere.\r\n * The sky and ground colors are unused, as are the sky and ground exponents.\r\n *\r\n * For a four-color gradient, a \"horizon\" is produced on the equator of the sphere, where the ground color and sky color meet. The lower half of the sphere transitions\r\n * smoothly from the ground color at the equator to the nadir color at the bottom, and the upper half transitions from the sky color at the equator to the zenith color at\r\n * the top of the sphere.\r\n *\r\n * The color and exponent properties are unused if one or more texture images are supplied.\r\n *\r\n * @see [[DisplayStyle3dSettings.environment]] to define the skybox for a display style.\r\n * @public\r\n */\r\nexport interface SkyBoxProps {\r\n /** Whether or not the skybox should be displayed.\r\n * Default: false.\r\n */\r\n display?: boolean;\r\n /** For a [[SkyGradient]], if true, a 2-color gradient skybox is used instead of a 4-color.\r\n * Default: false.\r\n */\r\n twoColor?: boolean;\r\n /** The color of the sky at the horizon. Unused unless this is a four-color [[SkyGradient]].\r\n * Default: (143, 205, 255).\r\n */\r\n skyColor?: ColorDefProps;\r\n /** The color of the ground at the horizon. Unused unless this is a four-color [[SkyGradient]].\r\n * Default: (120, 143, 125).\r\n */\r\n groundColor?: ColorDefProps;\r\n /** The color of the top of the sphere.\r\n * Default: (54, 117, 255).\r\n */\r\n zenithColor?: ColorDefProps;\r\n /** The color of the bottom of the sphere.\r\n * Default: (40, 15, 0).\r\n */\r\n nadirColor?: ColorDefProps;\r\n /** For a 4-color [[SkyGradient]], controls speed of change from sky color to zenith color; otherwise unused.\r\n * Default: 4.0.\r\n */\r\n skyExponent?: number;\r\n /** For a 4-color [[SkyGradient]], controls speed of change from ground color to nadir color; otherwise unused.\r\n * Default: 4.0.\r\n */\r\n groundExponent?: number;\r\n /** The image(s), if any, to be mapped to the surfaces of the sphere or cube. If undefined, the skybox will be displayed as a gradient instead.\r\n * Default: undefined.\r\n */\r\n image?: SkyBoxImageProps;\r\n}\r\n\r\nconst defaultGroundColor = ColorDef.from(143, 205, 125);\r\nconst defaultZenithColor = ColorDef.from(54, 117, 255);\r\nconst defaultNadirColor = ColorDef.from(40, 125, 0);\r\nconst defaultSkyColor = ColorDef.from(142, 205, 255);\r\nconst defaultExponent = 4.0;\r\n\r\nfunction colorDefFromJson(props?: ColorDefProps): ColorDef | undefined {\r\n return undefined !== props ? ColorDef.fromJSON(props) : undefined;\r\n}\r\n\r\n/** A type containing all of the properties and none of the methods of [[SkyGradient]] with `readonly` modifiers removed.\r\n * @see [[SkyGradient.create]] and [[SkyGradient.clone]].\r\n * @public\r\n */\r\nexport type SkyGradientProperties = NonFunctionPropertiesOf<SkyGradient>;\r\n\r\n/** Describes how to map a two- or four-color [[Gradient]] to the interior of a sphere to produce a [[SkyBox]].\r\n * @see [[SkyBox.gradient]].\r\n * @public\r\n */\r\nexport class SkyGradient {\r\n public readonly twoColor: boolean;\r\n public readonly skyColor: ColorDef;\r\n public readonly groundColor: ColorDef;\r\n public readonly zenithColor: ColorDef;\r\n public readonly nadirColor: ColorDef;\r\n public readonly skyExponent: number;\r\n public readonly groundExponent: number;\r\n\r\n private constructor(args: Partial<SkyGradientProperties>) {\r\n this.twoColor = args.twoColor ?? false;\r\n this.skyColor = args.skyColor ?? defaultSkyColor;\r\n this.groundColor = args.groundColor ?? defaultGroundColor;\r\n this.nadirColor = args.nadirColor ?? defaultNadirColor;\r\n this.zenithColor = args.zenithColor ?? defaultZenithColor;\r\n this.skyExponent = args.skyExponent ?? defaultExponent;\r\n this.groundExponent = args.groundExponent ?? defaultExponent;\r\n }\r\n\r\n /** Default settings for a four-color gradient. */\r\n public static readonly defaults = new SkyGradient({});\r\n\r\n /** Create a new gradient. Any properties not specified by `props` are initialized to their default values. */\r\n public static create(props?: Partial<SkyGradientProperties>): SkyGradient {\r\n return props ? new this(props) : this.defaults;\r\n }\r\n\r\n /** Create from JSON representation. */\r\n public static fromJSON(props?: SkyBoxProps): SkyGradient {\r\n if (!props)\r\n return this.defaults;\r\n\r\n return new this({\r\n twoColor: props.twoColor,\r\n skyExponent: props.skyExponent,\r\n groundExponent: props.groundExponent,\r\n skyColor: colorDefFromJson(props.skyColor),\r\n groundColor: colorDefFromJson(props.groundColor),\r\n nadirColor: colorDefFromJson(props.nadirColor),\r\n zenithColor: colorDefFromJson(props.zenithColor),\r\n });\r\n }\r\n\r\n /** Create ea copy of this gradient, identical except for any properties explicitly specified by `changedProps`.\r\n * Any properties of `changedProps` explicitly set to `undefined` will be reset to their default values.\r\n */\r\n public clone(changedProps: SkyGradientProperties): SkyGradient {\r\n return new SkyGradient({ ...this, ...changedProps });\r\n }\r\n\r\n /** Convert to JSON representation. */\r\n public toJSON(): SkyBoxProps {\r\n const props: SkyBoxProps = {\r\n skyColor: this.skyColor.toJSON(),\r\n groundColor: this.groundColor.toJSON(),\r\n nadirColor: this.nadirColor.toJSON(),\r\n zenithColor: this.zenithColor.toJSON(),\r\n };\r\n\r\n if (this.groundExponent !== defaultExponent)\r\n props.groundExponent = this.groundExponent;\r\n\r\n if (this.skyExponent !== defaultExponent)\r\n props.skyExponent = this.skyExponent;\r\n\r\n if (this.twoColor)\r\n props.twoColor = this.twoColor;\r\n\r\n return props;\r\n }\r\n\r\n /** Returns true if this gradient is equivalent to the supplied gradient. */\r\n public equals(other: SkyGradient): boolean {\r\n if (this === other)\r\n return true;\r\n\r\n return this.twoColor === other.twoColor && this.skyColor.equals(other.skyColor) && this.groundColor.equals(other.groundColor) &&\r\n this.zenithColor.equals(other.zenithColor) && this.nadirColor.equals(other.nadirColor);\r\n }\r\n}\r\n\r\n/** Describes how to draw a representation of a sky, as part of an [[Environment]].\r\n * @see [[SkyBoxProps]].\r\n * @public\r\n */\r\nexport class SkyBox {\r\n /** The gradient settings, used if no cube or sphere images are supplied, or if the images cannot be loaded. */\r\n public readonly gradient: SkyGradient;\r\n\r\n protected constructor(gradient: SkyGradient) {\r\n this.gradient = gradient;\r\n }\r\n\r\n /** Default settings for a four-color gradient. */\r\n public static readonly defaults = new SkyBox(SkyGradient.defaults);\r\n\r\n /** Create a skybox that displays the specified gradient, or the default gradient if none is supplied. */\r\n public static createGradient(gradient?: SkyGradient): SkyBox {\r\n return gradient ? new this(gradient) : this.defaults;\r\n }\r\n\r\n /** Create from JSON representation. */\r\n public static fromJSON(props?: SkyBoxProps): SkyBox {\r\n const gradient = SkyGradient.fromJSON(props);\r\n\r\n if (props?.image) {\r\n switch (props.image.type) {\r\n case SkyBoxImageType.Spherical:\r\n if (undefined !== props.image.texture)\r\n return new SkySphere(props.image.texture, gradient);\r\n\r\n break;\r\n case SkyBoxImageType.Cube: {\r\n const tx = props.image.textures;\r\n if (tx && undefined !== tx.top && undefined !== tx.bottom && undefined !== tx.right && undefined !== tx.left && undefined !== tx.front && undefined !== tx.back)\r\n return new SkyCube(tx, gradient);\r\n\r\n break;\r\n }\r\n }\r\n }\r\n\r\n return this.createGradient(gradient);\r\n }\r\n\r\n /** Convert to JSON representation.\r\n * @param display If defined, the value to use for [[SkyBoxProps.display]]; otherwise, that property will be left undefined.\r\n */\r\n public toJSON(display?: boolean): SkyBoxProps {\r\n const props = this.gradient.toJSON();\r\n if (undefined !== display)\r\n props.display = display;\r\n\r\n return props;\r\n }\r\n\r\n /** @internal */\r\n public get textureIds(): Iterable<Id64String> {\r\n return [];\r\n }\r\n}\r\n\r\n/** Describes how to draw a representation of a sky by mapping a single image to the interior of a sphere.\r\n * @public\r\n */\r\nexport class SkySphere extends SkyBox {\r\n /** The image to map to the interior of the sphere. */\r\n public readonly image: TextureImageSpec;\r\n\r\n /** Create a new sky sphere using the specified image.\r\n * @param image The image to map to the interior of the sphere.\r\n * @param gradient Optionally overrides the default gradient settings used if the image cannot be obtained.\r\n */\r\n public constructor(image: TextureImageSpec, gradient?: SkyGradient) {\r\n super(gradient ?? SkyGradient.defaults);\r\n this.image = image;\r\n }\r\n\r\n /** @internal override */\r\n public override toJSON(display?: boolean): SkyBoxProps {\r\n const props = super.toJSON(display);\r\n props.image = {\r\n type: SkyBoxImageType.Spherical,\r\n texture: this.image,\r\n };\r\n\r\n return props;\r\n }\r\n\r\n /** @internal */\r\n public override get textureIds(): Iterable<Id64String> {\r\n return Id64.isValidId64(this.image) ? [this.image] : [];\r\n }\r\n}\r\n\r\n/** Describes how to draw a representation of a sky by mapping images to the interior faces of a cube.\r\n * The images are required to be *square*, and each image must have the same dimensions as the other images.\r\n * @public\r\n */\r\nexport class SkyCube extends SkyBox {\r\n /** The images to map to each face of the cube. */\r\n public readonly images: SkyCubeProps;\r\n\r\n /** Create a new sky cube using the specified images.\r\n * @param images The images to map to each face of the cube.\r\n * @param Optionally overrides the default gradient settings used if the images cannot be obtained.\r\n */\r\n public constructor(images: SkyCubeProps, gradient?: SkyGradient) {\r\n super(gradient ?? SkyGradient.defaults);\r\n this.images = { ...images };\r\n }\r\n\r\n /** @internal override */\r\n public override toJSON(display?: boolean): SkyBoxProps {\r\n const props = super.toJSON(display);\r\n props.image = {\r\n type: SkyBoxImageType.Cube,\r\n textures: { ...this.images },\r\n };\r\n\r\n return props;\r\n }\r\n\r\n /** @internal */\r\n public override get textureIds(): Iterable<Id64String> {\r\n const imgs = this.images;\r\n return [imgs.front, imgs.back, imgs.top, imgs.bottom, imgs.left, imgs.right].filter((x) => Id64.isValidId64(x));\r\n }\r\n}\r\n"]}
|
|
@@ -53,6 +53,8 @@ export declare namespace TextureMapping {
|
|
|
53
53
|
* ```
|
|
54
54
|
*/
|
|
55
55
|
constructor(m00?: number, m01?: number, originX?: number, m10?: number, m11?: number, originY?: number);
|
|
56
|
+
/** An immutable 2x3 identity matrix. */
|
|
57
|
+
static readonly identity: Trans2x3;
|
|
56
58
|
}
|
|
57
59
|
/** Properties used to construct a [[TextureMapping.Params]]. */
|
|
58
60
|
interface ParamProps {
|
|
@@ -83,7 +85,7 @@ export declare namespace TextureMapping {
|
|
|
83
85
|
mode: TextureMapping.Mode;
|
|
84
86
|
/** @internal */
|
|
85
87
|
worldMapping: boolean;
|
|
86
|
-
constructor(props?: ParamProps);
|
|
88
|
+
constructor(props?: TextureMapping.ParamProps);
|
|
87
89
|
/**
|
|
88
90
|
* Generates UV parameters for textured surfaces. Returns undefined on failure.
|
|
89
91
|
* @internal
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextureMapping.d.ts","sourceRoot":"","sources":["../../src/TextureMapping.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,sBAAsB,EAAY,OAAO,EAAW,eAAe,EAAE,SAAS,EAAY,MAAM,sBAAsB,CAAC;AAChI,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD;;GAEG;AACH,qBAAa,cAAc;IACzB,+CAA+C;IAC/C,SAAgB,OAAO,EAAE,aAAa,CAAC;IACvC,gFAAgF;IAChF,SAAgB,MAAM,EAAE,cAAc,CAAC,MAAM,CAAC;gBAE3B,EAAE,EAAE,aAAa,EAAE,MAAM,EAAE,cAAc,CAAC,MAAM;IAKnE,gBAAgB;IACT,eAAe,CAAC,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,SAAS,GAAG,OAAO,EAAE,GAAG,SAAS;CAGtG;AAED,cAAc;AACd,yBAAiB,cAAc,CAAC;IAC9B,qDAAqD;IACrD,KAAY,IAAI;QACd,IAAI,KAAK;QACT,UAAU,IAAI;QACd,cAAc,IAAI;QAClB,MAAM,IAAI;QACV,gBAAgB;QAChB,gBAAgB,IAAI;QACpB,gBAAgB;QAChB,KAAK,IAAI;QACT,gBAAgB;QAChB,SAAS,IAAI;QACb,gBAAgB;QAChB,WAAW,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B,sDAAsD;QACtD,SAAgB,SAAS,EAAE,SAAS,CAAC;QAErC;;;;;;;;;;;WAWG;oBACgB,GAAG,SAAI,EAAE,GAAG,SAAI,EAAE,OAAO,SAAI,EAAE,GAAG,SAAI,EAAE,GAAG,SAAI,EAAE,OAAO,SAAI;QAM/E,wCAAwC;QACxC,gBAAuB,QAAQ,WAAkB;KAClD;IAED,gEAAgE;IAChE,UAAiB,UAAU;QACzB,qDAAqD;QACrD,aAAa,CAAC,EAAE,cAAc,CAAC,QAAQ,CAAC;QACxC;;;;WAIG;QACH,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB;;WAEG;QACH,OAAO,CAAC,EAAE,cAAc,CAAC,IAAI,CAAC;QAC9B,gBAAgB;QAChB,YAAY,CAAC,EAAE,OAAO,CAAC;KACxB;IAED,oFAAoF;IACpF,MAAa,MAAM;QACjB,qDAAqD;QAC9C,aAAa,EAAE,cAAc,CAAC,QAAQ,CAAC;QAC9C;;WAEG;QACI,MAAM,EAAE,MAAM,CAAC;QACtB,uDAAuD;QAChD,IAAI,EAAE,cAAc,CAAC,IAAI,CAAC;QACjC,gBAAgB;QACT,YAAY,EAAE,OAAO,CAAC;oBAEV,KAAK,CAAC,EAAE,cAAc,CAAC,UAAU;QAOpD;;;WAGG;QACI,eAAe,CAAC,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,SAAS,GAAG,OAAO,EAAE,GAAG,SAAS;QAwB5G,yEAAyE;QACzE,OAAO,CAAC,yBAAyB;QAiBjC,sHAAsH;QACtH,OAAO,CAAC,qBAAqB;QA+C7B,+HAA+H;QAC/H,OAAO,CAAC,6BAA6B;KActC;CACF"}
|
|
@@ -61,15 +61,17 @@ export class TextureMapping {
|
|
|
61
61
|
this.transform = Transform.createRefs(origin, matrix);
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
+
/** An immutable 2x3 identity matrix. */
|
|
65
|
+
Trans2x3.identity = new Trans2x3();
|
|
64
66
|
TextureMapping.Trans2x3 = Trans2x3;
|
|
65
67
|
/** Parameters describing how a [[RenderTexture]]'s image is mapped to a surface. */
|
|
66
68
|
class Params {
|
|
67
|
-
constructor(props
|
|
68
|
-
|
|
69
|
-
this.textureMatrix = textureMat2x3;
|
|
70
|
-
this.weight = textureWeight;
|
|
71
|
-
this.mode = mapMode;
|
|
72
|
-
this.worldMapping = worldMapping;
|
|
69
|
+
constructor(props) {
|
|
70
|
+
var _a, _b, _c, _d;
|
|
71
|
+
this.textureMatrix = (_a = props === null || props === void 0 ? void 0 : props.textureMat2x3) !== null && _a !== void 0 ? _a : Trans2x3.identity;
|
|
72
|
+
this.weight = (_b = props === null || props === void 0 ? void 0 : props.textureWeight) !== null && _b !== void 0 ? _b : 1;
|
|
73
|
+
this.mode = (_c = props === null || props === void 0 ? void 0 : props.mapMode) !== null && _c !== void 0 ? _c : Mode.Parametric;
|
|
74
|
+
this.worldMapping = (_d = props === null || props === void 0 ? void 0 : props.worldMapping) !== null && _d !== void 0 ? _d : false;
|
|
73
75
|
}
|
|
74
76
|
/**
|
|
75
77
|
* Generates UV parameters for textured surfaces. Returns undefined on failure.
|
|
@@ -165,4 +167,5 @@ export class TextureMapping {
|
|
|
165
167
|
}
|
|
166
168
|
TextureMapping.Params = Params;
|
|
167
169
|
})(TextureMapping || (TextureMapping = {}));
|
|
170
|
+
Object.freeze(TextureMapping.Trans2x3.identity);
|
|
168
171
|
//# sourceMappingURL=TextureMapping.js.map
|