API reference
API reference
Select your platform
No SDKs available
No versions available

ControllerRayVisual Class

Extends MonoBehaviour
A visual affordance designed to accompany RayInteractors.
This is used in most ray interaction prefabs, wizards, and example scenes provided by the Interaction SDK. Though this class includes a number of customization options and can be set up independently, you should usually start from an example (scene or prefab) rather than trying to add this visual from scratch as this type makes assumptions about certain of its dependencies, such as those added by InjectRenderer(Renderer) and InjectMaterialPropertyBlockEditor(MaterialPropertyBlockEditor).

Properties

HoverColor0 : Color
[Get][Set]
The inner color to show when hovering.
Signature
Color Oculus.Interaction.ControllerRayVisual.HoverColor0
HoverColor1 : Color
[Get][Set]
The outer color to show when hovering.
Signature
Color Oculus.Interaction.ControllerRayVisual.HoverColor1
MaxRayVisualLength : float
[Get][Set]
The maximum distance the visual ray is allowed to extend.
Note that this has nothing to do with RayInteractor.MaxRayLength, which is usually much longer as the visual typically attenuates only part of the way to the ray's actual terminus.
Signature
float Oculus.Interaction.ControllerRayVisual.MaxRayVisualLength
SelectColor0 : Color
[Get][Set]
The inner color to show when selecting.
This color will supersede HoverColor0 when the associated RayInteractor moves from InteractorState.Hover to InteractorState.Select.
Signature
Color Oculus.Interaction.ControllerRayVisual.SelectColor0
SelectColor1 : Color
[Get][Set]
The outer color to show when selecting.
This color will supersede HoverColor1 when the associated RayInteractor moves from InteractorState.Hover to InteractorState.Select.
Signature
Color Oculus.Interaction.ControllerRayVisual.SelectColor1

Protected Methods

OnDisable ()
Signature
virtual void Oculus.Interaction.ControllerRayVisual.OnDisable()
Returns
void
OnEnable ()
Signature
virtual void Oculus.Interaction.ControllerRayVisual.OnEnable()
Returns
void
Start ()
Signature
virtual void Oculus.Interaction.ControllerRayVisual.Start()
Returns
void

Methods

InjectAllControllerRayVisual ( rayInteractor , renderer , materialPropertyBlockEditor )
Injects all required dependencies for a dynamically instantiated ControllerRayVisual; effectively wraps InjectRayInteractor(RayInteractor), InjectRenderer(Renderer), and InjectMaterialPropertyBlockEditor(MaterialPropertyBlockEditor).
This method exists to support Interaction SDK's dependency injection pattern and is not needed for typical Unity Editor-based usage.
Signature
void Oculus.Interaction.ControllerRayVisual.InjectAllControllerRayVisual(RayInteractor rayInteractor, Renderer renderer, MaterialPropertyBlockEditor materialPropertyBlockEditor)
Parameters
rayInteractor: RayInteractor
renderer: Renderer
materialPropertyBlockEditor: MaterialPropertyBlockEditor
Returns
void
InjectMaterialPropertyBlockEditor ( materialPropertyBlockEditor )
Sets the MaterialPropertyBlockEditor for a dynamically instantiated ControllerRayVisual.
This method exists to support Interaction SDK's dependency injection pattern and is not needed for typical Unity Editor-based usage.
Signature
void Oculus.Interaction.ControllerRayVisual.InjectMaterialPropertyBlockEditor(MaterialPropertyBlockEditor materialPropertyBlockEditor)
Parameters
materialPropertyBlockEditor: MaterialPropertyBlockEditor
Returns
void
InjectRayInteractor ( rayInteractor )
Sets the RayInteractor for a dynamically instantiated ControllerRayVisual.
This method exists to support Interaction SDK's dependency injection pattern and is not needed for typical Unity Editor-based usage.
Signature
void Oculus.Interaction.ControllerRayVisual.InjectRayInteractor(RayInteractor rayInteractor)
Parameters
rayInteractor: RayInteractor
Returns
void
InjectRenderer ( renderer )
Sets the Renderer for a dynamically instantiated ControllerRayVisual.
This method exists to support Interaction SDK's dependency injection pattern and is not needed for typical Unity Editor-based usage.
Signature
void Oculus.Interaction.ControllerRayVisual.InjectRenderer(Renderer renderer)
Parameters
renderer: Renderer
Returns
void