[gd_scene load_steps=5 format=2]

[ext_resource path="res://addons/godot-openvr/scenes/ovr_shader_cache.tscn" type="PackedScene" id=1]
[ext_resource path="res://addons/godot-openvr/scenes/ovr_controller.tscn" type="PackedScene" id=2]
[ext_resource path="res://addons/godot-openvr/scenes/ovr_main.gd" type="Script" id=3]

[sub_resource type="GDScript" id=1]
script/source = "extends Spatial

func _physics_process(delta):
	# we keep this in line with our camera but we remove the tilt
	var new_transform = get_node(\"../ARVRCamera\").transform
	
	var new_basis = Basis()
	new_basis.z = Vector3(new_transform.basis.z.x, 0.0, new_transform.basis.z.z).normalized()
	if new_basis.z.length() > 0.5:
		new_basis.y - Vector3(0.0, 1.0, 0.0)
		new_basis.x = new_basis.y.cross(new_basis.z)
		new_transform.basis = new_basis
	
		transform = new_transform
	else:
		# we're looking straight up or down, ignore this
		pass"

[node name="OVRFirstPerson" type="ARVROrigin"]
script = ExtResource( 3 )

[node name="ARVRCamera" type="ARVRCamera" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.85, 0 )
fov = 65.0
near = 0.01
far = 1000.01

[node name="ovr_shader_cache" parent="ARVRCamera" instance=ExtResource( 1 )]

[node name="HUD_Anchor" type="Spatial" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.85, 0 )
script = SubResource( 1 )

[node name="Left_Hand" parent="." instance=ExtResource( 2 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.5, 1.25, 0 )

[node name="Right_Hand" parent="." instance=ExtResource( 2 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.5, 1.25, 0 )
controller_id = 2
