Touch Proxy | Used to isolate geometry that is only used as a touch target but are not visible to the user. |
The Multi Touch System inside Ventuz uses the geometry behind an interaction node as its hit target. If a touch starts on a geometry, the interaction nodes along the path to the scene hierarchy's root are activated. For example, when using a Rectangle behind a Touch Translation node, that rectangle is both used for rendering as well as as to determine the area that can be used to interact with the translation gesture.
However, there can be various reasons why the geometry used for hit testing sometimes has to be different than the geometry used for rendering:
In all of those cases, it makes sense to use a separate geometry for hit testing, a hit proxy that is invisible to the user.
In the following example, we have a dragon model sitting on a plane that we want to be rotatable. Since the dragon is a bit small and has too many concave areas, we're going to put a sphere around it as a touch proxy.
The hierarchy is quite simple: between the Orbit Rotation node and the sphere, a Touch Proxy is added. This will automatically make it invisible. Beneath the Touch Proxy is a Touch Excluder that prevents hit testing to spent any time on the actual rendering geometry. It also has the effect that the plane will actually not be reacting to touches. To temporarily unhide the proxy, activate the Visible flag on the Touch Proxy node.
As mentioned on the Multi Touch page, Ventuz's Multi Touch System supports nested gestures. So if we add a Touch Button node right in front of the dragon mesh, the hit testing will ignore the plane but react on the dragon. In fact, the dragon can now be rotated and tapped when hitting the dragon geometry but only rotated when hitting the sphere. This allows for very complex interaction scenarios.
Internally, the intersection testing treats proxies as second class citizens. If the intersection testing finds an intersection with the proxy geometry, it only records that hit if no "proper" hit was first registered. It even marks the hit as a special proxy hit and if it find's any other hit with a mesh directly underneath a touch gesture, it will override the proxy hit. Otherwise it would not be possible to hit the dragon inside the proxy sphere as the sphere is always closer to the viewer!
For rotation nodes, the shape of the proxy should roughly match the original geometry. Otherwise rotations in an unexpected direction can occur because the user thinks he is grabbing and rotating the backside of the mesh but in fact is hitting the front of the proxy.