EllipsoidGeometryUpdater.js 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452
  1. import Cartesian3 from '../Core/Cartesian3.js';
  2. import Check from '../Core/Check.js';
  3. import Color from '../Core/Color.js';
  4. import ColorGeometryInstanceAttribute from '../Core/ColorGeometryInstanceAttribute.js';
  5. import defaultValue from '../Core/defaultValue.js';
  6. import defined from '../Core/defined.js';
  7. import defineProperties from '../Core/defineProperties.js';
  8. import DistanceDisplayCondition from '../Core/DistanceDisplayCondition.js';
  9. import DistanceDisplayConditionGeometryInstanceAttribute from '../Core/DistanceDisplayConditionGeometryInstanceAttribute.js';
  10. import EllipsoidGeometry from '../Core/EllipsoidGeometry.js';
  11. import EllipsoidOutlineGeometry from '../Core/EllipsoidOutlineGeometry.js';
  12. import GeometryInstance from '../Core/GeometryInstance.js';
  13. import GeometryOffsetAttribute from '../Core/GeometryOffsetAttribute.js';
  14. import Iso8601 from '../Core/Iso8601.js';
  15. import Matrix4 from '../Core/Matrix4.js';
  16. import OffsetGeometryInstanceAttribute from '../Core/OffsetGeometryInstanceAttribute.js';
  17. import ShowGeometryInstanceAttribute from '../Core/ShowGeometryInstanceAttribute.js';
  18. import HeightReference from '../Scene/HeightReference.js';
  19. import MaterialAppearance from '../Scene/MaterialAppearance.js';
  20. import PerInstanceColorAppearance from '../Scene/PerInstanceColorAppearance.js';
  21. import Primitive from '../Scene/Primitive.js';
  22. import SceneMode from '../Scene/SceneMode.js';
  23. import ColorMaterialProperty from './ColorMaterialProperty.js';
  24. import DynamicGeometryUpdater from './DynamicGeometryUpdater.js';
  25. import GeometryUpdater from './GeometryUpdater.js';
  26. import heightReferenceOnEntityPropertyChanged from './heightReferenceOnEntityPropertyChanged.js';
  27. import MaterialProperty from './MaterialProperty.js';
  28. import Property from './Property.js';
  29. var defaultMaterial = new ColorMaterialProperty(Color.WHITE);
  30. var defaultOffset = Cartesian3.ZERO;
  31. var offsetScratch = new Cartesian3();
  32. var radiiScratch = new Cartesian3();
  33. var innerRadiiScratch = new Cartesian3();
  34. var scratchColor = new Color();
  35. var unitSphere = new Cartesian3(1, 1, 1);
  36. function EllipsoidGeometryOptions(entity) {
  37. this.id = entity;
  38. this.vertexFormat = undefined;
  39. this.radii = undefined;
  40. this.innerRadii = undefined;
  41. this.minimumClock = undefined;
  42. this.maximumClock = undefined;
  43. this.minimumCone = undefined;
  44. this.maximumCone = undefined;
  45. this.stackPartitions = undefined;
  46. this.slicePartitions = undefined;
  47. this.subdivisions = undefined;
  48. this.offsetAttribute = undefined;
  49. }
  50. /**
  51. * A {@link GeometryUpdater} for ellipsoids.
  52. * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.
  53. * @alias EllipsoidGeometryUpdater
  54. * @constructor
  55. *
  56. * @param {Entity} entity The entity containing the geometry to be visualized.
  57. * @param {Scene} scene The scene where visualization is taking place.
  58. */
  59. function EllipsoidGeometryUpdater(entity, scene) {
  60. GeometryUpdater.call(this, {
  61. entity : entity,
  62. scene : scene,
  63. geometryOptions : new EllipsoidGeometryOptions(entity),
  64. geometryPropertyName : 'ellipsoid',
  65. observedPropertyNames : ['availability', 'position', 'orientation', 'ellipsoid']
  66. });
  67. this._onEntityPropertyChanged(entity, 'ellipsoid', entity.ellipsoid, undefined);
  68. }
  69. if (defined(Object.create)) {
  70. EllipsoidGeometryUpdater.prototype = Object.create(GeometryUpdater.prototype);
  71. EllipsoidGeometryUpdater.prototype.constructor = EllipsoidGeometryUpdater;
  72. }
  73. defineProperties(EllipsoidGeometryUpdater.prototype, {
  74. /**
  75. * Gets the terrain offset property
  76. * @type {TerrainOffsetProperty}
  77. * @memberof EllipsoidGeometryUpdater.prototype
  78. * @readonly
  79. */
  80. terrainOffsetProperty : {
  81. get : function() {
  82. return this._terrainOffsetProperty;
  83. }
  84. }
  85. });
  86. /**
  87. * Creates the geometry instance which represents the fill of the geometry.
  88. *
  89. * @param {JulianDate} time The time to use when retrieving initial attribute values.
  90. * @param {Boolean} [skipModelMatrix=false] Whether to compute a model matrix for the geometry instance
  91. * @param {Matrix4} [modelMatrixResult] Used to store the result of the model matrix calculation
  92. * @returns {GeometryInstance} The geometry instance representing the filled portion of the geometry.
  93. *
  94. * @exception {DeveloperError} This instance does not represent a filled geometry.
  95. */
  96. EllipsoidGeometryUpdater.prototype.createFillGeometryInstance = function(time, skipModelMatrix, modelMatrixResult) {
  97. //>>includeStart('debug', pragmas.debug);
  98. Check.defined('time', time);
  99. //>>includeEnd('debug');
  100. var entity = this._entity;
  101. var isAvailable = entity.isAvailable(time);
  102. var color;
  103. var show = new ShowGeometryInstanceAttribute(isAvailable && entity.isShowing && this._showProperty.getValue(time) && this._fillProperty.getValue(time));
  104. var distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue(time);
  105. var distanceDisplayConditionAttribute = DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(distanceDisplayCondition);
  106. var attributes = {
  107. show : show,
  108. distanceDisplayCondition : distanceDisplayConditionAttribute,
  109. color : undefined,
  110. offset : undefined
  111. };
  112. if (this._materialProperty instanceof ColorMaterialProperty) {
  113. var currentColor;
  114. if (defined(this._materialProperty.color) && (this._materialProperty.color.isConstant || isAvailable)) {
  115. currentColor = this._materialProperty.color.getValue(time, scratchColor);
  116. }
  117. if (!defined(currentColor)) {
  118. currentColor = Color.WHITE;
  119. }
  120. color = ColorGeometryInstanceAttribute.fromColor(currentColor);
  121. attributes.color = color;
  122. }
  123. if (defined(this._options.offsetAttribute)) {
  124. attributes.offset = OffsetGeometryInstanceAttribute.fromCartesian3(Property.getValueOrDefault(this._terrainOffsetProperty, time, defaultOffset, offsetScratch));
  125. }
  126. return new GeometryInstance({
  127. id : entity,
  128. geometry : new EllipsoidGeometry(this._options),
  129. modelMatrix : skipModelMatrix ? undefined : entity.computeModelMatrixForHeightReference(time, entity.ellipsoid.heightReference, this._options.radii.z * 0.5, this._scene.mapProjection.ellipsoid, modelMatrixResult),
  130. attributes : attributes
  131. });
  132. };
  133. /**
  134. * Creates the geometry instance which represents the outline of the geometry.
  135. *
  136. * @param {JulianDate} time The time to use when retrieving initial attribute values.
  137. * @param {Boolean} [skipModelMatrix=false] Whether to compute a model matrix for the geometry instance
  138. * @param {Matrix4} [modelMatrixResult] Used to store the result of the model matrix calculation
  139. * @returns {GeometryInstance} The geometry instance representing the outline portion of the geometry.
  140. *
  141. * @exception {DeveloperError} This instance does not represent an outlined geometry.
  142. */
  143. EllipsoidGeometryUpdater.prototype.createOutlineGeometryInstance = function(time, skipModelMatrix, modelMatrixResult) {
  144. //>>includeStart('debug', pragmas.debug);
  145. Check.defined('time', time);
  146. //>>includeEnd('debug');
  147. var entity = this._entity;
  148. var isAvailable = entity.isAvailable(time);
  149. var outlineColor = Property.getValueOrDefault(this._outlineColorProperty, time, Color.BLACK, scratchColor);
  150. var distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue(time);
  151. var attributes = {
  152. show : new ShowGeometryInstanceAttribute(isAvailable && entity.isShowing && this._showProperty.getValue(time) && this._showOutlineProperty.getValue(time)),
  153. color : ColorGeometryInstanceAttribute.fromColor(outlineColor),
  154. distanceDisplayCondition : DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(distanceDisplayCondition),
  155. offset : undefined
  156. };
  157. if (defined(this._options.offsetAttribute)) {
  158. attributes.offset = OffsetGeometryInstanceAttribute.fromCartesian3(Property.getValueOrDefault(this._terrainOffsetProperty, time, defaultOffset, offsetScratch));
  159. }
  160. return new GeometryInstance({
  161. id : entity,
  162. geometry : new EllipsoidOutlineGeometry(this._options),
  163. modelMatrix : skipModelMatrix ? undefined : entity.computeModelMatrixForHeightReference(time, entity.ellipsoid.heightReference, this._options.radii.z * 0.5, this._scene.mapProjection.ellipsoid, modelMatrixResult),
  164. attributes : attributes
  165. });
  166. };
  167. EllipsoidGeometryUpdater.prototype._computeCenter = function(time, result) {
  168. return Property.getValueOrUndefined(this._entity.position, time, result);
  169. };
  170. EllipsoidGeometryUpdater.prototype._isHidden = function(entity, ellipsoid) {
  171. return !defined(entity.position) || !defined(ellipsoid.radii) || GeometryUpdater.prototype._isHidden.call(this, entity, ellipsoid);
  172. };
  173. EllipsoidGeometryUpdater.prototype._isDynamic = function(entity, ellipsoid) {
  174. return !entity.position.isConstant || //
  175. !Property.isConstant(entity.orientation) || //
  176. !ellipsoid.radii.isConstant || //
  177. !Property.isConstant(ellipsoid.innerRadii) || //
  178. !Property.isConstant(ellipsoid.stackPartitions) || //
  179. !Property.isConstant(ellipsoid.slicePartitions) || //
  180. !Property.isConstant(ellipsoid.outlineWidth) || //
  181. !Property.isConstant(ellipsoid.minimumClock) || //
  182. !Property.isConstant(ellipsoid.maximumClock) || //
  183. !Property.isConstant(ellipsoid.minimumCone) || //
  184. !Property.isConstant(ellipsoid.maximumCone) || //
  185. !Property.isConstant(ellipsoid.subdivisions);
  186. };
  187. EllipsoidGeometryUpdater.prototype._setStaticOptions = function(entity, ellipsoid) {
  188. var heightReference = Property.getValueOrDefault(ellipsoid.heightReference, Iso8601.MINIMUM_VALUE, HeightReference.NONE);
  189. var options = this._options;
  190. options.vertexFormat = this._materialProperty instanceof ColorMaterialProperty ? PerInstanceColorAppearance.VERTEX_FORMAT : MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat;
  191. options.radii = ellipsoid.radii.getValue(Iso8601.MINIMUM_VALUE, options.radii);
  192. options.innerRadii = Property.getValueOrUndefined(ellipsoid.innerRadii, options.radii);
  193. options.minimumClock = Property.getValueOrUndefined(ellipsoid.minimumClock, Iso8601.MINIMUM_VALUE);
  194. options.maximumClock = Property.getValueOrUndefined(ellipsoid.maximumClock, Iso8601.MINIMUM_VALUE);
  195. options.minimumCone = Property.getValueOrUndefined(ellipsoid.minimumCone, Iso8601.MINIMUM_VALUE);
  196. options.maximumCone = Property.getValueOrUndefined(ellipsoid.maximumCone, Iso8601.MINIMUM_VALUE);
  197. options.stackPartitions = Property.getValueOrUndefined(ellipsoid.stackPartitions, Iso8601.MINIMUM_VALUE);
  198. options.slicePartitions = Property.getValueOrUndefined(ellipsoid.slicePartitions, Iso8601.MINIMUM_VALUE);
  199. options.subdivisions = Property.getValueOrUndefined(ellipsoid.subdivisions, Iso8601.MINIMUM_VALUE);
  200. options.offsetAttribute = heightReference !== HeightReference.NONE ? GeometryOffsetAttribute.ALL : undefined;
  201. };
  202. EllipsoidGeometryUpdater.prototype._onEntityPropertyChanged = heightReferenceOnEntityPropertyChanged;
  203. EllipsoidGeometryUpdater.DynamicGeometryUpdater = DynamicEllipsoidGeometryUpdater;
  204. /**
  205. * @private
  206. */
  207. function DynamicEllipsoidGeometryUpdater(geometryUpdater, primitives, groundPrimitives) {
  208. DynamicGeometryUpdater.call(this, geometryUpdater, primitives, groundPrimitives);
  209. this._scene = geometryUpdater._scene;
  210. this._modelMatrix = new Matrix4();
  211. this._attributes = undefined;
  212. this._outlineAttributes = undefined;
  213. this._lastSceneMode = undefined;
  214. this._lastShow = undefined;
  215. this._lastOutlineShow = undefined;
  216. this._lastOutlineWidth = undefined;
  217. this._lastOutlineColor = undefined;
  218. this._lastOffset = new Cartesian3();
  219. this._material = {};
  220. }
  221. if (defined(Object.create)) {
  222. DynamicEllipsoidGeometryUpdater.prototype = Object.create(DynamicGeometryUpdater.prototype);
  223. DynamicEllipsoidGeometryUpdater.prototype.constructor = DynamicEllipsoidGeometryUpdater;
  224. }
  225. DynamicEllipsoidGeometryUpdater.prototype.update = function(time) {
  226. //>>includeStart('debug', pragmas.debug);
  227. Check.defined('time', time);
  228. //>>includeEnd('debug');
  229. var entity = this._entity;
  230. var ellipsoid = entity.ellipsoid;
  231. if (!entity.isShowing || !entity.isAvailable(time) || !Property.getValueOrDefault(ellipsoid.show, time, true)) {
  232. if (defined(this._primitive)) {
  233. this._primitive.show = false;
  234. }
  235. if (defined(this._outlinePrimitive)) {
  236. this._outlinePrimitive.show = false;
  237. }
  238. return;
  239. }
  240. var radii = Property.getValueOrUndefined(ellipsoid.radii, time, radiiScratch);
  241. var modelMatrix = defined(radii) ? entity.computeModelMatrixForHeightReference(time, ellipsoid.heightReference, radii.z * 0.5, this._scene.mapProjection.ellipsoid, this._modelMatrix) : undefined;
  242. if (!defined(modelMatrix) || !defined(radii)) {
  243. if (defined(this._primitive)) {
  244. this._primitive.show = false;
  245. }
  246. if (defined(this._outlinePrimitive)) {
  247. this._outlinePrimitive.show = false;
  248. }
  249. return;
  250. }
  251. //Compute attributes and material.
  252. var showFill = Property.getValueOrDefault(ellipsoid.fill, time, true);
  253. var showOutline = Property.getValueOrDefault(ellipsoid.outline, time, false);
  254. var outlineColor = Property.getValueOrClonedDefault(ellipsoid.outlineColor, time, Color.BLACK, scratchColor);
  255. var material = MaterialProperty.getValue(time, defaultValue(ellipsoid.material, defaultMaterial), this._material);
  256. // Check properties that could trigger a primitive rebuild.
  257. var innerRadii = Property.getValueOrUndefined(ellipsoid.innerRadii, time, innerRadiiScratch);
  258. var minimumClock = Property.getValueOrUndefined(ellipsoid.minimumClock, time);
  259. var maximumClock = Property.getValueOrUndefined(ellipsoid.maximumClock, time);
  260. var minimumCone = Property.getValueOrUndefined(ellipsoid.minimumCone, time);
  261. var maximumCone = Property.getValueOrUndefined(ellipsoid.maximumCone, time);
  262. var stackPartitions = Property.getValueOrUndefined(ellipsoid.stackPartitions, time);
  263. var slicePartitions = Property.getValueOrUndefined(ellipsoid.slicePartitions, time);
  264. var subdivisions = Property.getValueOrUndefined(ellipsoid.subdivisions, time);
  265. var outlineWidth = Property.getValueOrDefault(ellipsoid.outlineWidth, time, 1.0);
  266. var heightReference = Property.getValueOrDefault(ellipsoid.heightReference, time, HeightReference.NONE);
  267. var offsetAttribute = heightReference !== HeightReference.NONE ? GeometryOffsetAttribute.ALL : undefined;
  268. //In 3D we use a fast path by modifying Primitive.modelMatrix instead of regenerating the primitive every frame.
  269. //Also check for height reference because this method doesn't work when the height is relative to terrain.
  270. var sceneMode = this._scene.mode;
  271. var in3D = sceneMode === SceneMode.SCENE3D && heightReference === HeightReference.NONE;
  272. var options = this._options;
  273. var shadows = this._geometryUpdater.shadowsProperty.getValue(time);
  274. var distanceDisplayConditionProperty = this._geometryUpdater.distanceDisplayConditionProperty;
  275. var distanceDisplayCondition = distanceDisplayConditionProperty.getValue(time);
  276. var offset = Property.getValueOrDefault(this._geometryUpdater.terrainOffsetProperty, time, defaultOffset, offsetScratch);
  277. //We only rebuild the primitive if something other than the radii has changed
  278. //For the radii, we use unit sphere and then deform it with a scale matrix.
  279. var rebuildPrimitives = !in3D || this._lastSceneMode !== sceneMode || !defined(this._primitive) || //
  280. options.stackPartitions !== stackPartitions || options.slicePartitions !== slicePartitions || //
  281. defined(innerRadii) && !Cartesian3.equals(options.innerRadii !== innerRadii) || options.minimumClock !== minimumClock || //
  282. options.maximumClock !== maximumClock || options.minimumCone !== minimumCone || //
  283. options.maximumCone !== maximumCone || options.subdivisions !== subdivisions || //
  284. this._lastOutlineWidth !== outlineWidth || options.offsetAttribute !== offsetAttribute;
  285. if (rebuildPrimitives) {
  286. var primitives = this._primitives;
  287. primitives.removeAndDestroy(this._primitive);
  288. primitives.removeAndDestroy(this._outlinePrimitive);
  289. this._primitive = undefined;
  290. this._outlinePrimitive = undefined;
  291. this._lastSceneMode = sceneMode;
  292. this._lastOutlineWidth = outlineWidth;
  293. options.stackPartitions = stackPartitions;
  294. options.slicePartitions = slicePartitions;
  295. options.subdivisions = subdivisions;
  296. options.offsetAttribute = offsetAttribute;
  297. options.radii = Cartesian3.clone(in3D ? unitSphere : radii, options.radii);
  298. if (defined(innerRadii)) {
  299. if (in3D) {
  300. var mag = Cartesian3.magnitude(radii);
  301. options.innerRadii = Cartesian3.fromElements(innerRadii.x / mag, innerRadii.y / mag, innerRadii.z / mag, options.innerRadii);
  302. } else {
  303. options.innerRadii = Cartesian3.clone(innerRadii, options.innerRadii);
  304. }
  305. } else {
  306. options.innerRadii = undefined;
  307. }
  308. options.minimumClock = minimumClock;
  309. options.maximumClock = maximumClock;
  310. options.minimumCone = minimumCone;
  311. options.maximumCone = maximumCone;
  312. var appearance = new MaterialAppearance({
  313. material : material,
  314. translucent : material.isTranslucent(),
  315. closed : true
  316. });
  317. options.vertexFormat = appearance.vertexFormat;
  318. var fillInstance = this._geometryUpdater.createFillGeometryInstance(time, in3D, this._modelMatrix);
  319. this._primitive = primitives.add(new Primitive({
  320. geometryInstances : fillInstance,
  321. appearance : appearance,
  322. asynchronous : false,
  323. shadows : shadows
  324. }));
  325. var outlineInstance = this._geometryUpdater.createOutlineGeometryInstance(time, in3D, this._modelMatrix);
  326. this._outlinePrimitive = primitives.add(new Primitive({
  327. geometryInstances : outlineInstance,
  328. appearance : new PerInstanceColorAppearance({
  329. flat : true,
  330. translucent : outlineInstance.attributes.color.value[3] !== 255,
  331. renderState : {
  332. lineWidth : this._geometryUpdater._scene.clampLineWidth(outlineWidth)
  333. }
  334. }),
  335. asynchronous : false,
  336. shadows : shadows
  337. }));
  338. this._lastShow = showFill;
  339. this._lastOutlineShow = showOutline;
  340. this._lastOutlineColor = Color.clone(outlineColor, this._lastOutlineColor);
  341. this._lastDistanceDisplayCondition = distanceDisplayCondition;
  342. this._lastOffset = Cartesian3.clone(offset, this._lastOffset);
  343. } else if (this._primitive.ready) {
  344. //Update attributes only.
  345. var primitive = this._primitive;
  346. var outlinePrimitive = this._outlinePrimitive;
  347. primitive.show = true;
  348. outlinePrimitive.show = true;
  349. primitive.appearance.material = material;
  350. var attributes = this._attributes;
  351. if (!defined(attributes)) {
  352. attributes = primitive.getGeometryInstanceAttributes(entity);
  353. this._attributes = attributes;
  354. }
  355. if (showFill !== this._lastShow) {
  356. attributes.show = ShowGeometryInstanceAttribute.toValue(showFill, attributes.show);
  357. this._lastShow = showFill;
  358. }
  359. var outlineAttributes = this._outlineAttributes;
  360. if (!defined(outlineAttributes)) {
  361. outlineAttributes = outlinePrimitive.getGeometryInstanceAttributes(entity);
  362. this._outlineAttributes = outlineAttributes;
  363. }
  364. if (showOutline !== this._lastOutlineShow) {
  365. outlineAttributes.show = ShowGeometryInstanceAttribute.toValue(showOutline, outlineAttributes.show);
  366. this._lastOutlineShow = showOutline;
  367. }
  368. if (!Color.equals(outlineColor, this._lastOutlineColor)) {
  369. outlineAttributes.color = ColorGeometryInstanceAttribute.toValue(outlineColor, outlineAttributes.color);
  370. Color.clone(outlineColor, this._lastOutlineColor);
  371. }
  372. if (!DistanceDisplayCondition.equals(distanceDisplayCondition, this._lastDistanceDisplayCondition)) {
  373. attributes.distanceDisplayCondition = DistanceDisplayConditionGeometryInstanceAttribute.toValue(distanceDisplayCondition, attributes.distanceDisplayCondition);
  374. outlineAttributes.distanceDisplayCondition = DistanceDisplayConditionGeometryInstanceAttribute.toValue(distanceDisplayCondition, outlineAttributes.distanceDisplayCondition);
  375. DistanceDisplayCondition.clone(distanceDisplayCondition, this._lastDistanceDisplayCondition);
  376. }
  377. if (!Cartesian3.equals(offset, this._lastOffset)) {
  378. attributes.offset = OffsetGeometryInstanceAttribute.toValue(offset, attributes.offset);
  379. outlineAttributes.offset = OffsetGeometryInstanceAttribute.toValue(offset, attributes.offset);
  380. Cartesian3.clone(offset, this._lastOffset);
  381. }
  382. }
  383. if (in3D) {
  384. //Since we are scaling a unit sphere, we can't let any of the values go to zero.
  385. //Instead we clamp them to a small value. To the naked eye, this produces the same results
  386. //that you get passing EllipsoidGeometry a radii with a zero component.
  387. radii.x = Math.max(radii.x, 0.001);
  388. radii.y = Math.max(radii.y, 0.001);
  389. radii.z = Math.max(radii.z, 0.001);
  390. modelMatrix = Matrix4.multiplyByScale(modelMatrix, radii, modelMatrix);
  391. this._primitive.modelMatrix = modelMatrix;
  392. this._outlinePrimitive.modelMatrix = modelMatrix;
  393. }
  394. };
  395. export default EllipsoidGeometryUpdater;