CellexalVR  1.1.0
A virtual reality platform for the exploration and analysis of single-cell gene expression data
CellexalVR.Interaction.ControllerModelSwitcher Class Reference

Responsible for changing the controller model and the activated tool. More...

Inheritance diagram for CellexalVR.Interaction.ControllerModelSwitcher:

Public Types

enum  ControllerBrand { Set_Automatically, HTC_Vive, Valve_Index, HP_Reverb }
 
enum  Model {
  Normal, SelectionTool, Menu, Minimizer,
  DeleteTool, Keyboard, TwoLasers, DrawTool,
  WebBrowser
}
 
enum  ControllerColorMode { StaticColors, AnimatedPulse }
 

Public Member Functions

void SwitchControllerBaseModel (ControllerBrand brand, bool left=true, bool right=true)
 Switches the controller's models. More...
 
void SwitchControllerBaseModel (GameObject newModel, bool left=true, bool right=true)
 Switches the controllers' models. More...
 
void SwitchToModel (Model model)
 Switches the right controller's model. More...
 
void ActivateDesiredTool ()
 Activates the current tool and changes the controller's model to that tool and deactivates previously active tool. More...
 
void TurnOffActiveTool (bool inMenu)
 Turns off the active tool and sets our desired model to the normal model. More...
 
void SwitchToDesiredModel ()
 Switches to the desired model. Does not activate or deactivate any tool. More...
 
void SwitchSelectionToolColor (Color color)
 Used by the selectiontoolhandler. Changes the current model's color. More...
 
void SwitchSelectionToolMesh (bool dir)
 Switches the current selection tool mesh. More...
 
void SwitchControllerModelColor (ControllerColorMode mode)
 Changes the colors of the decals on the controllers. More...
 

Public Attributes

ReferenceManager referenceManager
 
ActionBasedController leftControllerScript
 
ActionBasedController rightControllerScript
 
GameObject viveControllerPrefab
 
GameObject valveIndexControllerPrefab
 
GameObject hpReverbControllerPrefab
 
Model ActualModel
 
ControllerColorMode colorMode
 
Material defaultStaticMaterial
 
Material animatedPulseMaterial
 

Properties

ControllerBrand BaseModel [get, set]
 
Model DesiredModel [get, set]
 

Detailed Description

Responsible for changing the controller model and the activated tool.

Member Function Documentation

◆ ActivateDesiredTool()

void CellexalVR.Interaction.ControllerModelSwitcher.ActivateDesiredTool ( )

Activates the current tool and changes the controller's model to that tool and deactivates previously active tool.

◆ SwitchControllerBaseModel() [1/2]

void CellexalVR.Interaction.ControllerModelSwitcher.SwitchControllerBaseModel ( ControllerBrand  brand,
bool  left = true,
bool  right = true 
)

Switches the controller's models.

Parameters
brandThe new model to apply.
leftTrue if the left controller's model should be switched.
rightTrue if the right controller's model should be switched.

◆ SwitchControllerBaseModel() [2/2]

void CellexalVR.Interaction.ControllerModelSwitcher.SwitchControllerBaseModel ( GameObject  newModel,
bool  left = true,
bool  right = true 
)

Switches the controllers' models.

Parameters
newModelThe new model to apply.
leftTrue if the left controller's model should be switched.
rightTrue if the right controller's model should be switched.

◆ SwitchControllerModelColor()

void CellexalVR.Interaction.ControllerModelSwitcher.SwitchControllerModelColor ( ControllerColorMode  mode)

Changes the colors of the decals on the controllers.

Parameters
modeThe new mode
Exceptions
ArgumentException

◆ SwitchSelectionToolColor()

void CellexalVR.Interaction.ControllerModelSwitcher.SwitchSelectionToolColor ( Color  color)

Used by the selectiontoolhandler. Changes the current model's color.

Parameters
colorThe new color.

◆ SwitchSelectionToolMesh()

void CellexalVR.Interaction.ControllerModelSwitcher.SwitchSelectionToolMesh ( bool  dir)

Switches the current selection tool mesh.

Parameters
dirTrue to go 1 index forward in the list of meshes, false to go 1 index backwards.

◆ SwitchToDesiredModel()

void CellexalVR.Interaction.ControllerModelSwitcher.SwitchToDesiredModel ( )

Switches to the desired model. Does not activate or deactivate any tool.

◆ SwitchToModel()

void CellexalVR.Interaction.ControllerModelSwitcher.SwitchToModel ( Model  model)

Switches the right controller's model.

◆ TurnOffActiveTool()

void CellexalVR.Interaction.ControllerModelSwitcher.TurnOffActiveTool ( bool  inMenu)

Turns off the active tool and sets our desired model to the normal model.

Parameters
inMenuTrue if the controller is in the menu and we should temporarily change into the menu model, false otherwise.

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