Skip to content
Permalink
Browse files

feat(examples): add ability to use pointer to pick up objects

Two new StraightPointers have been added to follow each controller
alias and if the controller Interactor isn't touching anything then
pointers become available and will activate when the grab button is
pressed and emit a straight pointer from the relevant interactor.

If the pointer touches something and then the grab button is released
then the Interactable the pointer is touching is grabbed to the
Interactor that is emitting the pointer.

It's not prudent to allow grabbing everything at a distance, such as
doors and drawers so new rules have been set up to prevent certain
items from being grabbed, but also previously Interactables were put
on the `Ignore Raycast` layer as so the teleporter Pointers wouldn't
interact with them, this then creates an issue with the Grab Pointers
as they will also by default just pass through anything on the
"Ignore Raycast" layer.

To solve this, the Interactables that want to be grabbed have been
moved on to the "Water" layer and a rule has been added so they only
consider anything on the Water layer as a valid target.

The Teleporter Pointers have a custom PhysicsCast to ensure they now
ignore anything on both `Ignore Raycast` and `Water` layer so the
pointer grabbable Interactables still ignore the teleporter pointers.

The reason the `Water` layer was used was it is a default layer that
comes with Unity and it's just an example scene, in practice it would
be better to define a specific new layer in the Unity project but as
VRTK doesn't auto specify custom layers then this is not feasible.
  • Loading branch information...
thestonefox committed May 7, 2019
1 parent 6315ad1 commit ab9409b96a10fdbbdfb7866a72845b963c8bfaea

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
Oops, something went wrong.

0 comments on commit ab9409b

Please sign in to comment.
You can’t perform that action at this time.