Skip to content

Commit

Permalink
Upgrade to Cesium 1.99 and add dist files
Browse files Browse the repository at this point in the history
  • Loading branch information
Flowm committed Dec 25, 2022
1 parent 5d9aef5 commit 037c681
Show file tree
Hide file tree
Showing 6 changed files with 12,682 additions and 79 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@
.tmp/
coverage/
node_modules/
package-lock.json
74 changes: 37 additions & 37 deletions dist/cesium-sensor-volumes.es.js
Original file line number Diff line number Diff line change
Expand Up @@ -777,15 +777,15 @@ function removePrimitive(entity, hash, primitives) {
}
}

const defaultIntersectionColor = Color.WHITE;
const defaultIntersectionWidth = 1.0;
const defaultRadius = Number.POSITIVE_INFINITY;
const defaultIntersectionColor$2 = Color.WHITE;
const defaultIntersectionWidth$2 = 1.0;
const defaultRadius$2 = Number.POSITIVE_INFINITY;

const matrix3Scratch = new Matrix3();
const cachedPosition = new Cartesian3();
const cachedOrientation = new Quaternion();
const matrix3Scratch$2 = new Matrix3();
const cachedPosition$2 = new Cartesian3();
const cachedOrientation$2 = new Quaternion();

function assignSpherical(index, array, clock, cone) {
function assignSpherical$1(index, array, clock, cone) {
var spherical = array[index];
if (!defined(spherical)) {
spherical = new Spherical();
Expand All @@ -806,21 +806,21 @@ function computeDirections(primitive, minimumClockAngle, maximumClockAngle, inne
// No clock angle limits, so this is just a circle.
// There might be a hole but we're ignoring it for now.
for (angle = 0.0; angle < CesiumMath.TWO_PI; angle += angleStep) {
assignSpherical(i++, directions, angle, outerHalfAngle);
assignSpherical$1(i++, directions, angle, outerHalfAngle);
}
} else {
// There are clock angle limits.
for (angle = minimumClockAngle; angle < maximumClockAngle; angle += angleStep) {
assignSpherical(i++, directions, angle, outerHalfAngle);
assignSpherical$1(i++, directions, angle, outerHalfAngle);
}
assignSpherical(i++, directions, maximumClockAngle, outerHalfAngle);
assignSpherical$1(i++, directions, maximumClockAngle, outerHalfAngle);
if (innerHalfAngle) {
for (angle = maximumClockAngle; angle > minimumClockAngle; angle -= angleStep) {
assignSpherical(i++, directions, angle, innerHalfAngle);
assignSpherical$1(i++, directions, angle, innerHalfAngle);
}
assignSpherical(i++, directions, minimumClockAngle, innerHalfAngle);
assignSpherical$1(i++, directions, minimumClockAngle, innerHalfAngle);
} else {
assignSpherical(i++, directions, maximumClockAngle, 0.0);
assignSpherical$1(i++, directions, maximumClockAngle, 0.0);
}
}
directions.length = i;
Expand Down Expand Up @@ -884,8 +884,8 @@ ConicSensorVisualizer.prototype.update = function(time) {
var show = entity.isShowing && entity.isAvailable(time) && Property.getValueOrDefault(conicSensorGraphics._show, time, true);

if (show) {
position = Property.getValueOrUndefined(entity._position, time, cachedPosition);
orientation = Property.getValueOrUndefined(entity._orientation, time, cachedOrientation);
position = Property.getValueOrUndefined(entity._position, time, cachedPosition$2);
orientation = Property.getValueOrUndefined(entity._orientation, time, cachedOrientation$2);
show = defined(position) && defined(orientation);
}

Expand Down Expand Up @@ -916,7 +916,7 @@ ConicSensorVisualizer.prototype.update = function(time) {
}

if (!Cartesian3.equals(position, data.position) || !Quaternion.equals(orientation, data.orientation)) {
Matrix4.fromRotationTranslation(Matrix3.fromQuaternion(orientation, matrix3Scratch), position, primitive.modelMatrix);
Matrix4.fromRotationTranslation(Matrix3.fromQuaternion(orientation, matrix3Scratch$2), position, primitive.modelMatrix);
data.position = Cartesian3.clone(position, data.position);
data.orientation = Quaternion.clone(orientation, data.orientation);
}
Expand All @@ -939,10 +939,10 @@ ConicSensorVisualizer.prototype.update = function(time) {
data.minimumClockAngle = minimumClockAngle;
}

primitive.radius = Property.getValueOrDefault(conicSensorGraphics._radius, time, defaultRadius);
primitive.radius = Property.getValueOrDefault(conicSensorGraphics._radius, time, defaultRadius$2);
primitive.lateralSurfaceMaterial = MaterialProperty.getValue(time, conicSensorGraphics._lateralSurfaceMaterial, primitive.lateralSurfaceMaterial);
primitive.intersectionColor = Property.getValueOrClonedDefault(conicSensorGraphics._intersectionColor, time, defaultIntersectionColor, primitive.intersectionColor);
primitive.intersectionWidth = Property.getValueOrDefault(conicSensorGraphics._intersectionWidth, time, defaultIntersectionWidth);
primitive.intersectionColor = Property.getValueOrClonedDefault(conicSensorGraphics._intersectionColor, time, defaultIntersectionColor$2, primitive.intersectionColor);
primitive.intersectionWidth = Property.getValueOrDefault(conicSensorGraphics._intersectionWidth, time, defaultIntersectionWidth$2);
}
return true;
};
Expand Down Expand Up @@ -1446,7 +1446,7 @@ RectangularSensorGraphics.prototype.merge = function(source) {
this.lateralSurfaceMaterial = defaultValue(this.lateralSurfaceMaterial, source.lateralSurfaceMaterial);
};

function assignSpherical$1(index, array, clock, cone) {
function assignSpherical(index, array, clock, cone) {
var spherical = array[index];
if (!defined(spherical)) {
spherical = new Spherical();
Expand All @@ -1466,10 +1466,10 @@ function updateDirections(rectangularSensor) {
var theta = Math.atan(tanX / tanY);
var cone = Math.atan(Math.sqrt((tanX * tanX) + (tanY * tanY)));

assignSpherical$1(0, directions, theta, cone);
assignSpherical$1(1, directions, CesiumMath.toRadians(180.0) - theta, cone);
assignSpherical$1(2, directions, CesiumMath.toRadians(180.0) + theta, cone);
assignSpherical$1(3, directions, -theta, cone);
assignSpherical(0, directions, theta, cone);
assignSpherical(1, directions, CesiumMath.toRadians(180.0) - theta, cone);
assignSpherical(2, directions, CesiumMath.toRadians(180.0) + theta, cone);
assignSpherical(3, directions, -theta, cone);

directions.length = 4;
rectangularSensor._customSensor.directions = directions;
Expand Down Expand Up @@ -1611,13 +1611,13 @@ RectangularPyramidSensorVolume.prototype.destroy = function() {
return destroyObject(this);
};

const defaultIntersectionColor$2 = Color.WHITE;
const defaultIntersectionWidth$2 = 1.0;
const defaultRadius$2 = Number.POSITIVE_INFINITY;
const defaultIntersectionColor = Color.WHITE;
const defaultIntersectionWidth = 1.0;
const defaultRadius = Number.POSITIVE_INFINITY;

const matrix3Scratch$2 = new Matrix3();
const cachedPosition$2 = new Cartesian3();
const cachedOrientation$2 = new Quaternion();
const matrix3Scratch = new Matrix3();
const cachedPosition = new Cartesian3();
const cachedOrientation = new Quaternion();

/**
* A {@link Visualizer} which maps {@link Entity#rectangularSensor} to a {@link RectangularSensor}.
Expand Down Expand Up @@ -1676,8 +1676,8 @@ RectangularSensorVisualizer.prototype.update = function(time) {
var show = entity.isShowing && entity.isAvailable(time) && Property.getValueOrDefault(rectangularSensorGraphics._show, time, true);

if (show) {
position = Property.getValueOrUndefined(entity._position, time, cachedPosition$2);
orientation = Property.getValueOrUndefined(entity._orientation, time, cachedOrientation$2);
position = Property.getValueOrUndefined(entity._position, time, cachedPosition);
orientation = Property.getValueOrUndefined(entity._orientation, time, cachedOrientation);
show = defined(position) && defined(orientation);
}

Expand All @@ -1704,18 +1704,18 @@ RectangularSensorVisualizer.prototype.update = function(time) {
}

if (!Cartesian3.equals(position, data.position) || !Quaternion.equals(orientation, data.orientation)) {
Matrix4.fromRotationTranslation(Matrix3.fromQuaternion(orientation, matrix3Scratch$2), position, primitive.modelMatrix);
Matrix4.fromRotationTranslation(Matrix3.fromQuaternion(orientation, matrix3Scratch), position, primitive.modelMatrix);
data.position = Cartesian3.clone(position, data.position);
data.orientation = Quaternion.clone(orientation, data.orientation);
}

primitive.show = true;
primitive.xHalfAngle = Property.getValueOrDefault(rectangularSensorGraphics._xHalfAngle, time, CesiumMath.PI_OVER_TWO);
primitive.yHalfAngle = Property.getValueOrDefault(rectangularSensorGraphics._yHalfAngle, time, CesiumMath.PI_OVER_TWO);
primitive.radius = Property.getValueOrDefault(rectangularSensorGraphics._radius, time, defaultRadius$2);
primitive.radius = Property.getValueOrDefault(rectangularSensorGraphics._radius, time, defaultRadius);
primitive.lateralSurfaceMaterial = MaterialProperty.getValue(time, rectangularSensorGraphics._lateralSurfaceMaterial, primitive.lateralSurfaceMaterial);
primitive.intersectionColor = Property.getValueOrClonedDefault(rectangularSensorGraphics._intersectionColor, time, defaultIntersectionColor$2, primitive.intersectionColor);
primitive.intersectionWidth = Property.getValueOrDefault(rectangularSensorGraphics._intersectionWidth, time, defaultIntersectionWidth$2);
primitive.intersectionColor = Property.getValueOrClonedDefault(rectangularSensorGraphics._intersectionColor, time, defaultIntersectionColor, primitive.intersectionColor);
primitive.intersectionWidth = Property.getValueOrDefault(rectangularSensorGraphics._intersectionWidth, time, defaultIntersectionWidth);
}
return true;
};
Expand Down Expand Up @@ -1954,4 +1954,4 @@ var cesiumSensorVolumes = {
RectangularSensorVisualizer
};

export default cesiumSensorVolumes;
export { cesiumSensorVolumes as default };
2 changes: 1 addition & 1 deletion dist/cesium-sensor-volumes.es.min.js

Large diffs are not rendered by default.

76 changes: 38 additions & 38 deletions dist/cesium-sensor-volumes.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.CesiumSensorVolumes = factory());
}(this, (function () { 'use strict';
})(this, (function () { 'use strict';

/**
* Cesium Sensor Volumes - https://github.com/Flowm/cesium-sensor-volumes
Expand Down Expand Up @@ -783,15 +783,15 @@
}
}

const defaultIntersectionColor = Color.WHITE;
const defaultIntersectionWidth = 1.0;
const defaultRadius = Number.POSITIVE_INFINITY;
const defaultIntersectionColor$2 = Color.WHITE;
const defaultIntersectionWidth$2 = 1.0;
const defaultRadius$2 = Number.POSITIVE_INFINITY;

const matrix3Scratch = new Matrix3();
const cachedPosition = new Cartesian3();
const cachedOrientation = new Quaternion();
const matrix3Scratch$2 = new Matrix3();
const cachedPosition$2 = new Cartesian3();
const cachedOrientation$2 = new Quaternion();

function assignSpherical(index, array, clock, cone) {
function assignSpherical$1(index, array, clock, cone) {
var spherical = array[index];
if (!defined(spherical)) {
spherical = new Spherical();
Expand All @@ -812,21 +812,21 @@
// No clock angle limits, so this is just a circle.
// There might be a hole but we're ignoring it for now.
for (angle = 0.0; angle < CesiumMath.TWO_PI; angle += angleStep) {
assignSpherical(i++, directions, angle, outerHalfAngle);
assignSpherical$1(i++, directions, angle, outerHalfAngle);
}
} else {
// There are clock angle limits.
for (angle = minimumClockAngle; angle < maximumClockAngle; angle += angleStep) {
assignSpherical(i++, directions, angle, outerHalfAngle);
assignSpherical$1(i++, directions, angle, outerHalfAngle);
}
assignSpherical(i++, directions, maximumClockAngle, outerHalfAngle);
assignSpherical$1(i++, directions, maximumClockAngle, outerHalfAngle);
if (innerHalfAngle) {
for (angle = maximumClockAngle; angle > minimumClockAngle; angle -= angleStep) {
assignSpherical(i++, directions, angle, innerHalfAngle);
assignSpherical$1(i++, directions, angle, innerHalfAngle);
}
assignSpherical(i++, directions, minimumClockAngle, innerHalfAngle);
assignSpherical$1(i++, directions, minimumClockAngle, innerHalfAngle);
} else {
assignSpherical(i++, directions, maximumClockAngle, 0.0);
assignSpherical$1(i++, directions, maximumClockAngle, 0.0);
}
}
directions.length = i;
Expand Down Expand Up @@ -890,8 +890,8 @@
var show = entity.isShowing && entity.isAvailable(time) && Property.getValueOrDefault(conicSensorGraphics._show, time, true);

if (show) {
position = Property.getValueOrUndefined(entity._position, time, cachedPosition);
orientation = Property.getValueOrUndefined(entity._orientation, time, cachedOrientation);
position = Property.getValueOrUndefined(entity._position, time, cachedPosition$2);
orientation = Property.getValueOrUndefined(entity._orientation, time, cachedOrientation$2);
show = defined(position) && defined(orientation);
}

Expand Down Expand Up @@ -922,7 +922,7 @@
}

if (!Cartesian3.equals(position, data.position) || !Quaternion.equals(orientation, data.orientation)) {
Matrix4.fromRotationTranslation(Matrix3.fromQuaternion(orientation, matrix3Scratch), position, primitive.modelMatrix);
Matrix4.fromRotationTranslation(Matrix3.fromQuaternion(orientation, matrix3Scratch$2), position, primitive.modelMatrix);
data.position = Cartesian3.clone(position, data.position);
data.orientation = Quaternion.clone(orientation, data.orientation);
}
Expand All @@ -945,10 +945,10 @@
data.minimumClockAngle = minimumClockAngle;
}

primitive.radius = Property.getValueOrDefault(conicSensorGraphics._radius, time, defaultRadius);
primitive.radius = Property.getValueOrDefault(conicSensorGraphics._radius, time, defaultRadius$2);
primitive.lateralSurfaceMaterial = MaterialProperty.getValue(time, conicSensorGraphics._lateralSurfaceMaterial, primitive.lateralSurfaceMaterial);
primitive.intersectionColor = Property.getValueOrClonedDefault(conicSensorGraphics._intersectionColor, time, defaultIntersectionColor, primitive.intersectionColor);
primitive.intersectionWidth = Property.getValueOrDefault(conicSensorGraphics._intersectionWidth, time, defaultIntersectionWidth);
primitive.intersectionColor = Property.getValueOrClonedDefault(conicSensorGraphics._intersectionColor, time, defaultIntersectionColor$2, primitive.intersectionColor);
primitive.intersectionWidth = Property.getValueOrDefault(conicSensorGraphics._intersectionWidth, time, defaultIntersectionWidth$2);
}
return true;
};
Expand Down Expand Up @@ -1452,7 +1452,7 @@
this.lateralSurfaceMaterial = defaultValue(this.lateralSurfaceMaterial, source.lateralSurfaceMaterial);
};

function assignSpherical$1(index, array, clock, cone) {
function assignSpherical(index, array, clock, cone) {
var spherical = array[index];
if (!defined(spherical)) {
spherical = new Spherical();
Expand All @@ -1472,10 +1472,10 @@
var theta = Math.atan(tanX / tanY);
var cone = Math.atan(Math.sqrt((tanX * tanX) + (tanY * tanY)));

assignSpherical$1(0, directions, theta, cone);
assignSpherical$1(1, directions, CesiumMath.toRadians(180.0) - theta, cone);
assignSpherical$1(2, directions, CesiumMath.toRadians(180.0) + theta, cone);
assignSpherical$1(3, directions, -theta, cone);
assignSpherical(0, directions, theta, cone);
assignSpherical(1, directions, CesiumMath.toRadians(180.0) - theta, cone);
assignSpherical(2, directions, CesiumMath.toRadians(180.0) + theta, cone);
assignSpherical(3, directions, -theta, cone);

directions.length = 4;
rectangularSensor._customSensor.directions = directions;
Expand Down Expand Up @@ -1617,13 +1617,13 @@
return destroyObject(this);
};

const defaultIntersectionColor$2 = Color.WHITE;
const defaultIntersectionWidth$2 = 1.0;
const defaultRadius$2 = Number.POSITIVE_INFINITY;
const defaultIntersectionColor = Color.WHITE;
const defaultIntersectionWidth = 1.0;
const defaultRadius = Number.POSITIVE_INFINITY;

const matrix3Scratch$2 = new Matrix3();
const cachedPosition$2 = new Cartesian3();
const cachedOrientation$2 = new Quaternion();
const matrix3Scratch = new Matrix3();
const cachedPosition = new Cartesian3();
const cachedOrientation = new Quaternion();

/**
* A {@link Visualizer} which maps {@link Entity#rectangularSensor} to a {@link RectangularSensor}.
Expand Down Expand Up @@ -1682,8 +1682,8 @@
var show = entity.isShowing && entity.isAvailable(time) && Property.getValueOrDefault(rectangularSensorGraphics._show, time, true);

if (show) {
position = Property.getValueOrUndefined(entity._position, time, cachedPosition$2);
orientation = Property.getValueOrUndefined(entity._orientation, time, cachedOrientation$2);
position = Property.getValueOrUndefined(entity._position, time, cachedPosition);
orientation = Property.getValueOrUndefined(entity._orientation, time, cachedOrientation);
show = defined(position) && defined(orientation);
}

Expand All @@ -1710,18 +1710,18 @@
}

if (!Cartesian3.equals(position, data.position) || !Quaternion.equals(orientation, data.orientation)) {
Matrix4.fromRotationTranslation(Matrix3.fromQuaternion(orientation, matrix3Scratch$2), position, primitive.modelMatrix);
Matrix4.fromRotationTranslation(Matrix3.fromQuaternion(orientation, matrix3Scratch), position, primitive.modelMatrix);
data.position = Cartesian3.clone(position, data.position);
data.orientation = Quaternion.clone(orientation, data.orientation);
}

primitive.show = true;
primitive.xHalfAngle = Property.getValueOrDefault(rectangularSensorGraphics._xHalfAngle, time, CesiumMath.PI_OVER_TWO);
primitive.yHalfAngle = Property.getValueOrDefault(rectangularSensorGraphics._yHalfAngle, time, CesiumMath.PI_OVER_TWO);
primitive.radius = Property.getValueOrDefault(rectangularSensorGraphics._radius, time, defaultRadius$2);
primitive.radius = Property.getValueOrDefault(rectangularSensorGraphics._radius, time, defaultRadius);
primitive.lateralSurfaceMaterial = MaterialProperty.getValue(time, rectangularSensorGraphics._lateralSurfaceMaterial, primitive.lateralSurfaceMaterial);
primitive.intersectionColor = Property.getValueOrClonedDefault(rectangularSensorGraphics._intersectionColor, time, defaultIntersectionColor$2, primitive.intersectionColor);
primitive.intersectionWidth = Property.getValueOrDefault(rectangularSensorGraphics._intersectionWidth, time, defaultIntersectionWidth$2);
primitive.intersectionColor = Property.getValueOrClonedDefault(rectangularSensorGraphics._intersectionColor, time, defaultIntersectionColor, primitive.intersectionColor);
primitive.intersectionWidth = Property.getValueOrDefault(rectangularSensorGraphics._intersectionWidth, time, defaultIntersectionWidth);
}
return true;
};
Expand Down Expand Up @@ -1962,4 +1962,4 @@

return cesiumSensorVolumes;

})));
}));
Loading

0 comments on commit 037c681

Please sign in to comment.