From: Clifton Palmer Date: Sat, 19 Apr 2025 12:13:40 +0000 (+0300) Subject: Finished basic movement, collision, visuals X-Git-Url: http://git.purplebirdman.com/baabarian.git/commitdiff_plain/87f90ed1d61c12766366f39de1ee2c0213ffbe1f?ds=sidebyside Finished basic movement, collision, visuals * Added menu option to skip straight to starting scene for testing * Added some basic physics-based collision handling * Added player skin, animations --- diff --git a/Scene.gd b/Scene.gd deleted file mode 100644 index a9d57e0..0000000 --- a/Scene.gd +++ /dev/null @@ -1,12 +0,0 @@ -extends Node3D -class_name Scene - - -func _input(event: InputEvent) -> void: - if event.is_action_pressed("left_click"): - Input.mouse_mode = Input.MOUSE_MODE_CAPTURED - elif event.is_action_pressed("ui_cancel"): - if Input.mouse_mode == Input.MOUSE_MODE_VISIBLE: - get_tree().quit() - else: - Input.mouse_mode = Input.MOUSE_MODE_VISIBLE diff --git a/Scene.gd.uid b/Scene.gd.uid deleted file mode 100644 index 6e9cc0b..0000000 --- a/Scene.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://dpsqolvx3mdic diff --git a/class/Scene.gd b/class/Scene.gd new file mode 100644 index 0000000..a9d57e0 --- /dev/null +++ b/class/Scene.gd @@ -0,0 +1,12 @@ +extends Node3D +class_name Scene + + +func _input(event: InputEvent) -> void: + if event.is_action_pressed("left_click"): + Input.mouse_mode = Input.MOUSE_MODE_CAPTURED + elif event.is_action_pressed("ui_cancel"): + if Input.mouse_mode == Input.MOUSE_MODE_VISIBLE: + get_tree().quit() + else: + Input.mouse_mode = Input.MOUSE_MODE_VISIBLE diff --git a/class/Scene.gd.uid b/class/Scene.gd.uid new file mode 100644 index 0000000..6e9cc0b --- /dev/null +++ b/class/Scene.gd.uid @@ -0,0 +1 @@ +uid://dpsqolvx3mdic diff --git a/class/ux/debug_draw_3d.gd b/class/ux/debug_draw_3d.gd new file mode 100644 index 0000000..fd922f0 --- /dev/null +++ b/class/ux/debug_draw_3d.gd @@ -0,0 +1,50 @@ +extends Control +class_name DebugDraw3D + + +class Vector: + var object # The node to follow + var property # The property to draw + var scale # Scale factor + var width # Line width + var color # Draw color + + func _init(_object, _property, _scale, _width, _color) -> void: + object = _object + property = _property + scale = _scale + width = _width + color = _color + + func draw(node: Control, camera: Camera3D) -> void: + var start = camera.unproject_position(object.global_transform.origin) + var endv = object.global_transform.origin + object.get(property) * scale + var end = camera.unproject_position(endv) + if start != end: + node.draw_line(start, end, color, width) + if camera.is_position_in_frustum(endv): + node.draw_triangle(end, start.direction_to(end), width * 2, color) + + +var vectors = [] # Array to hold all registered values. + +func draw_triangle(pos: Vector2, dir: Vector2, length: float, color: Color) -> void: + var a = pos + dir.rotated(-PI / 2) * length + var b = pos + dir * length + var c = pos + dir.rotated(PI / 2) * length + var points = PackedVector2Array([a, b, c]) + draw_polygon(points, PackedColorArray([color])) + + +func _process(_delta: float) -> void: + queue_redraw() + + +func _draw() -> void: + var camera = get_viewport().get_camera_3d() + for vector in vectors: + vector.draw(self, camera) + + +func add_vector(object, property, vscale, width, color) -> void: + vectors.append(Vector.new(object, property, vscale, width, color)) diff --git a/class/ux/debug_draw_3d.gd.uid b/class/ux/debug_draw_3d.gd.uid new file mode 100644 index 0000000..0b4dc38 --- /dev/null +++ b/class/ux/debug_draw_3d.gd.uid @@ -0,0 +1 @@ +uid://bocc5xwqtbkbb diff --git a/class/ux/debug_overlay.gd b/class/ux/debug_overlay.gd new file mode 100644 index 0000000..f8113d9 --- /dev/null +++ b/class/ux/debug_overlay.gd @@ -0,0 +1,19 @@ +extends CanvasLayer +class_name DebugOverlay + + +@onready var draw = $DebugDraw3D +@onready var stats = $DebugStats + + +func _ready(): + if not InputMap.has_action("toggle_debug"): + InputMap.add_action("toggle_debug") + var ev = InputEventKey.new() + ev.physical_keycode = KEY_BACKSLASH + InputMap.action_add_event("toggle_debug", ev) + + +func _input(event): + if event.is_action_pressed("toggle_debug"): + self.visible = not self.visible diff --git a/class/ux/debug_overlay.gd.uid b/class/ux/debug_overlay.gd.uid new file mode 100644 index 0000000..cf38035 --- /dev/null +++ b/class/ux/debug_overlay.gd.uid @@ -0,0 +1 @@ +uid://dd3sep8kprktl diff --git a/class/ux/debug_stats.gd b/class/ux/debug_stats.gd new file mode 100644 index 0000000..3e95fbc --- /dev/null +++ b/class/ux/debug_stats.gd @@ -0,0 +1,69 @@ +extends MarginContainer +class_name DebugStats + + +var _vbox: VBoxContainer = null + + +class Property: + var num_format = "%4.2f" + var object # The object being tracked. + var property # The property to display (NodePath). + var label_ref # A reference to the Label. + var display # Display option (rounded, etc.) + + func _init(_object, _property, _label, _display): + object = _object + property = _property + label_ref = _label + display = _display + + func set_label(): + # Sets the label's text. + var s = object.name + "/" + property + " : " + var p = object.get_indexed(property) + match display: + "": + s += str(p) + "length": + s += num_format % p.length() + "round": + match typeof(p): + TYPE_INT, TYPE_FLOAT: + s += num_format % p + TYPE_VECTOR2, TYPE_VECTOR3: + s += str(p.round()) + label_ref.text = s + +var props = [] # An array of the tracked properties. +var _labelSettings: LabelSettings = null + + +func _ready() -> void: + _labelSettings = LabelSettings.new() + _labelSettings.font_size = 15 + + # add VBoxContainer as child + _vbox = VBoxContainer.new() + add_child(_vbox) + print(str(get_tree())) + + +func _process(_delta): + if not visible: + return + for prop in props: + prop.set_label() + + +func add_property(object, property, display): + var label = Label.new() + label.label_settings = _labelSettings + _vbox.add_child(label) + props.append(Property.new(object, property, label, display)) + + +func remove_property(object, property): + for prop in props: + if prop.object == object and prop.property == property: + props.erase(prop) diff --git a/class/ux/debug_stats.gd.uid b/class/ux/debug_stats.gd.uid new file mode 100644 index 0000000..766ccd8 --- /dev/null +++ b/class/ux/debug_stats.gd.uid @@ -0,0 +1 @@ +uid://mgg7ii0w4vod diff --git a/cube.tscn b/cube.tscn index 0976e80..e72d8af 100644 --- a/cube.tscn +++ b/cube.tscn @@ -1,9 +1,15 @@ -[gd_scene load_steps=2 format=3 uid="uid://bx83k2u0snfjc"] +[gd_scene load_steps=3 format=3 uid="uid://bx83k2u0snfjc"] [sub_resource type="BoxMesh" id="BoxMesh_xc3wn"] +size = Vector3(2, 2, 2) -[node name="Cube" type="Node3D"] +[sub_resource type="BoxShape3D" id="BoxShape3D_xc3wn"] +size = Vector3(2, 2, 2) + +[node name="Cube" type="RigidBody3D"] [node name="MeshInstance3D" type="MeshInstance3D" parent="."] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0) mesh = SubResource("BoxMesh_xc3wn") + +[node name="CollisionShape3D" type="CollisionShape3D" parent="."] +shape = SubResource("BoxShape3D_xc3wn") diff --git a/main.gd b/main.gd index ae1af4c..6779aef 100644 --- a/main.gd +++ b/main.gd @@ -3,13 +3,17 @@ class_name MainMenu @export var scene: PackedScene -@export var fullscreen: bool = true +@export var load_scene_immediately: bool = false +@export var fullscreen: bool = false @export var screen_size_fractional: float = 0.5 func _ready() -> void: _set_project_version() _set_screen_size() + + if load_scene_immediately: + _load_scene() func _set_project_version() -> void: @@ -35,6 +39,10 @@ func _input(event: InputEvent) -> void: func _on_start_pressed() -> void: + _load_scene() + + +func _load_scene(): if scene: get_tree().change_scene_to_packed(scene) else: diff --git a/main.tscn b/main.tscn index 361cc01..f3a1c14 100644 --- a/main.tscn +++ b/main.tscn @@ -6,7 +6,7 @@ [node name="Main" type="Node"] script = ExtResource("1_ig7tw") scene = ExtResource("2_0xm2m") -fullscreen = false +load_scene_immediately = true screen_size_fractional = 0.7 [node name="menu" type="Control" parent="."] diff --git a/model/ram-barbarian.glb b/model/ram-barbarian.glb index 54bc529..cfcbabf 100644 Binary files a/model/ram-barbarian.glb and b/model/ram-barbarian.glb differ diff --git a/player.gd b/player.gd deleted file mode 100644 index 332ffcd..0000000 --- a/player.gd +++ /dev/null @@ -1,128 +0,0 @@ -extends CharacterBody3D -class_name Player - - -# player settings -@export_group("Movement") -@export var walk_speed := 3.0 -@export var jog_speed := 6.0 -@export var charge_speed := 20 - -@export var air_speed := 3.0 -@export var acceleration := 30.0 -@export var jump_speed := 6.0 -@export var rotation_speed := 10.0 -@export var fall_speed := 1.2 -@export var idle_timeout := 5.0 -@export var hard_landing_limit := 10.0 - -@export_group("Camera") -@export_range(1.0, 10.0) var camera_distance := 2.0 -@export_range(0.0, 1.0) var mouse_sensitivity := 0.15 -@export_range(0.0, 1.0) var mouse_sensitivity_x := 1.0 -@export_range(0.0, 1.0) var mouse_sensitivity_y := 0.5 -@export_range(0.0, 10.0) var joystick_sensitivity_x := 4.0 -@export_range(0.0, 10.0) var joystick_sensitivity_y := 2.0 - - -@onready var _debug: CanvasLayer = %debug -@onready var _camera_pivot: Node3D = %camera_pivot -@onready var _camera: Camera3D = %camera -@onready var _skin: AnimatedSkin = %skin - -var _last_movement_direction := rotation -var _camera_input_direction := Vector2.ZERO - -enum {CAMERA_MOUSE_INPUT, CAMERA_JOYSTICK_INPUT} -var _camera_input_method := CAMERA_MOUSE_INPUT - -var _idle_time: float = 0.0 -var _player_speed: float = walk_speed - - -func _ready() -> void: - _debug.draw.add_vector(self, "velocity", 1, 1, Color(0,1,0,1)) - _debug.draw.add_vector(self, "_last_movement_direction", 1, 1, Color(1,0,0,1)) - _debug.stats.add_property(self, "velocity", "length") - _debug.stats.add_property(self, "_idle_time", "round") - - -func _physics_process(delta: float) -> void: - _process_camera(delta) - _process_player(delta) - - -func _unhandled_input(event: InputEvent) -> void: - # If user clicks on the window, capture the mouse and direct the camera with it - if Input.get_mouse_mode() != Input.MOUSE_MODE_CAPTURED: - return - - #_camera_input_direction *= mouse_sensitivity - if event is InputEventMouseMotion: - _camera_input_method = CAMERA_MOUSE_INPUT - _camera_input_direction = event.screen_relative * mouse_sensitivity - elif event is InputEventJoypadMotion: - _camera_input_method = CAMERA_JOYSTICK_INPUT - _camera_input_direction = Input.get_vector("camera-left", "camera-right", "camera-up", "camera-down") - _camera_input_direction *= Vector2(joystick_sensitivity_x, -joystick_sensitivity_y) - - -func _input(event: InputEvent): - if event.is_action_pressed("player_run"): - _player_speed = jog_speed - elif event.is_action_released("player_run"): - _player_speed = walk_speed - - if event.is_action_pressed("player_attack") and velocity.length() > jog_speed * .75: - _player_speed = charge_speed - - -# Get the XZ input direction based on player's input relative to the camera -func _get_player_move_direction() -> Vector3: - var input_dir := Input.get_vector("player_left", "player_right", "player_forward", "player_backward") - var forward := _camera.global_basis.z - var right := _camera.global_basis.x - var move_direction := (forward * input_dir.y + right * input_dir.x).normalized() - move_direction.y = 0 - return move_direction - - -func _process_camera(delta: float) -> void: - # vertical camera rotation - _camera_pivot.rotation.x += _camera_input_direction.y * mouse_sensitivity_y * delta - _camera_pivot.rotation.x = clamp(_camera_pivot.rotation.x, -PI / 6, PI / 3) - - # horizontal camera rotation - _camera_pivot.rotation.y -= _camera_input_direction.x * mouse_sensitivity_x * delta - - # reset mouse movement vector if mouse input - if _camera_input_method == CAMERA_MOUSE_INPUT: - _camera_input_direction = Vector2.ZERO - - -func _process_player(delta: float) -> void: - var move_direction := _get_player_move_direction() - - # if we're not stuck, then it's okay to set the velocity - velocity = velocity.move_toward(move_direction * _player_speed, acceleration * delta) - var movement_speed := Vector3(velocity.x, 0, velocity.z).length() - - # also, if we're moving, we're not idle - if move_direction.length() < 0.2: - if velocity == Vector3.ZERO: - _idle_time += delta - else: - _last_movement_direction = move_direction - _idle_time = 0.0 - - # if camera is unlocked, rotate whole skin to face movement direction - # else, rotate to face camera pivot global Y direction - var skin_target_angle := Vector3.BACK.signed_angle_to(_last_movement_direction, Vector3.UP) - _skin.global_rotation.y = lerp_angle( - _skin.global_rotation.y, - skin_target_angle, - rotation_speed * delta - ) - _skin.set_movement_speed(movement_speed) - - move_and_slide() diff --git a/player.gd.uid b/player.gd.uid deleted file mode 100644 index 3dbf65c..0000000 --- a/player.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://b3hff6ctx5cgj diff --git a/player.tscn b/player.tscn deleted file mode 100644 index 96cda06..0000000 --- a/player.tscn +++ /dev/null @@ -1,28 +0,0 @@ -[gd_scene load_steps=4 format=3 uid="uid://ch6s2gvhi64uh"] - -[ext_resource type="PackedScene" uid="uid://127fi2uta0p8" path="res://skin.tscn" id="1_4flbx"] -[ext_resource type="Script" uid="uid://b3hff6ctx5cgj" path="res://player.gd" id="1_onrkg"] - -[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_sh265"] -radius = 0.602678 - -[node name="player" type="CharacterBody3D"] -script = ExtResource("1_onrkg") - -[node name="CollisionShape3D" type="CollisionShape3D" parent="."] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0) -shape = SubResource("CapsuleShape3D_sh265") - -[node name="skin" parent="." instance=ExtResource("1_4flbx")] -unique_name_in_owner = true -transform = Transform3D(0.688, 0, 0, 0, 0.688, 0, 0, 0, 0.688, 0, 0, 0) - -[node name="camera_pivot" type="Node3D" parent="."] -unique_name_in_owner = true - -[node name="SpringArm3D" type="SpringArm3D" parent="camera_pivot"] -transform = Transform3D(-1, 0, -8.74228e-08, -2.43198e-08, 0.960527, 0.278187, 8.39719e-08, 0.278187, -0.960527, 0, 2.12611, 0) -spring_length = 3.0 - -[node name="camera" type="Camera3D" parent="camera_pivot/SpringArm3D"] -unique_name_in_owner = true diff --git a/player/player.gd b/player/player.gd new file mode 100644 index 0000000..d538d8b --- /dev/null +++ b/player/player.gd @@ -0,0 +1,154 @@ +extends CharacterBody3D +class_name Player + + +# player settings +@export_group("Movement") +@export var walk_speed := 3.0 +@export var jog_speed := 6.0 +@export var charge_speed := 20 + +@export var air_speed := 3.0 +@export var acceleration := 20.0 +@export var jump_speed := 6.0 +@export var rotation_speed := 10.0 +@export var fall_speed := 1.2 +@export var idle_timeout := 5.0 +@export var hard_landing_limit := 10.0 + +@export_group("Physics") +@export var push_force := 1.5 + +@export_group("Camera") +@export_range(1.0, 10.0) var camera_distance := 2.5 +@export_range(0.0, 1.0) var mouse_sensitivity := 0.15 +@export_range(0.0, 1.0) var mouse_sensitivity_x := 1.0 +@export_range(0.0, 1.0) var mouse_sensitivity_y := 0.5 +@export_range(0.0, 10.0) var joystick_sensitivity_x := 4.0 +@export_range(0.0, 10.0) var joystick_sensitivity_y := 2.0 + + +@onready var _debug: CanvasLayer = %debug +@onready var _camera_pivot: Node3D = %camera_pivot +@onready var _camera: Camera3D = %camera +@onready var _skin: AnimatedSkin = %skin + +var _last_movement_direction := rotation +var _camera_input_direction := Vector2.ZERO + +enum {CAMERA_MOUSE_INPUT, CAMERA_JOYSTICK_INPUT} +var _camera_input_method := CAMERA_MOUSE_INPUT + +var _idle_time: float = 0.0 +var _player_speed: float = walk_speed + + +func _ready() -> void: + $camera_pivot/SpringArm3D.spring_length = camera_distance + _debug.draw.add_vector(self, "velocity", 1, 1, Color(0,1,0,1)) + _debug.draw.add_vector(self, "_last_movement_direction", 1, 1, Color(1,0,0,1)) + _debug.stats.add_property(self, "velocity", "length") + _debug.stats.add_property(self, "_idle_time", "round") + + +func _physics_process(delta: float) -> void: + _process_camera(delta) + _process_player(delta) + + +func _unhandled_input(event: InputEvent) -> void: + # If user clicks on the window, capture the mouse and direct the camera with it + if Input.get_mouse_mode() != Input.MOUSE_MODE_CAPTURED: + return + + #_camera_input_direction *= mouse_sensitivity + if event is InputEventMouseMotion: + _camera_input_method = CAMERA_MOUSE_INPUT + _camera_input_direction = event.screen_relative * mouse_sensitivity + elif event is InputEventJoypadMotion: + _camera_input_method = CAMERA_JOYSTICK_INPUT + _camera_input_direction = Input.get_vector("camera-left", "camera-right", "camera-up", "camera-down") + _camera_input_direction *= Vector2(joystick_sensitivity_x, -joystick_sensitivity_y) + + +func _input(event: InputEvent): + if event.is_action_pressed("player_run"): + _player_speed = jog_speed + elif event.is_action_released("player_run"): + _player_speed = walk_speed + + if event.is_action_pressed("player_attack") and velocity.length() > jog_speed * .75: + _player_speed = charge_speed + + +# Get the XZ input direction based on player's input relative to the camera +func _get_player_move_direction() -> Vector3: + var input_dir := Input.get_vector("player_left", "player_right", "player_forward", "player_backward") + var forward := _camera.global_basis.z + var right := _camera.global_basis.x + var move_direction := (forward * input_dir.y + right * input_dir.x).normalized() + move_direction.y = 0 + return move_direction + + +func _process_camera(delta: float) -> void: + # vertical camera rotation + _camera_pivot.rotation.x += _camera_input_direction.y * mouse_sensitivity_y * delta + _camera_pivot.rotation.x = clamp(_camera_pivot.rotation.x, -PI / 6, PI / 3) + + # horizontal camera rotation + _camera_pivot.rotation.y -= _camera_input_direction.x * mouse_sensitivity_x * delta + + # reset mouse movement vector if mouse input + if _camera_input_method == CAMERA_MOUSE_INPUT: + _camera_input_direction = Vector2.ZERO + + +func _process_player_on_floor(delta: float): + var move_direction := _get_player_move_direction() + + # if we're not stuck, then it's okay to set the velocity + velocity = velocity.move_toward(move_direction * _player_speed, acceleration * delta) + var movement_speed := Vector3(velocity.x, 0, velocity.z).length() + + # also, if we're moving, we're not idle + if move_direction.length() < 0.2: + if velocity == Vector3.ZERO: + _idle_time += delta + else: + _last_movement_direction = move_direction + _idle_time = 0.0 + + # if camera is unlocked, rotate whole skin to face movement direction + # else, rotate to face camera pivot global Y direction + var skin_target_angle := Vector3.BACK.signed_angle_to(_last_movement_direction, Vector3.UP) + _skin.global_rotation.y = lerp_angle( + _skin.global_rotation.y, + skin_target_angle, + rotation_speed * delta + ) + _skin.set_movement_speed(movement_speed) + + # timescale tweaking for fun effect! + if movement_speed >= charge_speed * 0.75: + _skin.set_timescale(2.0) + else: + _skin.set_timescale(1.0) + + +func _process_player(delta: float) -> void: + if is_on_floor(): + _process_player_on_floor(delta) + else: + velocity += get_gravity() * air_speed * delta + + # now actually move! + var movement_speed := velocity.length() + move_and_slide() + + # handle collisions + for i in get_slide_collision_count(): + var c := get_slide_collision(i) + if c.get_collider() is RigidBody3D: + var col: RigidBody3D = c.get_collider() + col.apply_central_impulse(-c.get_normal() * push_force * movement_speed / col.mass) diff --git a/player/player.gd.uid b/player/player.gd.uid new file mode 100644 index 0000000..3dbf65c --- /dev/null +++ b/player/player.gd.uid @@ -0,0 +1 @@ +uid://b3hff6ctx5cgj diff --git a/player/player.tscn b/player/player.tscn new file mode 100644 index 0000000..4a19e57 --- /dev/null +++ b/player/player.tscn @@ -0,0 +1,27 @@ +[gd_scene load_steps=4 format=3 uid="uid://ch6s2gvhi64uh"] + +[ext_resource type="PackedScene" uid="uid://127fi2uta0p8" path="res://player/skin.tscn" id="1_4flbx"] +[ext_resource type="Script" uid="uid://b3hff6ctx5cgj" path="res://player/player.gd" id="1_onrkg"] + +[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_sh265"] +radius = 0.602678 + +[node name="player" type="CharacterBody3D"] +script = ExtResource("1_onrkg") + +[node name="CollisionShape3D" type="CollisionShape3D" parent="."] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0) +shape = SubResource("CapsuleShape3D_sh265") + +[node name="skin" parent="." instance=ExtResource("1_4flbx")] +unique_name_in_owner = true +transform = Transform3D(0.688, 0, 0, 0, 0.688, 0, 0, 0, 0.688, 0, 0, 0) + +[node name="camera_pivot" type="Node3D" parent="."] +unique_name_in_owner = true + +[node name="SpringArm3D" type="SpringArm3D" parent="camera_pivot"] +transform = Transform3D(-1, 0, -8.74228e-08, -2.43198e-08, 0.960527, 0.278187, 8.39719e-08, 0.278187, -0.960527, 0, 2.12611, 0) + +[node name="camera" type="Camera3D" parent="camera_pivot/SpringArm3D"] +unique_name_in_owner = true diff --git a/player/skin.gd b/player/skin.gd new file mode 100644 index 0000000..0938204 --- /dev/null +++ b/player/skin.gd @@ -0,0 +1,21 @@ +extends Node3D +class_name AnimatedSkin + + +@onready var _tree: AnimationTree = %AnimationTree + + +func set_movement_speed(s: float): + _tree.set("parameters/movement/blend_position", s) + + +func set_motion_forward(): + _tree.set("parameters/motion/transition_request", "move") + + +func set_motion_idle(): + _tree.set("parameters/motion/transition_request", "idle") + + +func set_timescale(s: float): + _tree.set("parameters/timescale/scale", s) diff --git a/player/skin.gd.uid b/player/skin.gd.uid new file mode 100644 index 0000000..0575542 --- /dev/null +++ b/player/skin.gd.uid @@ -0,0 +1 @@ +uid://b2hbg1leabjky diff --git a/player/skin.tscn b/player/skin.tscn new file mode 100644 index 0000000..ada25d9 --- /dev/null +++ b/player/skin.tscn @@ -0,0 +1,355 @@ +[gd_scene load_steps=13 format=3 uid="uid://127fi2uta0p8"] + +[ext_resource type="PackedScene" uid="uid://b77p7nmn30107" path="res://model/ram-barbarian.glb" id="1_slxxm"] +[ext_resource type="Script" uid="uid://b2hbg1leabjky" path="res://player/skin.gd" id="2_0vn8v"] + +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_0vn8v"] +animation = &"idle-standing" + +[sub_resource type="AnimationNodeTransition" id="AnimationNodeTransition_slxxm"] +sync = true +xfade_time = 0.5 +input_0/name = "idle" +input_0/auto_advance = false +input_0/break_loop_at_end = false +input_0/reset = true +input_1/name = "move" +input_1/auto_advance = false +input_1/break_loop_at_end = false +input_1/reset = true + +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_ogs51"] +animation = &"idle-standing" + +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_5n2vx"] +animation = &"move-walk" + +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_slxxm"] +animation = &"move-jog" + +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_lkge1"] +animation = &"move-run" + +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_2kaph"] +animation = &"move-charge" + +[sub_resource type="AnimationNodeBlendSpace1D" id="AnimationNodeBlendSpace1D_lkge1"] +blend_point_0/node = SubResource("AnimationNodeAnimation_ogs51") +blend_point_0/pos = 0.0 +blend_point_1/node = SubResource("AnimationNodeAnimation_5n2vx") +blend_point_1/pos = 3.0 +blend_point_2/node = SubResource("AnimationNodeAnimation_slxxm") +blend_point_2/pos = 6.0 +blend_point_3/node = SubResource("AnimationNodeAnimation_lkge1") +blend_point_3/pos = 15.0 +blend_point_4/node = SubResource("AnimationNodeAnimation_2kaph") +blend_point_4/pos = 20.0 +min_space = 0.0 +max_space = 20.0 +sync = true + +[sub_resource type="AnimationNodeTimeScale" id="AnimationNodeTimeScale_uiah6"] + +[sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_slxxm"] +nodes/idle/node = SubResource("AnimationNodeAnimation_0vn8v") +nodes/idle/position = Vector2(-320, -40) +nodes/motion/node = SubResource("AnimationNodeTransition_slxxm") +nodes/motion/position = Vector2(-30, 90) +nodes/movement/node = SubResource("AnimationNodeBlendSpace1D_lkge1") +nodes/movement/position = Vector2(-320, 180) +nodes/output/position = Vector2(550, 110) +nodes/timescale/node = SubResource("AnimationNodeTimeScale_uiah6") +nodes/timescale/position = Vector2(250, 100) +node_connections = [&"motion", 0, &"idle", &"motion", 1, &"movement", &"output", 0, &"timescale", &"timescale", 0, &"motion"] + +[node name="skin" instance=ExtResource("1_slxxm")] +script = ExtResource("2_0vn8v") + +[node name="AnimationTree" type="AnimationTree" parent="." index="0"] +unique_name_in_owner = true +root_node = NodePath("%AnimationTree/..") +tree_root = SubResource("AnimationNodeBlendTree_slxxm") +anim_player = NodePath("../AnimationPlayer") +parameters/motion/current_state = "move" +parameters/motion/transition_request = "" +parameters/motion/current_index = 1 +parameters/movement/blend_position = 0.0 +parameters/timescale/scale = 1.0 + +[node name="Skeleton3D" parent="." index="1"] +bones/0/position = Vector3(-0.00267065, 2.38603, 0.199771) +bones/0/rotation = Quaternion(0.239609, 0.000249904, -0.0302077, 0.970399) +bones/2/position = Vector3(0.0106148, 1.06697, -0.155807) +bones/2/rotation = Quaternion(0.198047, -0.0236731, 0.00276388, 0.979903) +bones/3/rotation = Quaternion(-0.0515642, -1.19138e-07, -9.52299e-09, 0.99867) +bones/3/scale = Vector3(1, 1, 1) +bones/4/rotation = Quaternion(-0.115084, 0.00528055, 0.00473896, 0.99333) +bones/4/scale = Vector3(1, 1, 1) +bones/5/rotation = Quaternion(0.0458719, 0.0117897, 0.00977276, 0.99883) +bones/5/scale = Vector3(0.999999, 1, 0.999999) +bones/6/rotation = Quaternion(0.248499, 0.00805833, -0.0367739, 0.9679) +bones/7/rotation = Quaternion(-0.0948396, 0.0195393, -0.00186186, 0.995299) +bones/8/rotation = Quaternion(0.00825577, -0.0308189, -0.00906405, 0.99945) +bones/9/position = Vector3(0.00633017, 1.04915, -0.0671743) +bones/9/rotation = Quaternion(-0.011999, -0.74511, -0.40534, 0.529497) +bones/10/position = Vector3(0.00633022, 1.04915, -0.0671743) +bones/10/rotation = Quaternion(-0.0282832, 0.719165, 0.402212, 0.565886) +bones/11/position = Vector3(-0.010296, 0.940563, 0.273476) +bones/11/rotation = Quaternion(0.975224, -0.00719365, 0.022743, 0.219932) +bones/11/scale = Vector3(0.999999, 0.999999, 1) +bones/12/position = Vector3(0.238329, 1.03615, -0.0427686) +bones/12/rotation = Quaternion(0.97194, 0.151313, 0.0331481, 0.177026) +bones/12/scale = Vector3(1.01391, 0.972759, 1.01391) +bones/13/rotation = Quaternion(2.25727e-08, -0.0603173, 3.86079e-08, 0.998179) +bones/14/rotation = Quaternion(0.482517, -0.0596135, 0.0330136, 0.873232) +bones/14/scale = Vector3(1.00239, 0.966426, 1.03299) +bones/15/rotation = Quaternion(3.15411e-08, -0.00786937, -5.35516e-08, 0.999969) +bones/16/rotation = Quaternion(-0.75751, -0.00801581, 0.112817, 0.642951) +bones/16/scale = Vector3(0.985174, 0.985403, 1.03034) +bones/17/rotation = Quaternion(-0.000131442, 0.977292, -0.211898, -0.000613969) +bones/17/scale = Vector3(0.999998, 1, 0.999998) +bones/18/position = Vector3(-0.227032, 1.038, -0.0648937) +bones/18/rotation = Quaternion(0.969333, -0.142191, 0.0135083, 0.19998) +bones/18/scale = Vector3(1.01644, 0.967919, 1.01644) +bones/19/rotation = Quaternion(-4.17223e-09, 0.0566505, 2.4988e-08, 0.998394) +bones/20/rotation = Quaternion(0.478587, 0.0560147, -0.030681, 0.875715) +bones/20/scale = Vector3(1.00235, 0.961857, 1.03824) +bones/21/rotation = Quaternion(4.25747e-08, 0.0105861, 1.65266e-08, 0.999944) +bones/22/rotation = Quaternion(-0.741466, 0.00982181, -0.135983, 0.656994) +bones/22/scale = Vector3(0.983688, 0.982557, 1.03498) +bones/23/rotation = Quaternion(-0.000139739, 0.976142, -0.217133, -0.000613285) +bones/23/scale = Vector3(0.999997, 1, 0.999998) +bones/24/position = Vector3(0.135939, 2.43565, 0.340442) +bones/24/rotation = Quaternion(0.257456, -0.081828, -0.143206, 0.95211) +bones/25/position = Vector3(0.14939, 2.48387, 0.370411) +bones/25/rotation = Quaternion(-0.306539, 0.0857769, -0.417251, 0.851221) +bones/26/position = Vector3(0.18094, 2.50612, 0.341945) +bones/26/rotation = Quaternion(0.750105, -0.159481, 0.622202, -0.157394) +bones/26/scale = Vector3(0.999998, 1.00001, 0.999995) +bones/28/position = Vector3(0.147337, 2.40668, 0.33163) +bones/28/rotation = Quaternion(0.202518, -0.405425, 0.10624, 0.885059) +bones/29/position = Vector3(-0.130272, 2.45126, 0.344432) +bones/29/rotation = Quaternion(0.263916, 0.0808602, 0.0833871, 0.957526) +bones/30/position = Vector3(-0.137099, 2.50066, 0.374705) +bones/30/rotation = Quaternion(-0.304756, -0.0549504, 0.371275, 0.875362) +bones/31/position = Vector3(-0.16667, 2.52649, 0.347155) +bones/31/rotation = Quaternion(0.748758, 0.112949, -0.62308, -0.195896) +bones/33/position = Vector3(-0.145235, 2.42383, 0.336015) +bones/33/rotation = Quaternion(0.224279, 0.406078, -0.160858, 0.871163) +bones/34/position = Vector3(-0.00320069, 2.3062, 0.476614) +bones/34/rotation = Quaternion(-0.516746, 0.0215367, -0.0211833, 0.855605) +bones/35/position = Vector3(-0.00199491, 2.30966, 0.543529) +bones/35/rotation = Quaternion(-0.679437, 0.0253827, -0.016379, 0.733111) +bones/36/rotation = Quaternion(0.172857, -8.96689e-08, 5.17381e-07, 0.984947) +bones/36/scale = Vector3(1.00001, 0.99999, 1) +bones/37/position = Vector3(0.0240037, 2.32828, 0.498317) +bones/37/rotation = Quaternion(-0.0480895, 0.515431, 0.815977, 0.257295) +bones/38/position = Vector3(-0.0269791, 2.33127, 0.499081) +bones/38/rotation = Quaternion(0.0903657, 0.507826, 0.828823, -0.216795) +bones/39/position = Vector3(0.0784617, 2.41923, 0.478438) +bones/39/rotation = Quaternion(0.0215367, 0.516746, 0.855605, 0.0211833) +bones/40/position = Vector3(0.0408224, 2.40087, 0.502459) +bones/40/rotation = Quaternion(0.734724, 0.499731, 0.346613, -0.300516) +bones/40/scale = Vector3(0.999991, 1.00002, 0.999991) +bones/41/rotation = Quaternion(0.0748443, -0.0181031, -0.0431399, 0.996097) +bones/41/scale = Vector3(1.00002, 0.999968, 1.00002) +bones/42/rotation = Quaternion(0.274345, -0.0136419, -0.129806, 0.952732) +bones/42/scale = Vector3(0.999996, 1, 1) +bones/43/rotation = Quaternion(0.27804, -0.00341172, 0.0671248, 0.958215) +bones/43/scale = Vector3(0.999993, 1.00001, 0.999995) +bones/44/position = Vector3(0.114994, 2.41725, 0.479451) +bones/44/rotation = Quaternion(-0.623357, 0.604359, 0.399417, -0.294352) +bones/44/scale = Vector3(0.999998, 1, 0.999998) +bones/45/rotation = Quaternion(0.2161, 2.22311e-06, 4.32705e-05, 0.976371) +bones/45/scale = Vector3(1, 0.999993, 1) +bones/46/rotation = Quaternion(0.356977, 0.00869095, -0.115439, 0.926912) +bones/46/scale = Vector3(1.00001, 0.99998, 1.00001) +bones/47/rotation = Quaternion(0.0323413, 0.0279362, -0.125436, 0.991181) +bones/47/scale = Vector3(0.999984, 1.00003, 0.999982) +bones/48/position = Vector3(0.0784617, 2.41923, 0.478438) +bones/48/rotation = Quaternion(0.0215367, 0.516747, 0.855605, 0.0211832) +bones/50/position = Vector3(-0.0710107, 2.42799, 0.480678) +bones/50/rotation = Quaternion(0.0215367, 0.516746, 0.855605, 0.0211833) +bones/51/position = Vector3(-0.0350725, 2.40532, 0.503597) +bones/51/rotation = Quaternion(0.698954, -0.546307, -0.339386, -0.312776) +bones/51/scale = Vector3(0.999994, 1.00001, 0.999994) +bones/52/rotation = Quaternion(0.0748532, 0.0181026, 0.0431495, 0.996096) +bones/52/scale = Vector3(1.00001, 0.999982, 1.00001) +bones/53/rotation = Quaternion(0.274339, 0.013641, 0.129806, 0.952734) +bones/53/scale = Vector3(0.999994, 1.00001, 0.999996) +bones/54/rotation = Quaternion(0.278045, 0.00341402, -0.0671337, 0.958213) +bones/54/scale = Vector3(1.00001, 0.999981, 1.00001) +bones/55/position = Vector3(-0.107477, 2.43029, 0.482786) +bones/55/rotation = Quaternion(0.663552, 0.571191, 0.372139, 0.308143) +bones/55/scale = Vector3(0.999997, 1.00001, 0.999997) +bones/56/rotation = Quaternion(0.216103, -7.73366e-06, -1.78721e-05, 0.976371) +bones/56/scale = Vector3(1.00001, 0.999986, 1.00001) +bones/57/rotation = Quaternion(0.356974, -0.00869836, 0.115457, 0.926911) +bones/57/scale = Vector3(0.999996, 1, 1) +bones/58/rotation = Quaternion(0.0323403, -0.0279344, 0.125375, 0.991189) +bones/58/scale = Vector3(1.00001, 0.999986, 1.00001) +bones/59/position = Vector3(-0.0710107, 2.42799, 0.480678) +bones/59/rotation = Quaternion(0.0215366, 0.516746, 0.855606, 0.0211833) +bones/61/position = Vector3(-0.00584984, 2.27021, 0.446126) +bones/61/rotation = Quaternion(-0.516746, 0.0215367, -0.0211833, 0.855605) +bones/62/position = Vector3(-0.0050508, 2.28629, 0.431044) +bones/62/rotation = Quaternion(-0.42068, 0.0191065, -0.0233989, 0.906706) +bones/65/position = Vector3(0.00318072, 2.437, 0.390851) +bones/65/rotation = Quaternion(0.998241, -0.0288468, -0.00896812, 0.0510211) +bones/66/position = Vector3(-0.010335, 2.20626, 0.415327) +bones/66/rotation = Quaternion(0.412229, -0.00525242, -0.0297484, 0.910579) +bones/66/scale = Vector3(0.999995, 1.00001, 0.999995) +bones/67/scale = Vector3(1.00001, 0.999973, 1.00001) +bones/68/position = Vector3(-0.00854236, 2.2489, 0.344302) +bones/68/rotation = Quaternion(0.875994, -0.0220452, -0.0206537, 0.481375) +bones/69/position = Vector3(0.1373, 2.42914, 0.388841) +bones/69/rotation = Quaternion(0.972307, -0.117931, -0.0316608, -0.199271) +bones/72/position = Vector3(-0.130939, 2.44486, 0.392862) +bones/72/rotation = Quaternion(0.977906, 0.0578474, 0.0287151, -0.19882) +bones/75/position = Vector3(-0.00414163, 2.28717, 0.48986) +bones/75/rotation = Quaternion(-0.408349, -0.295997, -0.535073, 0.677742) +bones/76/rotation = Quaternion(-0.152114, -0.0958311, 0.26607, 0.94704) +bones/76/scale = Vector3(0.999995, 1.00001, 0.999996) +bones/77/position = Vector3(-0.00414163, 2.28717, 0.48986) +bones/77/rotation = Quaternion(-0.382282, 0.329486, 0.500553, 0.703382) +bones/78/rotation = Quaternion(-0.152099, 0.0958265, -0.266074, 0.947042) +bones/78/scale = Vector3(0.999996, 1.00001, 0.999997) +bones/79/position = Vector3(-0.00543533, 2.2693, 0.473408) +bones/79/rotation = Quaternion(-0.338333, -0.290247, -0.462669, 0.766306) +bones/79/scale = Vector3(0.999996, 1.00001, 0.999996) +bones/80/rotation = Quaternion(-0.0082481, 0.0772324, 0.0388616, 0.996221) +bones/80/scale = Vector3(1.00001, 0.999983, 1.00001) +bones/81/position = Vector3(-0.00543533, 2.2693, 0.473408) +bones/81/rotation = Quaternion(-0.313816, 0.320974, 0.422052, 0.787634) +bones/82/rotation = Quaternion(-0.00824437, -0.0772325, -0.0388543, 0.996222) +bones/82/scale = Vector3(1.00001, 0.999978, 1.00001) +bones/83/position = Vector3(0.118909, 2.42513, 0.486768) +bones/83/rotation = Quaternion(0.255366, 0.40917, 0.648815, 0.588564) +bones/83/scale = Vector3(0.999998, 1, 0.999998) +bones/84/rotation = Quaternion(-0.223152, -3.36832e-06, 0.0151671, 0.974666) +bones/84/scale = Vector3(1, 1, 0.999999) +bones/85/rotation = Quaternion(-0.299471, 2.72422e-06, -0.0939843, 0.949465) +bones/86/rotation = Quaternion(-0.172955, -4.25693e-07, 0.173112, 0.969597) +bones/86/scale = Vector3(0.999992, 1.00002, 0.999992) +bones/87/position = Vector3(0.0354297, 2.4102, 0.503832) +bones/87/rotation = Quaternion(-0.354302, 0.00644714, 0.922159, 0.155086) +bones/87/scale = Vector3(1, 0.999998, 1) +bones/88/scale = Vector3(1, 0.999995, 1) +bones/89/position = Vector3(-0.110224, 2.43856, 0.490202) +bones/89/rotation = Quaternion(0.221254, -0.414553, -0.685893, 0.555646) +bones/89/scale = Vector3(0.999995, 1.00001, 0.999995) +bones/90/rotation = Quaternion(-0.223173, -2.162e-06, -0.0151925, 0.97466) +bones/90/scale = Vector3(1.00001, 0.999989, 1) +bones/91/rotation = Quaternion(-0.299462, -6.08687e-08, 0.0939902, 0.949467) +bones/92/rotation = Quaternion(-0.172932, -3.16152e-07, -0.173093, 0.969605) +bones/92/scale = Vector3(1.00001, 0.999989, 1.00001) +bones/93/position = Vector3(-0.0285886, 2.41395, 0.504792) +bones/93/rotation = Quaternion(0.36783, -0.0166147, 0.924248, -0.100946) +bones/93/scale = Vector3(0.999998, 1, 0.999998) +bones/94/scale = Vector3(1, 0.999994, 1) +bones/95/position = Vector3(0.126489, 2.42546, 0.438376) +bones/95/rotation = Quaternion(0.542823, -0.28751, -0.196881, 0.764146) +bones/96/position = Vector3(0.125834, 2.44488, 0.493317) +bones/96/rotation = Quaternion(0.704436, -0.446407, 0.0840668, 0.545366) +bones/97/rotation = Quaternion(0.295784, -1.33077e-06, 0.145409, 0.944123) +bones/98/position = Vector3(0.0359119, 2.42506, 0.536073) +bones/98/rotation = Quaternion(0.746417, -0.504941, 0.425331, 0.0836042) +bones/99/position = Vector3(-0.119156, 2.43986, 0.442058) +bones/99/rotation = Quaternion(0.561599, 0.266658, 0.143692, 0.769969) +bones/100/position = Vector3(-0.114597, 2.45897, 0.496921) +bones/100/rotation = Quaternion(0.728014, 0.412535, -0.126362, 0.532769) +bones/102/position = Vector3(-0.0263683, 2.42871, 0.537007) +bones/102/rotation = Quaternion(0.768233, 0.461601, -0.440613, 0.0510122) +bones/103/position = Vector3(0.0467389, 2.29026, 0.456898) +bones/103/rotation = Quaternion(-0.301239, -0.208187, -0.393482, 0.843259) +bones/105/position = Vector3(-0.0552787, 2.29692, 0.45834) +bones/105/rotation = Quaternion(-0.282622, 0.238048, 0.347934, 0.861626) +bones/107/position = Vector3(0.126489, 2.42546, 0.438376) +bones/107/rotation = Quaternion(0.79493, -0.324505, -0.510183, 0.0499713) +bones/109/position = Vector3(-0.119156, 2.43986, 0.442058) +bones/109/rotation = Quaternion(0.820098, 0.278151, 0.494435, 0.0748737) +bones/111/position = Vector3(0.034327, 2.51215, 0.545576) +bones/111/rotation = Quaternion(0.717457, -0.0312607, 0.694423, -0.0453229) +bones/112/position = Vector3(0.0801213, 2.52637, 0.529015) +bones/112/rotation = Quaternion(0.797377, 0.0449795, 0.599602, -0.0514152) +bones/113/position = Vector3(0.115025, 2.53512, 0.495807) +bones/113/rotation = Quaternion(0.933388, 0.0508257, 0.353627, -0.0339282) +bones/114/position = Vector3(-0.0143385, 2.51501, 0.546305) +bones/114/rotation = Quaternion(0.707587, -0.011451, -0.701238, -0.0863366) +bones/115/position = Vector3(-0.0586332, 2.5345, 0.531095) +bones/115/rotation = Quaternion(0.78432, -0.0923176, -0.607429, -0.0857297) +bones/116/position = Vector3(-0.0932516, 2.54733, 0.498929) +bones/116/rotation = Quaternion(0.92342, -0.105851, -0.364961, -0.0537955) +bones/117/position = Vector3(0.00335769, 2.40632, 0.524044) +bones/117/rotation = Quaternion(0.995954, -0.0285285, -0.0099351, 0.0846316) +bones/118/rotation = Quaternion(-0.0510243, -8.36275e-09, -1.62563e-07, 0.998697) +bones/118/scale = Vector3(1.00001, 0.999989, 1.00001) +bones/119/position = Vector3(-0.00197634, 2.31987, 0.506414) +bones/119/rotation = Quaternion(0.963626, -0.0302036, 0.000560127, -0.265543) +bones/119/scale = Vector3(0.999996, 1.00001, 0.999998) +bones/120/position = Vector3(0.136373, 2.53209, 0.438328) +bones/120/rotation = Quaternion(0.974996, 0.00502512, -0.00377621, -0.222133) +bones/121/position = Vector3(-0.116514, 2.54692, 0.442118) +bones/121/rotation = Quaternion(0.972979, -0.0653836, 0.00217867, -0.221431) +bones/122/position = Vector3(0.0130592, 2.71492, -0.0369636) +bones/122/rotation = Quaternion(-0.579957, 0.0147546, -0.0339977, 0.813804) +bones/123/rotation = Quaternion(-0.340497, -0.00349068, -0.0219255, 0.939983) +bones/124/rotation = Quaternion(-0.306573, -0.00302042, -0.0153471, 0.951719) +bones/125/rotation = Quaternion(-0.213217, -0.000162095, -0.00417275, 0.976996) +bones/126/position = Vector3(0.0175721, 2.07511, 0.28222) +bones/126/rotation = Quaternion(-0.555061, -0.253007, -0.431487, 0.664615) +bones/127/position = Vector3(0.454302, 2.04956, 0.0184054) +bones/127/rotation = Quaternion(-0.186481, -0.285897, 0.919108, -0.196793) +bones/127/scale = Vector3(1.01167, 0.977061, 1.01167) +bones/128/rotation = Quaternion(-1.58411e-07, -0.0873467, 1.02427e-07, 0.996178) +bones/129/rotation = Quaternion(0.481139, -0.0865761, 0.0480724, 0.871033) +bones/129/scale = Vector3(1.00071, 0.974216, 1.02625) +bones/130/rotation = Quaternion(6.03821e-08, 0.225167, 1.24826e-07, 0.97432) +bones/131/rotation = Quaternion(0.153441, 0.224617, -0.166382, 0.947797) +bones/131/scale = Vector3(0.990101, 1.01783, 0.992748) +bones/132/rotation = Quaternion(0.112021, 0.553108, 0.152628, 0.811312) +bones/133/rotation = Quaternion(0.415176, -0.351153, 0.0602002, 0.837076) +bones/133/scale = Vector3(1, 0.999988, 0.999998) +bones/134/rotation = Quaternion(0.379246, -0.0573383, -0.0704669, 0.920825) +bones/135/rotation = Quaternion(-0.149154, 0.948608, 0.276142, 0.0405069) +bones/136/rotation = Quaternion(0.474587, -0.33913, 0.218, 0.782454) +bones/137/rotation = Quaternion(0.119079, -0.0302991, -0.146089, 0.981611) +bones/139/rotation = Quaternion(0.216842, 0.505373, 0.0749101, 0.831845) +bones/140/rotation = Quaternion(0.425493, -0.464854, 0.09843, 0.77018) +bones/141/rotation = Quaternion(0.264572, -0.0608534, -0.064556, 0.960276) +bones/143/rotation = Quaternion(0.356623, 0.458771, 0.0410128, 0.812815) +bones/144/rotation = Quaternion(0.38229, -0.465177, 0.0711398, 0.795238) +bones/145/rotation = Quaternion(0.347023, -0.0630967, -0.0397124, 0.934889) +bones/147/rotation = Quaternion(0.490824, 0.359264, -0.0531385, 0.791958) +bones/148/rotation = Quaternion(0.346259, -0.531402, 0.0615647, 0.770666) +bones/149/rotation = Quaternion(0.264023, -0.061118, -0.0534597, 0.961093) +bones/151/position = Vector3(-0.0355044, 2.07355, 0.28129) +bones/151/rotation = Quaternion(-0.555841, 0.262732, 0.422075, 0.666232) +bones/152/position = Vector3(-0.473026, 2.05536, 0.0181773) +bones/152/rotation = Quaternion(0.180994, -0.287694, 0.917264, 0.207605) +bones/152/scale = Vector3(1.0181, 0.964762, 1.0181) +bones/153/rotation = Quaternion(-1.3775e-07, 0.0679515, 1.14696e-08, 0.997689) +bones/154/rotation = Quaternion(0.514803, 0.0670698, -0.0408478, 0.853704) +bones/154/scale = Vector3(1.00078, 0.957759, 1.04432) +bones/155/rotation = Quaternion(9.412e-08, -0.212471, -1.61983e-07, 0.977167) +bones/156/rotation = Quaternion(0.101424, -0.212394, 0.0690701, 0.969449) +bones/156/scale = Vector3(0.981982, 1.03485, 0.984401) +bones/157/rotation = Quaternion(0.10093, -0.554534, -0.152205, 0.811873) +bones/158/rotation = Quaternion(0.368957, 0.347604, -0.062927, 0.859699) +bones/159/rotation = Quaternion(0.317335, 0.0411269, 0.0538326, 0.945891) +bones/160/rotation = Quaternion(0.164171, 0.943046, 0.285639, -0.0460756) +bones/161/rotation = Quaternion(0.486865, 0.338377, -0.223255, 0.773706) +bones/162/rotation = Quaternion(0.171044, 0.014186, 0.139637, 0.975215) +bones/164/rotation = Quaternion(0.209538, -0.50666, -0.0757155, 0.832861) +bones/165/rotation = Quaternion(0.390228, 0.461128, -0.100198, 0.790597) +bones/166/rotation = Quaternion(0.215709, 0.0440052, 0.04848, 0.97426) +bones/168/rotation = Quaternion(0.352311, -0.459481, -0.0440094, 0.814136) +bones/169/rotation = Quaternion(0.355636, 0.460433, -0.0725003, 0.810104) +bones/170/rotation = Quaternion(0.310679, 0.0479801, 0.0275115, 0.948904) +bones/172/rotation = Quaternion(0.489625, -0.358278, 0.0468806, 0.79354) +bones/173/rotation = Quaternion(0.324356, 0.52555, -0.0639526, 0.783901) +bones/174/rotation = Quaternion(0.234412, 0.0489577, 0.0398553, 0.970086) +bones/176/position = Vector3(0.288091, 1.69498, 0.409252) +bones/176/rotation = Quaternion(-0.012167, 0.609695, 0.792541, -0.00175093) +bones/177/position = Vector3(-0.287593, 1.67811, 0.39916) +bones/177/rotation = Quaternion(-0.0213525, 0.610438, 0.791728, -0.00880874) diff --git a/project.godot b/project.godot index 2ce3c04..a59b7ee 100644 --- a/project.godot +++ b/project.godot @@ -57,3 +57,9 @@ player_run={ "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194325,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) ] } + +[layer_names] + +3d_physics/layer_1="world" +3d_physics/layer_2="player" +3d_physics/layer_3="items" diff --git a/skin.gd b/skin.gd deleted file mode 100644 index f28c089..0000000 --- a/skin.gd +++ /dev/null @@ -1,17 +0,0 @@ -extends Node3D -class_name AnimatedSkin - - -@onready var _tree: AnimationTree = %AnimationTree - - -func set_movement_speed(speed: float): - _tree.set("parameters/movement/blend_position", speed) - - -func set_motion_forward(): - _tree.set("parameters/motion/transition_request", "move") - - -func set_motion_idle(): - _tree.set("parameters/motion/transition_request", "idle") diff --git a/skin.gd.uid b/skin.gd.uid deleted file mode 100644 index 0575542..0000000 --- a/skin.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://b2hbg1leabjky diff --git a/skin.tscn b/skin.tscn deleted file mode 100644 index 9e83834..0000000 --- a/skin.tscn +++ /dev/null @@ -1,351 +0,0 @@ -[gd_scene load_steps=12 format=3 uid="uid://127fi2uta0p8"] - -[ext_resource type="PackedScene" uid="uid://b77p7nmn30107" path="res://model/ram-barbarian.glb" id="1_slxxm"] -[ext_resource type="Script" uid="uid://b2hbg1leabjky" path="res://skin.gd" id="2_0vn8v"] - -[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_0vn8v"] -animation = &"idle-standing" - -[sub_resource type="AnimationNodeTransition" id="AnimationNodeTransition_slxxm"] -sync = true -xfade_time = 0.5 -input_0/name = "idle" -input_0/auto_advance = false -input_0/break_loop_at_end = false -input_0/reset = true -input_1/name = "move" -input_1/auto_advance = false -input_1/break_loop_at_end = false -input_1/reset = true - -[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_ogs51"] -animation = &"idle-standing" - -[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_5n2vx"] -animation = &"move-walk" - -[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_slxxm"] -animation = &"move-jog" - -[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_lkge1"] -animation = &"move-run" - -[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_2kaph"] -animation = &"move-charge" - -[sub_resource type="AnimationNodeBlendSpace1D" id="AnimationNodeBlendSpace1D_lkge1"] -blend_point_0/node = SubResource("AnimationNodeAnimation_ogs51") -blend_point_0/pos = 0.0 -blend_point_1/node = SubResource("AnimationNodeAnimation_5n2vx") -blend_point_1/pos = 3.0 -blend_point_2/node = SubResource("AnimationNodeAnimation_slxxm") -blend_point_2/pos = 6.0 -blend_point_3/node = SubResource("AnimationNodeAnimation_lkge1") -blend_point_3/pos = 15.0 -blend_point_4/node = SubResource("AnimationNodeAnimation_2kaph") -blend_point_4/pos = 20.0 -min_space = 0.0 -max_space = 20.0 -sync = true - -[sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_slxxm"] -graph_offset = Vector2(-636.716, -80.3395) -nodes/idle/node = SubResource("AnimationNodeAnimation_0vn8v") -nodes/idle/position = Vector2(-320, -40) -nodes/motion/node = SubResource("AnimationNodeTransition_slxxm") -nodes/motion/position = Vector2(-30, 90) -nodes/movement/node = SubResource("AnimationNodeBlendSpace1D_lkge1") -nodes/movement/position = Vector2(-320, 180) -nodes/output/position = Vector2(260, 100) -node_connections = [&"motion", 0, &"idle", &"motion", 1, &"movement", &"output", 0, &"motion"] - -[node name="skin" instance=ExtResource("1_slxxm")] -script = ExtResource("2_0vn8v") - -[node name="AnimationTree" type="AnimationTree" parent="." index="0"] -unique_name_in_owner = true -root_node = NodePath("%AnimationTree/..") -tree_root = SubResource("AnimationNodeBlendTree_slxxm") -anim_player = NodePath("../AnimationPlayer") -parameters/motion/current_state = "move" -parameters/motion/transition_request = "" -parameters/motion/current_index = 1 -parameters/movement/blend_position = 0.0 - -[node name="Skeleton3D" parent="." index="1"] -bones/0/position = Vector3(0.00217866, 2.36614, 0.207771) -bones/0/rotation = Quaternion(0.173451, -0.0217286, -0.0349716, 0.983982) -bones/2/position = Vector3(-0.00033081, 1.04773, -0.167883) -bones/2/rotation = Quaternion(0.203866, -0.0143156, -0.00295468, 0.97889) -bones/3/rotation = Quaternion(-0.0515642, -1.19138e-07, -9.52299e-09, 0.99867) -bones/3/scale = Vector3(1, 1, 1) -bones/4/rotation = Quaternion(-0.107927, 0.00433947, 0.00533881, 0.994135) -bones/4/scale = Vector3(1, 1, 1) -bones/5/rotation = Quaternion(0.0513819, 0.00970749, 0.00897262, 0.998592) -bones/5/scale = Vector3(0.999999, 1, 0.999999) -bones/6/rotation = Quaternion(0.207477, 0.00434387, -0.0370628, 0.977528) -bones/7/rotation = Quaternion(-0.0948569, 0.00300923, -0.000286785, 0.995486) -bones/8/rotation = Quaternion(-0.0351983, -0.0391799, -0.00324711, 0.998607) -bones/9/position = Vector3(-0.00292446, 1.02887, -0.0793991) -bones/9/rotation = Quaternion(-0.0156798, -0.737123, -0.411571, 0.535736) -bones/10/position = Vector3(-0.00292441, 1.02887, -0.0793992) -bones/10/rotation = Quaternion(-0.0181458, 0.722621, 0.404749, 0.560061) -bones/11/position = Vector3(-0.0133461, 0.91629, 0.2602) -bones/11/rotation = Quaternion(0.97634, -0.00872798, 0.0118799, 0.215736) -bones/11/scale = Vector3(0.999999, 0.999999, 1) -bones/12/position = Vector3(0.229423, 1.01393, -0.0599366) -bones/12/rotation = Quaternion(0.964887, 0.167957, 0.0245226, 0.200455) -bones/12/scale = Vector3(1.01325, 0.974025, 1.01325) -bones/13/rotation = Quaternion(-2.16179e-08, -0.0630815, 9.66979e-09, 0.998008) -bones/14/rotation = Quaternion(0.517933, -0.0623744, 0.0380681, 0.852294) -bones/14/scale = Vector3(1.00262, 0.964567, 1.03457) -bones/15/rotation = Quaternion(-8.04483e-09, 0.00452582, 8.19296e-09, 0.99999) -bones/16/rotation = Quaternion(-0.766151, 0.00448979, 0.113278, 0.632583) -bones/16/scale = Vector3(0.98527, 0.986272, 1.02933) -bones/17/rotation = Quaternion(-0.000131442, 0.977292, -0.211898, -0.000613969) -bones/17/scale = Vector3(0.999998, 1, 0.999998) -bones/18/position = Vector3(-0.236267, 1.01935, -0.0724381) -bones/18/rotation = Quaternion(0.965212, -0.144677, 0.00172298, 0.217789) -bones/18/scale = Vector3(1.01557, 0.96958, 1.01557) -bones/19/rotation = Quaternion(-2.91454e-08, 0.059961, -1.0754e-08, 0.998201) -bones/20/rotation = Quaternion(0.514466, 0.0595643, -0.0360275, 0.854681) -bones/20/scale = Vector3(1.00261, 0.959745, 1.04) -bones/21/rotation = Quaternion(9.05591e-08, 0.0124282, -3.86341e-08, 0.999923) -bones/22/rotation = Quaternion(-0.752824, 0.011618, -0.141228, 0.642787) -bones/22/scale = Vector3(0.984327, 0.983737, 1.03312) -bones/23/rotation = Quaternion(-0.000141056, 0.97525, -0.221103, -0.000612969) -bones/23/scale = Vector3(0.999997, 1, 0.999998) -bones/24/position = Vector3(0.136808, 2.43218, 0.345526) -bones/24/rotation = Quaternion(0.193777, -0.111132, -0.141594, 0.964392) -bones/25/position = Vector3(0.150228, 2.4838, 0.369167) -bones/25/rotation = Quaternion(-0.355347, 0.0445519, -0.43567, 0.825794) -bones/26/position = Vector3(0.183223, 2.50144, 0.339154) -bones/26/rotation = Quaternion(0.746099, -0.120927, 0.646624, -0.102912) -bones/26/scale = Vector3(0.999998, 1.00001, 0.999995) -bones/28/position = Vector3(0.147886, 2.40209, 0.341157) -bones/28/rotation = Quaternion(0.135945, -0.415178, 0.128898, 0.890243) -bones/29/position = Vector3(-0.129019, 2.45253, 0.337329) -bones/29/rotation = Quaternion(0.197269, 0.0664198, 0.0734082, 0.975338) -bones/30/position = Vector3(-0.135812, 2.50571, 0.360376) -bones/30/rotation = Quaternion(-0.370889, -0.0425602, 0.360251, 0.854897) -bones/31/position = Vector3(-0.163876, 2.52802, 0.328465) -bones/31/rotation = Quaternion(0.772609, 0.066696, -0.613721, -0.148234) -bones/33/position = Vector3(-0.144259, 2.42446, 0.332147) -bones/33/rotation = Quaternion(0.171136, 0.376122, -0.192276, 0.890098) -bones/34/position = Vector3(-0.00974592, 2.32479, 0.492662) -bones/34/rotation = Quaternion(-0.573132, 0.00936423, -0.0400931, 0.818428) -bones/35/position = Vector3(-0.0108095, 2.33731, 0.558488) -bones/35/rotation = Quaternion(-0.727104, 0.0172954, -0.0373632, 0.685291) -bones/36/rotation = Quaternion(0.172857, -8.96689e-08, 5.17381e-07, 0.984947) -bones/36/scale = Vector3(1.00001, 0.99999, 1) -bones/37/position = Vector3(0.0171475, 2.34917, 0.512179) -bones/37/rotation = Quaternion(-0.075461, 0.56548, 0.775492, 0.270462) -bones/38/position = Vector3(-0.0337554, 2.35307, 0.510614) -bones/38/rotation = Quaternion(0.0946329, 0.566085, 0.795827, -0.193008) -bones/39/position = Vector3(0.0741976, 2.43565, 0.482216) -bones/39/rotation = Quaternion(0.00936417, 0.573132, 0.818428, 0.040093) -bones/40/position = Vector3(0.0353571, 2.42136, 0.507073) -bones/40/rotation = Quaternion(0.751746, 0.520607, 0.327904, -0.237332) -bones/40/scale = Vector3(0.999991, 1.00002, 0.999991) -bones/41/rotation = Quaternion(0.0748443, -0.0181031, -0.0431399, 0.996097) -bones/41/scale = Vector3(1.00002, 0.999968, 1.00002) -bones/42/rotation = Quaternion(0.274345, -0.0136419, -0.129806, 0.952732) -bones/42/scale = Vector3(0.999996, 1, 1) -bones/43/rotation = Quaternion(0.27804, -0.00341172, 0.0671248, 0.958215) -bones/43/scale = Vector3(0.999993, 1.00001, 0.999995) -bones/44/position = Vector3(0.110621, 2.43323, 0.48486) -bones/44/rotation = Quaternion(-0.603265, 0.641298, 0.348676, -0.3213) -bones/44/scale = Vector3(0.999998, 1, 0.999998) -bones/45/rotation = Quaternion(0.2161, 2.22311e-06, 4.32705e-05, 0.976371) -bones/45/scale = Vector3(1, 0.999993, 1) -bones/46/rotation = Quaternion(0.356977, 0.00869095, -0.115439, 0.926912) -bones/46/scale = Vector3(1.00001, 0.99998, 1.00001) -bones/47/rotation = Quaternion(0.0323413, 0.0279362, -0.125436, 0.991181) -bones/47/scale = Vector3(0.999984, 1.00003, 0.999982) -bones/48/position = Vector3(0.0741976, 2.43565, 0.482216) -bones/48/rotation = Quaternion(0.00936423, 0.573133, 0.818428, 0.040093) -bones/50/position = Vector3(-0.0750406, 2.44709, 0.477629) -bones/50/rotation = Quaternion(0.00936417, 0.573132, 0.818428, 0.040093) -bones/51/position = Vector3(-0.0404188, 2.42717, 0.504744) -bones/51/rotation = Quaternion(0.7195, -0.56896, -0.285642, -0.277514) -bones/51/scale = Vector3(0.999994, 1.00001, 0.999994) -bones/52/rotation = Quaternion(0.0748532, 0.0181026, 0.0431495, 0.996096) -bones/52/scale = Vector3(1.00001, 0.999982, 1.00001) -bones/53/rotation = Quaternion(0.274339, 0.013641, 0.129806, 0.952734) -bones/53/scale = Vector3(0.999994, 1.00001, 0.999996) -bones/54/rotation = Quaternion(0.278045, 0.00341402, -0.0671337, 0.958213) -bones/54/scale = Vector3(1.00001, 0.999981, 1.00001) -bones/55/position = Vector3(-0.111501, 2.45025, 0.478034) -bones/55/rotation = Quaternion(0.639518, 0.583207, 0.341444, 0.366474) -bones/55/scale = Vector3(0.999997, 1.00001, 0.999997) -bones/56/rotation = Quaternion(0.216103, -7.73366e-06, -1.78721e-05, 0.976371) -bones/56/scale = Vector3(1.00001, 0.999986, 1.00001) -bones/57/rotation = Quaternion(0.356974, -0.00869836, 0.115457, 0.926911) -bones/57/scale = Vector3(0.999996, 1, 1) -bones/58/rotation = Quaternion(0.0323403, -0.0279344, 0.125375, 0.991189) -bones/58/scale = Vector3(1.00001, 0.999986, 1.00001) -bones/59/position = Vector3(-0.0750406, 2.44709, 0.477629) -bones/59/rotation = Quaternion(0.00936412, 0.573133, 0.818428, 0.0400931) -bones/61/position = Vector3(-0.0120677, 2.28434, 0.467379) -bones/61/rotation = Quaternion(-0.573132, 0.00936423, -0.040093, 0.818428) -bones/62/position = Vector3(-0.0104246, 2.29889, 0.450175) -bones/62/rotation = Quaternion(-0.480772, 0.00495065, -0.0408734, 0.875879) -bones/65/position = Vector3(0.00242506, 2.44256, 0.390263) -bones/65/rotation = Quaternion(0.992126, -0.0397584, 0.0106962, 0.118282) -bones/66/position = Vector3(-0.0166653, 2.2154, 0.445092) -bones/66/rotation = Quaternion(0.349647, -0.0277307, -0.0304327, 0.935977) -bones/66/scale = Vector3(0.999995, 1.00001, 0.999995) -bones/67/scale = Vector3(1.00001, 0.999973, 1.00001) -bones/68/position = Vector3(-0.0116753, 2.25009, 0.369232) -bones/68/rotation = Quaternion(0.84115, -0.0404421, -0.00771911, 0.539232) -bones/69/position = Vector3(0.136334, 2.4323, 0.394378) -bones/69/rotation = Quaternion(0.982878, -0.125364, -0.00397405, -0.134978) -bones/72/position = Vector3(-0.131484, 2.45282, 0.386148) -bones/72/rotation = Quaternion(0.988997, 0.0540205, 0.0443724, -0.130377) -bones/75/position = Vector3(-0.011535, 2.30772, 0.508326) -bones/75/rotation = Quaternion(-0.446553, -0.340157, -0.527392, 0.637763) -bones/76/rotation = Quaternion(-0.152114, -0.0958311, 0.26607, 0.94704) -bones/76/scale = Vector3(0.999995, 1.00001, 0.999996) -bones/77/position = Vector3(-0.011535, 2.30772, 0.508326) -bones/77/rotation = Quaternion(-0.435218, 0.353569, 0.463227, 0.686291) -bones/78/rotation = Quaternion(-0.152099, 0.0958265, -0.266074, 0.947042) -bones/78/scale = Vector3(0.999996, 1.00001, 0.999997) -bones/79/position = Vector3(-0.0126331, 2.2878, 0.494408) -bones/79/rotation = Quaternion(-0.384009, -0.331765, -0.455133, 0.731657) -bones/79/scale = Vector3(0.999996, 1.00001, 0.999996) -bones/80/rotation = Quaternion(-0.0082481, 0.0772324, 0.0388616, 0.996221) -bones/80/scale = Vector3(1.00001, 0.999983, 1.00001) -bones/81/position = Vector3(-0.0126331, 2.2878, 0.494408) -bones/81/rotation = Quaternion(-0.371312, 0.337554, 0.385955, 0.774095) -bones/82/rotation = Quaternion(-0.00824437, -0.0772325, -0.0388543, 0.996222) -bones/82/scale = Vector3(1.00001, 0.999978, 1.00001) -bones/83/position = Vector3(0.114445, 2.44197, 0.491183) -bones/83/rotation = Quaternion(0.206696, 0.439216, 0.618364, 0.618055) -bones/83/scale = Vector3(0.999998, 1, 0.999998) -bones/84/rotation = Quaternion(-0.223152, -3.36832e-06, 0.0151671, 0.974666) -bones/84/scale = Vector3(1, 1, 0.999999) -bones/85/rotation = Quaternion(-0.299471, 2.72422e-06, -0.0939843, 0.949465) -bones/86/rotation = Quaternion(-0.172955, -4.25693e-07, 0.173112, 0.969597) -bones/86/scale = Vector3(0.999992, 1.00002, 0.999992) -bones/87/position = Vector3(0.03012, 2.43088, 0.506965) -bones/87/rotation = Quaternion(-0.380683, 0.0697822, 0.91147, 0.139401) -bones/87/scale = Vector3(1, 0.999998, 1) -bones/88/scale = Vector3(1, 0.999995, 1) -bones/89/position = Vector3(-0.114329, 2.4595, 0.484152) -bones/89/rotation = Quaternion(0.191398, -0.472434, -0.65714, 0.555283) -bones/89/scale = Vector3(0.999995, 1.00001, 0.999995) -bones/90/rotation = Quaternion(-0.223173, -2.162e-06, -0.0151925, 0.97466) -bones/90/scale = Vector3(1.00001, 0.999989, 1) -bones/91/rotation = Quaternion(-0.299462, -6.08687e-08, 0.0939902, 0.949467) -bones/92/rotation = Quaternion(-0.172932, -3.16152e-07, -0.173093, 0.969605) -bones/92/scale = Vector3(1.00001, 0.999989, 1.00001) -bones/93/position = Vector3(-0.0337979, 2.43577, 0.505) -bones/93/rotation = Quaternion(0.356804, 0.0447444, 0.930685, -0.0671915) -bones/93/scale = Vector3(0.999998, 1, 0.999998) -bones/94/scale = Vector3(1, 0.999994, 1) -bones/95/position = Vector3(0.12372, 2.43558, 0.443512) -bones/95/rotation = Quaternion(0.490255, -0.31923, -0.174153, 0.792094) -bones/96/position = Vector3(0.121557, 2.46231, 0.495251) -bones/96/rotation = Quaternion(0.659746, -0.456137, 0.121916, 0.584646) -bones/97/rotation = Quaternion(0.295784, -1.33077e-06, 0.145409, 0.944123) -bones/98/position = Vector3(0.0297907, 2.44998, 0.536888) -bones/98/rotation = Quaternion(0.726315, -0.483273, 0.471437, 0.129077) -bones/99/position = Vector3(-0.12154, 2.45437, 0.435975) -bones/99/rotation = Quaternion(0.507635, 0.25645, 0.128094, 0.812485) -bones/100/position = Vector3(-0.118497, 2.4807, 0.487873) -bones/100/rotation = Quaternion(0.696076, 0.386304, -0.14594, 0.587324) -bones/102/position = Vector3(-0.0323919, 2.45475, 0.534977) -bones/102/rotation = Quaternion(0.775196, 0.422219, -0.457449, 0.107442) -bones/103/position = Vector3(0.0405015, 2.30549, 0.47718) -bones/103/rotation = Quaternion(-0.35273, -0.246954, -0.391763, 0.813091) -bones/105/position = Vector3(-0.0613044, 2.31329, 0.474052) -bones/105/rotation = Quaternion(-0.344674, 0.248147, 0.317542, 0.847815) -bones/107/position = Vector3(0.12372, 2.43558, 0.443512) -bones/107/rotation = Quaternion(0.795722, -0.366868, -0.472797, 0.093265) -bones/109/position = Vector3(-0.12154, 2.45437, 0.435975) -bones/109/rotation = Quaternion(0.806556, 0.302009, 0.488444, 0.14029) -bones/111/position = Vector3(0.0297342, 2.53757, 0.534432) -bones/111/rotation = Quaternion(0.705799, 0.0101586, 0.708274, 0.00966742) -bones/112/position = Vector3(0.0763732, 2.54864, 0.51783) -bones/112/rotation = Quaternion(0.788377, 0.0791014, 0.610011, 0.00952507) -bones/113/position = Vector3(0.112597, 2.55222, 0.485077) -bones/113/rotation = Quaternion(0.927383, 0.0665714, 0.366569, 0.034011) -bones/114/position = Vector3(-0.018855, 2.54129, 0.532939) -bones/114/rotation = Quaternion(0.724324, -0.0643154, -0.684992, -0.0447608) -bones/115/position = Vector3(-0.0621637, 2.55926, 0.513572) -bones/115/rotation = Quaternion(0.798349, -0.139325, -0.584523, -0.0395112) -bones/116/position = Vector3(-0.0953532, 2.56815, 0.478687) -bones/116/rotation = Quaternion(0.930383, -0.138203, -0.339519, 0.00386543) -bones/117/position = Vector3(-0.00269708, 2.43028, 0.526312) -bones/117/rotation = Quaternion(0.987576, -0.0400964, 0.00935013, 0.151652) -bones/118/rotation = Quaternion(-0.0510243, -8.36275e-09, -1.62563e-07, 0.998697) -bones/118/scale = Vector3(1.00001, 0.999989, 1.00001) -bones/119/position = Vector3(-0.00925337, 2.34233, 0.520368) -bones/119/rotation = Quaternion(0.978976, -0.0343767, 0.0226585, -0.199777) -bones/119/scale = Vector3(0.999996, 1.00001, 0.999998) -bones/120/position = Vector3(0.135874, 2.54104, 0.429382) -bones/120/rotation = Quaternion(0.987774, -0.00042991, 0.0157294, -0.155097) -bones/121/position = Vector3(-0.116616, 2.56038, 0.421622) -bones/121/rotation = Quaternion(0.98494, -0.0702479, 0.0264221, -0.15576) -bones/122/position = Vector3(0.0332116, 2.65944, -0.0705842) -bones/122/rotation = Quaternion(-0.633333, 0.00842316, -0.0460125, 0.772464) -bones/123/rotation = Quaternion(-0.322584, -0.00121162, -0.00683712, 0.946515) -bones/124/rotation = Quaternion(-0.28706, 1.33863e-05, -0.00053349, 0.957912) -bones/125/rotation = Quaternion(-0.202199, 0.000651262, 0.00264667, 0.979341) -bones/126/position = Vector3(0.0213086, 2.04387, 0.291416) -bones/126/rotation = Quaternion(-0.554912, -0.227743, -0.403546, 0.69091) -bones/127/position = Vector3(0.436636, 2.04233, -0.00603555) -bones/127/rotation = Quaternion(-0.160674, -0.27628, 0.92092, -0.22307) -bones/127/scale = Vector3(1.00914, 0.981966, 1.00914) -bones/128/rotation = Quaternion(2.98339e-09, -0.0893274, 1.67719e-08, 0.996002) -bones/129/rotation = Quaternion(0.471696, -0.0887018, 0.047945, 0.875977) -bones/129/scale = Vector3(1.00072, 0.979843, 1.02016) -bones/130/rotation = Quaternion(-2.04077e-08, 0.200744, -7.04901e-09, 0.979644) -bones/131/rotation = Quaternion(0.170934, 0.199734, -0.156646, 0.952024) -bones/131/scale = Vector3(0.99186, 1.01381, 0.99477) -bones/132/rotation = Quaternion(0.0783025, 0.555143, 0.160821, 0.812294) -bones/133/rotation = Quaternion(0.346558, -0.351494, 0.0549728, 0.867945) -bones/133/scale = Vector3(1, 0.999988, 0.999998) -bones/134/rotation = Quaternion(0.311173, -0.0424918, -0.0571949, 0.947679) -bones/135/rotation = Quaternion(-0.149154, 0.948608, 0.276142, 0.0405069) -bones/136/rotation = Quaternion(0.474587, -0.33913, 0.218, 0.782454) -bones/137/rotation = Quaternion(0.119079, -0.0302991, -0.146089, 0.981611) -bones/139/rotation = Quaternion(0.189327, 0.510411, 0.0761978, 0.835362) -bones/140/rotation = Quaternion(0.370829, -0.464359, 0.0911669, 0.79909) -bones/141/rotation = Quaternion(0.208333, -0.0450114, -0.0494871, 0.975768) -bones/143/rotation = Quaternion(0.33973, 0.463961, 0.0419968, 0.817043) -bones/144/rotation = Quaternion(0.346766, -0.464288, 0.0668139, 0.812235) -bones/145/rotation = Quaternion(0.312628, -0.0513284, -0.0305345, 0.947996) -bones/147/rotation = Quaternion(0.486157, 0.361674, -0.053741, 0.793697) -bones/148/rotation = Quaternion(0.33522, -0.530714, 0.0599458, 0.776129) -bones/149/rotation = Quaternion(0.253389, -0.057419, -0.049569, 0.964386) -bones/151/position = Vector3(-0.0317867, 2.04275, 0.291213) -bones/151/rotation = Quaternion(-0.55163, 0.249406, 0.390817, 0.693371) -bones/152/position = Vector3(-0.451919, 2.05534, 0.000902578) -bones/152/rotation = Quaternion(0.164793, -0.257712, 0.916438, 0.258011) -bones/152/scale = Vector3(1.0129, 0.974698, 1.0129) -bones/153/rotation = Quaternion(-1.17463e-07, 0.0760118, -5.84345e-08, 0.997107) -bones/154/rotation = Quaternion(0.491757, 0.0753948, -0.0430603, 0.866393) -bones/154/scale = Vector3(1.0008, 0.970767, 1.02988) -bones/155/rotation = Quaternion(-6.51005e-10, -0.202436, 6.24587e-08, 0.979295) -bones/156/rotation = Quaternion(0.169748, -0.201895, 0.0816823, 0.96112) -bones/156/scale = Vector3(0.98683, 1.02206, 0.991864) -bones/157/rotation = Quaternion(0.0906175, -0.555281, -0.154177, 0.812208) -bones/158/rotation = Quaternion(0.360792, 0.347882, -0.0623381, 0.863088) -bones/159/rotation = Quaternion(0.31465, 0.0405869, 0.053315, 0.94684) -bones/160/rotation = Quaternion(0.164171, 0.943046, 0.285639, -0.0460756) -bones/161/rotation = Quaternion(0.486865, 0.338377, -0.223255, 0.773706) -bones/162/rotation = Quaternion(0.171044, 0.014186, 0.139637, 0.975215) -bones/164/rotation = Quaternion(0.223379, -0.503869, -0.0757894, 0.830948) -bones/165/rotation = Quaternion(0.400958, 0.461577, -0.101959, 0.784719) -bones/166/rotation = Quaternion(0.219395, 0.0450474, 0.0493877, 0.973343) -bones/168/rotation = Quaternion(0.384634, -0.448938, -0.0428199, 0.805405) -bones/169/rotation = Quaternion(0.383108, 0.45964, -0.0757627, 0.797633) -bones/170/rotation = Quaternion(0.319427, 0.0507866, 0.0297069, 0.945783) -bones/172/rotation = Quaternion(0.533552, -0.334159, 0.0391453, 0.775969) -bones/173/rotation = Quaternion(0.365816, 0.531263, -0.0725717, 0.760705) -bones/174/rotation = Quaternion(0.247888, 0.0533933, 0.0444526, 0.966294) -bones/176/position = Vector3(0.30216, 1.66966, 0.380346) -bones/176/rotation = Quaternion(0.00680124, 0.59611, 0.802868, 0.00312333) -bones/177/position = Vector3(-0.297226, 1.65703, 0.378094) -bones/177/rotation = Quaternion(-0.0219893, 0.596623, 0.802012, -0.0182615) diff --git a/test.tscn b/test.tscn index c5570b8..a1312ce 100644 --- a/test.tscn +++ b/test.tscn @@ -1,11 +1,12 @@ -[gd_scene load_steps=13 format=3 uid="uid://c1bxy5s8fvheq"] +[gd_scene load_steps=14 format=3 uid="uid://c1bxy5s8fvheq"] -[ext_resource type="Script" uid="uid://dpsqolvx3mdic" path="res://Scene.gd" id="1_6uqi0"] -[ext_resource type="PackedScene" uid="uid://ch6s2gvhi64uh" path="res://player.tscn" id="1_37kl0"] +[ext_resource type="Script" uid="uid://dpsqolvx3mdic" path="res://class/Scene.gd" id="1_6uqi0"] +[ext_resource type="PackedScene" uid="uid://ch6s2gvhi64uh" path="res://player/player.tscn" id="1_37kl0"] [ext_resource type="PackedScene" uid="uid://bx83k2u0snfjc" path="res://cube.tscn" id="2_8uh7m"] -[ext_resource type="Script" uid="uid://dd3sep8kprktl" path="res://ux/debug_overlay.gd" id="2_g14j6"] -[ext_resource type="Script" uid="uid://mgg7ii0w4vod" path="res://ux/debug_stats.gd" id="2_ppyta"] -[ext_resource type="Script" uid="uid://bocc5xwqtbkbb" path="res://ux/debug_draw_3d.gd" id="4_vbegm"] +[ext_resource type="Script" uid="uid://dd3sep8kprktl" path="res://class/ux/debug_overlay.gd" id="2_g14j6"] +[ext_resource type="Script" uid="uid://mgg7ii0w4vod" path="res://class/ux/debug_stats.gd" id="2_ppyta"] +[ext_resource type="Script" uid="uid://bocc5xwqtbkbb" path="res://class/ux/debug_draw_3d.gd" id="4_vbegm"] +[ext_resource type="Texture2D" uid="uid://dpjg45owgorg2" path="res://texture/untextured.png" id="5_vbegm"] [sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_mf4mk"] sky_horizon_color = Color(0.662243, 0.671743, 0.686743, 1) @@ -25,6 +26,9 @@ size = Vector2(222, 222) [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_37kl0"] albedo_color = Color(0.133333, 0.278431, 0.133333, 1) +albedo_texture = ExtResource("5_vbegm") +uv1_scale = Vector3(10, 10, 10) +uv1_world_triplanar = true [sub_resource type="ConcavePolygonShape3D" id="ConcavePolygonShape3D_37kl0"] data = PackedVector3Array(111, 0, 111, -111, 0, 111, 111, 0, -111, -111, 0, 111, -111, 0, -111, 111, 0, -111) @@ -45,9 +49,6 @@ theme_override_constants/margin_right = 5 theme_override_constants/margin_bottom = 5 script = ExtResource("2_ppyta") -[node name="VBoxContainer" type="VBoxContainer" parent="debug/DebugStats"] -layout_mode = 2 - [node name="DebugDraw3D" type="Control" parent="debug"] layout_mode = 3 anchors_preset = 0 @@ -55,26 +56,43 @@ offset_right = 40.0 offset_bottom = 40.0 script = ExtResource("4_vbegm") -[node name="WorldEnvironment" type="WorldEnvironment" parent="."] +[node name="player" parent="." instance=ExtResource("1_37kl0")] +collision_layer = 2 +collision_mask = 7 + +[node name="map" type="Node3D" parent="."] + +[node name="WorldEnvironment" type="WorldEnvironment" parent="map"] environment = SubResource("Environment_8uh7m") -[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."] +[node name="DirectionalLight3D" type="DirectionalLight3D" parent="map"] transform = Transform3D(1, 0, 0, 0, 0.499998, 0.866027, 0, -0.866027, 0.499998, 0, 0, 0) shadow_enabled = true -[node name="MeshInstance3D" type="MeshInstance3D" parent="."] +[node name="MeshInstance3D" type="MeshInstance3D" parent="map"] mesh = SubResource("PlaneMesh_mf4mk") +skeleton = NodePath("../..") surface_material_override/0 = SubResource("StandardMaterial3D_37kl0") -[node name="StaticBody3D" type="StaticBody3D" parent="MeshInstance3D"] +[node name="StaticBody3D" type="StaticBody3D" parent="map/MeshInstance3D"] +collision_mask = 7 -[node name="CollisionShape3D" type="CollisionShape3D" parent="MeshInstance3D/StaticBody3D"] +[node name="CollisionShape3D" type="CollisionShape3D" parent="map/MeshInstance3D/StaticBody3D"] shape = SubResource("ConcavePolygonShape3D_37kl0") -[node name="player" parent="." instance=ExtResource("1_37kl0")] +[node name="boxes" type="Node3D" parent="."] [node name="Cube" parent="." instance=ExtResource("2_8uh7m")] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.297243, 0, 10.8886) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.566431, 1, 10.0699) [node name="Cube2" parent="." instance=ExtResource("2_8uh7m")] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 6.27809, -9.53674e-07, 6.40379) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3.10187, 1, 6.38805) + +[node name="Cube3" parent="." instance=ExtResource("2_8uh7m")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 4.92195, 1, 9.742) + +[node name="Cube4" parent="." instance=ExtResource("2_8uh7m")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.37007, 0.999999, 14.1222) + +[node name="Cube5" parent="." instance=ExtResource("2_8uh7m")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.3609, 1, 14.9511) diff --git a/texture/untextured.png b/texture/untextured.png new file mode 100644 index 0000000..a22b16c Binary files /dev/null and b/texture/untextured.png differ diff --git a/texture/untextured.png.import b/texture/untextured.png.import new file mode 100644 index 0000000..edf7237 --- /dev/null +++ b/texture/untextured.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dpjg45owgorg2" +path.s3tc="res://.godot/imported/untextured.png-686bf4d9f00eea506455fbf6a6d8912d.s3tc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://texture/untextured.png" +dest_files=["res://.godot/imported/untextured.png-686bf4d9f00eea506455fbf6a6d8912d.s3tc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/texture/untextured2.png b/texture/untextured2.png new file mode 100644 index 0000000..b9965c7 Binary files /dev/null and b/texture/untextured2.png differ diff --git a/texture/untextured2.png.import b/texture/untextured2.png.import new file mode 100644 index 0000000..e1aa9cb --- /dev/null +++ b/texture/untextured2.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://b2k1iykgmhi1" +path.s3tc="res://.godot/imported/untextured2.png-9e17cf976f902ea62c87f6ba31332990.s3tc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://texture/untextured2.png" +dest_files=["res://.godot/imported/untextured2.png-9e17cf976f902ea62c87f6ba31332990.s3tc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/ux/debug_draw_3d.gd b/ux/debug_draw_3d.gd deleted file mode 100644 index 65d512f..0000000 --- a/ux/debug_draw_3d.gd +++ /dev/null @@ -1,49 +0,0 @@ -extends Control - - -class Vector: - var object # The node to follow - var property # The property to draw - var scale # Scale factor - var width # Line width - var color # Draw color - - func _init(_object, _property, _scale, _width, _color) -> void: - object = _object - property = _property - scale = _scale - width = _width - color = _color - - func draw(node: Control, camera: Camera3D) -> void: - var start = camera.unproject_position(object.global_transform.origin) - var endv = object.global_transform.origin + object.get(property) * scale - var end = camera.unproject_position(endv) - if start != end: - node.draw_line(start, end, color, width) - if camera.is_position_in_frustum(endv): - node.draw_triangle(end, start.direction_to(end), width * 2, color) - - -var vectors = [] # Array to hold all registered values. - -func draw_triangle(pos: Vector2, dir: Vector2, length: float, color: Color) -> void: - var a = pos + dir.rotated(-PI / 2) * length - var b = pos + dir * length - var c = pos + dir.rotated(PI / 2) * length - var points = PackedVector2Array([a, b, c]) - draw_polygon(points, PackedColorArray([color])) - - -func _process(_delta: float) -> void: - queue_redraw() - - -func _draw() -> void: - var camera = get_viewport().get_camera_3d() - for vector in vectors: - vector.draw(self, camera) - - -func add_vector(object, property, vscale, width, color) -> void: - vectors.append(Vector.new(object, property, vscale, width, color)) diff --git a/ux/debug_draw_3d.gd.uid b/ux/debug_draw_3d.gd.uid deleted file mode 100644 index 0b4dc38..0000000 --- a/ux/debug_draw_3d.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://bocc5xwqtbkbb diff --git a/ux/debug_overlay.gd b/ux/debug_overlay.gd deleted file mode 100644 index 9358517..0000000 --- a/ux/debug_overlay.gd +++ /dev/null @@ -1,18 +0,0 @@ -extends CanvasLayer - - -@onready var draw = $DebugDraw3D -@onready var stats = $DebugStats - - -func _ready(): - if not InputMap.has_action("toggle_debug"): - InputMap.add_action("toggle_debug") - var ev = InputEventKey.new() - ev.physical_keycode = KEY_BACKSLASH - InputMap.action_add_event("toggle_debug", ev) - - -func _input(event): - if event.is_action_pressed("toggle_debug"): - self.visible = not self.visible diff --git a/ux/debug_overlay.gd.uid b/ux/debug_overlay.gd.uid deleted file mode 100644 index cf38035..0000000 --- a/ux/debug_overlay.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://dd3sep8kprktl diff --git a/ux/debug_stats.gd b/ux/debug_stats.gd deleted file mode 100644 index 3f930df..0000000 --- a/ux/debug_stats.gd +++ /dev/null @@ -1,60 +0,0 @@ -extends MarginContainer - - -class Property: - var num_format = "%4.2f" - var object # The object being tracked. - var property # The property to display (NodePath). - var label_ref # A reference to the Label. - var display # Display option (rounded, etc.) - - func _init(_object, _property, _label, _display): - object = _object - property = _property - label_ref = _label - display = _display - - func set_label(): - # Sets the label's text. - var s = object.name + "/" + property + " : " - var p = object.get_indexed(property) - match display: - "": - s += str(p) - "length": - s += num_format % p.length() - "round": - match typeof(p): - TYPE_INT, TYPE_FLOAT: - s += num_format % p - TYPE_VECTOR2, TYPE_VECTOR3: - s += str(p.round()) - label_ref.text = s - -var props = [] # An array of the tracked properties. -var _labelSettings: LabelSettings = null - - -func _ready() -> void: - _labelSettings = LabelSettings.new() - _labelSettings.font_size = 15 - - -func _process(_delta): - if not visible: - return - for prop in props: - prop.set_label() - - -func add_property(object, property, display): - var label = Label.new() - label.label_settings = _labelSettings - $VBoxContainer.add_child(label) - props.append(Property.new(object, property, label, display)) - - -func remove_property(object, property): - for prop in props: - if prop.object == object and prop.property == property: - props.erase(prop) diff --git a/ux/debug_stats.gd.uid b/ux/debug_stats.gd.uid deleted file mode 100644 index 766ccd8..0000000 --- a/ux/debug_stats.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://mgg7ii0w4vod