Skip to content

Overview of Features

Holger Dammertz edited this page Jun 4, 2020 · 2 revisions

OQ_Toolkit feature documentation

This is a short overview of the available nodes in the OQ_Toolkit. The best place to see the nodes in action is to have a look at the example scenes in demo_scenes/.

Features will usually provide additional options inside the Inspector when the respective node is selected.

vr_autoload.gd

This file needs to be registers as an autoload with the global name vr in your project. It contains the vr.intialize() function that needs to be called on application start and also is used as the central place to sync between features.

It contains some global helper functions and enums.

Log functions (that store the messages for in-game display on an OQ_UI2D/OQ_UI2DLogWindow)

  • vr.log_info(string)
  • vr.log_warning(string)
  • vr.log_error(string)

Controller access helper functions:

  • vr.BUTTON: enum for left and right controller buttons
  • vr.get_controller_axis(vr.BUTTON)
  • vr.button_pressed(vr.BUTTON)
  • vr.button_just_pressed(vr.BUTTON)
  • vr.button_just_released(vr.BUTTON)
  • vr.AXIS: enum for left and right controller axis
  • vr.get_controller_axis(vr.AXIS)

Some wrapper functions around the Oculus VrAPI (to be extended in the future):

  • vr.get_supported_display_refresh_rates()
  • vr.set_display_refresh_rate(value)
  • vr.get_boundary_oriented_bounding_box()
  • vr.get_tracking_space()

OQ_ARVROrigin

The OQ_ARVROrigin is the place where anything related to player movement needs to take place.

Feature_Climbing.tscn: In combination with the OQ_ARVRController/Feature_StaticGrab.tscn it allows to climb by moving the origin relative to the grab position.

Feature_Falling.tscn: If the player is above the ground and not fixed by a OQ_ARVRController/Feature_StaticGrab.tscn it will move the player downwards.

Feature_VRSimulator.tscn: Adding this to your scene allows to interact/change the ARVROrigin and ARVRCamera and ARVRController via keyboard commands to allow some basic testing of functionality without the need to deploy to the Oculus Quest. This will be ignored when the variable vr.inVR is true and thus does not need to be removed when running on oculus quest.

Feature_VRRecorder.tscn: This allows to record position, orientation and other things on the Oculus Quest into a .json file and then play it back on desktop for easier feature development and debugging. It is useful for example when building a gesture detection system or debugging more complex (tracking based) interactions for which the Feature_VRSimulator is not sufficient.

More details can be found at Feature_VRRecorder

Locomotion_Stick.tscn: Moves and/or rotates the origin based on joystick input.

OQ_ARVRCamera

Feature_StereoPanorama.tscn: This node renders an omni-directional stereo image. The image needs to be in lat-long format with the upper half representing the left eye. Tools like blender are able to render omni-directional stereo images (see for example here: https://veer.tv/blog/blender-tutorial-how-to-render-a-3d-vr-video-from-blender/)

More details about the omni-direcitonal stereo format and how it can be created can be found here https://developers.google.com/vr/jump/rendering-ods-content.pdf.

The image below is the one used in the stereo panorama demo scene: sponza_2k_ods

The current implementation renders a large quad attached to the camera. You will need to tweak this to your far plane especially if you want to use it as a background together with a 3D scene.

OQ_ARVRController

Feature_ControllerModel_Left/Right.tscn: A model of the Oculus Touch Controller..

Feature_StaticGrab.tscn: a basic indicator that something grabable has been grabbed. This is used by the
OQ_ARVROrigin/Feature_Climbing.tscn for example.

Feature_RigidBodyGrab.tscn: simple logic to grab any rigid body with a controller and release it again. Uses at the moment only velcoity based tracking. It allows basic physics interaction but introduces one physics-frame of delay an will get unstable if there is too much penetration.

Feature_UIRayCast.tscn: A RayCast with a visible representation that allows to interact with a OQ_UI2D/OQ_UI2DCanvas.tscn

OQ_UI2D

OQ_UI2DCanvas.tscn: A world space quad that will render a Control child onto it's surface and contains the logic to interact with a OQ_ARVRController/Feature_UIRayCast.tscn. Important Note: At runtime the child Control will be re-parented under the canvas. So if you need to access control nodes from code you need to use find_node(...) and can not rely on an absolute node path.

OQ_UI2DLabel_IPD.tscn: A OQ_UI2DLabel with a script attached that checks and displays the current IPD

OQ_UI2DLabel.tscn: A world space label to show static text.

OQ_UI2DLogWindow.tscn: A world space quad that will show the text log messages that were printed using the vr.log_info(str), vr.log_warning(str) and vr.log_error(str) functions.

OQ_UI2DVRSettings.tscn: A helper dialog that exposes some VR settings for easy change at runtime. The intended use-case is to be able to check the impact of (performance) settings live fixed foveated rendering at runtime. Best attached as a child to a controller to have it available where needed.

OQ_Helpers

OQ_VisibilityToggle.tscn: A node that will toggle the visibility of it's child based on a controller button. Use this for example to show/hide a UI element attached to a controller.

OQ_SplashScreen.tscn: A Godot logo splash screen (always make sure to advertise Godot at the beginning of your app :-)