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
2
votes
3 answers

Check whether touched Point lies inside given area or not

Have a look at below image. Total image is around 300X300. Inside that 1 Diamond shape is there. I know its Points as below pointA = new Point(0, 183); pointB = new Point(183, 0); pointC = new Point(366, 183); pointD = new…
Braj
  • 2,164
  • 2
  • 26
  • 44
2
votes
1 answer

Find a point in a complex polygon

This polygon could be shaped like a C I tried the formula located here How can I determine whether a 2D Point is within a Polygon? however it doesn't actually correctly predict if the point is in the polygon.
Mel
  • 2,055
  • 2
  • 26
  • 45
2
votes
1 answer

Show series value over any point on chart using tooltip c#

So I've seen lots of examples on using tooltip to show chart data when hovering over a data point, but I was hoping to show the values when my mouse is simply over the chart and not necessarily over a particular data point (i.e. the whitespace…
tmwoods
  • 2,353
  • 7
  • 28
  • 55
2
votes
0 answers

Exclude custom slider from delaysContentTouches of scroll view

Situation 1: I've created a horizontal UIScrollView and added smaller horizontal UIScrollView as a subview. It works fine - I can scroll both without any delay. Situation 2: I've created a horizontal UIScrollView and added my custom UIControl which…
msmialko
  • 1,439
  • 2
  • 20
  • 35
2
votes
2 answers

How to Mouse Hittest using IsVisible with rotated and transformed paths

I am drawing scaleable vector graphics with GDI+ and I need to hitttest on mousemove. All the examples I've seen use model space = world space, with no transforms. Here's a simplified example of the problem: Imports System.Drawing.Drawing2D Public…
smirkingman
  • 6,167
  • 4
  • 34
  • 47
1
vote
2 answers

AS3 RemoveChild. Bullet and Enemy?

I having some problem with bullet and enemy. I don't think i need to explain so much, just take a look at the code. Im not very good at AS3, im new and learning so I need help :P Ok, this is on the flash/stage timeline. Here I say if I press mouse…
user1133188
  • 71
  • 4
  • 12
1
vote
1 answer

How can I unit test this hitTest override in iPhone?

How can I unit test this hitTest override? - (UIView*) hitTest:(CGPoint)point withEvent:(UIEvent *)event { UIView* hitView = [super hitTest:point withEvent:event]; // Do something based on hitView's properties } The problem I'm facing is…
hpique
  • 119,096
  • 131
  • 338
  • 476
1
vote
0 answers

iOS retains views tree on hit testing?

I have a "mysterious" retain in my app and I was able to reproduce it in simplification. I have a view hierarchy as follows: Base view (UIView) : Main view (UIView) : Button1 (UIRectButton) Kind-of side menu (UIView) : Button2…
1
vote
2 answers

How can I have a control return a hit from HitTest on a right click only?

I want to open a context menu when the user right clicks on an object but I want to pass all other mouse hits through it. protected override HitTestResult HitTestCore( PointHitTestParameters hitTestParameters ) { var hitPoint =…
chrislarson
  • 958
  • 2
  • 10
  • 20
1
vote
1 answer

AS3 line of sight without using hittest object.

I'm working on a game project, and I am working on the AI aspect of the game. I want the enemy objects to start aiming and shooting at the player when they are in sight of the enemy, and i came across this article on a way to do…
AlexW.H.B.
  • 1,781
  • 3
  • 25
  • 50
1
vote
1 answer

How do you pass a gesture between subviews in UIKit?

I've got a ViewController with three subviews. I'm trying to get them to detect touches in their bounds from a starting point outside their bounds without the user lifting their finger (ie the user dragging into the view). I thought hitTest would do…
CodeyTown
  • 87
  • 4
1
vote
0 answers

How to check if the plane detected in WebXR's hit test results is vertical?

I am new to WebXR and trying to only allow the reticle to show up if the plane detected is vertical (like a wall). I am following this basic hit test example as a starting point. I don't see any parameter for vertical detection of the plane but in…
sparkanzo
  • 11
  • 1
1
vote
1 answer

ToolTip on Adorner doesn't show up

I have an adorner defined as follows: private class ErrorAdorner : Adorner { private readonly Border _errorBorder; public ErrorAdorner(UIElement adornedElement) : base(adornedElement) { …
Thomas Levesque
  • 286,951
  • 70
  • 623
  • 758
1
vote
1 answer

Make rectangle and check point location against it without changing concept very much if we imagine it being rotated by 45°?

Take a look at this simple combination of rectangle zone creation and point location. Whilst current calculation retrieves a TRUE for this point being inside the calculated area, the new adjusted calculation should interpret the same point position…
taraz
  • 117
  • 2
  • 8
1
vote
3 answers

How can I do a hit test on two dynamically added objects in AS3?

I have a grid of objects that have been added to the stage dynamically, the objects are either of a Class Red or Class Blue, how do I perform a hit test on the Classes? I want the Blue object to disappear once it hits a Red one. Help please, if you…
Garth Humphreys
  • 793
  • 2
  • 9
  • 16