PointPrimitive.js 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590
  1. import BoundingRectangle from '../Core/BoundingRectangle.js';
  2. import Cartesian2 from '../Core/Cartesian2.js';
  3. import Cartesian3 from '../Core/Cartesian3.js';
  4. import Cartesian4 from '../Core/Cartesian4.js';
  5. import Color from '../Core/Color.js';
  6. import defaultValue from '../Core/defaultValue.js';
  7. import defined from '../Core/defined.js';
  8. import defineProperties from '../Core/defineProperties.js';
  9. import DeveloperError from '../Core/DeveloperError.js';
  10. import DistanceDisplayCondition from '../Core/DistanceDisplayCondition.js';
  11. import Matrix4 from '../Core/Matrix4.js';
  12. import NearFarScalar from '../Core/NearFarScalar.js';
  13. import SceneMode from './SceneMode.js';
  14. import SceneTransforms from './SceneTransforms.js';
  15. /**
  16. * A graphical point positioned in the 3D scene, that is created
  17. * and rendered using a {@link PointPrimitiveCollection}. A point is created and its initial
  18. * properties are set by calling {@link PointPrimitiveCollection#add}.
  19. *
  20. * @alias PointPrimitive
  21. *
  22. * @performance Reading a property, e.g., {@link PointPrimitive#show}, is constant time.
  23. * Assigning to a property is constant time but results in
  24. * CPU to GPU traffic when {@link PointPrimitiveCollection#update} is called. The per-pointPrimitive traffic is
  25. * the same regardless of how many properties were updated. If most pointPrimitives in a collection need to be
  26. * updated, it may be more efficient to clear the collection with {@link PointPrimitiveCollection#removeAll}
  27. * and add new pointPrimitives instead of modifying each one.
  28. *
  29. * @exception {DeveloperError} scaleByDistance.far must be greater than scaleByDistance.near
  30. * @exception {DeveloperError} translucencyByDistance.far must be greater than translucencyByDistance.near
  31. * @exception {DeveloperError} distanceDisplayCondition.far must be greater than distanceDisplayCondition.near
  32. *
  33. * @see PointPrimitiveCollection
  34. * @see PointPrimitiveCollection#add
  35. *
  36. * @internalConstructor
  37. * @class
  38. *
  39. * @demo {@link https://sandcastle.cesium.com/index.html?src=Points.html|Cesium Sandcastle Points Demo}
  40. */
  41. function PointPrimitive(options, pointPrimitiveCollection) {
  42. options = defaultValue(options, defaultValue.EMPTY_OBJECT);
  43. //>>includeStart('debug', pragmas.debug);
  44. if (defined(options.disableDepthTestDistance) && options.disableDepthTestDistance < 0.0) {
  45. throw new DeveloperError('disableDepthTestDistance must be greater than or equal to 0.0.');
  46. }
  47. //>>includeEnd('debug');
  48. var translucencyByDistance = options.translucencyByDistance;
  49. var scaleByDistance = options.scaleByDistance;
  50. var distanceDisplayCondition = options.distanceDisplayCondition;
  51. if (defined(translucencyByDistance)) {
  52. //>>includeStart('debug', pragmas.debug);
  53. if (translucencyByDistance.far <= translucencyByDistance.near) {
  54. throw new DeveloperError('translucencyByDistance.far must be greater than translucencyByDistance.near.');
  55. }
  56. //>>includeEnd('debug');
  57. translucencyByDistance = NearFarScalar.clone(translucencyByDistance);
  58. }
  59. if (defined(scaleByDistance)) {
  60. //>>includeStart('debug', pragmas.debug);
  61. if (scaleByDistance.far <= scaleByDistance.near) {
  62. throw new DeveloperError('scaleByDistance.far must be greater than scaleByDistance.near.');
  63. }
  64. //>>includeEnd('debug');
  65. scaleByDistance = NearFarScalar.clone(scaleByDistance);
  66. }
  67. if (defined(distanceDisplayCondition)) {
  68. //>>includeStart('debug', pragmas.debug);
  69. if (distanceDisplayCondition.far <= distanceDisplayCondition.near) {
  70. throw new DeveloperError('distanceDisplayCondition.far must be greater than distanceDisplayCondition.near.');
  71. }
  72. //>>includeEnd('debug');
  73. distanceDisplayCondition = DistanceDisplayCondition.clone(distanceDisplayCondition);
  74. }
  75. this._show = defaultValue(options.show, true);
  76. this._position = Cartesian3.clone(defaultValue(options.position, Cartesian3.ZERO));
  77. this._actualPosition = Cartesian3.clone(this._position); // For columbus view and 2D
  78. this._color = Color.clone(defaultValue(options.color, Color.WHITE));
  79. this._outlineColor = Color.clone(defaultValue(options.outlineColor, Color.TRANSPARENT));
  80. this._outlineWidth = defaultValue(options.outlineWidth, 0.0);
  81. this._pixelSize = defaultValue(options.pixelSize, 10.0);
  82. this._scaleByDistance = scaleByDistance;
  83. this._translucencyByDistance = translucencyByDistance;
  84. this._distanceDisplayCondition = distanceDisplayCondition;
  85. this._disableDepthTestDistance = defaultValue(options.disableDepthTestDistance, 0.0);
  86. this._id = options.id;
  87. this._collection = defaultValue(options.collection, pointPrimitiveCollection);
  88. this._clusterShow = true;
  89. this._pickId = undefined;
  90. this._pointPrimitiveCollection = pointPrimitiveCollection;
  91. this._dirty = false;
  92. this._index = -1; //Used only by PointPrimitiveCollection
  93. }
  94. var SHOW_INDEX = PointPrimitive.SHOW_INDEX = 0;
  95. var POSITION_INDEX = PointPrimitive.POSITION_INDEX = 1;
  96. var COLOR_INDEX = PointPrimitive.COLOR_INDEX = 2;
  97. var OUTLINE_COLOR_INDEX = PointPrimitive.OUTLINE_COLOR_INDEX = 3;
  98. var OUTLINE_WIDTH_INDEX = PointPrimitive.OUTLINE_WIDTH_INDEX = 4;
  99. var PIXEL_SIZE_INDEX = PointPrimitive.PIXEL_SIZE_INDEX = 5;
  100. var SCALE_BY_DISTANCE_INDEX = PointPrimitive.SCALE_BY_DISTANCE_INDEX = 6;
  101. var TRANSLUCENCY_BY_DISTANCE_INDEX = PointPrimitive.TRANSLUCENCY_BY_DISTANCE_INDEX = 7;
  102. var DISTANCE_DISPLAY_CONDITION_INDEX = PointPrimitive.DISTANCE_DISPLAY_CONDITION_INDEX = 8;
  103. var DISABLE_DEPTH_DISTANCE_INDEX = PointPrimitive.DISABLE_DEPTH_DISTANCE_INDEX = 9;
  104. PointPrimitive.NUMBER_OF_PROPERTIES = 10;
  105. function makeDirty(pointPrimitive, propertyChanged) {
  106. var pointPrimitiveCollection = pointPrimitive._pointPrimitiveCollection;
  107. if (defined(pointPrimitiveCollection)) {
  108. pointPrimitiveCollection._updatePointPrimitive(pointPrimitive, propertyChanged);
  109. pointPrimitive._dirty = true;
  110. }
  111. }
  112. defineProperties(PointPrimitive.prototype, {
  113. /**
  114. * Determines if this point will be shown. Use this to hide or show a point, instead
  115. * of removing it and re-adding it to the collection.
  116. * @memberof PointPrimitive.prototype
  117. * @type {Boolean}
  118. */
  119. show : {
  120. get : function() {
  121. return this._show;
  122. },
  123. set : function(value) {
  124. //>>includeStart('debug', pragmas.debug);
  125. if (!defined(value)) {
  126. throw new DeveloperError('value is required.');
  127. }
  128. //>>includeEnd('debug');
  129. if (this._show !== value) {
  130. this._show = value;
  131. makeDirty(this, SHOW_INDEX);
  132. }
  133. }
  134. },
  135. /**
  136. * Gets or sets the Cartesian position of this point.
  137. * @memberof PointPrimitive.prototype
  138. * @type {Cartesian3}
  139. */
  140. position : {
  141. get : function() {
  142. return this._position;
  143. },
  144. set : function(value) {
  145. //>>includeStart('debug', pragmas.debug)
  146. if (!defined(value)) {
  147. throw new DeveloperError('value is required.');
  148. }
  149. //>>includeEnd('debug');
  150. var position = this._position;
  151. if (!Cartesian3.equals(position, value)) {
  152. Cartesian3.clone(value, position);
  153. Cartesian3.clone(value, this._actualPosition);
  154. makeDirty(this, POSITION_INDEX);
  155. }
  156. }
  157. },
  158. /**
  159. * Gets or sets near and far scaling properties of a point based on the point's distance from the camera.
  160. * A point's scale will interpolate between the {@link NearFarScalar#nearValue} and
  161. * {@link NearFarScalar#farValue} while the camera distance falls within the upper and lower bounds
  162. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  163. * Outside of these ranges the point's scale remains clamped to the nearest bound. This scale
  164. * multiplies the pixelSize and outlineWidth to affect the total size of the point. If undefined,
  165. * scaleByDistance will be disabled.
  166. * @memberof PointPrimitive.prototype
  167. * @type {NearFarScalar}
  168. *
  169. * @example
  170. * // Example 1.
  171. * // Set a pointPrimitive's scaleByDistance to scale to 15 when the
  172. * // camera is 1500 meters from the pointPrimitive and disappear as
  173. * // the camera distance approaches 8.0e6 meters.
  174. * p.scaleByDistance = new Cesium.NearFarScalar(1.5e2, 15, 8.0e6, 0.0);
  175. *
  176. * @example
  177. * // Example 2.
  178. * // disable scaling by distance
  179. * p.scaleByDistance = undefined;
  180. */
  181. scaleByDistance : {
  182. get : function() {
  183. return this._scaleByDistance;
  184. },
  185. set : function(value) {
  186. //>>includeStart('debug', pragmas.debug);
  187. if (defined(value) && value.far <= value.near) {
  188. throw new DeveloperError('far distance must be greater than near distance.');
  189. }
  190. //>>includeEnd('debug');
  191. var scaleByDistance = this._scaleByDistance;
  192. if (!NearFarScalar.equals(scaleByDistance, value)) {
  193. this._scaleByDistance = NearFarScalar.clone(value, scaleByDistance);
  194. makeDirty(this, SCALE_BY_DISTANCE_INDEX);
  195. }
  196. }
  197. },
  198. /**
  199. * Gets or sets near and far translucency properties of a point based on the point's distance from the camera.
  200. * A point's translucency will interpolate between the {@link NearFarScalar#nearValue} and
  201. * {@link NearFarScalar#farValue} while the camera distance falls within the upper and lower bounds
  202. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  203. * Outside of these ranges the point's translucency remains clamped to the nearest bound. If undefined,
  204. * translucencyByDistance will be disabled.
  205. * @memberof PointPrimitive.prototype
  206. * @type {NearFarScalar}
  207. *
  208. * @example
  209. * // Example 1.
  210. * // Set a point's translucency to 1.0 when the
  211. * // camera is 1500 meters from the point and disappear as
  212. * // the camera distance approaches 8.0e6 meters.
  213. * p.translucencyByDistance = new Cesium.NearFarScalar(1.5e2, 1.0, 8.0e6, 0.0);
  214. *
  215. * @example
  216. * // Example 2.
  217. * // disable translucency by distance
  218. * p.translucencyByDistance = undefined;
  219. */
  220. translucencyByDistance : {
  221. get : function() {
  222. return this._translucencyByDistance;
  223. },
  224. set : function(value) {
  225. //>>includeStart('debug', pragmas.debug);
  226. if (defined(value) && value.far <= value.near) {
  227. throw new DeveloperError('far distance must be greater than near distance.');
  228. }
  229. //>>includeEnd('debug');
  230. var translucencyByDistance = this._translucencyByDistance;
  231. if (!NearFarScalar.equals(translucencyByDistance, value)) {
  232. this._translucencyByDistance = NearFarScalar.clone(value, translucencyByDistance);
  233. makeDirty(this, TRANSLUCENCY_BY_DISTANCE_INDEX);
  234. }
  235. }
  236. },
  237. /**
  238. * Gets or sets the inner size of the point in pixels.
  239. * @memberof PointPrimitive.prototype
  240. * @type {Number}
  241. */
  242. pixelSize : {
  243. get : function() {
  244. return this._pixelSize;
  245. },
  246. set : function(value) {
  247. //>>includeStart('debug', pragmas.debug);
  248. if (!defined(value)) {
  249. throw new DeveloperError('value is required.');
  250. }
  251. //>>includeEnd('debug');
  252. if (this._pixelSize !== value) {
  253. this._pixelSize = value;
  254. makeDirty(this, PIXEL_SIZE_INDEX);
  255. }
  256. }
  257. },
  258. /**
  259. * Gets or sets the inner color of the point.
  260. * The red, green, blue, and alpha values are indicated by <code>value</code>'s <code>red</code>, <code>green</code>,
  261. * <code>blue</code>, and <code>alpha</code> properties as shown in Example 1. These components range from <code>0.0</code>
  262. * (no intensity) to <code>1.0</code> (full intensity).
  263. * @memberof PointPrimitive.prototype
  264. * @type {Color}
  265. *
  266. * @example
  267. * // Example 1. Assign yellow.
  268. * p.color = Cesium.Color.YELLOW;
  269. *
  270. * @example
  271. * // Example 2. Make a pointPrimitive 50% translucent.
  272. * p.color = new Cesium.Color(1.0, 1.0, 1.0, 0.5);
  273. */
  274. color : {
  275. get : function() {
  276. return this._color;
  277. },
  278. set : function(value) {
  279. //>>includeStart('debug', pragmas.debug);
  280. if (!defined(value)) {
  281. throw new DeveloperError('value is required.');
  282. }
  283. //>>includeEnd('debug');
  284. var color = this._color;
  285. if (!Color.equals(color, value)) {
  286. Color.clone(value, color);
  287. makeDirty(this, COLOR_INDEX);
  288. }
  289. }
  290. },
  291. /**
  292. * Gets or sets the outline color of the point.
  293. * @memberof PointPrimitive.prototype
  294. * @type {Color}
  295. */
  296. outlineColor : {
  297. get : function() {
  298. return this._outlineColor;
  299. },
  300. set : function(value) {
  301. //>>includeStart('debug', pragmas.debug);
  302. if (!defined(value)) {
  303. throw new DeveloperError('value is required.');
  304. }
  305. //>>includeEnd('debug');
  306. var outlineColor = this._outlineColor;
  307. if (!Color.equals(outlineColor, value)) {
  308. Color.clone(value, outlineColor);
  309. makeDirty(this, OUTLINE_COLOR_INDEX);
  310. }
  311. }
  312. },
  313. /**
  314. * Gets or sets the outline width in pixels. This width adds to pixelSize,
  315. * increasing the total size of the point.
  316. * @memberof PointPrimitive.prototype
  317. * @type {Number}
  318. */
  319. outlineWidth : {
  320. get : function() {
  321. return this._outlineWidth;
  322. },
  323. set : function(value) {
  324. //>>includeStart('debug', pragmas.debug);
  325. if (!defined(value)) {
  326. throw new DeveloperError('value is required.');
  327. }
  328. //>>includeEnd('debug');
  329. if (this._outlineWidth !== value) {
  330. this._outlineWidth = value;
  331. makeDirty(this, OUTLINE_WIDTH_INDEX);
  332. }
  333. }
  334. },
  335. /**
  336. * Gets or sets the condition specifying at what distance from the camera that this point will be displayed.
  337. * @memberof PointPrimitive.prototype
  338. * @type {DistanceDisplayCondition}
  339. * @default undefined
  340. */
  341. distanceDisplayCondition : {
  342. get : function() {
  343. return this._distanceDisplayCondition;
  344. },
  345. set : function(value) {
  346. //>>includeStart('debug', pragmas.debug);
  347. if (defined(value) && value.far <= value.near) {
  348. throw new DeveloperError('far must be greater than near');
  349. }
  350. //>>includeEnd('debug');
  351. if (!DistanceDisplayCondition.equals(this._distanceDisplayCondition, value)) {
  352. this._distanceDisplayCondition = DistanceDisplayCondition.clone(value, this._distanceDisplayCondition);
  353. makeDirty(this, DISTANCE_DISPLAY_CONDITION_INDEX);
  354. }
  355. }
  356. },
  357. /**
  358. * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain.
  359. * When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied.
  360. * @memberof PointPrimitive.prototype
  361. * @type {Number}
  362. * @default 0.0
  363. */
  364. disableDepthTestDistance : {
  365. get : function() {
  366. return this._disableDepthTestDistance;
  367. },
  368. set : function(value) {
  369. if (this._disableDepthTestDistance !== value) {
  370. //>>includeStart('debug', pragmas.debug);
  371. if (!defined(value) || value < 0.0) {
  372. throw new DeveloperError('disableDepthTestDistance must be greater than or equal to 0.0.');
  373. }
  374. //>>includeEnd('debug');
  375. this._disableDepthTestDistance = value;
  376. makeDirty(this, DISABLE_DEPTH_DISTANCE_INDEX);
  377. }
  378. }
  379. },
  380. /**
  381. * Gets or sets the user-defined value returned when the point is picked.
  382. * @memberof PointPrimitive.prototype
  383. * @type {*}
  384. */
  385. id : {
  386. get : function() {
  387. return this._id;
  388. },
  389. set : function(value) {
  390. this._id = value;
  391. if (defined(this._pickId)) {
  392. this._pickId.object.id = value;
  393. }
  394. }
  395. },
  396. /**
  397. * @private
  398. */
  399. pickId : {
  400. get : function() {
  401. return this._pickId;
  402. }
  403. },
  404. /**
  405. * Determines whether or not this point will be shown or hidden because it was clustered.
  406. * @memberof PointPrimitive.prototype
  407. * @type {Boolean}
  408. * @private
  409. */
  410. clusterShow : {
  411. get : function() {
  412. return this._clusterShow;
  413. },
  414. set : function(value) {
  415. if (this._clusterShow !== value) {
  416. this._clusterShow = value;
  417. makeDirty(this, SHOW_INDEX);
  418. }
  419. }
  420. }
  421. });
  422. PointPrimitive.prototype.getPickId = function(context) {
  423. if (!defined(this._pickId)) {
  424. this._pickId = context.createPickId({
  425. primitive : this,
  426. collection : this._collection,
  427. id : this._id
  428. });
  429. }
  430. return this._pickId;
  431. };
  432. PointPrimitive.prototype._getActualPosition = function() {
  433. return this._actualPosition;
  434. };
  435. PointPrimitive.prototype._setActualPosition = function(value) {
  436. Cartesian3.clone(value, this._actualPosition);
  437. makeDirty(this, POSITION_INDEX);
  438. };
  439. var tempCartesian3 = new Cartesian4();
  440. PointPrimitive._computeActualPosition = function(position, frameState, modelMatrix) {
  441. if (frameState.mode === SceneMode.SCENE3D) {
  442. return position;
  443. }
  444. Matrix4.multiplyByPoint(modelMatrix, position, tempCartesian3);
  445. return SceneTransforms.computeActualWgs84Position(frameState, tempCartesian3);
  446. };
  447. var scratchCartesian4 = new Cartesian4();
  448. // This function is basically a stripped-down JavaScript version of PointPrimitiveCollectionVS.glsl
  449. PointPrimitive._computeScreenSpacePosition = function(modelMatrix, position, scene, result) {
  450. // Model to world coordinates
  451. var positionWorld = Matrix4.multiplyByVector(modelMatrix, Cartesian4.fromElements(position.x, position.y, position.z, 1, scratchCartesian4), scratchCartesian4);
  452. var positionWC = SceneTransforms.wgs84ToWindowCoordinates(scene, positionWorld, result);
  453. return positionWC;
  454. };
  455. /**
  456. * Computes the screen-space position of the point's origin.
  457. * The screen space origin is the top, left corner of the canvas; <code>x</code> increases from
  458. * left to right, and <code>y</code> increases from top to bottom.
  459. *
  460. * @param {Scene} scene The scene.
  461. * @param {Cartesian2} [result] The object onto which to store the result.
  462. * @returns {Cartesian2} The screen-space position of the point.
  463. *
  464. * @exception {DeveloperError} PointPrimitive must be in a collection.
  465. *
  466. * @example
  467. * console.log(p.computeScreenSpacePosition(scene).toString());
  468. */
  469. PointPrimitive.prototype.computeScreenSpacePosition = function(scene, result) {
  470. var pointPrimitiveCollection = this._pointPrimitiveCollection;
  471. if (!defined(result)) {
  472. result = new Cartesian2();
  473. }
  474. //>>includeStart('debug', pragmas.debug);
  475. if (!defined(pointPrimitiveCollection)) {
  476. throw new DeveloperError('PointPrimitive must be in a collection.');
  477. }
  478. if (!defined(scene)) {
  479. throw new DeveloperError('scene is required.');
  480. }
  481. //>>includeEnd('debug');
  482. var modelMatrix = pointPrimitiveCollection.modelMatrix;
  483. var windowCoordinates = PointPrimitive._computeScreenSpacePosition(modelMatrix, this._actualPosition, scene, result);
  484. if (!defined(windowCoordinates)) {
  485. return undefined;
  486. }
  487. windowCoordinates.y = scene.canvas.clientHeight - windowCoordinates.y;
  488. return windowCoordinates;
  489. };
  490. /**
  491. * Gets a point's screen space bounding box centered around screenSpacePosition.
  492. * @param {PointPrimitive} point The point to get the screen space bounding box for.
  493. * @param {Cartesian2} screenSpacePosition The screen space center of the label.
  494. * @param {BoundingRectangle} [result] The object onto which to store the result.
  495. * @returns {BoundingRectangle} The screen space bounding box.
  496. *
  497. * @private
  498. */
  499. PointPrimitive.getScreenSpaceBoundingBox = function(point, screenSpacePosition, result) {
  500. var size = point.pixelSize;
  501. var halfSize = size * 0.5;
  502. var x = screenSpacePosition.x - halfSize;
  503. var y = screenSpacePosition.y - halfSize;
  504. var width = size;
  505. var height = size;
  506. if (!defined(result)) {
  507. result = new BoundingRectangle();
  508. }
  509. result.x = x;
  510. result.y = y;
  511. result.width = width;
  512. result.height = height;
  513. return result;
  514. };
  515. /**
  516. * Determines if this point equals another point. Points are equal if all their properties
  517. * are equal. Points in different collections can be equal.
  518. *
  519. * @param {PointPrimitive} other The point to compare for equality.
  520. * @returns {Boolean} <code>true</code> if the points are equal; otherwise, <code>false</code>.
  521. */
  522. PointPrimitive.prototype.equals = function(other) {
  523. return this === other ||
  524. defined(other) &&
  525. this._id === other._id &&
  526. Cartesian3.equals(this._position, other._position) &&
  527. Color.equals(this._color, other._color) &&
  528. this._pixelSize === other._pixelSize &&
  529. this._outlineWidth === other._outlineWidth &&
  530. this._show === other._show &&
  531. Color.equals(this._outlineColor, other._outlineColor) &&
  532. NearFarScalar.equals(this._scaleByDistance, other._scaleByDistance) &&
  533. NearFarScalar.equals(this._translucencyByDistance, other._translucencyByDistance) &&
  534. DistanceDisplayCondition.equals(this._distanceDisplayCondition, other._distanceDisplayCondition) &&
  535. this._disableDepthTestDistance === other._disableDepthTestDistance;
  536. };
  537. PointPrimitive.prototype._destroy = function() {
  538. this._pickId = this._pickId && this._pickId.destroy();
  539. this._pointPrimitiveCollection = undefined;
  540. };
  541. export default PointPrimitive;