diff --git a/addons/godot-xr-tools/functions/movement_climb.gd b/addons/godot-xr-tools/functions/movement_climb.gd index 278d8863..a772905e 100644 --- a/addons/godot-xr-tools/functions/movement_climb.gd +++ b/addons/godot-xr-tools/functions/movement_climb.gd @@ -26,9 +26,6 @@ signal player_climb_start signal player_climb_end -## Horizontal vector used to calculate the horizontal component of vectors -const HORIZONTAL := Vector3(1.0, 0.0, 1.0) - ## Distance at which grabs snap const SNAP_DISTANCE : float = 1.0 @@ -149,9 +146,15 @@ func _set_climbing(active: bool, player_body: XRToolsPlayerBody) -> void: player_body.override_player_height(self, 0.0) emit_signal("player_climb_start") else: + # Calculate the forward direction (based on camera-forward) + var dir_forward = -player_body.up_plane.project( + player_body.camera_node.global_transform.basis.z).normalized() + + # Set player velocity based on averaged velocity, fling multiplier, + # and a forward push var velocity := _averager.velocity() - var dir_forward = -(player_body.camera_node.global_transform.basis.z * HORIZONTAL).normalized() player_body.velocity = (velocity * fling_multiplier) + (dir_forward * forward_push) + player_body.override_player_height(self) emit_signal("player_climb_end") diff --git a/addons/godot-xr-tools/functions/movement_flight.gd b/addons/godot-xr-tools/functions/movement_flight.gd index 7c790b76..0832e4fd 100644 --- a/addons/godot-xr-tools/functions/movement_flight.gd +++ b/addons/godot-xr-tools/functions/movement_flight.gd @@ -3,33 +3,30 @@ class_name XRToolsMovementFlight extends XRToolsMovementProvider +## XR Tools Movement Provider for Flying ## -## Movement Provider for Flying +## This script provides flying movement for the player. The control parameters +## are intended to support a wide variety of flight mechanics. ## -## @desc: -## This script provides flying movement for the player. The control parameters -## are intended to support a wide variety of flight mechanics. +## Pitch and Bearing input devices are selected which produce a "forwards" +## reference frame. The player controls (forwards/backwards and +## left/right) are applied in relation to this reference frame. ## -## Pitch and Bearing input devices are selected which produce a "forwards" -## reference frame. The player controls (forwards/backwards and -## left/right) are applied in relation to this reference frame. +## The Speed Scale and Traction parameters allow primitive flight where +## the player is in direct control of their speed (in the reference frame). +## This produces an effect described as the "Mary Poppins Flying Umbrella". ## -## The Speed Scale and Traction parameters allow primitive flight where -## the player is in direct control of their speed (in the reference frame). -## This produces an effect described as the "Mary Poppins Flying Umbrella". +## The Acceleration, Drag, and Guidance parameters allow for slightly more +## realisitic flying where the player can accelerate in their reference +## frame. The drag is applied against the global reference and can be used +## to construct a terminal velocity. ## -## The Acceleration, Drag, and Guidance parameters allow for slightly more -## realisitic flying where the player can accelerate in their reference -## frame. The drag is applied against the global reference and can be used -## to construct a terminal velocity. -## -## The Guidance property attempts to lerp the players velocity into flight -## forwards direction as if the player had guide-fins or wings. -## -## The Exclusive property specifies whether flight is exclusive (no further -## physics effects after flying) or whether additional effects such as -## the default player gravity are applied. +## The Guidance property attempts to lerp the players velocity into flight +## forwards direction as if the player had guide-fins or wings. ## +## The Exclusive property specifies whether flight is exclusive (no further +## physics effects after flying) or whether additional effects such as +## the default player gravity are applied. ## Signal emitted when flight starts @@ -39,33 +36,26 @@ signal flight_started() signal flight_finished() -# Enumeration of controller to use for flight +## Enumeration of controller to use for flight enum FlightController { - LEFT, # Use left controller - RIGHT, # Use right controler + LEFT, ## Use left controller + RIGHT, ## Use right controler } -# Enumeration of pitch control input +## Enumeration of pitch control input enum FlightPitch { - HEAD, # Head controls pitch - CONTROLLER, # Controller controls pitch + HEAD, ## Head controls pitch + CONTROLLER, ## Controller controls pitch } -# Enumeration of bearing control input +## Enumeration of bearing control input enum FlightBearing { - HEAD, # Head controls bearing - CONTROLLER, # Controller controls bearing - BODY, # Body controls bearing + HEAD, ## Head controls bearing + CONTROLLER, ## Controller controls bearing + BODY, ## Body controls bearing } -# Vector3 for getting vertical component -const VERTICAL := Vector3(0.0, 1.0, 0.0) - -# Vector3 for getting horizontal component -const HORIZONTAL := Vector3(1.0, 0.0, 1.0) - - ## Movement provider order export var order : int = 30 @@ -100,10 +90,10 @@ export var guidance : float = 0.0 export var exclusive : bool = true -# Flight button state +## Flight button state var _flight_button : bool = false -# Flight controller +## Flight controller var _controller : ARVRController @@ -126,7 +116,7 @@ func _ready(): _controller = _right_controller -# Process physics movement for +# Process physics movement for flight func physics_movement(delta: float, player_body: XRToolsPlayerBody, disabled: bool): # Disable flying if requested, or if no controller if disabled or !enabled or !_controller.get_is_active(): @@ -147,29 +137,29 @@ func physics_movement(delta: float, player_body: XRToolsPlayerBody, disabled: bo var pitch_vector: Vector3 if pitch == FlightPitch.HEAD: # Use the vertical part of the 'head' forwards vector - pitch_vector = -_camera.global_transform.basis.z.y * VERTICAL + pitch_vector = -_camera.transform.basis.z.y * player_body.up_vector else: # Use the vertical part of the 'controller' forwards vector - pitch_vector = -_controller.global_transform.basis.z.y * VERTICAL + pitch_vector = -_controller.transform.basis.z.y * player_body.up_vector # Select the bearing vector var bearing_vector: Vector3 if bearing == FlightBearing.HEAD: # Use the horizontal part of the 'head' forwards vector - bearing_vector = -_camera.global_transform.basis.z * HORIZONTAL + bearing_vector = -player_body.up_plane.project(_camera.global_transform.basis.z) elif bearing == FlightBearing.CONTROLLER: # Use the horizontal part of the 'controller' forwards vector - bearing_vector = -_controller.global_transform.basis.z * HORIZONTAL + bearing_vector = -player_body.up_plane.project(_controller.global_transform.basis.z) else: # Use the horizontal part of the 'body' forwards vector var left := _left_controller.global_transform.origin var right := _right_controller.global_transform.origin - var left_to_right := (right - left) * HORIZONTAL - bearing_vector = left_to_right.rotated(Vector3.UP, PI/2) + var left_to_right := right - left + bearing_vector = player_body.up_plane.project(left_to_right.rotated(player_body.up_vector, PI/2)) # Construct the flight bearing var forwards := (bearing_vector.normalized() + pitch_vector).normalized() - var side := forwards.cross(Vector3.UP) + var side := forwards.cross(player_body.up_vector) # Construct the target velocity var joy_forwards := _controller.get_joystick_axis(XRTools.Axis.VR_PRIMARY_Y_AXIS) diff --git a/addons/godot-xr-tools/functions/movement_glide.gd b/addons/godot-xr-tools/functions/movement_glide.gd index ea8e574d..28725d2c 100644 --- a/addons/godot-xr-tools/functions/movement_glide.gd +++ b/addons/godot-xr-tools/functions/movement_glide.gd @@ -3,23 +3,20 @@ class_name XRToolsMovementGlide extends XRToolsMovementProvider +## XR Tools Movement Provider for Gliding ## -## Movement Provider for Gliding +## This script provides glide mechanics for the player. This script works +## with the [XRToolsPlayerBody] attached to the players [ARVROrigin]. ## -## @desc: -## This script provides glide mechanics for the player. This script works -## with the PlayerBody attached to the players ARVROrigin. +## The player enables flying by moving the controllers apart further than +## 'glide_detect_distance'. ## -## The player enables flying by moving the controllers apart further than -## 'glide_detect_distance'. -## -## When gliding, the players fall speed will slew to 'glide_fall_speed' and -## the velocity will slew to 'glide_forward_speed' in the direction the -## player is facing. -## -## Gliding is an exclusive motion operation, and so gliding should be ordered -## after any Direct movement providers responsible for turning. +## When gliding, the players fall speed will slew to 'glide_fall_speed' and +## the velocity will slew to 'glide_forward_speed' in the direction the +## player is facing. ## +## Gliding is an exclusive motion operation, and so gliding should be ordered +## after any Direct movement providers responsible for turning. ## Signal invoked when the player starts gliding @@ -29,10 +26,6 @@ signal player_glide_start signal player_glide_end -# Horizontal vector (multiply by this to get only the horizontal components -const HORIZONTAL := Vector3(1.0, 0.0, 1.0) - - ## Movement provider order export var order : int = 35 @@ -80,19 +73,19 @@ func physics_movement(delta: float, player_body: XRToolsPlayerBody, disabled: bo return # If on the ground, or not falling, then not gliding - if player_body.on_ground || player_body.velocity.y >= glide_min_fall_speed: + var vertical_velocity := player_body.velocity.dot(player_body.up_vector) + if player_body.on_ground || vertical_velocity >= glide_min_fall_speed: _set_gliding(false) return # Get the controller left and right global horizontal positions var left_position := _left_controller.global_transform.origin var right_position := _right_controller.global_transform.origin - var left_to_right_vector := right_position - left_position - var left_to_right := (left_to_right_vector) * HORIZONTAL + var left_to_right := right_position - left_position if turn_with_roll: - var angle = -left_to_right_vector.y - _rotate_player(player_body, roll_turn_speed * delta * angle) + var angle = -left_to_right.dot(player_body.up_vector) + player_body.rotate_player(roll_turn_speed * delta * angle) # Set gliding based on hand separation var separation := left_to_right.length() / ARVRServer.world_scale @@ -103,32 +96,21 @@ func physics_movement(delta: float, player_body: XRToolsPlayerBody, disabled: bo return # Lerp the vertical velocity to glide_fall_speed - var vertical_velocity := player_body.velocity.y vertical_velocity = lerp(vertical_velocity, glide_fall_speed, vertical_slew_rate * delta) # Lerp the horizontal velocity towards forward_speed - var horizontal_velocity := player_body.velocity * HORIZONTAL - var dir_forward := left_to_right.rotated(Vector3.UP, PI/2).normalized() + var horizontal_velocity := player_body.up_plane.project(player_body.velocity) + var dir_forward := player_body.up_plane.project(left_to_right.rotated(player_body.up_vector, PI/2)).normalized() var forward_velocity := dir_forward * glide_forward_speed horizontal_velocity = lerp(horizontal_velocity, forward_velocity, horizontal_slew_rate * delta) # Perform the glide - var glide_velocity := horizontal_velocity + vertical_velocity * Vector3.UP + var glide_velocity := horizontal_velocity + vertical_velocity * player_body.up_vector player_body.velocity = player_body.move_body(glide_velocity) # Report exclusive motion performed (to bypass gravity) return true -# Rotate the origin node around the camera -func _rotate_player(player_body: XRToolsPlayerBody, angle: float): - var t1 := Transform() - var t2 := Transform() - var rot := Transform() - - t1.origin = -player_body.camera_node.transform.origin - t2.origin = player_body.camera_node.transform.origin - rot = rot.rotated(Vector3(0.0, -1.0, 0.0), angle) - player_body.origin_node.transform = (player_body.origin_node.transform * t2 * rot * t1).orthonormalized() # Set the gliding state and fire any signals func _set_gliding(active: bool) -> void: diff --git a/addons/godot-xr-tools/functions/movement_turn.gd b/addons/godot-xr-tools/functions/movement_turn.gd index 93551290..71cf6b64 100644 --- a/addons/godot-xr-tools/functions/movement_turn.gd +++ b/addons/godot-xr-tools/functions/movement_turn.gd @@ -69,7 +69,7 @@ func physics_movement(delta: float, player_body: XRToolsPlayerBody, _disabled: b # Handle smooth rotation if !_snap_turning(): - _rotate_player(player_body, smooth_turn_speed * delta * left_right) + player_body.rotate_player(smooth_turn_speed * delta * left_right) return # Update the next turn-step delay @@ -79,19 +79,7 @@ func physics_movement(delta: float, player_body: XRToolsPlayerBody, _disabled: b # Turn one step in the requested direction _turn_step = step_turn_delay - _rotate_player(player_body, deg2rad(step_turn_angle) * sign(left_right)) - - -# Rotate the origin node around the camera -func _rotate_player(player_body: XRToolsPlayerBody, angle: float): - var t1 := Transform() - var t2 := Transform() - var rot := Transform() - - t1.origin = -player_body.camera_node.transform.origin - t2.origin = player_body.camera_node.transform.origin - rot = rot.rotated(Vector3(0.0, -1.0, 0.0), angle) - player_body.origin_node.transform = (player_body.origin_node.transform * t2 * rot * t1).orthonormalized() + player_body.rotate_player(deg2rad(step_turn_angle) * sign(left_right)) # This method verifies the movement provider has a valid configuration. diff --git a/addons/godot-xr-tools/functions/movement_wall_walk.gd b/addons/godot-xr-tools/functions/movement_wall_walk.gd new file mode 100644 index 00000000..dd172be2 --- /dev/null +++ b/addons/godot-xr-tools/functions/movement_wall_walk.gd @@ -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 diff --git a/addons/godot-xr-tools/functions/movement_wall_walk.tscn b/addons/godot-xr-tools/functions/movement_wall_walk.tscn new file mode 100644 index 00000000..ad16a85e --- /dev/null +++ b/addons/godot-xr-tools/functions/movement_wall_walk.tscn @@ -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 ) diff --git a/addons/godot-xr-tools/player/player_body.gd b/addons/godot-xr-tools/player/player_body.gd index 03315c38..5d2511ce 100644 --- a/addons/godot-xr-tools/player/player_body.gd +++ b/addons/godot-xr-tools/player/player_body.gd @@ -3,23 +3,20 @@ class_name XRToolsPlayerBody, "res://addons/godot-xr-tools/editor/icons/body.svg extends Node +## XR Tools Player Physics Body Script ## -## Player Physics Body Script +## This node provides the player with a physics body. The body is a +## [CapsuleShape] which tracks the player location as measured by the +## [ARVRCamera] for the players head. ## -## @desc: -## This script works with the PlayerBody asset to provide the player with -## a PlayerBody. This PlayerBody is a capsule tracking the players hear -## via the ARVRCamera node. +## The player body can detect when the player is in the air, on the ground, +## or on a steep slope. ## -## The PlayerBody can detect when the player is in the air, on the ground, -## or on a steep slope. -## -## The PlayerBody works with movement providers to allow the player to move -## around the environment. -## -## At the end of each physics process step the ARVROrigin is updated to -## track any movement to the PlayerBody. +## Player movement is achieved by a number of movement providers attached to +## either the player or their controllers. ## +## After the player body moves, the [ARVROrigin] is updated as necessary to +## track the players movement. ## Signal emitted when the player jumps @@ -29,10 +26,6 @@ signal player_jumped() signal player_bounced(collider, magnitude) -# Horizontal vector (multiply by this to get only the horizontal components -const HORIZONTAL := Vector3(1.0, 0.0, 1.0) - - ## Player body enabled flag export var enabled : bool = true setget set_enabled @@ -51,9 +44,6 @@ export var player_height_max : float = 2.2 ## Eyes forward offset from center of body in player_radius units export (float, 0.0, 1.0) var eye_forward_offset : float = 0.66 -## Force of gravity on the player -export var gravity : float = -9.8 - ## Lets the player push rigid bodies export var push_rigid_bodies : bool = true @@ -70,6 +60,9 @@ export (int, LAYERS_3D_PHYSICS) var collision_mask : int = 1023 setget set_colli ## Player Velocity - modifiable by movement providers var velocity : Vector3 = Vector3.ZERO +## Current player gravity +var gravity : Vector3 = Vector3.ZERO + ## Player On Ground flag - used by movement providers var on_ground : bool = true @@ -94,6 +87,11 @@ var player_height_offset : float = 0.0 ## Velocity of the ground under the players feet var ground_velocity : Vector3 = Vector3.ZERO +## Player up direction +var up_vector := Vector3.UP + +## Player up plane +var up_plane := Plane(Vector3.UP, 0.0) # Movement providers var _movement_providers := Array() @@ -101,10 +99,10 @@ var _movement_providers := Array() # Jump cool-down counter var _jump_cooldown := 0 -## Player height overrides +# Player height overrides var _player_height_overrides := { } -# Player height override (enabled when non-negative) +## Player height override (enabled when non-negative) var _player_height_override : float = -1.0 # Previous ground node @@ -212,6 +210,14 @@ func _physics_process(delta: float): set_physics_process(false) return + # Read the player gravity + var state := PhysicsServer.body_get_direct_state(kinematic_node.get_rid()) + gravity = state.total_gravity + + # Get the up vector from the origin + up_vector = origin_node.global_transform.basis.y + up_plane = Plane(up_vector, 0.0) + # Decrement the jump cool-down on each physics update if _jump_cooldown: _jump_cooldown -= 1 @@ -232,6 +238,7 @@ func _physics_process(delta: float): # - Read and modify the ground-control velocity # - Perform exclusive updating of the player (bypassing other movement providers) # - Request a jump + # - Modify gravity direction ground_control_velocity = Vector2.ZERO var exclusive := false for p in _movement_providers: @@ -244,16 +251,21 @@ func _physics_process(delta: float): if !exclusive: if on_ground and ground_physics.stop_on_slope and ground_angle < ground_physics.move_max_slope: # Apply gravity towards slope to prevent sliding - velocity += ground_vector * gravity * delta + velocity += -ground_vector * gravity.length() * delta else: - # Apply gravity down - velocity += Vector3.UP * gravity * delta + # Apply gravity + velocity += gravity * delta _apply_velocity_and_control(delta) # Apply the player-body movement to the ARVR origin var movement := kinematic_node.global_transform.origin - position_before_movement origin_node.global_transform.origin += movement + # Orient the player towards gravity + up_vector = -gravity.normalized() + slew_up(up_vector, 5.0 * delta) + + # Request a jump func request_jump(skip_jump_velocity := false): # Skip if cooling down from a previous jump @@ -284,7 +296,49 @@ func request_jump(skip_jump_velocity := false): # Move the players body func move_body(p_velocity: Vector3) -> Vector3: - return kinematic_node.move_and_slide(p_velocity, Vector3.UP, false, 4, 0.785398, push_rigid_bodies) + return kinematic_node.move_and_slide(p_velocity, up_vector, false, 4, 0.785398, push_rigid_bodies) + +## Rotate the player +## +## This method rotates the player by rotating the [ARVROrigin] around the camera. +func rotate_player(angle: float): + var t1 := Transform() + var t2 := Transform() + var rot := Transform() + + t1.origin = -camera_node.transform.origin + t2.origin = camera_node.transform.origin + rot = rot.rotated(Vector3.DOWN, angle) + origin_node.transform = (origin_node.transform * t2 * rot * t1).orthonormalized() + +## Slew the players up vector +## +## This method slews the players up vector by rotating the [ARVROrigin] around +## the players feet. +func slew_up(up: Vector3, slew: float) -> void: + # Skip if the up vector is not valid + if up.is_equal_approx(Vector3.ZERO): + return + + # Get the current origin + var current_origin := origin_node.global_transform + + # Save the player foot global and local positions + var ref_pos_global := kinematic_node.global_translation + var ref_pos_local : Vector3 = current_origin.xform_inv(ref_pos_global) + + # Calculate the target origin + var target_origin := current_origin + target_origin.basis.y = up.normalized() + target_origin.basis.x = target_origin.basis.y.cross(target_origin.basis.z).normalized() + target_origin.basis.z = target_origin.basis.x.cross(target_origin.basis.y).normalized() + target_origin.origin = ref_pos_global - target_origin.basis.xform(ref_pos_local) + + # Calculate the new origin + var new_origin := current_origin.interpolate_with(target_origin, slew).orthonormalized() + + # Update the origin + origin_node.global_transform = new_origin # Set or clear a named height override func override_player_height(key, value: float = -1.0): @@ -321,11 +375,12 @@ func _update_body_under_camera(): # Center the kinematic body on the ground under the camera var curr_transform := kinematic_node.global_transform var camera_transform := camera_node.global_transform + curr_transform.basis = origin_node.global_transform.basis curr_transform.origin = camera_transform.origin - curr_transform.origin.y += player_head_height - player_height + curr_transform.origin += up_vector * (player_head_height - player_height) # The camera/eyes are towards the front of the body, so move the body back slightly - var forward_dir := -camera_transform.basis.z * HORIZONTAL + var forward_dir := up_plane.project(-camera_transform.basis.z) if forward_dir.length() > 0.01: curr_transform.origin -= forward_dir.normalized() * eye_forward_offset * player_radius @@ -335,10 +390,10 @@ func _update_body_under_camera(): # This method updates the information about the ground under the players feet func _update_ground_information(delta: float): # Update the ground information - var ground_collision := kinematic_node.move_and_collide(Vector3(0.0, -0.1, 0.0), true, true, true) + var ground_collision := kinematic_node.move_and_collide(up_vector * -0.1, true, true, true) if !ground_collision: on_ground = false - ground_vector = Vector3.UP + ground_vector = up_vector ground_angle = 0.0 ground_node = null ground_physics = null @@ -348,7 +403,7 @@ func _update_ground_information(delta: float): # Save the ground information from the collision on_ground = true ground_vector = ground_collision.normal - ground_angle = rad2deg(ground_collision.get_angle()) + ground_angle = rad2deg(ground_collision.get_angle(up_vector)) ground_node = ground_collision.collider # Select the ground physics @@ -378,8 +433,8 @@ func _apply_velocity_and_control(delta: float): var local_velocity := velocity - ground_velocity # Split the velocity into horizontal and vertical components - var horizontal_velocity := local_velocity * HORIZONTAL - var vertical_velocity := local_velocity * Vector3.UP + var horizontal_velocity := up_plane.project(local_velocity) + var vertical_velocity := local_velocity - horizontal_velocity # If the player is on the ground then give them control if on_ground: @@ -387,8 +442,8 @@ func _apply_velocity_and_control(delta: float): var control_velocity := Vector3.ZERO if abs(ground_control_velocity.x) > 0.1 or abs(ground_control_velocity.y) > 0.1: var camera_transform := camera_node.global_transform - var dir_forward := (camera_transform.basis.z * HORIZONTAL).normalized() - var dir_right := (camera_transform.basis.x * HORIZONTAL).normalized() + var dir_forward := up_plane.project(camera_transform.basis.z).normalized() + var dir_right := up_plane.project(camera_transform.basis.x).normalized() control_velocity = (dir_forward * -ground_control_velocity.y + dir_right * ground_control_velocity.x) * ARVRServer.world_scale # Apply control velocity to horizontal velocity based on traction @@ -400,7 +455,7 @@ func _apply_velocity_and_control(delta: float): var current_max_slope := XRToolsGroundPhysicsSettings.get_move_max_slope(ground_physics, default_physics) if ground_angle > current_max_slope: # Get a vector in the down-hill direction - var down_direction := (ground_vector * HORIZONTAL).normalized() + var down_direction := up_plane.project(ground_vector).normalized() var vdot: float = down_direction.dot(horizontal_velocity) if vdot < 0: horizontal_velocity -= down_direction * vdot @@ -434,8 +489,9 @@ func _apply_velocity_and_control(delta: float): emit_signal("player_bounced", collision_node, magnitude) # Hack to ensure feet stick to ground (if not jumping) - if abs(velocity.y) < 0.001: - velocity.y = ground_velocity.y + # TODO: FIX + #if abs(velocity.y) < 0.001: + # velocity.y = ground_velocity.y # Get a guaranteed-valid physics func _guaranteed_physics(): diff --git a/assets/nasa/README.txt b/assets/nasa/README.txt new file mode 100644 index 00000000..75ba82e8 --- /dev/null +++ b/assets/nasa/README.txt @@ -0,0 +1,9 @@ +Nasa Deep Star Maps 2020 and constellation figures visualization: + +https://svs.gsfc.nasa.gov/4851 + +NASA/Goddard Space Flight Center Scientific Visualization Studio. Gaia DR2: ESA/Gaia/DPAC. Constellation figures based on those developed for the IAU by Alan MacRobert of Sky and Telescope magazine (Roger Sinnott and Rick Fienberg). + +This work has made use of data from the European Space Agency (ESA) mission Gaia (https://www.cosmos.esa.int/gaia), processed by the Gaia Data Processing and Analysis Consortium (DPAC, https://www.cosmos.esa.int/web/gaia/dpac/consortium). Funding for the DPAC has been provided by national institutions, in particular the institutions participating in the Gaia Multilateral Agreement. + +Educational and non-commercial use allowed by nasa (https://www.nasa.gov/multimedia/guidelines/index.html) \ No newline at end of file diff --git a/assets/nasa/starmap_and_constellation_figures_4k.jpg b/assets/nasa/starmap_and_constellation_figures_4k.jpg new file mode 100644 index 00000000..d1266107 Binary files /dev/null and b/assets/nasa/starmap_and_constellation_figures_4k.jpg differ diff --git a/assets/nasa/starmap_and_constellation_figures_4k.jpg.import b/assets/nasa/starmap_and_constellation_figures_4k.jpg.import new file mode 100644 index 00000000..849f7bb2 --- /dev/null +++ b/assets/nasa/starmap_and_constellation_figures_4k.jpg.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/starmap_and_constellation_figures_4k.jpg-44440b8ebaa8e4137f11fb76267d3017.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/nasa/starmap_and_constellation_figures_4k.jpg" +dest_files=[ "res://.import/starmap_and_constellation_figures_4k.jpg-44440b8ebaa8e4137f11fb76267d3017.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/project.godot b/project.godot index 41c59303..3c3f28fd 100644 --- a/project.godot +++ b/project.godot @@ -14,11 +14,6 @@ _global_script_classes=[ { "language": "GDScript", "path": "res://addons/godot-xr-tools/misc/arvr_helpers.gd" }, { -"base": "ARVROrigin", -"class": "FirstPersonControllerVR", -"language": "GDScript", -"path": "res://addons/godot-openxr/scenes/first_person_controller_vr.gd" -}, { "base": "Spatial", "class": "Teleport", "language": "GDScript", @@ -225,6 +220,11 @@ _global_script_classes=[ { "path": "res://addons/godot-xr-tools/functions/movement_turn.gd" }, { "base": "XRToolsMovementProvider", +"class": "XRToolsMovementWallWalk", +"language": "GDScript", +"path": "res://addons/godot-xr-tools/functions/movement_wall_walk.gd" +}, { +"base": "XRToolsMovementProvider", "class": "XRToolsMovementWind", "language": "GDScript", "path": "res://addons/godot-xr-tools/functions/movement_wind.gd" @@ -291,7 +291,6 @@ _global_script_classes=[ { } ] _global_script_class_icons={ "ARVRHelpers": "", -"FirstPersonControllerVR": "", "Teleport": "", "XRTools": "", "XRToolsClimbable": "res://addons/godot-xr-tools/editor/icons/hand.svg", @@ -333,6 +332,7 @@ _global_script_class_icons={ "XRToolsMovementProvider": "res://addons/godot-xr-tools/editor/icons/movement_provider.svg", "XRToolsMovementSprint": "", "XRToolsMovementTurn": "", +"XRToolsMovementWallWalk": "", "XRToolsMovementWind": "", "XRToolsPhysicsHand": "", "XRToolsPickable": "", @@ -375,6 +375,7 @@ common/drop_mouse_on_gui_input_disabled=true 3d_physics/layer_1="static_world" 3d_physics/layer_2="dynamic_world" 3d_physics/layer_3="object" +3d_physics/layer_4="orientable_ground" 3d_physics/layer_17="held_object" 3d_physics/layer_18="player_hand" 3d_physics/layer_20="player_body" diff --git a/scenes/main_menu/main_menu_level.gd b/scenes/main_menu/main_menu_level.gd index 23f87bbc..6a6a21a3 100644 --- a/scenes/main_menu/main_menu_level.gd +++ b/scenes/main_menu/main_menu_level.gd @@ -7,7 +7,7 @@ func _update_demo_positions() -> void: var angle = 2.0 * PI / count for i in count: var t = Transform() - t.origin = Vector3(0.0, 0.0, -7.0) + t.origin = Vector3(0.0, 0.0, -10.0) t = t.rotated(Vector3.UP, angle * i) $Demos.get_child(i).transform = t diff --git a/scenes/main_menu/main_menu_level.tscn b/scenes/main_menu/main_menu_level.tscn index 21d7e44b..6990743e 100644 --- a/scenes/main_menu/main_menu_level.tscn +++ b/scenes/main_menu/main_menu_level.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=44 format=2] +[gd_scene load_steps=48 format=2] [ext_resource path="res://addons/godot-xr-tools/staging/scene_base.tscn" type="PackedScene" id=1] [ext_resource path="res://addons/godot-xr-tools/hands/scenes/lowpoly/right_fullglove_low.tscn" type="PackedScene" id=2] @@ -31,6 +31,10 @@ [ext_resource path="res://addons/godot-xr-tools/functions/function_pose_detector.tscn" type="PackedScene" id=29] [ext_resource path="res://scenes/sprinting_demo/sprinting_demo.tscn" type="PackedScene" id=30] [ext_resource path="res://scenes/sprinting_demo/sprinting_demo.png" type="Texture" id=31] +[ext_resource path="res://scenes/origin_gravity_demo/origin_gravity_demo.png" type="Texture" id=32] +[ext_resource path="res://scenes/origin_gravity_demo/origin_gravity_demo.tscn" type="PackedScene" id=33] +[ext_resource path="res://scenes/sphere_world_demo/sphere_world_demo.png" type="Texture" id=34] +[ext_resource path="res://scenes/sphere_world_demo/sphere_world_demo.tscn" type="PackedScene" id=35] [sub_resource type="AnimationNodeAnimation" id=1] animation = "Grip" @@ -40,29 +44,28 @@ animation = "Grip" [sub_resource type="AnimationNodeBlend2" id=3] filter_enabled = true -filters = [ "Armature/Skeleton:Little_Distal_L", "Armature/Skeleton:Little_Intermediate_L", "Armature/Skeleton:Little_Proximal_L", "Armature/Skeleton:Middle_Distal_L", "Armature/Skeleton:Middle_Intermediate_L", "Armature/Skeleton:Middle_Proximal_L", "Armature/Skeleton:Ring_Distal_L", "Armature/Skeleton:Ring_Intermediate_L", "Armature/Skeleton:Ring_Proximal_L", "Armature/Skeleton:Thumb_Distal_L", "Armature/Skeleton:Thumb_Proximal_L", "Armature_Left/Skeleton:Middle.Distal", "Armature_Left/Skeleton:Middle.Middle", "Armature_Left/Skeleton:Middle.Proximal", "Armature_Left/Skeleton:Pinky.Distal", "Armature_Left/Skeleton:Pinky.Middle", "Armature_Left/Skeleton:Pinky.Proximal", "Armature_Left/Skeleton:Ring.Distal", "Armature_Left/Skeleton:Ring.Middle", "Armature_Left/Skeleton:Ring.Proximal", "Armature_Left/Skeleton:Thumb.Distal", "Armature_Left/Skeleton:Thumb.Proximal" ] +filters = [ "Armature/Skeleton:Little_Distal_L", "Armature/Skeleton:Little_Intermediate_L", "Armature/Skeleton:Little_Proximal_L", "Armature/Skeleton:Middle_Distal_L", "Armature/Skeleton:Middle_Intermediate_L", "Armature/Skeleton:Middle_Proximal_L", "Armature/Skeleton:Ring_Distal_L", "Armature/Skeleton:Ring_Intermediate_L", "Armature/Skeleton:Ring_Proximal_L", "Armature/Skeleton:Thumb_Distal_L", "Armature/Skeleton:Thumb_Proximal_L" ] [sub_resource type="AnimationNodeAnimation" id=4] animation = "Grip 5" [sub_resource type="AnimationNodeBlend2" id=5] filter_enabled = true -filters = [ "Armature/Skeleton:Index_Distal_L", "Armature/Skeleton:Index_Intermediate_L", "Armature/Skeleton:Index_Proximal_L", "Armature_Left/Skeleton:Index.Distal", "Armature_Left/Skeleton:Index.Middle", "Armature_Left/Skeleton:Index.Proximal" ] +filters = [ "Armature/Skeleton:Index_Distal_L", "Armature/Skeleton:Index_Intermediate_L", "Armature/Skeleton:Index_Proximal_L" ] [sub_resource type="AnimationNodeBlendTree" id=6] -graph_offset = Vector2( -156.488, -45.3264 ) +graph_offset = Vector2( -798.981, 58.67 ) nodes/ClosedHand1/node = SubResource( 1 ) -nodes/ClosedHand1/position = Vector2( -400, 200 ) +nodes/ClosedHand1/position = Vector2( -600, 300 ) nodes/ClosedHand2/node = SubResource( 2 ) -nodes/ClosedHand2/position = Vector2( -200, 300 ) +nodes/ClosedHand2/position = Vector2( -360, 300 ) nodes/Grip/node = SubResource( 3 ) -nodes/Grip/position = Vector2( 200, 0 ) +nodes/Grip/position = Vector2( 0, 20 ) nodes/OpenHand/node = SubResource( 4 ) -nodes/OpenHand/position = Vector2( -400, 0 ) +nodes/OpenHand/position = Vector2( -600, 100 ) nodes/Trigger/node = SubResource( 5 ) -nodes/Trigger/position = Vector2( -160, 0 ) -nodes/output/position = Vector2( 400, 0 ) -node_connections = [ "output", 0, "Grip", "Grip", 0, "Trigger", "Grip", 1, "ClosedHand2", "Trigger", 0, "OpenHand", "Trigger", 1, "ClosedHand1" ] +nodes/Trigger/position = Vector2( -360, 20 ) +node_connections = [ "Grip", 0, "Trigger", "Grip", 1, "ClosedHand2", "Trigger", 0, "OpenHand", "Trigger", 1, "ClosedHand1", "output", 0, "Grip" ] [sub_resource type="AnimationNodeAnimation" id=7] animation = "Grip" @@ -93,7 +96,7 @@ nodes/OpenHand/node = SubResource( 10 ) nodes/OpenHand/position = Vector2( -600, 100 ) nodes/Trigger/node = SubResource( 11 ) nodes/Trigger/position = Vector2( -360, 40 ) -node_connections = [ "output", 0, "Grip", "Grip", 0, "Trigger", "Grip", 1, "ClosedHand2", "Trigger", 0, "OpenHand", "Trigger", 1, "ClosedHand1" ] +node_connections = [ "Grip", 0, "Trigger", "Grip", 1, "ClosedHand2", "Trigger", 0, "OpenHand", "Trigger", 1, "ClosedHand1", "output", 0, "Grip" ] [node name="MainMenuLevel" instance=ExtResource( 1 )] script = ExtResource( 23 ) @@ -151,58 +154,71 @@ strafe = false [node name="Demos" type="Spatial" parent="." index="2"] [node name="ToBasicMovementDemo" parent="Demos" index="0" instance=ExtResource( 9 )] -transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -7 ) +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -10 ) scene_base = NodePath("../..") scene = ExtResource( 7 ) title = ExtResource( 10 ) [node name="ToTeleportDemo" parent="Demos" index="1" instance=ExtResource( 9 )] -transform = Transform( 0.707107, 0, 0.707107, 0, 1, 0, -0.707107, 0, 0.707107, -4.94975, 0, -4.94975 ) +transform = Transform( 0.841254, 0, 0.540641, 0, 1, 0, -0.540641, 0, 0.841254, -5.40641, 0, -8.41253 ) scene_base = NodePath("../..") scene = ExtResource( 11 ) title = ExtResource( 12 ) [node name="ToClimbingGlidingDemo" parent="Demos" index="2" instance=ExtResource( 9 )] -transform = Transform( -4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, -7, 0, 3.0598e-07 ) +transform = Transform( 0.415415, 0, 0.909632, 0, 1, 0, -0.909632, 0, 0.415415, -9.09632, 0, -4.15415 ) scene_base = NodePath("../..") scene = ExtResource( 14 ) title = ExtResource( 13 ) [node name="ToGrapplingDemo" parent="Demos" index="3" instance=ExtResource( 9 )] -transform = Transform( -0.707107, 0, 0.707107, 0, 1, 0, -0.707107, 0, -0.707107, -4.94975, 0, 4.94975 ) +transform = Transform( -0.142315, 0, 0.989821, 0, 1, 0, -0.989821, 0, -0.142315, -9.89821, 0, 1.42315 ) scene_base = NodePath("../..") scene = ExtResource( 15 ) title = ExtResource( 16 ) [node name="ToInteractablesDemo" parent="Demos" index="4" instance=ExtResource( 9 )] -transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 6.11959e-07, 0, 7 ) +transform = Transform( -0.654861, 0, 0.75575, 0, 1, 0, -0.75575, 0, -0.654861, -7.5575, 0, 6.54861 ) scene_base = NodePath("../..") scene = ExtResource( 18 ) title = ExtResource( 17 ) [node name="ToPointerDemo" parent="Demos" index="5" instance=ExtResource( 9 )] -transform = Transform( -0.707107, 0, -0.707107, 0, 1, 0, 0.707107, 0, -0.707107, 4.94975, 0, 4.94975 ) +transform = Transform( -0.959493, 0, 0.281733, 0, 1, 0, -0.281733, 0, -0.959493, -2.81733, 0, 9.59493 ) scene_base = NodePath("../..") scene = ExtResource( 19 ) title = ExtResource( 20 ) [node name="ToPickableDemo" parent="Demos" index="6" instance=ExtResource( 9 )] -transform = Transform( 1.19249e-08, 0, -1, 0, 1, 0, 1, 0, 1.19249e-08, 7, 0, -8.34742e-08 ) +transform = Transform( -0.959493, 0, -0.281733, 0, 1, 0, 0.281733, 0, -0.959493, 2.81733, 0, 9.59493 ) scene_base = NodePath("../..") scene = ExtResource( 21 ) title = ExtResource( 22 ) [node name="ToPokeDemo" parent="Demos" index="7" instance=ExtResource( 9 )] -transform = Transform( 0.707107, 0, -0.707107, 0, 1, 0, 0.707107, 0, 0.707107, 4.94975, 0, -4.94975 ) +transform = Transform( -0.654861, 0, -0.75575, 0, 1, 0, 0.75575, 0, -0.654861, 7.5575, 0, 6.54861 ) scene_base = NodePath("../..") scene = ExtResource( 24 ) title = ExtResource( 25 ) [node name="ToSprintingDemo" parent="Demos" index="8" instance=ExtResource( 9 )] +transform = Transform( -0.142315, 0, -0.989821, 0, 1, 0, 0.989821, 0, -0.142315, 9.89821, 0, 1.42315 ) scene_base = NodePath("../..") scene = ExtResource( 30 ) title = ExtResource( 31 ) +[node name="ToOriginGravityDemo" parent="Demos" index="9" instance=ExtResource( 9 )] +transform = Transform( 0.415415, 0, -0.909632, 0, 1, 0, 0.909632, 0, 0.415415, 9.09632, 0, -4.15415 ) +scene_base = NodePath("../..") +scene = ExtResource( 33 ) +title = ExtResource( 32 ) + +[node name="ToSphereWorldDemo" parent="Demos" index="10" instance=ExtResource( 9 )] +transform = Transform( 0.841253, 0, -0.540641, 0, 1, 0, 0.540641, 0, 0.841253, 5.40641, 0, -8.41253 ) +scene_base = NodePath("../..") +scene = ExtResource( 35 ) +title = ExtResource( 34 ) + [node name="SettingsUI" parent="." index="3" instance=ExtResource( 26 )] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -1.5 ) camera = NodePath("../ARVROrigin/ARVRCamera") diff --git a/scenes/origin_gravity_demo/objects/instructions.tscn b/scenes/origin_gravity_demo/objects/instructions.tscn new file mode 100644 index 00000000..6b8438f5 --- /dev/null +++ b/scenes/origin_gravity_demo/objects/instructions.tscn @@ -0,0 +1,23 @@ +[gd_scene load_steps=5 format=2] + +[ext_resource path="res://scenes/origin_gravity_demo/objects/instructions_2d.tscn" type="PackedScene" id=1] +[ext_resource path="res://addons/godot-xr-tools/objects/viewport_2d_in_3d.tscn" type="PackedScene" id=2] +[ext_resource path="res://assets/wahooney.itch.io/brown_grid_triplanar.tres" type="Material" id=3] + +[sub_resource type="CubeMesh" id=1] +material = ExtResource( 3 ) +size = Vector3( 4.2, 2.7, 0.1 ) + +[node name="Instructions" type="Spatial"] + +[node name="Viewport2Din3D" parent="." instance=ExtResource( 2 )] +screen_size = Vector2( 4, 2.5 ) +viewport_size = Vector2( 400, 250 ) +unshaded = true +scene = ExtResource( 1 ) +update_mode = 0 +collision_layer = 0 + +[node name="MeshInstance" type="MeshInstance" parent="."] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -0.1 ) +mesh = SubResource( 1 ) diff --git a/scenes/origin_gravity_demo/objects/instructions_2d.tscn b/scenes/origin_gravity_demo/objects/instructions_2d.tscn new file mode 100644 index 00000000..6cc9faad --- /dev/null +++ b/scenes/origin_gravity_demo/objects/instructions_2d.tscn @@ -0,0 +1,34 @@ +[gd_scene format=2] + +[node name="Instructions" type="Control"] +anchor_right = 1.0 +anchor_bottom = 1.0 +margin_right = -624.0 +margin_bottom = -350.0 +rect_pivot_offset = Vector2( -421, -85 ) + +[node name="ColorRect" type="ColorRect" parent="."] +margin_right = 400.0 +margin_bottom = 250.0 +color = Color( 0, 0, 0, 0.87451 ) + +[node name="Description" type="RichTextLabel" parent="."] +margin_left = 10.0 +margin_top = 10.0 +margin_right = 390.0 +margin_bottom = 240.0 +text = "Origin Gravity Demo + +This scene demonstrates walking on non-flat surfaces. + + > Left Controller: + - Direct Movement: U/D/L/R Joystick + - Jumping: A/X Button + - Sprinting: Joystick Button (hold) + - Flying: B/Y (toggle) + + > Right Controller: + - Direct Movement: U/D Joystick + - Turning: L/R Joystick + - Jumping: A/X Button +" diff --git a/scenes/origin_gravity_demo/objects/pill_orient.tscn b/scenes/origin_gravity_demo/objects/pill_orient.tscn new file mode 100644 index 00000000..0421ce05 --- /dev/null +++ b/scenes/origin_gravity_demo/objects/pill_orient.tscn @@ -0,0 +1,38 @@ +[gd_scene load_steps=5 format=2] + +[ext_resource path="res://assets/wahooney.itch.io/blue_grid.tres" type="Material" id=2] + +[sub_resource type="CapsuleMesh" id=4] +radius = 7.0 +mid_height = 7.0 +radial_segments = 32 + +[sub_resource type="CapsuleShape" id=5] +radius = 7.0 +height = 7.0 + +[sub_resource type="CapsuleShape" id=9] +radius = 9.0 +height = 7.0 + +[node name="PillOrient" type="Spatial"] + +[node name="Body" type="StaticBody" parent="."] +transform = Transform( -4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 0, 0, 0 ) +collision_layer = 8 +collision_mask = 0 + +[node name="MeshInstance" type="MeshInstance" parent="Body"] +mesh = SubResource( 4 ) +material/0 = ExtResource( 2 ) + +[node name="CollisionShape" type="CollisionShape" parent="Body"] +shape = SubResource( 5 ) + +[node name="Gravity" type="Area" parent="."] +space_override = 3 +gravity_point = true + +[node name="CollisionShape" type="CollisionShape" parent="Gravity"] +transform = Transform( -4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, 0, 0, 0 ) +shape = SubResource( 9 ) diff --git a/scenes/origin_gravity_demo/objects/sphere_orient.tscn b/scenes/origin_gravity_demo/objects/sphere_orient.tscn new file mode 100644 index 00000000..b80de5d0 --- /dev/null +++ b/scenes/origin_gravity_demo/objects/sphere_orient.tscn @@ -0,0 +1,34 @@ +[gd_scene load_steps=5 format=2] + +[ext_resource path="res://assets/wahooney.itch.io/green_grid_triplanar.tres" type="Material" id=2] + +[sub_resource type="SphereMesh" id=2] +radius = 10.0 +height = 20.0 + +[sub_resource type="SphereShape" id=3] +radius = 10.0 + +[sub_resource type="SphereShape" id=8] +radius = 15.0 + +[node name="SphereOrient" type="Spatial"] + +[node name="Body" type="StaticBody" parent="."] +collision_layer = 8 +collision_mask = 0 + +[node name="MeshInstance" type="MeshInstance" parent="Body"] +mesh = SubResource( 2 ) +skeleton = NodePath("../../..") +material/0 = ExtResource( 2 ) + +[node name="CollisionShape" type="CollisionShape" parent="Body"] +shape = SubResource( 3 ) + +[node name="Gravity" type="Area" parent="."] +space_override = 3 +gravity_point = true + +[node name="CollisionShape" type="CollisionShape" parent="Gravity"] +shape = SubResource( 8 ) diff --git a/scenes/origin_gravity_demo/origin_gravity_demo.png b/scenes/origin_gravity_demo/origin_gravity_demo.png new file mode 100644 index 00000000..17bedff3 Binary files /dev/null and b/scenes/origin_gravity_demo/origin_gravity_demo.png differ diff --git a/scenes/origin_gravity_demo/origin_gravity_demo.png.import b/scenes/origin_gravity_demo/origin_gravity_demo.png.import new file mode 100644 index 00000000..38e96cbd --- /dev/null +++ b/scenes/origin_gravity_demo/origin_gravity_demo.png.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="StreamTexture" +path.s3tc="res://.import/origin_gravity_demo.png-d9ea68a2fdb85934db7bb07faa15248a.s3tc.stex" +path.etc="res://.import/origin_gravity_demo.png-d9ea68a2fdb85934db7bb07faa15248a.etc.stex" +metadata={ +"imported_formats": [ "s3tc", "etc" ], +"vram_texture": true +} + +[deps] + +source_file="res://scenes/origin_gravity_demo/origin_gravity_demo.png" +dest_files=[ "res://.import/origin_gravity_demo.png-d9ea68a2fdb85934db7bb07faa15248a.s3tc.stex", "res://.import/origin_gravity_demo.png-d9ea68a2fdb85934db7bb07faa15248a.etc.stex" ] + +[params] + +compress/mode=2 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=true +flags/filter=true +flags/mipmaps=true +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=false +svg/scale=1.0 diff --git a/scenes/origin_gravity_demo/origin_gravity_demo.tscn b/scenes/origin_gravity_demo/origin_gravity_demo.tscn new file mode 100644 index 00000000..ef572244 --- /dev/null +++ b/scenes/origin_gravity_demo/origin_gravity_demo.tscn @@ -0,0 +1,142 @@ +[gd_scene load_steps=21 format=2] + +[ext_resource path="res://addons/godot-xr-tools/staging/scene_base.tscn" type="PackedScene" id=1] +[ext_resource path="res://assets/maps/basic_map.tscn" type="PackedScene" id=2] +[ext_resource path="res://assets/wahooney.itch.io/brown_grid_triplanar.tres" type="Material" id=3] +[ext_resource path="res://addons/godot-xr-tools/player/player_body.tscn" type="PackedScene" id=4] +[ext_resource path="res://addons/godot-xr-tools/functions/movement_jump.tscn" type="PackedScene" id=5] +[ext_resource path="res://addons/godot-xr-tools/functions/movement_turn.tscn" type="PackedScene" id=6] +[ext_resource path="res://addons/godot-xr-tools/functions/movement_direct.tscn" type="PackedScene" id=7] +[ext_resource path="res://addons/godot-xr-tools/functions/movement_wall_walk.tscn" type="PackedScene" id=8] +[ext_resource path="res://scenes/main_menu/return to main menu.png" type="Texture" id=9] +[ext_resource path="res://assets/meshes/teleport/teleport.tscn" type="PackedScene" id=10] +[ext_resource path="res://scenes/origin_gravity_demo/objects/pill_orient.tscn" type="PackedScene" id=11] +[ext_resource path="res://scenes/origin_gravity_demo/objects/sphere_orient.tscn" type="PackedScene" id=12] +[ext_resource path="res://addons/godot-xr-tools/hands/scenes/lowpoly/left_hand_low.tscn" type="PackedScene" id=13] +[ext_resource path="res://addons/godot-xr-tools/hands/scenes/lowpoly/right_hand_low.tscn" type="PackedScene" id=14] +[ext_resource path="res://addons/godot-xr-tools/functions/movement_sprint.tscn" type="PackedScene" id=15] +[ext_resource path="res://addons/godot-xr-tools/functions/movement_flight.tscn" type="PackedScene" id=18] +[ext_resource path="res://scenes/origin_gravity_demo/objects/instructions.tscn" type="PackedScene" id=19] +[ext_resource path="res://addons/godot-xr-tools/functions/movement_crouch.tscn" type="PackedScene" id=21] + +[sub_resource type="Curve3D" id=6] +_data = { +"points": PoolVector3Array( -4.24937, -1.06234, 0, 4.24937, 1.06234, 0, -28.8455, 28.3772, 22.046, -4.1528, 0.820904, 0, 4.1528, -0.820904, 0, -14.1804, 30.4904, 21.7814, -2.83784, 2.60267, 0.0372009, 2.83784, -2.60267, -0.0372009, -4.79844, 27.0269, 22.1809, 1.6403, 2.9682, -0.0173683, -1.6403, -2.9682, 0.0173683, -2.87687, 17.8878, 23.2453, 0.57946, 4.05622, 0, -0.57946, -4.05622, 0, -7.44255, 8.17148, 23.1395, -2.70415, 1.11063, 0, 2.70415, -1.11063, 0, -0.888668, 1.09893, 23.2599, -2.3209, -0.153747, -0.449579, 2.3209, 0.153747, 0.449579, 6.55866, -1.48348, 25.7184 ), +"tilts": PoolRealArray( 0, 0, 0, 0, 0, 0, 0 ) +} + +[sub_resource type="Curve3D" id=1] +bake_interval = 0.3 +_data = { +"points": PoolVector3Array( -0.71487, -1.87416, 1.71397, 0.71487, 1.87416, -1.71397, -21.7835, 21.1047, 22.9351, 1.79321, 2.0844, 5.63986, -1.79321, -2.0844, -5.63986, -17.503, 22.8378, 3.86977, 1.63235, 1.43539, 4.76624, -1.63235, -1.43539, -4.76624, -21.1288, 16.2403, -8.78015, -6.09683, 0.913348, 3.4931, 6.09683, -0.913348, -3.4931, -16.9968, 15.3497, -24.9826, -1.11305, -0.695772, 2.12971, 1.11305, 0.695772, -2.12971, -1.5803, 19.8361, -28.6373 ), +"tilts": PoolRealArray( 0, 0, 0, 0, 0 ) +} + +[node name="OriginGravityDemo" instance=ExtResource( 1 )] + +[node name="ARVROrigin" parent="." index="0"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 4, 0, 36 ) + +[node name="LeftHand" parent="ARVROrigin/LeftHand" index="0" instance=ExtResource( 13 )] + +[node name="MovementDirect" parent="ARVROrigin/LeftHand" index="1" instance=ExtResource( 7 )] +enabled = true +order = 10 +max_speed = 3.0 +strafe = true + +[node name="MovementJump" parent="ARVROrigin/LeftHand" index="2" instance=ExtResource( 5 )] +jump_button_id = 7 + +[node name="MovementCrouch" parent="ARVROrigin/LeftHand" index="3" instance=ExtResource( 21 )] +crouch_button = 1 + +[node name="MovementSprint" parent="ARVROrigin/LeftHand" index="4" instance=ExtResource( 15 )] + +[node name="RightHand" parent="ARVROrigin/RightHand" index="0" instance=ExtResource( 14 )] + +[node name="MovementDirect" parent="ARVROrigin/RightHand" index="1" instance=ExtResource( 7 )] +enabled = true +order = 10 +max_speed = 3.0 +strafe = false + +[node name="MovementTurn" parent="ARVROrigin/RightHand" index="2" instance=ExtResource( 6 )] + +[node name="MovementJump" parent="ARVROrigin/RightHand" index="3" instance=ExtResource( 5 )] +jump_button_id = 7 + +[node name="MovementSprint" parent="ARVROrigin/RightHand" index="4" instance=ExtResource( 15 )] +controller = 1 + +[node name="MovementFlight" parent="ARVROrigin" index="3" instance=ExtResource( 18 )] + +[node name="MovementWallWalk" parent="ARVROrigin" index="4" instance=ExtResource( 8 )] +follow_mask = 8 + +[node name="PlayerBody" parent="ARVROrigin" index="5" instance=ExtResource( 4 )] + +[node name="BasicMap" parent="." index="1" instance=ExtResource( 2 )] + +[node name="Teleport" parent="." index="2" instance=ExtResource( 10 )] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 4, 0, 44 ) +scene_base = NodePath("..") +title = ExtResource( 9 ) + +[node name="Teleport2" parent="." index="3" instance=ExtResource( 10 )] +transform = Transform( -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 0, 0, 1, 10.4, 19, -33 ) +scene_base = NodePath("..") +title = ExtResource( 9 ) + +[node name="Instructions" parent="." index="4" instance=ExtResource( 19 )] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 4, 5, 29 ) + +[node name="SphereOrient" parent="." index="5" instance=ExtResource( 12 )] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -30, 20, 22 ) + +[node name="PillOrient" parent="." index="6" instance=ExtResource( 11 )] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 19, -33 ) + +[node name="Walkway1" type="Spatial" parent="." index="7"] + +[node name="Path" type="Path" parent="Walkway1" index="0"] +curve = SubResource( 6 ) + +[node name="Body" type="CSGPolygon" parent="Walkway1" index="1"] +use_collision = true +collision_layer = 8 +collision_mask = 0 +polygon = PoolVector2Array( -4, 0, -3.7, 0.7, -3, 1, 3, 1, 3.7, 0.7, 4, 0, 3.7, -0.7, 3, -1, -3, -1, -3.7, -0.7 ) +mode = 2 +path_node = NodePath("../Path") +path_interval_type = 0 +path_interval = 1.0 +path_simplify_angle = 0.0 +path_rotation = 2 +path_local = false +path_continuous_u = true +path_u_distance = 1.0 +path_joined = false +material = ExtResource( 3 ) + +[node name="Walkway2" type="Spatial" parent="." index="8"] + +[node name="Path" type="Path" parent="Walkway2" index="0"] +curve = SubResource( 1 ) + +[node name="Body" type="CSGPolygon" parent="Walkway2" index="1"] +use_collision = true +collision_layer = 8 +collision_mask = 0 +polygon = PoolVector2Array( 0, -4, 0.7, -3.7, 1, -3, 1, 3, 0.7, 3.7, 0, 4, -0.7, 3.7, -1, 3, -1, -3, -0.7, -3.7 ) +mode = 2 +path_node = NodePath("../Path") +path_interval_type = 0 +path_interval = 1.0 +path_simplify_angle = 0.0 +path_rotation = 2 +path_local = false +path_continuous_u = true +path_u_distance = 1.0 +path_joined = false +material = ExtResource( 3 ) diff --git a/scenes/sphere_world_demo/environments/constellations.tres b/scenes/sphere_world_demo/environments/constellations.tres new file mode 100644 index 00000000..5daf332f --- /dev/null +++ b/scenes/sphere_world_demo/environments/constellations.tres @@ -0,0 +1,12 @@ +[gd_resource type="Environment" load_steps=3 format=2] + +[ext_resource path="res://assets/nasa/starmap_and_constellation_figures_4k.jpg" type="Texture" id=1] + +[sub_resource type="PanoramaSky" id=1] +panorama = ExtResource( 1 ) + +[resource] +background_mode = 2 +background_sky = SubResource( 1 ) +ambient_light_color = Color( 1, 1, 1, 1 ) +ambient_light_energy = 0.7 diff --git a/scenes/sphere_world_demo/objects/donut.tscn b/scenes/sphere_world_demo/objects/donut.tscn new file mode 100644 index 00000000..bdde1a9b --- /dev/null +++ b/scenes/sphere_world_demo/objects/donut.tscn @@ -0,0 +1,16 @@ +[gd_scene load_steps=2 format=2] + +[ext_resource path="res://assets/wahooney.itch.io/blue_grid.tres" type="Material" id=1] + +[node name="Donut" type="Spatial"] + +[node name="CSGTorus" type="CSGTorus" parent="."] +transform = Transform( -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 0, 0, 1, 0, 6, 0 ) +use_collision = true +collision_layer = 8 +collision_mask = 0 +inner_radius = 6.0 +outer_radius = 8.0 +sides = 30 +ring_sides = 12 +material = ExtResource( 1 ) diff --git a/scenes/sphere_world_demo/objects/tower.tscn b/scenes/sphere_world_demo/objects/tower.tscn new file mode 100644 index 00000000..7efcbd29 --- /dev/null +++ b/scenes/sphere_world_demo/objects/tower.tscn @@ -0,0 +1,23 @@ +[gd_scene load_steps=5 format=2] + +[ext_resource path="res://addons/godot-xr-tools/objects/climbable.tscn" type="PackedScene" id=1] +[ext_resource path="res://assets/wahooney.itch.io/brown_grid_triplanar.tres" type="Material" id=2] + +[sub_resource type="BoxShape" id=1] +extents = Vector3( 1.5, 4, 1.5 ) + +[sub_resource type="CubeMesh" id=2] +size = Vector3( 3, 8, 3 ) + +[node name="Tower" instance=ExtResource( 1 )] +collision_layer = 2 +collision_mask = 0 + +[node name="CollisionShape" parent="." index="0"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 4, 0 ) +shape = SubResource( 1 ) + +[node name="MeshInstance" type="MeshInstance" parent="." index="1"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 4, 0 ) +mesh = SubResource( 2 ) +material/0 = ExtResource( 2 ) diff --git a/scenes/sphere_world_demo/sphere_world_demo.png b/scenes/sphere_world_demo/sphere_world_demo.png new file mode 100644 index 00000000..8bd1f5d5 Binary files /dev/null and b/scenes/sphere_world_demo/sphere_world_demo.png differ diff --git a/scenes/sphere_world_demo/sphere_world_demo.png.import b/scenes/sphere_world_demo/sphere_world_demo.png.import new file mode 100644 index 00000000..6e218154 --- /dev/null +++ b/scenes/sphere_world_demo/sphere_world_demo.png.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="StreamTexture" +path.s3tc="res://.import/sphere_world_demo.png-dea9370d686dcfe7b9838df58c9a3444.s3tc.stex" +path.etc="res://.import/sphere_world_demo.png-dea9370d686dcfe7b9838df58c9a3444.etc.stex" +metadata={ +"imported_formats": [ "s3tc", "etc" ], +"vram_texture": true +} + +[deps] + +source_file="res://scenes/sphere_world_demo/sphere_world_demo.png" +dest_files=[ "res://.import/sphere_world_demo.png-dea9370d686dcfe7b9838df58c9a3444.s3tc.stex", "res://.import/sphere_world_demo.png-dea9370d686dcfe7b9838df58c9a3444.etc.stex" ] + +[params] + +compress/mode=2 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=true +flags/filter=true +flags/mipmaps=true +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=false +svg/scale=1.0 diff --git a/scenes/sphere_world_demo/sphere_world_demo.tscn b/scenes/sphere_world_demo/sphere_world_demo.tscn new file mode 100644 index 00000000..7dbaf253 --- /dev/null +++ b/scenes/sphere_world_demo/sphere_world_demo.tscn @@ -0,0 +1,167 @@ +[gd_scene load_steps=27 format=2] + +[ext_resource path="res://addons/godot-xr-tools/staging/scene_base.tscn" type="PackedScene" id=1] +[ext_resource path="res://assets/wahooney.itch.io/green_grid_triplanar.tres" type="Material" id=2] +[ext_resource path="res://addons/godot-xr-tools/player/player_body.tscn" type="PackedScene" id=3] +[ext_resource path="res://addons/godot-xr-tools/hands/scenes/lowpoly/left_tac_glove_low.tscn" type="PackedScene" id=4] +[ext_resource path="res://addons/godot-xr-tools/functions/movement_direct.tscn" type="PackedScene" id=5] +[ext_resource path="res://addons/godot-xr-tools/functions/movement_sprint.tscn" type="PackedScene" id=6] +[ext_resource path="res://addons/godot-xr-tools/functions/movement_jump.tscn" type="PackedScene" id=7] +[ext_resource path="res://addons/godot-xr-tools/functions/function_pickup.tscn" type="PackedScene" id=8] +[ext_resource path="res://addons/godot-xr-tools/functions/movement_crouch.tscn" type="PackedScene" id=9] +[ext_resource path="res://addons/godot-xr-tools/hands/scenes/lowpoly/right_tac_glove_low.tscn" type="PackedScene" id=10] +[ext_resource path="res://addons/godot-xr-tools/functions/movement_grapple.tscn" type="PackedScene" id=11] +[ext_resource path="res://addons/godot-xr-tools/functions/movement_wall_walk.tscn" type="PackedScene" id=12] +[ext_resource path="res://addons/godot-xr-tools/functions/movement_wind.tscn" type="PackedScene" id=13] +[ext_resource path="res://addons/godot-xr-tools/functions/movement_turn.tscn" type="PackedScene" id=16] +[ext_resource path="res://addons/godot-xr-tools/functions/movement_glide.tscn" type="PackedScene" id=17] +[ext_resource path="res://addons/godot-xr-tools/functions/movement_climb.tscn" type="PackedScene" id=18] +[ext_resource path="res://scenes/sphere_world_demo/environments/constellations.tres" type="Environment" id=19] +[ext_resource path="res://assets/meshes/teleport/teleport.tscn" type="PackedScene" id=20] +[ext_resource path="res://scenes/main_menu/return to main menu.png" type="Texture" id=21] +[ext_resource path="res://assets/meshes/mound/mound.tscn" type="PackedScene" id=22] +[ext_resource path="res://assets/meshes/ramps/ramps.tscn" type="PackedScene" id=23] +[ext_resource path="res://scenes/sphere_world_demo/objects/tower.tscn" type="PackedScene" id=24] +[ext_resource path="res://scenes/sphere_world_demo/objects/donut.tscn" type="PackedScene" id=25] + +[sub_resource type="SphereMesh" id=1] +material = ExtResource( 2 ) +radius = 50.0 +height = 100.0 + +[sub_resource type="SphereShape" id=2] +radius = 50.0 + +[sub_resource type="SphereShape" id=3] +radius = 80.0 + +[node name="SphereWorldDemo" instance=ExtResource( 1 )] +environment = ExtResource( 19 ) + +[node name="ARVROrigin" parent="." index="0"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 50, 0 ) + +[node name="LeftHand" parent="ARVROrigin/LeftHand" index="0" instance=ExtResource( 4 )] + +[node name="FunctionPickup" parent="ARVROrigin/LeftHand" index="1" instance=ExtResource( 8 )] +grab_collision_mask = 6 +ranged_enable = false + +[node name="MovementDirect" parent="ARVROrigin/LeftHand" index="2" instance=ExtResource( 5 )] +enabled = true +order = 10 +max_speed = 3.0 +strafe = true + +[node name="MovementSprint" parent="ARVROrigin/LeftHand" index="3" instance=ExtResource( 6 )] + +[node name="MovementJump" parent="ARVROrigin/LeftHand" index="4" instance=ExtResource( 7 )] +jump_button_id = 7 + +[node name="MovementCrouch" parent="ARVROrigin/LeftHand" index="5" instance=ExtResource( 9 )] +crouch_button = 1 + +[node name="RightHand" parent="ARVROrigin/RightHand" index="0" instance=ExtResource( 10 )] + +[node name="FunctionPickup" parent="ARVROrigin/RightHand" index="1" instance=ExtResource( 8 )] +grab_collision_mask = 6 +ranged_enable = false +ranged_collision_mask = 0 + +[node name="MovementDirect" parent="ARVROrigin/RightHand" index="2" instance=ExtResource( 5 )] +enabled = true +order = 10 +max_speed = 3.0 +strafe = false + +[node name="MovementTurn" parent="ARVROrigin/RightHand" index="3" instance=ExtResource( 16 )] + +[node name="MovementJump" parent="ARVROrigin/RightHand" index="4" instance=ExtResource( 7 )] +jump_button_id = 7 + +[node name="MovementGrapple" parent="ARVROrigin/RightHand" index="5" instance=ExtResource( 11 )] +grapple_collision_mask = 3 + +[node name="PlayerBody" parent="ARVROrigin" index="3" instance=ExtResource( 3 )] + +[node name="MovementClimb" parent="ARVROrigin" index="4" instance=ExtResource( 18 )] + +[node name="MovementWind" parent="ARVROrigin" index="5" instance=ExtResource( 13 )] + +[node name="MovementGlide" parent="ARVROrigin" index="6" instance=ExtResource( 17 )] + +[node name="MovementWallWalk" parent="ARVROrigin" index="7" instance=ExtResource( 12 )] +follow_mask = 8 + +[node name="Teleport1" parent="." index="1" instance=ExtResource( 20 )] +transform = Transform( -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 0, 0, 1, 49.9, 0, 0 ) +scene_base = NodePath("..") +title = ExtResource( 21 ) + +[node name="Teleport2" parent="." index="2" instance=ExtResource( 20 )] +transform = Transform( 1.91069e-15, -4.37114e-08, 1, -1, -4.37114e-08, 0, 4.37114e-08, -1, -4.37114e-08, 0, 0, -49.9 ) +scene_base = NodePath("..") +title = ExtResource( 21 ) + +[node name="Teleport3" parent="." index="3" instance=ExtResource( 20 )] +transform = Transform( 4.37114e-08, -1, -8.74228e-08, -1, -4.37114e-08, 0, -3.82137e-15, 8.74228e-08, -1, -49.9, 0, 0 ) +scene_base = NodePath("..") +title = ExtResource( 21 ) + +[node name="Teleport4" parent="." index="4" instance=ExtResource( 20 )] +transform = Transform( -5.73206e-15, 1.31134e-07, -1, -1, -4.37114e-08, 0, -4.37114e-08, 1, 1.31134e-07, 0, 0, 49.9 ) +scene_base = NodePath("..") +title = ExtResource( 21 ) + +[node name="World" type="Spatial" parent="." index="5"] + +[node name="Body" type="StaticBody" parent="World" index="0"] +collision_layer = 8 +collision_mask = 0 + +[node name="MeshInstance" type="MeshInstance" parent="World/Body" index="0"] +mesh = SubResource( 1 ) + +[node name="CollisionShape" type="CollisionShape" parent="World/Body" index="1"] +shape = SubResource( 2 ) + +[node name="Gravity" type="Area" parent="World" index="1"] +space_override = 3 +gravity_point = true + +[node name="CollisionShape" type="CollisionShape" parent="World/Gravity" index="0"] +shape = SubResource( 3 ) + +[node name="Mound1" parent="World" index="2" instance=ExtResource( 22 )] +transform = Transform( 1, 0, 0, 0, 0.965926, -0.258819, 0, 0.258819, 0.965926, 0, 47, 14 ) + +[node name="Mound2" parent="World" index="3" instance=ExtResource( 22 )] +transform = Transform( 1, 0, 0, 0, 0.965926, 0.258819, 0, -0.258819, 0.965926, 0, 47, -14 ) + +[node name="Ramps1" parent="World" index="4" instance=ExtResource( 23 )] +transform = Transform( -4.2222e-08, -0.258819, 0.965926, -1.13133e-08, 0.965926, 0.258819, -1, 0, -4.37114e-08, -12, 48, 0 ) + +[node name="Ramps2" parent="World" index="5" instance=ExtResource( 23 )] +transform = Transform( -4.2222e-08, 0.258819, 0.965926, 1.13133e-08, 0.965926, -0.258819, -1, 0, -4.37114e-08, 12, 48, 0 ) + +[node name="Tower1" parent="World" index="6" instance=ExtResource( 24 )] +transform = Transform( 0.707107, -0.707107, 0, 0.707107, 0.707107, 0, 0, 0, 1, -35, 35, 0 ) + +[node name="Tower2" parent="World" index="7" instance=ExtResource( 24 )] +transform = Transform( 0.707107, 0.707107, 0, -0.707107, 0.707107, 0, 0, 0, 1, 35, 35, 0 ) + +[node name="Tower3" parent="World" index="8" instance=ExtResource( 24 )] +transform = Transform( 1, 5.96046e-08, 0, -4.21468e-08, 0.707107, -0.707107, -4.21468e-08, 0.707107, 0.707107, 0, 35, 35 ) + +[node name="Tower4" parent="World" index="9" instance=ExtResource( 24 )] +transform = Transform( 1, 5.96046e-08, 0, -4.21468e-08, 0.707107, 0.707107, 4.21469e-08, -0.707107, 0.707107, 0, 35, -35 ) + +[node name="Donut1" parent="World" index="10" instance=ExtResource( 25 )] +transform = Transform( 0.707107, 0, -0.707107, 0, 1, 0, 0.707107, 0, 0.707107, 0, 49.5, 0 ) + +[node name="Donut2" parent="World" index="11" instance=ExtResource( 25 )] +transform = Transform( 0.707107, 0, 0.707107, 0, 1, 0, -0.707107, 0, 0.707107, 0, 49.5, 0 ) + +[node name="DirectionalLight" type="DirectionalLight" parent="." index="6"] +transform = Transform( 1, 0, 0, 0, 0.258819, 0.965926, 0, -0.965926, 0.258819, 0, 60, 0 ) +light_energy = 0.8