Demo Projects
This section provides detailed explanations of the demo projects included with the QWR Unity SDK for VROne. Edu. These demos showcase various VR interaction patterns and serve as excellent starting points for your own VR applications.
Demo Explanation
QWRRotate.cs Demo
Development Environment:
- Unity version: 2019.4.17 or later versions
- QWR SDK version: 0.8.1 (beta)/0.8.1b
Function Description: The QwrRotat functionality supports controlling the movement or rotation direction of the attached object or self using a controller.
Movement Controls
- Forward Movement: Touch the front of the controller to make the object move towards the forward direction
- Backward Movement: Touch the bottom of the controller to make the object move towards the back direction
- Left Movement: Touch the left side of the controller to make the object move towards the left direction
- Right Movement: Touch the right side of the controller to make the object move towards the right direction
Rotation Controls
- X-Axis Counterclockwise: Press the trigger button and touch the front of the touchpad to rotate the object counterclockwise around the X-axis
- X-Axis Clockwise: Press the trigger button and touch the back of the touchpad to rotate the object clockwise around the X-axis
- Y-Axis Counterclockwise: Press the trigger button and move the joystick touchpad to the left to rotate the object counterclockwise around the Y-axis
- Y-Axis Clockwise: Press the trigger button and move the joystick touchpad to the right to rotate the object clockwise around the Y-axis
Teleport.cs Demo
Development Environment:
- Unity version: 2019.4.17 or later versions
- QWR SDK version: 0.8.1 (beta)/0.8.1b
Function Description:
Teleportation System
- Controller-Based Teleportation: Use the controller ray to align with the ground in the scene, press the trigger button to teleport to the position aligned with the ray
- Interactive Object Highlighting: Move the controller onto an object in the scene to cause the object's color to change, providing visual feedback for interactive elements
This demo demonstrates essential VR locomotion patterns and interactive feedback systems commonly used in VR applications.
Grabbable Script Demo
Development Environment:
- Unity version: 2019.4.17 or later versions
- QWR SDK version: 0.8.1 (beta)/0.8.1b
Function Description:
Object Grabbing System
The grabbable script uses the controllerTransform to compute the desired position of the object when it is grabbed. During the update, the object will gradually move towards the target position and align its orientation with the controller.
Parameters
| Parameter | Effect |
|---|---|
Grab() and Release() | Used to handle grabbing and releasing objects |
ReturnToStartPoint | Used to determine whether an object should return to its initial position after being released. During grabbing, the UI raycast detector is temporarily disabled and re-enabled upon release |
IsGrabbed() | Returns the grab state of an object |
Key Features
- Smooth Object Movement: Objects smoothly transition to the controller position when grabbed
- Orientation Alignment: Grabbed objects align their orientation with the controller
- Return to Start: Optional functionality to return objects to their original position when released
- UI Integration: Proper handling of UI raycast detection during grab operations
Getting Started with Demos
- Import the QWR Unity SDK into your Unity project
- Navigate to the Samples folder in the QWR SDK package
- Open the demo scenes to explore different interaction patterns
- Study the scripts to understand the implementation details
- Modify and experiment with the parameters to create your own VR interactions
Best Practices
Performance Optimization
- Use object pooling for frequently grabbed objects
- Implement proper cleanup in grab/release methods
- Consider LOD (Level of Detail) systems for complex objects
User Experience
- Provide clear visual feedback for interactive elements
- Ensure smooth transitions and animations
- Test with different controller configurations
Troubleshooting
Common Issues
- Objects not responding to controller input: Check that the QWR SDK is properly initialized
- Teleportation not working: Ensure the ground has proper colliders
- Grabbing feels sluggish: Adjust the movement speed parameters in the grabbable script
These demo projects provide a solid foundation for understanding VR interaction patterns and can be customized for your specific educational VR applications.