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
1
vote
1 answer

Comprehensive Silverlight rendering resource?

Is there any reference available that gives a comprehensive look at how Silverlight renders the controls in an application? The kinds of things I need to know: What is the bounding rectangle of control X? Is point P inside control X? Is control X…
Greg
  • 10,360
  • 6
  • 44
  • 67
1
vote
1 answer

iOS ARView.hitTest limited to a max of 100 meters

I found that ARView.hitTest is limited to 100 meters distance. All objects located further than 100m, regardless of size, are not recognized. Is there any way to unblock this? let hitTest = arView.hitTest(point, query: .any, mask: .all)
Sasha
  • 764
  • 1
  • 13
  • 21
1
vote
1 answer

Hittest for backBarButton Item, UIBarButtonItem

I'm trying to determine when a UIBackButton is pressed in a sublayer of a navigation app. Would HitTest be used for that? I've seen reference to HitTest, but not exactly sure what it is and how to code for it. Any help is muchly appreciated.…
Namhcir
  • 825
  • 3
  • 9
  • 16
1
vote
1 answer

Processing - Add hitTest and mousePressed to an Animation with 100 balls

I want to create an ArrayList of ball objects, which should be in a loop until there are 100 pieces. Now my problem: I must implement a function hitTest, so that when you click on a ball it gets removed. In the same position, there should appear two…
Julia
  • 29
  • 2
1
vote
1 answer

DwmDefWindowProc always returns false

I'm having trouble utilizing Win API's DwmDefWindowProc. It always returning false, even when DWM is enabled. I'm sending a WM_NCHITTEST message to the window procedure to detect the action of the mouse position but it's not giving me accurate…
1
vote
1 answer

Why does clipsToBounds prevent the subviews to be touched?

Let's say you have a superview that has a smaller size than its subview. You set the clipsToBound property of the superview to false. If you tap on the protruding area of the subview that is outside of the bounds of the superview, why does the hit…
Kevvv
  • 3,655
  • 10
  • 44
  • 90
1
vote
2 answers

Hit testing center bottom of screen on a plane tracker in Spark AR

In Spark AR I am trying to place an object at the point on a plane tracker that is equal to the center of the bottom of the screen. In pseudo code: tracker.hitTest(screenBottomCenter) Problem is as it states in the docs that the hitTest function…
Vibber
  • 127
  • 1
  • 7
1
vote
1 answer

Java program to detect a mouse click within a shape - program not working

I'm following a Java 2D tutorial and have got stuck on a program written to display a rectangle and ellipse which should fade in colour when clicked ...only nothing happens and I cannot work out why. I modified the original code slightly by passing…
Ingalator
  • 11
  • 1
1
vote
1 answer

Problems with VisualTreeHelper Hit test in landscape

I'm using the FindElementsInHostCoordinates method to find elements as the user swipes his finger across the screen. I'm noticing that it is reacting to if the phone was in portrait. For example - As I move my finger up it moves down, and as I move…
Tom
  • 1,187
  • 2
  • 12
  • 21
1
vote
0 answers

Swift scroll ScrollView with button in front of it

I have a problem where I have a UIButton in front of UIScrollView, as such: UIView | |- UIScrollView | |- UIButton I want it to be this way so the button is always visible and fixed on the top, but I also want to be able to scroll the UIScrollView…
ERP
  • 325
  • 2
  • 11
1
vote
2 answers

SwiftUI Path as contentShape, doesn't line up with Image

TL;DR: I'm using a Path to specify the hit area for an Image. But I don't know how to adjust the Path coordinates to match the layout that SwiftUI decides on... or if I even need to do so. Runtime My (test) app looks like this, Image borders (not…
Andrew Duncan
  • 3,553
  • 4
  • 28
  • 55
1
vote
1 answer

Flutter: Triggering GestureDetector on animated images in Stack

I have an animated "flower" made up of petal images that rotate into position on Widget build. The petal images can be of various lengths. Because I didn't know how to move the pivot point of each petal PNG to the bottom centre for the rotation, I…
Lucas Young
  • 187
  • 2
  • 13
1
vote
1 answer

Determine if two points are on the same side of a line in javascript

Suppose I have two points representing a line A, such as: var A = [ { x: 385, y: 380 }, { x: 420, y: 400 }] And I have two other points B and C such as: var B = { x: 385, y: 420 } var C = { x: 405, y: 423 } How would I determine if B and C are…
justin.m.chase
  • 13,061
  • 8
  • 52
  • 100
1
vote
1 answer

How to get touch event for uibutton outside of another uiwindow

I have my firstVC in the main window and when a button is pressed I animate a second window from the bottom right hand corner that stops almost 3/4 way of the entire screen. Everything animates fine. The problem is I have a cancelButton (red X) on…
Lance Samaria
  • 17,576
  • 18
  • 108
  • 256
1
vote
1 answer

The difference between worldTransform and localTransform in ARKit / ARHitTestResult

I'm trying to place an object in AR in a specific location after performing a hittest, but sometimes its misaligned / rotated incorrectly using a worldTransform. I'm trying to apply the localTransform property to the worldTransform as it seems like…