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

ARKit - Extend the reach of "hitTest"

I want to perform a hit testing from a point on the screen to a Cube in a 3D world. I've been using hitTest from ARKit. It works when I'm standing close to the cube, but when I start moving backwards, it stops working. I'm assuming this is because…
krntz
  • 613
  • 1
  • 6
  • 11
1
vote
1 answer

Hit Test behavior

I have the following code public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); } List ucs = new List(); private void Window_PreviewMouseLeftButtonDown(object sender, …
serhio
  • 28,010
  • 62
  • 221
  • 374
1
vote
1 answer

.hitTestPoint hitting multiple test points (AS3)

I can write a hitTestPoint trigger as such if (mc1.hitTestPoint(mc2.x, mc2.y, true)) and if I want to have multiple test points I can write something like if (mc1.hitTestPoint(mc2.x, mc2.y, true) || mc1.hitTestPoint(mc2.x-5, mc2.y, true) ||…
Koden
  • 353
  • 1
  • 13
1
vote
0 answers

failed to make a row of clickable buttons in UIScrollView with paging enabled

I am trying to make a row of buttons which can be scrolled horizontally. Like the news items in a feed in the Pulse News Reader app. I've successful made enabled paging on UIScrollView with the page size same as the width of a button. i.e. 3 buttons…
Patit
  • 21
  • 1
1
vote
1 answer

Change the hittest area

Imagine I have this ellipse applied to ControlTemplate of an Style. (e.g.: this will be used for thumb of slider)
M.kazem Akhgary
  • 18,645
  • 8
  • 57
  • 118
1
vote
2 answers

Is there a datagrid mouse down hit test to get the row and column index of the click?

With Winforms' DataGridView, one could use HitTest to determine the column and row index of the mouse down (and other events). Dim hti As DataGridView.HitTestInfo = sender.HitTest(e.X, e.Y) Is there something similar with WPF's DataGrid? I need to…
user1500403
  • 551
  • 8
  • 32
1
vote
3 answers

Where Should Collision Detection Code Be?

I'm writing a pong game and I have a ball class that has velocity x, y, positions and all that stuff that every frame is updated by calling @ball.update, this moves the ball forward by its x_vel and Y_vel etc. My question is Should my collision code…
Ell
  • 4,238
  • 6
  • 34
  • 60
1
vote
0 answers

How to continue hit testing for a specific FrameworkElement

Say that we have two superposed rectangle r1 and r2 where r1.Zindex < r2.Zindex. r2.IsHitTestVisible must be true because r2 has a tooltip and r2 is visible only if the mouse is over r1. With the default WPF hit testing, when the mouse is over those…
A. Jacquet
  • 51
  • 9
1
vote
2 answers

WPF hit test on custom control does not work

The following custom control public class DummyControl : FrameworkElement { private Visual visual; protected override Visual GetVisualChild(int index) { return visual; } protected override int VisualChildrenCount { get; }…
Earth Engine
  • 10,048
  • 5
  • 48
  • 78
1
vote
1 answer

what does it mean when it said "an event couldn't be handled"?

I am reading through the documentation of UIResponder class and I came across the responder chain. Now it's said that for example, when a hit-test can't handle an event, it passes it up a chain of responders. So, what example can clarify how an…
Badr
  • 694
  • 1
  • 7
  • 26
1
vote
0 answers

How to prevent a non-scrollable UIScrollView from stealing scroll event?

To elaborate on my question, I've three scrollviews one top of another, let say base, middle and top. Base scroll view's content size is more so it will scroll, middle scrollview's content size is equal to its frame so it will not scroll, top…
Feroz
  • 699
  • 5
  • 17
  • 25
1
vote
2 answers

CALayer -hitTest: not respecting containsPoint: overload

Back again and have a different question with the same function that I posted before: - (AIEnemyUnit *) hitTestForEnemyUnit:(CGPoint)where { CALayer * layer = [self hitTest:where]; while (layer) { if ([layer…
Phil M
  • 432
  • 7
  • 16
1
vote
1 answer

hitTestObject on dynamically placed MovieClip instances

Trying to do hitTestObject on instances that are dynamically placed on the stage. Receiving an error: TypeError: Error #2007: Parameter hitTestObject must be non-null. at flash.display::DisplayObject/_hitTest() at…
jc70
  • 255
  • 2
  • 13
  • 32
1
vote
1 answer

After send subview to back in uitableview, how to touch the subview?

I use a headerview as a UITableView subview, now I want to dynamic hide some view in the headerview. My solution is send the headerview to back of the UITableView and update the contentoffset of the UITableView. Like this:(before) The red rectangle…
Lei Kan
  • 487
  • 7
  • 20
1
vote
0 answers

Hit-test enclosed shape described by poly-bezier curve

I've read several of the Bezier curve posts & questions, but can't get my head around the maths or what I need to do to achieve what I'm after. I have an enclosed shape described by a poly-Bezier curve (actually I have several of these different…