-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modified XRToolsPlayerBody to use the ARVROrigin basis.y for its up v…
…ector. Added demo scene with ground-following movement provider to test the new up-vector logic. Added player orientation provider support to the XRToolsPlayerBody. Added ground and area orientation providers. Added path, point, and uniform orient areas to control the player orientation in different areas. Enhanced origin gravity demo to use orient areas to better handle player movement around the sphere and pill shapes. Removed experimental world-grab provider not intended for this PR Fixed climbing to work in the players orientation. Fixed flight to work in the players orientation. Fixed glide to work in the players orientation. Added sphere world demo. Removed orientation providers - orientation now comes from gravity as detected by the player body. Modified gravity demos to use standard Area nodes with space_override settings. Added movement_wall_walk to walk on walls of the specified physics layer. Further cleanup of orientation providers and unnecessary changes.
- Loading branch information
1 parent
05f7d20
commit 49a49ea
Showing
26 changed files
with
849 additions
and
167 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
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
tool | ||
class_name XRToolsMovementWallWalk | ||
extends XRToolsMovementProvider | ||
|
||
|
||
## Wall walking provider order | ||
export var order : int = 10 | ||
|
||
## Set our follow layer mask | ||
export (int, LAYERS_3D_PHYSICS) var follow_mask : int = 1023 | ||
|
||
## Wall stick strength | ||
export var stick_strength : float = 9.8 | ||
|
||
|
||
|
||
# Perform jump movement | ||
func physics_movement(_delta: float, player_body: XRToolsPlayerBody, _disabled: bool): | ||
# Skip if not in contact with ground | ||
if not player_body.on_ground: | ||
return | ||
|
||
# Skip if the ground node doesn't have a collision layer | ||
if not "collision_layer" in player_body.ground_node: | ||
return | ||
|
||
# Skip if the ground doesn't have the follow layer | ||
var ground_layer : int = player_body.ground_node.collision_layer | ||
if (ground_layer & follow_mask) == 0: | ||
return | ||
|
||
# Modify gravity to match the ground | ||
player_body.gravity = player_body.ground_vector * -stick_strength |
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,6 @@ | ||
[gd_scene load_steps=2 format=2] | ||
|
||
[ext_resource path="res://addons/godot-xr-tools/functions/movement_wall_walk.gd" type="Script" id=1] | ||
|
||
[node name="MovementWallWalk" type="Node" groups=["movement_providers"]] | ||
script = ExtResource( 1 ) |
Oops, something went wrong.