Skip to content
Update Laser Pointer authored by dev2_just2devs's avatar dev2_just2devs
...@@ -25,8 +25,34 @@ The hand tracking plugin comes with an implementation of the laser pointer based ...@@ -25,8 +25,34 @@ The hand tracking plugin comes with an implementation of the laser pointer based
## Laser Pointer Invalidation Area ## Laser Pointer Invalidation Area
When using the laser pointers you may want to enable and disable them depending on the current state of the application or what the user is doing. E.g. you may want the laser pointers on all the time but don't want them on when the user interacts with certain objects. Using the Laser Pointer Invalidation Area you can easily define a volume of space in which the laser pointers are disabled when the hand enters the volume and are enabled again when the hand leaves. If the laser pointers are not enabled to begin with then the invalidation area won't do anything. You can add a new laser pointer invalidation area by using the place actor window. Once you have dropped the box in the level you can resize it using the BoxExtent variable. When using the laser pointers you may want to enable and disable them depending on the current state of the application or what the user is doing. E.g. you may want the laser pointers on all the time but don't want them on when the user interacts with certain objects.
![image](uploads/4618e66a690470aaff29e8342026c237/image.png) Using the Laser Pointer Invalidation Area you can easily define a volume of space in which the laser pointers are disabled when the hand enters the volume and are enabled again when the hand leaves. If the laser pointers are not enabled to begin with then the invalidation area won't do anything.
Wrap the area in which you want the laser pointers disabled with the box and it's all done. One thing to keep in mind for the invalidation area to work correctly is that it needs the hand to have any sort of collision that generates overlap events. By default if you have any of the following enabled then this is already true: Grab, Primary or Secondary Pinch or Index Interaction. If none of the listed features are enabled then add a sphere or box collision to your hand tracking component and make sure it generated overlap events. You can add a new laser pointer invalidation area by using the quickly add to project button from the editor's toolbar.
\ No newline at end of file
![image](uploads/aeaaf08403c30eecac0d4fc336ff79cd/image.png)
Once you have dropped the box in the level you can resize it using the BoxExtent variable.
![image](uploads/6de7a6754b4ee649e58777f7450c30b8/image.png)
Wrap the area in which you want the laser pointers disabled with the box and it's all done.
One thing to keep in mind is that for the invalidation area to work correctly the hand needs some sort of collision that generates overlap events. By default if you have any of the following enabled then this is already true: Grab, Primary or Secondary Pinch or Index Interaction. If none of the listed features are enabled then add a sphere or box collision to your hand tracking component and make sure it generated overlap events.
## Laser Pointer Data
Similar to the invalidation area the laser pointer data component allows you to specify custom behaviour for the laser pointers. Instead of modifying the laser pointers themselves however, the laser pointer data component defines the laser pointer behaviour per actor.
Using the laser pointer data component you can do the following:
- Prevent the laser pointers from interacting with an actor
- Specify a custom laser pointer mesh scale for an actor
You can find an example of the first point in the example project inside the UI level. The transparent squared buttons are setup ultimately inherit from HTButton which makes them interactable with by laser pointers. Since we want the user to only interact with them by using the index finger we have added a laser pointer data component and set the property CanUseLaserPointer to false.
![image](uploads/aea40818ccd4eb4129bf966b4588ed31/image.png)
An example of the second point is in the same map on the slider. We want the slider to be interactable with by using the laser pointers but would like the pointer mesh to be smaller. In this case we have added a laser pointer data component, left the CanUseLaserPointer property to true but set the LaserPointerMeshScale to 0.5 on each axis.
![image](uploads/6577d0e20f7eb0095f1be1e9d0e5356d/image.png)
\ No newline at end of file