-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
Implement API for obtaining glasses friendly name
This change allows the friendly name defined in the Tilt Five control panel to be accessed. This change also removes the default_display_name option which was producing confusion because it was badly named and was misinterpreted for the the friendly name above. This was the name that was sent to the Tilt Five control panel to display with the glasses while the application was running. But really this should just be the application name and so the plugin now just sends the application name in it's place. The example apps were also amended to demo the feature. Co-authored-by: Jonathan Stevens <jstevens@tiltfive.com>
1 parent
a0207ea
commit d342f8a
Showing
20 changed files
with
134 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using Godot; | ||
using System; | ||
|
||
public partial class ExampleRig : T5XRRig | ||
{ | ||
Node3D pivot; | ||
|
||
public override void _Ready() | ||
{ | ||
pivot = GetNode<Node3D>("Origin/Pivot"); | ||
var label = GetNode<Label3D>("Origin/Pivot/GlassesName"); | ||
|
||
var timer = new Timer(); | ||
timer.Autostart = true; | ||
timer.WaitTime = 1.0; | ||
AddChild(timer); | ||
timer.Timeout += () => label.Text = GlassesName; | ||
} | ||
|
||
// Called every frame. 'delta' is the elapsed time since the previous frame. | ||
public override void _Process(double delta) | ||
{ | ||
var pos = Camera.GlobalPosition; | ||
if(pivot.GlobalPosition.DistanceTo(pos) < 0.01) return; | ||
pivot.LookAt(new Vector3(pos.X, pivot.GlobalPosition.Y, pos.Z), Vector3.Up, true); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
extends Node3D | ||
|
||
func _on_t5_manager_glasses_scene_was_added(glasses): | ||
print("Scene ", glasses.name, " added") | ||
|
||
func _on_t5_manager_glasses_scene_will_be_removed(glasses): | ||
print("Scene ", glasses.name, " removed") | ||
func _on_t5_manager_xr_rig_was_added(xr_rig): | ||
print("Scene for glasses ", xr_rig.get_glasses_id(), " added") | ||
|
||
|
||
func _on_t5_manager_xr_rig_will_be_removed(xr_rig): | ||
print("Scene for glasses ", xr_rig.get_glasses_id(), " removed") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
extends T5XRRig | ||
|
||
|
||
func _ready(): | ||
var timer = Timer.new() | ||
timer.autostart = true | ||
timer.wait_time = 1 | ||
add_child(timer) | ||
timer.timeout.connect(func(): | ||
$Origin/Pivot/GlassesName.text = get_glasses_name() | ||
) | ||
|
||
func _process(delta): | ||
var pos : Vector3 = $Origin/Camera.global_position | ||
if pos.distance_to($Origin/Pivot.global_position) < 0.001: return | ||
$Origin/Pivot.look_at(Vector3(pos.x, $Origin/Pivot.global_position.y, pos.z), Vector3.UP, true) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
#pragma once | ||
#include <TiltFiveNative.h> | ||
#include <chrono> | ||
#include <mutex> | ||
#include <thread> | ||
#include <vector> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters