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

Abstract class for signalers that use raycasting to trigger events on objects. More...

Inherits C2M2.Interaction.PressEventSignaler.

Inherited by C2M2.Interaction.MouseEventSignaler, and C2M2.Interaction.OculusEventSignaler.

Public Attributes

bool rightHand = true
 
LayerMask layerMask
 
float maxRaycastDistance = 10f
 

Protected Member Functions

abstract void OnAwake ()
 
void Awake ()
 
abstract void OnStart ()
 
override void OnHoverHold ()
 
override void OnHoverEnd ()
 
override void OnPressBegin ()
 
override void OnPressHold ()
 
override void OnPressEnd ()
 
abstract bool RaycastingMethod (out RaycastHit hit, float maxDistance, LayerMask layerMask)
 Let the input type choose their own raycasting method More...
 
abstract bool RaycastRequested ()
 Rrequire some condition before raycast requests are made. More...
 
abstract bool PressCondition ()
 Require a second condition before raycast events are triggered More...
 
- Protected Member Functions inherited from C2M2.Interaction.PressEventSignaler
virtual void OnHoverBegin ()
 

Private Member Functions

void Start ()
 
void FixedUpdate ()
 

Static Private Member Functions

static RaycastEventManager FindRaycastTrigger (RaycastHit hit)
 Try to find the RaycastTriggerManager on the hit object More...
 

Private Attributes

RaycastEventManager curEvent = null
 
RaycastHit hit
 
GameObject curObj
 

Additional Inherited Members

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

Detailed Description

Abstract class for signalers that use raycasting to trigger events on objects.

Manages event timing and shared logic.

Member Function Documentation

◆ Awake()

void C2M2.Interaction.RaycastEventSignaler.Awake ( )
protected

◆ FindRaycastTrigger()

static RaycastEventManager C2M2.Interaction.RaycastEventSignaler.FindRaycastTrigger ( RaycastHit  hit)
staticprivate

Try to find the RaycastTriggerManager on the hit object

◆ FixedUpdate()

void C2M2.Interaction.RaycastEventSignaler.FixedUpdate ( )
private

◆ OnAwake()

abstract void C2M2.Interaction.RaycastEventSignaler.OnAwake ( )
protectedpure virtual

◆ OnHoverEnd()

override void C2M2.Interaction.RaycastEventSignaler.OnHoverEnd ( )
protectedvirtual

◆ OnHoverHold()

override void C2M2.Interaction.RaycastEventSignaler.OnHoverHold ( )
protectedvirtual

◆ OnPressBegin()

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

◆ OnPressEnd()

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

◆ OnPressHold()

override void C2M2.Interaction.RaycastEventSignaler.OnPressHold ( )
protectedvirtual

◆ OnStart()

abstract void C2M2.Interaction.RaycastEventSignaler.OnStart ( )
protectedpure virtual

◆ PressCondition()

abstract bool C2M2.Interaction.RaycastEventSignaler.PressCondition ( )
protectedpure virtual

Require a second condition before raycast events are triggered

In Oculus, this is the trigger button. The user must hold "One" to begin raycasting, and then the trigger once they want to see events triggered. This way, raycasts can be visualized in VR before events are triggered with the raycast. With mouse raycasting, this simply returns "true", since we don't need to visualize raycasts before triggering events. We can just skip right to triggering events

Implemented in C2M2.Interaction.OculusEventSignaler, and C2M2.Interaction.MouseEventSignaler.

◆ RaycastingMethod()

abstract bool C2M2.Interaction.RaycastEventSignaler.RaycastingMethod ( out RaycastHit  hit,
float  maxDistance,
LayerMask  layerMask 
)
protectedpure virtual

Let the input type choose their own raycasting method

Parameters
hitResulting hit of the raycast
layerMaskWhich layer(s) should the raycast paya attention to?
Returns
Whether or not the raycast hit a valid target

Implemented in C2M2.Interaction.OculusEventSignaler, and C2M2.Interaction.MouseEventSignaler.

◆ RaycastRequested()

abstract bool C2M2.Interaction.RaycastEventSignaler.RaycastRequested ( )
protectedpure virtual

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

Implemented in C2M2.Interaction.OculusEventSignaler, and C2M2.Interaction.MouseEventSignaler.

◆ Start()

void C2M2.Interaction.RaycastEventSignaler.Start ( )
private

Member Data Documentation

◆ curEvent

RaycastEventManager C2M2.Interaction.RaycastEventSignaler.curEvent = null
private

◆ curObj

GameObject C2M2.Interaction.RaycastEventSignaler.curObj
private

◆ hit

RaycastHit C2M2.Interaction.RaycastEventSignaler.hit
private

◆ layerMask

LayerMask C2M2.Interaction.RaycastEventSignaler.layerMask

◆ maxRaycastDistance

float C2M2.Interaction.RaycastEventSignaler.maxRaycastDistance = 10f

◆ rightHand

bool C2M2.Interaction.RaycastEventSignaler.rightHand = true

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