mirror of
https://github.com/CrispyPin/ovr-utils.git
synced 2024-11-22 23:50:25 +01:00
grab translation works when attached to rotated controller
This commit is contained in:
parent
37d982458a
commit
5b55d3ce81
2 changed files with 4 additions and 5 deletions
|
@ -28,7 +28,7 @@ overlay_scene = ExtResource( 7 )
|
||||||
|
|
||||||
[node name="OverlayInstance UI demo" parent="." instance=ExtResource( 1 )]
|
[node name="OverlayInstance UI demo" parent="." instance=ExtResource( 1 )]
|
||||||
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -0.25 )
|
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -0.25 )
|
||||||
target = 3
|
target = 1
|
||||||
overlay_scene = ExtResource( 5 )
|
overlay_scene = ExtResource( 5 )
|
||||||
|
|
||||||
[node name="OverlayInteraction" parent="OverlayInstance UI demo" instance=ExtResource( 8 )]
|
[node name="OverlayInteraction" parent="OverlayInstance UI demo" instance=ExtResource( 8 )]
|
||||||
|
|
|
@ -41,11 +41,10 @@ func _ready() -> void:
|
||||||
func _process(_delta: float) -> void:
|
func _process(_delta: float) -> void:
|
||||||
_update_cursor()
|
_update_cursor()
|
||||||
if is_moving:
|
if is_moving:
|
||||||
# var controller_new = _overlay_area.global_transform.inverse() * _active_controller.global_transform
|
var oc:Transform=_overlay_area.get_parent().transform # controller that overlay is attached to
|
||||||
# var controller_delta = move_grab_offset.inverse() * controller_new
|
|
||||||
# get_parent().transform = move_start_offset * controller_delta
|
|
||||||
var global_target = move_grab_pos + _active_controller.translation
|
var global_target = move_grab_pos + _active_controller.translation
|
||||||
get_parent().translation = global_target - _overlay_area.get_parent().translation
|
global_target = oc.xform_inv(global_target)
|
||||||
|
get_parent().translation = global_target# - _overlay_area.get_parent().translation
|
||||||
|
|
||||||
|
|
||||||
func begin_move():
|
func begin_move():
|
||||||
|
|
Loading…
Reference in a new issue