-
Notifications
You must be signed in to change notification settings - Fork 0
Home
This fork extends NewtonVR with additional functionality for creating multiplayer experiences and for recording motion and interaction data and playing it back via virtual hands. There is a pull request in the main project for these changes, but in the meantime these will be maintained and documented here.
We've added OnBeginUseInteraction
and OnEndUseInteraction
events to the NVRHand
component so we can capture not just the beginning and end of an interaction (picking up or controlling an object), but also using it (for example, pressing the trigger on a gun object).
We've added an NVRHandedInteractableItem
component that allows you to assign per-hand interaction points. An example use was ensuring a walkie-talkie is rotated correctly to how you'd naturally hold one for both hands.
Use NVRInteractableItemSnappable
in place of NVRInteractableItem
to create objects that can snap to the nearest meters and degrees, or to the nearest horizontal surface. Use the index finger trigger to enable/disable snapping to degrees.
NVRVirtualHand
extends NVRHand
to add public methods for controlling the hand programmatically. To create remote players, create an object structure like this in your scene:
RemotePlayer
Head
LeftHand
RightHand
Attach the NVRVirtualHand
component to each hand object and attach your avatar models as children under each component. Movements can be transmitted between players using one of the networking solutions for Unity, controlling the head, hands, and player space (for example for teleporting).
Adding interactions works like this:
- Listen for the
OnBeginInteraction
,OnEndInteraction
,OnBeginUseInteraction
, andOnEndUseInteraction
events and transmit those to the remote players (including the hand and the name of the object being interacted with). - On the receiving end, feed these events to
NVRVirtualHand
'sHold(objectId)
,Release()
,Use()
, andEndUse()
methods.