Questions tagged [hittest]

Hit-testing (hit detection, picking, or pick correlation) is the process of determining whether a given object intersects another given object shape, line, or curve drawn on the screen.

Hit-testing (hit detection, picking, or pick correlation) is the process of determining whether a given object intersects another given object shape, line, or curve drawn on the screen.

Most commonly, hit-testing is used by GUI environments to respond to user actions. In addition, hit-testing is used in small-scale games, which do not require much computing power, and are thus able to perform all of their collision detection tests in one frame of the game loop.

In Web programming languages such as SVG and CSS, this is associated with the concept of pointer-events (e.g. user-initiated cursor movement or object selection).

543 questions
6
votes
1 answer

HitTest for SKSpriteNode

This is my problem: I work with SpriteKit and I want to ignore touch event when it occurs in some rectangle (prevent calling touchesBegan). The way how I would like to do it is something like "overriding the hitTestWithEvent of UIView". But I can't…
ukaszm
  • 254
  • 2
  • 9
6
votes
2 answers

Identify face of a cube hit on touches began in Swift - SceneKit

I'm tying to create an app with SceneKit to solve a Rubik's Cube. I've made my own dae file for the cube. Upon touches began I have the object that's been hit func tapGesture(sender: UITapGestureRecognizer){ // check what nodes are tapped …
Nishanth Vemula
  • 336
  • 4
  • 10
6
votes
1 answer

HTML5 canvas hittesting

I have some images drawn on a HTML5 Canvas and I want to check if they are hit on mouse click. Seems easy, I have the bounds of the images, however the images are transformed (translated and scaled). Unfortunately, the context does not have a method…
6
votes
3 answers

How to use IntersectsWith method with a rectangle defined in XAML

I have this rectangle in XAML : I want to check if it intersects with another rectangle. In this question on SO, they say that one have to use the IntersectsWith method. But I'm…
Michaël Polla
  • 3,511
  • 3
  • 23
  • 37
6
votes
6 answers

Horizontal UIScrollView having vertical UIScrollViews inside - how to prevent scrolling of inner scroll views when scrolling outer horizontal view?

couldn't find a solution for that. I am building an app, with big scroll view, who has paging (Horizontal). Inside this scroll view, there is a grid of UIView's, and an UIScrollview inside each one of them, with vertical scroll view. Now, the point…
Avi Tsadok
  • 1,843
  • 13
  • 19
6
votes
1 answer

Bug in geometry Hit-Testing

I have a DrawingVisual element that rappresents a path which geometry is described by this…
gliderkite
  • 8,828
  • 6
  • 44
  • 80
5
votes
1 answer

GestureDetector does not work after Transform and Offset Animation (Flutter)

I want to create an spinning animation with a set of buttons - arranged in a circle - that rotate and extend from a clicked center button. While animation and rotation work well, and the open button and close button work smoothly and respond to…
Defarine
  • 681
  • 8
  • 19
5
votes
3 answers

Mapping from 2D projection back to 3D point cloud

I have a 3D model consisting of point vertices (XYZ) and eventually triangular faces. Using OpenGL or camera-view-matrix-projection I can project the 3D model to a 2D plane, i.e. a view window or an image with m*n resolution. The question is how…
rnd_nr_gen
  • 2,203
  • 3
  • 36
  • 55
5
votes
1 answer

Ignoring an object in hittest

Is it possible to ignore an object in SceneKit's hitTest so that when the hitTest ray is sent, it goes through an object? I still want to see both objects, i just want the ray to ignore another. Here the top image shows how it works now, and the…
superman
  • 51
  • 2
5
votes
3 answers

hitTest returns wrong UIView

I have a view hierarchy which contains smaller views on a scroll view. Each view can have subviews in it such as buttons etc. For some reason, buttons on the view aren't clicked; exploring this further showed that while the scroll view receives the…
Aviad Ben Dov
  • 6,351
  • 2
  • 34
  • 45
5
votes
1 answer

WPF. Is it possible to do ellipse "rectangle bounds" hittest?

Is there possible to make hit test in ellipse bound rectangle, like on this image?
slavka
  • 119
  • 6
5
votes
1 answer

Why is hitTest not being called when views subview is touched?

I have a view which I'll call parentView which has a subview called childView. Part of childView is outside the bounds of parentView, and childView has a panGestureRecognizer attached to it. I have implemented the following in parentView so that it…
Ser Pounce
  • 14,196
  • 18
  • 84
  • 169
4
votes
5 answers

How to see if two shapes overlap

I'm trying to write a simple firemonkey test app. I have a form, with a panel (align:= alClient). On the form are 2 TCircle's. I have set TCircle.Dragmode:= dmAutomatic. I would like to drag the circles around and have something happen when the…
Johan
  • 74,508
  • 24
  • 191
  • 319
4
votes
2 answers

Hit Test WPF 3D Model parts

I have a big ModelVisual3D (e.g. car) which is divided into many smaller GeometryModel3D objects (e.g. tyres, seats, wheels, etc.). I would like to hit test the ModelVisual3D when the mouse is clicked and determine which GeometryModel3D was hit. I…
Silver Mikk
  • 43
  • 1
  • 3
4
votes
0 answers

How do I get multiple .gltf models to work in three.js webxr_ar_hittest example?

I'm using this example https://threejs.org/examples/?q=webxr#webxr_ar_hittest from three.js and the example works very well but when I change the cylinder to a model it just lets me put one model instead of letting me put several models in the place…
1 2
3
36 37