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
4 answers

How i can get hit test with image on canvas?

I create image in this way: var orc = new Image(); orc.src = "./orc.png"; I use image in objects like this: function Character(hp, image){ this.hp = hp; this.image = image; }; I call it in several times, like: unit245 = new…
asci
  • 2,540
  • 4
  • 16
  • 15
2
votes
1 answer

UIView hanging off edge of superview... tap events seen by *unrelated* underlying view

I've created a UIView (tooltip box) and added it as a subview of another view. Using anchor constraints, I've floated it off the edge of its superview where it hovers above an unrelated UIView (which happens to be UITextView) To the trespassing…
clearlight
  • 12,255
  • 11
  • 57
  • 75
2
votes
1 answer

Flutter: Filter hitevent for specific PointerDeviceKind and only absorb these

I am trying to read the stylus with a "global" listener, while still being able to interact with the rest of the UI with the finger. The event object passed to the listeners of the Listener widget actually has a property for the device kind, but I…
puaaaal
  • 196
  • 8
2
votes
0 answers

How to distinguish floor, walls and celling in hittest of WebXR

Unfortunately there is no documentation for Augmented Reality (ARButton) feature of Three.JS. In the example objects are not being placed distinguishing floor or wall. Can you guide how to correct the sizing of added object and rotation based on…
XIMRX
  • 2,130
  • 3
  • 29
  • 60
2
votes
3 answers

3D Hit Testing in WPF

I'm writing a WPF application that displays terrain in 3D. When I perform hit testing, the wrong 3D point is returned (not the point I clicked on). I tried highlighting the triangle that was hit (by creating a new mesh, taking the coordinates from…
Itai Bar-Haim
  • 1,686
  • 16
  • 40
2
votes
1 answer

Flutter IgnorePointer for 2 fingers

I am trying to ignore multi-finger touches (2-finger specifically) on a Button by wrapping it with IgnorePointer() like so: import 'package:flutter/material.dart'; void main() { runApp(MyApp()); } class MyApp extends StatelessWidget { // This…
Foti Dim
  • 1,303
  • 13
  • 19
2
votes
0 answers

SwiftUI Image pass through touches on transparent pixels

TL;DR: I want to re-solve in SwiftUI this classic (and solved in UIKit) problem: how to pass along, to views behind, touches in transparent parts. Some approaches: Figure out if tap point has alpha == 0 Providing a Bézier path to…
Andrew Duncan
  • 3,553
  • 4
  • 28
  • 55
2
votes
2 answers

Place multiple SCN objects in touchesBegan method

My Swift code below uses func touchesBegan to place a SCN object in the ARKit view. The problem is – it's only placing the object one time. I would like to create the code in a way that users can select any area to place the SCN object and it can…
user12655184
2
votes
1 answer

VisualTreeHelper.HitTest reports a hit even when rectangle is nowhere near the underlying shapes

I am attempting to implement Rubber-band selection of WPF Path objects on a canvas. Unfortunately my use of VisualTreeHelper.HitTest with a rectangle geometry is not working as I expect. I expect to only get a hit when some part of my…
Joe
  • 5,394
  • 3
  • 23
  • 54
2
votes
1 answer

Why does CGPath contains test sometime return true on a point outside the path?

I have a subclass of UIView containing a bunch of graphics drawn using CGPAths. I need to know when a touch hits one of these paths, and which one. override func touchesBegan(_ touches: Set, with event: UIEvent?) { for t in touches { …
executor21
  • 4,532
  • 6
  • 28
  • 38
2
votes
2 answers

WinForms equivalent of WPF's IsHitTestVisible

I have a button override that has a Label as a child. I have MouseEnter and Leave events attached to the button control. When the mouse enters the label the button's events are nullified (which is natural). My question is how can I disable the…
rotSin
  • 231
  • 1
  • 3
  • 13
2
votes
1 answer

Swift SpriteKit Detect TouchesBegan on SKSpriteNode with SKPhysicsBody from Sprite's Texture

I have a SpriteKit scene with a sprite. The sprite has a physics body derived from the texture's alpha to get an accurate physics shape like so: let texture_bottle = SKTexture(imageNamed:"Bottle") let sprite_bottle = SKSpriteNode(texture:…
Geoff H
  • 3,107
  • 1
  • 28
  • 53
2
votes
3 answers

ARKit crashing in iOS 11.3

Since iOS11.3 I'm getting a significant number of new crash reports from my AR measurement app. The crash description says: Exception Type: SIGABRT Exception Codes: #0 at 0x181b112ec Crashed Thread: 0 Application Specific Information: ***…
cujo30227
  • 720
  • 7
  • 15
2
votes
0 answers

SceneKit: How to create frozen SCNNode copy to perform hit test on background queue?

Right now I perform face landmark detection and then use SCNSceneRenderer.hitTest(cgPt, options: [.rootNode: faceNode]) on the resulting points to find the 3D positions of various landmarks. My face node is a child of ARFaceAnchor and has…
miweinst
  • 138
  • 11
2
votes
1 answer

ARKit: How to place one imported 3D model above another?

I am working on a AR project using ARKit. If I touch only the imported 3D object on a point, I want to place another 3D object above it. (For example I have placed a table above which I have to place something else like a flower vase on the touched…
Informatics
  • 155
  • 1
  • 10