Neuro-VISOR  0.2.0
Visualize and interact with computational simulations using a virtual reality interface
C2M2.Interaction.OculusEventSignaler Class Reference

Activate raycast triggers using oculus controller buttons and fingertip distance More...

Inherits C2M2.Interaction.RaycastEventSignaler.

Public Attributes

OVRInput.Controller controller = OVRInput.Controller.RTouch
 
OVRInput.Button beginRaycastingButton = OVRInput.Button.One
 
bool toggleMode = true
 
OVRInput.Button triggerEventsButton = OVRInput.Button.PrimaryIndexTrigger
 
OVRGrabber grabber = null
 
LineRenderer lineRend
 
Color unpressedColor = Color.cyan
 
Color pressedColor = new Color(1f, 0.6f, 0f)
 
Transform localAvatar
 
bool isLeftHand = false
 
MeshRenderer staticHand
 
float pressDistance = 0.01f
 
- Public Attributes inherited from C2M2.Interaction.RaycastEventSignaler
bool rightHand = true
 
LayerMask layerMask
 
float maxRaycastDistance = 10f
 

Protected Member Functions

override void OnAwake ()
 
override void OnStart ()
 
override bool RaycastRequested ()
 Rrequire some condition before raycast requests are made. More...
 
override bool PressCondition ()
 
Returns
True if the specified controller button is pressed OR if we are near enough to the raycast target
More...
 
override void OnPressBegin ()
 
override void OnPressEnd ()
 
override bool RaycastingMethod (out RaycastHit hit, float maxDistance, LayerMask layerMask)
 Raycast using fingertip position/direction, handle fingertip line renderer More...
 
- Protected Member Functions inherited from C2M2.Interaction.RaycastEventSignaler
void Awake ()
 
override void OnHoverHold ()
 
override void OnHoverEnd ()
 
override void OnPressBegin ()
 
override void OnPressHold ()
 
override void OnPressEnd ()
 
- Protected Member Functions inherited from C2M2.Interaction.PressEventSignaler
virtual void OnHoverBegin ()
 

Properties

bool Toggled [get]
 
- Properties inherited from C2M2.Interaction.PressEventSignaler
bool Pressing [get, set]
 Was the input source pressed in the previous frame? More...
 
bool Hovering [get, set]
 

Private Member Functions

void StaticHandSetActive (bool active)
 Enable/disable static raycasting hand model and default hand More...
 
void LineRendererSetActive (bool active)
 Enable/Disable line renderer depending on if raycasting mode is enabled More...
 
bool CheckPressDistance (RaycastHit hit)
 Figure out if we should trigger a press based on distance More...
 
IEnumerator SearchForHand (int waitFrames)
 

Private Attributes

bool toggled = false
 
bool distancePressed = false
 
UnityEngine.GameObject defaultHand = null
 

Detailed Description

Activate raycast triggers using oculus controller buttons and fingertip distance

Member Function Documentation

◆ CheckPressDistance()

bool C2M2.Interaction.OculusEventSignaler.CheckPressDistance ( RaycastHit  hit)
private

Figure out if we should trigger a press based on distance

Returns
True if we have instigated a click event by coming within click distance, True if we are holding a press by remaining within hysteresis distance (3 * click distance) after clicking, False otherwise

◆ LineRendererSetActive()

void C2M2.Interaction.OculusEventSignaler.LineRendererSetActive ( bool  active)
private

Enable/Disable line renderer depending on if raycasting mode is enabled

Parameters
activeTrue to enable line renderer, false to disable

◆ OnAwake()

override void C2M2.Interaction.OculusEventSignaler.OnAwake ( )
protectedvirtual

◆ OnPressBegin()

override void C2M2.Interaction.OculusEventSignaler.OnPressBegin ( )
protectedvirtual

◆ OnPressEnd()

override void C2M2.Interaction.OculusEventSignaler.OnPressEnd ( )
protectedvirtual

◆ OnStart()

override void C2M2.Interaction.OculusEventSignaler.OnStart ( )
protectedvirtual

◆ PressCondition()

override bool C2M2.Interaction.OculusEventSignaler.PressCondition ( )
protectedvirtual

Returns
True if the specified controller button is pressed OR if we are near enough to the raycast target

Implements C2M2.Interaction.RaycastEventSignaler.

◆ RaycastingMethod()

override bool C2M2.Interaction.OculusEventSignaler.RaycastingMethod ( out RaycastHit  hit,
float  maxDistance,
LayerMask  layerMask 
)
protectedvirtual

Raycast using fingertip position/direction, handle fingertip line renderer

Implements C2M2.Interaction.RaycastEventSignaler.

◆ RaycastRequested()

override bool C2M2.Interaction.OculusEventSignaler.RaycastRequested ( )
protectedvirtual

Rrequire some condition before raycast requests are made.

You can require a button be pressed before raycasting. In Oculus, this returns true if button "One" is pressed down. With mouse raycasting, this returns true if the mouse button is pressed down

Implements C2M2.Interaction.RaycastEventSignaler.

◆ SearchForHand()

IEnumerator C2M2.Interaction.OculusEventSignaler.SearchForHand ( int  waitFrames)
private

◆ StaticHandSetActive()

void C2M2.Interaction.OculusEventSignaler.StaticHandSetActive ( bool  active)
private

Enable/disable static raycasting hand model and default hand

Parameters
activeTrue to enable static hand, false to enable regular OVR hand

Member Data Documentation

◆ beginRaycastingButton

OVRInput.Button C2M2.Interaction.OculusEventSignaler.beginRaycastingButton = OVRInput.Button.One

◆ controller

OVRInput.Controller C2M2.Interaction.OculusEventSignaler.controller = OVRInput.Controller.RTouch

◆ defaultHand

UnityEngine.GameObject C2M2.Interaction.OculusEventSignaler.defaultHand = null
private

◆ distancePressed

bool C2M2.Interaction.OculusEventSignaler.distancePressed = false
private

◆ grabber

OVRGrabber C2M2.Interaction.OculusEventSignaler.grabber = null

◆ isLeftHand

bool C2M2.Interaction.OculusEventSignaler.isLeftHand = false

◆ lineRend

LineRenderer C2M2.Interaction.OculusEventSignaler.lineRend

◆ localAvatar

Transform C2M2.Interaction.OculusEventSignaler.localAvatar

◆ pressDistance

float C2M2.Interaction.OculusEventSignaler.pressDistance = 0.01f

◆ pressedColor

Color C2M2.Interaction.OculusEventSignaler.pressedColor = new Color(1f, 0.6f, 0f)

◆ staticHand

MeshRenderer C2M2.Interaction.OculusEventSignaler.staticHand

◆ toggled

bool C2M2.Interaction.OculusEventSignaler.toggled = false
private

◆ toggleMode

bool C2M2.Interaction.OculusEventSignaler.toggleMode = true

◆ triggerEventsButton

OVRInput.Button C2M2.Interaction.OculusEventSignaler.triggerEventsButton = OVRInput.Button.PrimaryIndexTrigger

◆ unpressedColor

Color C2M2.Interaction.OculusEventSignaler.unpressedColor = Color.cyan

Property Documentation

◆ Toggled

bool C2M2.Interaction.OculusEventSignaler.Toggled
getprivate

The documentation for this class was generated from the following file: