I'm currently working with EdgesGeometry on PlaneGeometry and it appears to be creating a larger hitbox in mouse events. Interestingly, this issue doesn't arise when using CircleGeometry. Below is the code snippet I am using:
createPanel = function(width, height, widthSegments) {
var geometry = new THREE.PlaneBufferGeometry(width, height, widthSegments);
var edges = new THREE.EdgesGeometry( geometry );
var panel = new THREE.LineSegments( edges, new THREE.LineBasicMaterial({
color: 0xffffff }));
return panel;
}
var tile = createPanel(1.45, .6, 1);
Currently, I am utilizing a RayInput library to handle raycasting, but for the sake of this scenario, let's assume I am solely using a standard raycaster for mouse events. When utilizing only the plane without the edges
, the collision boundaries are accurate.
However, upon adding EdgesGeometry, the vertical hitbox appears to have significantly expanded, causing the object to register as clicked even when not directly clicked on. On the other hand, the expansion of the horizontal hitbox seems to be minimal. As this is my first time working with EdgesGeometry, I am unsure of the cause behind this behavior. Any insights would be greatly appreciated.
Thank you in advance.