progress
This commit is contained in:
parent
13d6939103
commit
db7474043b
Binary file not shown.
BIN
blends/small_room.blend (Stored with Git LFS)
BIN
blends/small_room.blend (Stored with Git LFS)
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,24 @@
|
|||
[remap]
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamWAV"
|
||||
uid="uid://ckhf7ksthi053"
|
||||
path="res://.godot/imported/charge.wav-9ea0e7ab134da578b6f69151780ec24f.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://audio/charge.wav"
|
||||
dest_files=["res://.godot/imported/charge.wav-9ea0e7ab134da578b6f69151780ec24f.sample"]
|
||||
|
||||
[params]
|
||||
|
||||
force/8_bit=false
|
||||
force/mono=false
|
||||
force/max_rate=false
|
||||
force/max_rate_hz=44100
|
||||
edit/trim=false
|
||||
edit/normalize=false
|
||||
edit/loop_mode=0
|
||||
edit/loop_begin=0
|
||||
edit/loop_end=-1
|
||||
compress/mode=0
|
|
@ -4,13 +4,16 @@ extends Node3D
|
|||
@export var initial_target: Node3D
|
||||
var target: Targetable = null
|
||||
@export var sensitivity := 0.01
|
||||
@export var charge_time := 3
|
||||
@export var charge_time := 2
|
||||
|
||||
func _ready():
|
||||
set_target(initial_target)
|
||||
|
||||
func get_charge():
|
||||
return %radial_ui.charge_amount
|
||||
|
||||
func _input(event):
|
||||
if event is InputEventMouseMotion:
|
||||
if event is InputEventMouseMotion and MouseControl.mouse_is_locked() and get_charge() == 0.0:
|
||||
rotate_view(event.relative*sensitivity)
|
||||
if event.is_action("charge"):
|
||||
charge(event.get_action_strength("charge"))
|
||||
|
@ -25,9 +28,11 @@ func charge(amount: float):
|
|||
charge_tween.kill()
|
||||
if amount == 0.0:
|
||||
%radial_ui.set_charge(0.0)
|
||||
$AudioStreamPlayer.stop()
|
||||
return
|
||||
charge_tween = create_tween()
|
||||
charge_tween.tween_method(%radial_ui.set_charge, 0.0, 1.0, charge_time)
|
||||
$AudioStreamPlayer.play()
|
||||
|
||||
func rotate_view(amount: Vector2):
|
||||
rotate_y(-amount.x)
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
[gd_scene load_steps=3 format=3 uid="uid://drmb4sitb74fx"]
|
||||
[gd_scene load_steps=4 format=3 uid="uid://drmb4sitb74fx"]
|
||||
|
||||
[ext_resource type="Script" path="res://control_scheme/controller.gd" id="1_h3pjb"]
|
||||
[ext_resource type="PackedScene" uid="uid://p2n48c8st55d" path="res://control_scheme/radial_ui.tscn" id="2_qidcb"]
|
||||
[ext_resource type="AudioStream" uid="uid://ckhf7ksthi053" path="res://audio/charge.wav" id="3_exgm6"]
|
||||
|
||||
[node name="controller" type="Node3D"]
|
||||
top_level = true
|
||||
|
@ -16,3 +17,6 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0)
|
|||
|
||||
[node name="radial_ui" parent="." instance=ExtResource("2_qidcb")]
|
||||
unique_name_in_owner = true
|
||||
|
||||
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
|
||||
stream = ExtResource("3_exgm6")
|
||||
|
|
|
@ -3,6 +3,10 @@ extends Node3D
|
|||
func _ready():
|
||||
set_charge(0.0)
|
||||
|
||||
var charge_amount: float = 0.0
|
||||
|
||||
func set_charge(amount: float):
|
||||
charge_amount = amount
|
||||
var mat: ShaderMaterial = $MeshInstance3D.get_active_material(0)
|
||||
mat.set_shader_parameter("charge", amount)
|
||||
|
||||
|
|
Binary file not shown.
|
@ -0,0 +1,40 @@
|
|||
[remap]
|
||||
|
||||
importer="scene"
|
||||
importer_version=1
|
||||
type="PackedScene"
|
||||
uid="uid://bsge8trc5uwb0"
|
||||
path="res://.godot/imported/grape.glb-590b932d26d4103b5968cc4125e7a03e.scn"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://grape.glb"
|
||||
dest_files=["res://.godot/imported/grape.glb-590b932d26d4103b5968cc4125e7a03e.scn"]
|
||||
|
||||
[params]
|
||||
|
||||
nodes/root_type="Node3D"
|
||||
nodes/root_name="Scene Root"
|
||||
nodes/apply_root_scale=true
|
||||
nodes/root_scale=1.0
|
||||
meshes/ensure_tangents=true
|
||||
meshes/generate_lods=true
|
||||
meshes/create_shadow_meshes=true
|
||||
meshes/light_baking=1
|
||||
meshes/lightmap_texel_size=0.2
|
||||
skins/use_named_skins=true
|
||||
animation/import=true
|
||||
animation/fps=30
|
||||
animation/trimming=false
|
||||
animation/remove_immutable_tracks=true
|
||||
import_script/path="res://physics/import_billiard.gd"
|
||||
_subresources={
|
||||
"nodes": {
|
||||
"PATH:grape2": {
|
||||
"generate/physics": true,
|
||||
"physics/body_type": 1,
|
||||
"physics/shape_type": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
gltf/embedded_image_handling=1
|
|
@ -0,0 +1,23 @@
|
|||
extends Node
|
||||
|
||||
func lock_mouse():
|
||||
Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
|
||||
|
||||
func unlock_mouse():
|
||||
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
|
||||
|
||||
func toggle_mouse_lock():
|
||||
if mouse_is_locked():
|
||||
unlock_mouse()
|
||||
else:
|
||||
lock_mouse()
|
||||
|
||||
func mouse_is_locked():
|
||||
return Input.mouse_mode == Input.MOUSE_MODE_CAPTURED
|
||||
|
||||
func _input(event):
|
||||
if event.is_action("charge") and Input.mouse_mode != Input.MOUSE_MODE_CAPTURED:
|
||||
lock_mouse()
|
||||
get_viewport().set_input_as_handled()
|
||||
if event.is_action("ui_cancel"):
|
||||
unlock_mouse()
|
|
@ -0,0 +1 @@
|
|||
extends RigidBody3D
|
|
@ -0,0 +1,9 @@
|
|||
[gd_scene load_steps=3 format=3 uid="uid://cpj2gefpjwogk"]
|
||||
|
||||
[ext_resource type="Script" path="res://physics/billiard.gd" id="1_a0fke"]
|
||||
[ext_resource type="PackedScene" uid="uid://cbp8c4kpmr0hk" path="res://control_scheme/is_targetable.tscn" id="2_yrk4o"]
|
||||
|
||||
[node name="billiard" type="RigidBody3D"]
|
||||
script = ExtResource("1_a0fke")
|
||||
|
||||
[node name="is_targetable" parent="." instance=ExtResource("2_yrk4o")]
|
|
@ -0,0 +1,5 @@
|
|||
[gd_scene load_steps=2 format=3 uid="uid://c43pr474qofhl"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://bsge8trc5uwb0" path="res://grape.glb" id="1_jlfas"]
|
||||
|
||||
[node name="grape" instance=ExtResource("1_jlfas")]
|
|
@ -0,0 +1,24 @@
|
|||
@tool
|
||||
extends EditorScenePostImport
|
||||
|
||||
|
||||
func _post_import(scene: Node) -> Object:
|
||||
if scene.get_child_count(true) != 1:
|
||||
push_error("Ruh oh! 342808")
|
||||
return null
|
||||
var new_root: Node = scene.get_child(0)
|
||||
var billiard: Node = preload("billiard.tscn").instantiate()
|
||||
billiard.name = scene.name
|
||||
take_children(new_root, billiard)
|
||||
take_ownership(billiard, billiard)
|
||||
return billiard
|
||||
|
||||
func take_children(src: Node, dest: Node):
|
||||
for child in src.get_children(true):
|
||||
src.remove_child(child)
|
||||
dest.add_child(child)
|
||||
|
||||
func take_ownership(node: Node, owner: Node):
|
||||
for child in node.get_children(true):
|
||||
child.owner = owner
|
||||
take_ownership(child, owner)
|
|
@ -19,6 +19,7 @@ config/icon="res://icon.svg"
|
|||
|
||||
ControllerEventBus="*res://controller_event_bus.gd"
|
||||
TAS_System="*res://TAS_system/TAS_System.tscn"
|
||||
MouseControl="*res://mouse_control.gd"
|
||||
|
||||
[dotnet]
|
||||
|
||||
|
@ -30,6 +31,12 @@ import/blender/enabled=false
|
|||
|
||||
[input]
|
||||
|
||||
ui_cancel={
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194305,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null)
|
||||
, Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":0,"position":Vector2(0, 0),"global_position":Vector2(0, 0),"factor":1.0,"button_index":2,"canceled":false,"pressed":false,"double_click":false,"script":null)
|
||||
]
|
||||
}
|
||||
charge={
|
||||
"deadzone": 0.0,
|
||||
"events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":0,"position":Vector2(0, 0),"global_position":Vector2(0, 0),"factor":1.0,"button_index":1,"canceled":false,"pressed":false,"double_click":false,"script":null)
|
||||
|
|
BIN
godot/small_room.glb (Stored with Git LFS)
BIN
godot/small_room.glb (Stored with Git LFS)
Binary file not shown.
|
@ -28,5 +28,16 @@ animation/fps=30
|
|||
animation/trimming=false
|
||||
animation/remove_immutable_tracks=true
|
||||
import_script/path=""
|
||||
_subresources={}
|
||||
_subresources={
|
||||
"nodes": {
|
||||
"PATH:room": {
|
||||
"generate/physics": true,
|
||||
"physics/shape_type": 2
|
||||
},
|
||||
"PATH:table": {
|
||||
"generate/physics": true,
|
||||
"physics/shape_type": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
gltf/embedded_image_handling=1
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
[ext_resource type="PackedScene" uid="uid://bua7f25rpewkp" path="res://small_room.glb" id="1_2ticn"]
|
||||
[ext_resource type="PackedScene" uid="uid://drmb4sitb74fx" path="res://control_scheme/controller.tscn" id="2_dcvuq"]
|
||||
[ext_resource type="PackedScene" uid="uid://cbp8c4kpmr0hk" path="res://control_scheme/is_targetable.tscn" id="2_y2131"]
|
||||
[ext_resource type="PackedScene" uid="uid://c43pr474qofhl" path="res://physics/grape.tscn" id="3_gijly"]
|
||||
|
||||
[sub_resource type="Environment" id="Environment_f0m14"]
|
||||
ambient_light_source = 2
|
||||
|
@ -11,16 +11,22 @@ ambient_light_energy = 0.5
|
|||
|
||||
[node name="small_room" instance=ExtResource("1_2ticn")]
|
||||
|
||||
[node name="is_targetable" parent="grape" index="0" instance=ExtResource("2_y2131")]
|
||||
|
||||
[node name="WorldEnvironment" type="WorldEnvironment" parent="." index="3"]
|
||||
[node name="WorldEnvironment" type="WorldEnvironment" parent="." index="2"]
|
||||
environment = SubResource("Environment_f0m14")
|
||||
|
||||
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="WorldEnvironment" index="0"]
|
||||
transform = Transform3D(1, 0, 0, 0, 0.933762, 0.357895, 0, -0.357895, 0.933762, 0, 1.43864, 1.81738)
|
||||
|
||||
[node name="controller" parent="." index="4" node_paths=PackedStringArray("camera", "initial_target") instance=ExtResource("2_dcvuq")]
|
||||
[node name="controller" parent="." index="3" node_paths=PackedStringArray("camera", "initial_target") instance=ExtResource("2_dcvuq")]
|
||||
camera = NodePath("Camera3D")
|
||||
initial_target = NodePath("../grape")
|
||||
|
||||
[node name="Camera3D" type="Camera3D" parent="controller" index="1"]
|
||||
|
||||
[node name="billiard" parent="." index="4" instance=ExtResource("3_gijly")]
|
||||
|
||||
[node name="grape" parent="." index="5" instance=ExtResource("3_gijly")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.56762, 0.385236)
|
||||
|
||||
[node name="grape2" parent="." index="6" instance=ExtResource("3_gijly")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.60495, 0)
|
||||
|
|
Loading…
Reference in New Issue