-
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. Modified XRToolsPlayerBody to split "up" into "up_player" and "up_gravity" as both are needed in different circumstances. Added physics_pre_movement() method to movement providers to let them perform initial service actions such as messing with gravity. Modified wall_walk movement to check for walking walls, and to modify the gravity to point to them.
- Loading branch information
1 parent
05f7d20
commit 79b489d
Showing
28 changed files
with
884 additions
and
168 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
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,41 @@ | ||
tool | ||
class_name XRToolsMovementWallWalk | ||
extends XRToolsMovementProvider | ||
|
||
|
||
## Wall walking provider order | ||
export var order : int = 25 | ||
|
||
## Set our follow layer mask | ||
export (int, LAYERS_3D_PHYSICS) var follow_mask : int = 8 | ||
|
||
## Wall stick distance | ||
export var stick_distance : float = 1.0 | ||
|
||
## Wall stick strength | ||
export var stick_strength : float = 9.8 | ||
|
||
|
||
|
||
func physics_pre_movement(delta: float, player_body: XRToolsPlayerBody): | ||
# Test for collision with wall under feet | ||
var wall_collision := player_body.kinematic_node.move_and_collide( | ||
player_body.up_player_vector * -stick_distance, true, true, true) | ||
if !wall_collision: | ||
return | ||
|
||
# Get the wall information | ||
var wall_node := wall_collision.collider | ||
var wall_normal := wall_collision.normal | ||
|
||
# Skip if the wall node doesn't have a collision layer | ||
if not "collision_layer" in wall_node: | ||
return | ||
|
||
# Skip if the wall doesn't match the follow layer | ||
var wall_layer : int = wall_node.collision_layer | ||
if (wall_layer & follow_mask) == 0: | ||
return | ||
|
||
# Modify the player gravity | ||
player_body.gravity = -wall_normal * 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.