Skip to content

Commit

Permalink
Merge branch 'GodotVR:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
tcrass authored Sep 24, 2023
2 parents 8ffe875 + 05ac527 commit faf28ce
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions VERSIONS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# 4.2.1
- Fixed snap-zones showing highlight when disabled.
- Fixed pickup leaving target highlighted after picking up.
- Fixed collision hands getting stuck too far from the real hands.

# 4.2.0
- Environments can now be set normally in scenes loaded through the staging system.
Expand Down
8 changes: 8 additions & 0 deletions addons/godot-xr-tools/hands/collision_hand.gd
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ const DEFAULT_MASK := 0b0000_0000_0000_0000_1111_1111_1111_1111
# How much displacement is required for the hand to start orienting to a surface
const ORIENT_DISPLACEMENT := 0.05

# Distance to teleport hands
const TELEPORT_DISTANCE := 1.0


## Controls the hand collision mode
@export var mode : CollisionHandMode = CollisionHandMode.COLLIDE
Expand Down Expand Up @@ -160,6 +163,11 @@ func _move_to_target():
global_transform = _target.global_transform
return

# Handle too far from target
if global_position.distance_to(_target.global_position) > TELEPORT_DISTANCE:
global_transform = _target.global_transform
return

# Orient the hand then move
global_transform.basis = _target.global_transform.basis
move_and_slide(_target.global_position - global_position)
Expand Down
1 change: 1 addition & 0 deletions addons/godot-xr-tools/objects/snap_zone.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
[ext_resource type="Script" path="res://addons/godot-xr-tools/objects/snap_zone.gd" id="1"]

[sub_resource type="SphereShape3D" id="1"]
resource_local_to_scene = true
radius = 0.1

[node name="SnapZone" type="Area3D"]
Expand Down
2 changes: 1 addition & 1 deletion addons/godot-xr-tools/plugin.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
name="Godot XR Tools"
description="Godot XR Tools plugin"
author="Bastiaan Olij and Contributors"
version="4.1.0"
version="4.2.1"
script="plugin.gd"

0 comments on commit faf28ce

Please sign in to comment.