three-render-objects 1.36.0 → 1.37.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -86,6 +86,7 @@ new ThreeRenderObjects(<domElement>, { configOptions })
86
86
  | <b>hoverOrderComparator</b>([<i>fn</i>]) | Getter/setter for the comparator function to use when hovering over multiple objects under the same line of sight. This function can be used to prioritize hovering some objects over others. | By default, hovering priority is based solely on camera proximity (closest object wins). |
87
87
  | <b>hoverFilter</b>([<i>fn</i>]) | Getter/setter for the filter function that defines whether an object is eligible for hovering and other interactions. This function receives an object as sole argument and should return a `boolean` value | `() => true` |
88
88
  | <b>lineHoverPrecision</b>([<i>int</i>]) | Getter/setter for the precision to use when detecting hover events over [Line](https://threejs.org/docs/#api/objects/Line) objects. | 1 |
89
+ | <b>pointsHoverPrecision</b>([<i>int</i>]) | Getter/setter for the precision to use when detecting hover events over [Points](https://threejs.org/docs/#api/objects/Points) objects. | 1 |
89
90
  | <b>tooltipContent</b>([<i>str</i> or <i>fn</i>]) | Object accessor function or attribute for label (shown in tooltip). Supports plain text, HTML string content, an [HTML element](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement) or [React JSX](https://react.dev/learn/writing-markup-with-jsx). ||
90
91
  | <b>enablePointerInteraction([<i>boolean</i>]) | Getter/setter for whether to enable the mouse tracking events. This activates an internal tracker of the canvas mouse position and enables the functionality of object hover/click and tooltip labels, at the cost of performance. If you're looking for maximum gain in your render performance it's recommended to switch off this property. | `true` |
91
92
  | <b>hoverDuringDrag([<i>boolean</i>]) | Getter/setter for whether to trigger hover events while using the controls via pointer dragging.| `false` |
@@ -68,6 +68,8 @@ declare class ThreeRenderObjectsGeneric<ChainableInstance> {
68
68
  hoverFilter(filterFn: (obj: Object3D) => boolean): ChainableInstance;
69
69
  lineHoverPrecision(): number;
70
70
  lineHoverPrecision(precision: number): ChainableInstance;
71
+ pointsHoverPrecision(): number;
72
+ pointsHoverPrecision(precision: number): ChainableInstance;
71
73
  tooltipContent(): Obj3DAccessor<string | HTMLElement | ReactHTMLElement<HTMLElement> | boolean>;
72
74
  tooltipContent(contentAccessor: Obj3DAccessor<string | HTMLElement | ReactHTMLElement<HTMLElement> | boolean>): ChainableInstance;
73
75
  enablePointerInteraction(): boolean;
@@ -1,4 +1,4 @@
1
- // Version 1.36.0 three-render-objects - https://github.com/vasturiano/three-render-objects
1
+ // Version 1.37.0 three-render-objects - https://github.com/vasturiano/three-render-objects
2
2
  (function (global, factory) {
3
3
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('three')) :
4
4
  typeof define === 'function' && define.amd ? define(['three'], factory) :
@@ -77722,6 +77722,10 @@ var<${access}> ${name} : ${structName};`;
77722
77722
  "default": 1,
77723
77723
  triggerUpdate: false
77724
77724
  },
77725
+ pointsHoverPrecision: {
77726
+ "default": 1,
77727
+ triggerUpdate: false
77728
+ },
77725
77729
  hoverOrderComparator: {
77726
77730
  "default": function _default() {
77727
77731
  return -1;
@@ -77784,7 +77788,7 @@ var<${access}> ${name} : ${structName};`;
77784
77788
  }
77785
77789
  if (topObject !== state.hoverObj) {
77786
77790
  state.onHover(topObject, state.hoverObj, state.intersection);
77787
- state.tooltip.content(topObject ? index$2(state.tooltipContent)(topObject) || null : null);
77791
+ state.tooltip.content(topObject ? index$2(state.tooltipContent)(topObject, state.intersection) || null : null);
77788
77792
  state.hoverObj = topObject;
77789
77793
  }
77790
77794
  }
@@ -77927,6 +77931,7 @@ var<${access}> ${name} : ${structName};`;
77927
77931
  var relCoords = new three.Vector2(x / state.width * 2 - 1, -(y / state.height) * 2 + 1);
77928
77932
  var raycaster = new three.Raycaster();
77929
77933
  raycaster.params.Line.threshold = state.lineHoverPrecision; // set linePrecision
77934
+ raycaster.params.Points.threshold = state.pointsHoverPrecision; // set pointsPrecision
77930
77935
  raycaster.setFromCamera(relCoords, state.camera);
77931
77936
  return raycaster.intersectObjects(state.objects, true);
77932
77937
  },