-
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.
Merge pull request #61 from patrickdown/change_xrrig_access_mthods
Change T5XRRig to use getter functions
- Loading branch information
Showing
10 changed files
with
74 additions
and
32 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,28 @@ | ||
using Godot; | ||
using System; | ||
|
||
public static class T5Def { | ||
|
||
public enum GameboardType | ||
{ | ||
Unknown = 1, | ||
LE = 2, | ||
XE = 3, | ||
XE_Raised = 4 | ||
} | ||
|
||
// Buttons | ||
public static StringName WAND_BUTTON_A = "button_a"; | ||
public static StringName WAND_BUTTON_B = "button_b"; | ||
public static StringName WAND_BUTTON_X = "button_x"; | ||
public static StringName WAND_BUTTON_Y = "button_y"; | ||
public static StringName WAND_BUTTON_1 = "button_1"; | ||
public static StringName WAND_BUTTON_2 = "button_2"; | ||
public static StringName WAND_BUTTON_STICK = "button_3"; | ||
public static StringName WAND_BUTTON_T5 = "button_t5"; | ||
public static StringName WAND_BUTTON_TRIGGER = "trigger_click"; | ||
// Axis | ||
public static StringName WAND_ANALOG_STICK = "stick"; | ||
public static StringName WAND_ANALOG_TRIGGER = "trigger"; | ||
|
||
} |
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,28 +1,41 @@ | ||
class_name T5XRRig extends SubViewport | ||
## represents a scene with all the components needed for Tilt Five tracked glasses and wand | ||
|
||
## An ID attached to a pair of Tilt Five glasses | ||
var glasses_id : StringName | ||
var _glasses_id : StringName | ||
var _gameboard_type := T5Def.GameboardType.Unknown | ||
var _gameboard_size := AABB() | ||
var _origin : T5Origin3D | ||
var _camera : T5Camera3D | ||
var _wand : T5Controller3D | ||
|
||
## Get the ID attached to a pair of Tilt Five glasses | ||
func get_glasses_id() -> StringName: | ||
return _glasses_id | ||
|
||
## Type of gameboard that is set up | ||
var gameboard_type := T5Def.GameboardType.Unknown | ||
func get_gameboard_type() -> T5Def.GameboardType: | ||
return _gameboard_type | ||
|
||
## size of the gameboard in meters. Raised XE gameboards can have a height | ||
var gameboard_size := AABB() | ||
func get_gameboard_size() -> AABB: | ||
return _gameboard_size | ||
|
||
## the node that relates the center of the gameboard to world coordinates | ||
var origin : T5Origin3D | ||
func get_origin() -> T5Origin3D: | ||
return _origin | ||
|
||
## the tracked camera | ||
var camera : T5Camera3D | ||
func get_camera() -> T5Camera3D: | ||
return _camera | ||
|
||
## the tracked wand controller | ||
var wand : T5Controller3D | ||
func get_wand() -> T5Controller3D: | ||
return _wand | ||
|
||
func _enter_tree(): | ||
origin = $Origin | ||
camera = $Origin/Camera | ||
wand = $Origin/Wand_1 | ||
_origin = $Origin | ||
_camera = $Origin/Camera | ||
_wand = $Origin/Wand_1 | ||
|
||
func _process(_delta): | ||
if wand: wand.visible = wand.get_has_tracking_data() | ||
if _wand: _wand.visible = _wand.get_has_tracking_data() |
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