Skip to content
Snippets Groups Projects
Commit 0ab84732 authored by Florent Berthaut's avatar Florent Berthaut
Browse files

Add global position to default properties

parent 772aac5e
No related branches found
No related tags found
No related merge requests found
...@@ -18,6 +18,7 @@ func _ready(): ...@@ -18,6 +18,7 @@ func _ready():
#add default properties #add default properties
_add_property("position", [position.x, position.y, position.z]) _add_property("position", [position.x, position.y, position.z])
_add_property("global_position", [position.x, position.y, position.z])
_add_property("scale", [scale.x, scale.y, scale.z]) _add_property("scale", [scale.x, scale.y, scale.z])
_add_property("selected", [0]) _add_property("selected", [0])
_add_property("triggered", [0]) _add_property("triggered", [0])
...@@ -78,6 +79,9 @@ func set_property(prop, vals): ...@@ -78,6 +79,9 @@ func set_property(prop, vals):
"position": "position":
if _can_be_moved: if _can_be_moved:
position = Vector3(vals[0],vals[1],vals[2]) position = Vector3(vals[0],vals[1],vals[2])
"global_position":
if _can_be_moved:
global_position = Vector3(vals[0],vals[1],vals[2])
"rotation": "rotation":
if _can_be_rotated: if _can_be_rotated:
rotation_degrees = Vector3(vals[0],vals[1],vals[2]) rotation_degrees = Vector3(vals[0],vals[1],vals[2])
......
...@@ -38,7 +38,7 @@ enum VRMode {SplitHorizontal, SplitVertical, Anaglyph, QuadBuffer} ...@@ -38,7 +38,7 @@ enum VRMode {SplitHorizontal, SplitVertical, Anaglyph, QuadBuffer}
@export var _screen_vr_screen_size=Vector2(3,2) : set = set_screen_vr_screen_size @export var _screen_vr_screen_size=Vector2(3,2) : set = set_screen_vr_screen_size
@export var _screen_vr_window_size=Vector2(1024,600) : set = set_screen_vr_window_size @export var _screen_vr_window_size=Vector2(1024,600) : set = set_screen_vr_window_size
@export var _screen_vr_window_position=Vector2(640,480) : set = set_screen_vr_window_position @export var _screen_vr_window_position=Vector2(640,480) : set = set_screen_vr_window_position
var _xr_interface var _xr_interface : XRInterface
var _config var _config
# Network variables # Network variables
......
...@@ -7,6 +7,10 @@ var _socket = PacketPeerUDP.new() ...@@ -7,6 +7,10 @@ var _socket = PacketPeerUDP.new()
var _output_address = "127.0.0.1" var _output_address = "127.0.0.1"
var _output_port = 7770 var _output_port = 7770
var _input_port = 7771 var _input_port = 7771
var _verbose = false
func set_verbose(v : bool) -> void:
_verbose=v
func set_output(address, port) : func set_output(address, port) :
_output_address=address _output_address=address
...@@ -14,14 +18,16 @@ func set_output(address, port) : ...@@ -14,14 +18,16 @@ func set_output(address, port) :
if _socket.set_dest_address(_output_address, _output_port)!=OK : if _socket.set_dest_address(_output_address, _output_port)!=OK :
print("GodOSC : Error setting output ", address, ":",port) print("GodOSC : Error setting output ", address, ":",port)
else : else :
print("GodOSC : Setting output to ", address, ":", port) if _verbose :
print("GodOSC : Setting output to ", address, ":", port)
func set_input_port(port) : func set_input_port(port) :
_input_port=port _input_port=port
if _socket.bind(_input_port)!= OK : if _socket.bind(_input_port)!= OK :
print("GodOSC : Error setting input ", port) print("GodOSC : Error setting input ", port)
else : else :
print("GodOSC : Listening to port ", port) if _verbose :
print("GodOSC : Listening to port ", port)
func set_multicast(addr) : func set_multicast(addr) :
...@@ -30,7 +36,8 @@ func set_multicast(addr) : ...@@ -30,7 +36,8 @@ func set_multicast(addr) :
if _socket.join_multicast_group(addr, interf.name)!=OK : if _socket.join_multicast_group(addr, interf.name)!=OK :
print("GodOSC : Error joining multicast on ", interf.name) print("GodOSC : Error joining multicast on ", interf.name)
else : else :
print("GodOSC : Joining multicast on ", interf.name) if _verbose :
print("GodOSC : Joining multicast on ", interf.name)
func send_msg(address, tags, args) : func send_msg(address, tags, args) :
......
...@@ -31,8 +31,6 @@ func start() : ...@@ -31,8 +31,6 @@ func start() :
_osc_discov.set_input_port(mcprt) _osc_discov.set_input_port(mcprt)
_osc_discov.set_multicast(mcadd) _osc_discov.set_multicast(mcadd)
print(_osc_discov.get_local_address())
#retrieve local address #retrieve local address
_local_addr = _osc_discov.get_local_address() _local_addr = _osc_discov.get_local_address()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment