123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133 |
- import Cartesian3 from "../Core/Cartesian3.js";
- import defined from "../Core/defined.js";
- import DeveloperError from "../Core/DeveloperError.js";
- import Matrix3 from "../Core/Matrix3.js";
- import ReferenceFrame from "../Core/ReferenceFrame.js";
- import Transforms from "../Core/Transforms.js";
- function PositionProperty() {
- DeveloperError.throwInstantiationError();
- }
- Object.defineProperties(PositionProperty.prototype, {
-
- isConstant: {
- get: DeveloperError.throwInstantiationError,
- },
-
- definitionChanged: {
- get: DeveloperError.throwInstantiationError,
- },
-
- referenceFrame: {
- get: DeveloperError.throwInstantiationError,
- },
- });
- PositionProperty.prototype.getValue = DeveloperError.throwInstantiationError;
- PositionProperty.prototype.getValueInReferenceFrame =
- DeveloperError.throwInstantiationError;
- PositionProperty.prototype.equals = DeveloperError.throwInstantiationError;
- var scratchMatrix3 = new Matrix3();
- PositionProperty.convertToReferenceFrame = function (
- time,
- value,
- inputFrame,
- outputFrame,
- result
- ) {
- if (!defined(value)) {
- return value;
- }
- if (!defined(result)) {
- result = new Cartesian3();
- }
- if (inputFrame === outputFrame) {
- return Cartesian3.clone(value, result);
- }
- var icrfToFixed = Transforms.computeIcrfToFixedMatrix(time, scratchMatrix3);
- if (!defined(icrfToFixed)) {
- icrfToFixed = Transforms.computeTemeToPseudoFixedMatrix(
- time,
- scratchMatrix3
- );
- }
- if (inputFrame === ReferenceFrame.INERTIAL) {
- return Matrix3.multiplyByVector(icrfToFixed, value, result);
- }
- if (inputFrame === ReferenceFrame.FIXED) {
- return Matrix3.multiplyByVector(
- Matrix3.transpose(icrfToFixed, scratchMatrix3),
- value,
- result
- );
- }
- };
- export default PositionProperty;
|