# VRChem: A Virtual Reality Molecular Builder
## 2 Implementation
### User Experience
#### 2.4.2 Functions and Usage  
The usage of the software is meant to imitate familiar patterns from commonly used software to make it more accessible and faster to master. A suite of modeling software was studied, including Avogadro [46], GaussView [47], ChemDraw [48] and MolView [49], which inspired the design of the software's functionality. Atom and Bond Creation and Removal  
New atoms and bonds are created with a right hand pinch gesture or trigger press, emulating a mouse left click--demonstrated in Figure 6. When performing the create-action in empty space, a new atom is spawned at either the tip of the index finger of the virtual hand model or circa 5 cm in front of the controller. The element of the created atom can be selected from the menu. For elements with the necessary parameters set in a configuration file, the created atom is saturated with bonded hydrogen atoms in accordance with the VSEPR theory, if this functionality is turned on from the application menu. Performing the create action while pointing at or touching an existing atom will replace the referred atom with one of the user-selected elements. The new element inherits all bonds from the replaced atom, and while no existing bonds are removed, if the inherited bond count is less than dictated by VSEPR theory for the new element, extra hydrogen atoms are added automatically. Finally, starting the create action while pointing at an atom and dragging and releasing it over another creates a new single bond between the atoms. Bonds are modified through the same touch-and-pinch or point-and-click gestures, which cycles between a single, a double and a triple bond. With \"Auto Saturation\" enabled, hydrogen atoms are added or removed as necessary, and other bonded atoms are left unmodified. This building logic is used in many applications and allows quick molecule modeling. The mechanics of this scheme are also already familiar to most chemists and the familiarity should be transferable between software for most users. The control scheme also minimizes menu interactions while building molecules and offers a fluid workflow. Atoms and bonds are deleted by pointing at them and pressing the upper quadrant of the controller touchpad or by extending the right thumb and touching the target object, as shown in Figure 7. When using hand tracking, a red cube around the tip of the extended thumb indicates readiness for object destruction. Atoms and bonds are removed on collision with the cube, and the size of the deleting volume can be adjusted from the application menu. All atoms and bonds can also be removed via a menu button, as shown in Figure 8.  
Editing and Measuring the Molecule Structure  
The molecular structure can be edited with a right hand grab gesture or controller side button press, which when combined with a system for selecting atoms and bonds gives the user robust control over the molecule structure. Editing flow is illustrated in Figure 9. Objects are selected for editing by touching the object with an extended index finger or pointing at the object while pressing the lower quadrant of the controller touchpad. Selected object are highlighted with a green outline and overlaid with a measurement of the selected bond length or angle. Selecting different features of the molecule switches the function of the grab gesture. In a state with a single bond selected, grabbing either of the bonded atoms adjusts the length of the selected bond, moving the connected residue as a whole. Selecting a bond and either of the bonded atoms before grabbing one of the adjacent bonded atoms adjusts the rotational angle of the selected bond. The dihedral angle between two bonds is adjusted by selecting two adjacent bonds and grabbing one of the atoms at the ends of the selected chain.