-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12204 from CesiumGS/gpm-support
GPM 1.2 support
- Loading branch information
Showing
19 changed files
with
2,405 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
packages/engine/Source/Scene/Model/Extensions/Gpm/AnchorPointDirect.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import Check from "../../../../Core/Check.js"; | ||
|
||
/** | ||
* @typedef {object} AnchorPointDirect.ConstructorOptions | ||
* | ||
* Initialization options for the AnchorPointDirect constructor | ||
* | ||
* @property {Cartesian3} position Anchor point geographic coordinates | ||
* @property {Cartesian3} adjustmentParams The adjustment values in meters | ||
*/ | ||
|
||
/** | ||
* Metadata for one stored anchor point using direct storage. | ||
* | ||
* This reflects the `anchronPointDirect` definition of the | ||
* {@link https://nsgreg.nga.mil/csmwg.jsp|NGA_gpm_local} glTF extension. | ||
* | ||
* @constructor | ||
* @param {AnchorPointDirect.ConstructorOptions} options An object describing initialization options | ||
* @experimental This feature is not final and is subject to change without Cesium's standard deprecation policy. | ||
*/ | ||
function AnchorPointDirect(options) { | ||
//>>includeStart('debug', pragmas.debug); | ||
Check.typeOf.object("options.position", options.position); | ||
Check.typeOf.object("options.adjustmentParams", options.adjustmentParams); | ||
//>>includeEnd('debug'); | ||
|
||
this._position = options.position; | ||
this._adjustmentParams = options.adjustmentParams; | ||
} | ||
|
||
Object.defineProperties(AnchorPointDirect.prototype, { | ||
/** | ||
* Anchor point geographic coordinates in meters as X/Easting, Y/Northing, Z/HAE | ||
* | ||
* @memberof AnchorPointDirect.prototype | ||
* @type {Cartesian3} | ||
* @readonly | ||
*/ | ||
position: { | ||
get: function () { | ||
return this._position; | ||
}, | ||
}, | ||
|
||
/** | ||
* The delta-x delta-y delta-z adjustment values in meters per anchor | ||
* point. | ||
* | ||
* @memberof AnchorPointDirect.prototype | ||
* @type {Cartesian3} | ||
* @readonly | ||
*/ | ||
adjustmentParams: { | ||
get: function () { | ||
return this._adjustmentParams; | ||
}, | ||
}, | ||
}); | ||
|
||
export default AnchorPointDirect; |
77 changes: 77 additions & 0 deletions
77
packages/engine/Source/Scene/Model/Extensions/Gpm/AnchorPointIndirect.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
import Check from "../../../../Core/Check.js"; | ||
|
||
/** | ||
* @typedef {object} AnchorPointIndirect.ConstructorOptions | ||
* | ||
* Initialization options for the AnchorPointIndirect constructor | ||
* | ||
* @property {Cartesian3} position Anchor point geographic coordinates | ||
* @property {Cartesian3} adjustmentParams The adjustment values in meters | ||
* @property {Matrix3} covarianceMatrix The 3x3 covariance matrix | ||
*/ | ||
|
||
/** | ||
* Metadata for one stored anchor point. | ||
* | ||
* This reflects the `anchronPointIndirect` definition of the | ||
* {@link https://nsgreg.nga.mil/csmwg.jsp|NGA_gpm_local} glTF extension. | ||
* | ||
* @constructor | ||
* @param {AnchorPointIndirect.ConstructorOptions} options An object describing initialization options | ||
* @experimental This feature is not final and is subject to change without Cesium's standard deprecation policy. | ||
*/ | ||
function AnchorPointIndirect(options) { | ||
//>>includeStart('debug', pragmas.debug); | ||
Check.typeOf.object("options.position", options.position); | ||
Check.typeOf.object("options.adjustmentParams", options.adjustmentParams); | ||
Check.typeOf.object("options.covarianceMatrix", options.covarianceMatrix); | ||
//>>includeEnd('debug'); | ||
|
||
this._position = options.position; | ||
this._adjustmentParams = options.adjustmentParams; | ||
this._covarianceMatrix = options.covarianceMatrix; | ||
} | ||
|
||
Object.defineProperties(AnchorPointIndirect.prototype, { | ||
/** | ||
* Anchor point geographic coordinates in meters as X/Easting, Y/Northing, Z/HAE | ||
* | ||
* @memberof AnchorPointIndirect.prototype | ||
* @type {Cartesian3} | ||
* @readonly | ||
*/ | ||
position: { | ||
get: function () { | ||
return this._position; | ||
}, | ||
}, | ||
|
||
/** | ||
* The delta-x delta-y delta-z adjustment values in meters per anchor | ||
* point. | ||
* | ||
* @memberof AnchorPointIndirect.prototype | ||
* @type {Cartesian3} | ||
* @readonly | ||
*/ | ||
adjustmentParams: { | ||
get: function () { | ||
return this._adjustmentParams; | ||
}, | ||
}, | ||
|
||
/** | ||
* The 3x3 covariance matrix. | ||
* | ||
* @memberof AnchorPointIndirect.prototype | ||
* @type {Matrix3} | ||
* @readonly | ||
*/ | ||
covarianceMatrix: { | ||
get: function () { | ||
return this._covarianceMatrix; | ||
}, | ||
}, | ||
}); | ||
|
||
export default AnchorPointIndirect; |
81 changes: 81 additions & 0 deletions
81
packages/engine/Source/Scene/Model/Extensions/Gpm/CorrelationGroup.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
import Check from "../../../../Core/Check.js"; | ||
|
||
/** | ||
* @typedef {object} CorrelationGroup.ConstructorOptions | ||
* | ||
* Initialization options for the CorrelationGroup constructor | ||
* | ||
* @property {boolean[]} groupFlags Array of 3 booleans indicating if | ||
* parameters delta-x delta-y delta-z used in the correlation group | ||
* @property {Cartesian3} rotationThetas Rotations in milliradians | ||
* about X, Y, Z axes, respectively | ||
* @property {Spdcf[]} params Array of `Spdcf` (Strictly Positive-Definite | ||
* Correlation Function) parameters, for the U, V, W directions, respectively | ||
*/ | ||
|
||
/** | ||
* Metadata identifying parameters using same correlation modeling and | ||
* associated correlation parameters. | ||
* | ||
* This reflects the `correlationGroup` definition of the | ||
* {@link https://nsgreg.nga.mil/csmwg.jsp|NGA_gpm_local} glTF extension. | ||
* | ||
* @constructor | ||
* @param {CorrelationGroup.ConstructorOptions} options An object describing initialization options | ||
* @experimental This feature is not final and is subject to change without Cesium's standard deprecation policy. | ||
*/ | ||
function CorrelationGroup(options) { | ||
//>>includeStart('debug', pragmas.debug); | ||
Check.typeOf.object("options.groupFlags", options.groupFlags); | ||
Check.typeOf.object("options.rotationThetas", options.rotationThetas); | ||
Check.typeOf.object("options.params", options.params); | ||
//>>includeEnd('debug'); | ||
|
||
this._groupFlags = options.groupFlags; | ||
this._rotationThetas = options.rotationThetas; | ||
this._params = options.params; | ||
} | ||
|
||
Object.defineProperties(CorrelationGroup.prototype, { | ||
/** | ||
* Array of 3 booleans indicating if parameters delta-x delta-y delta-z | ||
* used in the correlation group | ||
* | ||
* @memberof CorrelationGroup.prototype | ||
* @type {boolean[]} | ||
* @readonly | ||
*/ | ||
groupFlags: { | ||
get: function () { | ||
return this._groupFlags; | ||
}, | ||
}, | ||
|
||
/** | ||
* Rotations in milliradians about X, Y, Z axes, respectively | ||
* | ||
* @memberof CorrelationGroup.prototype | ||
* @type {Cartesian3} | ||
* @readonly | ||
*/ | ||
rotationThetas: { | ||
get: function () { | ||
return this._rotationThetas; | ||
}, | ||
}, | ||
|
||
/** | ||
* Array of 3 sets of SPDCF parameters, for the U, V, W directions, respectively | ||
* | ||
* @memberof CorrelationGroup.prototype | ||
* @type {Spdcf[]} | ||
* @readonly | ||
*/ | ||
params: { | ||
get: function () { | ||
return this._params; | ||
}, | ||
}, | ||
}); | ||
|
||
export default CorrelationGroup; |
Oops, something went wrong.