This commit is contained in:
PajamaBee 2025-07-19 20:18:32 -05:00
parent 8f4b0602fd
commit 23d6a5b516
21 changed files with 425 additions and 0 deletions

4
.editorconfig Normal file
View file

@ -0,0 +1,4 @@
root = true
[*]
charset = utf-8

3
GlobalVariables.gd Normal file
View file

@ -0,0 +1,3 @@
extends Node
var selectedObject

1
GlobalVariables.gd.uid Normal file
View file

@ -0,0 +1 @@
uid://d1mciek5v8ur4

71
Main.tscn Normal file
View file

@ -0,0 +1,71 @@
[gd_scene load_steps=10 format=3 uid="uid://bt5a8babn8gyn"]
[ext_resource type="PackedScene" uid="uid://du8lkrvnc16gl" path="res://objects/Rotatable.tscn" id="1_glv2v"]
[ext_resource type="PackedScene" uid="uid://cbl4jcbilihv" path="res://objects/rotatableSphere.tscn" id="2_uu6xs"]
[ext_resource type="PackedScene" uid="uid://dqu5h8wloab26" path="res://objects/rotatableLong.tscn" id="3_r0du0"]
[ext_resource type="PackedScene" uid="uid://coowoxprnd50y" path="res://objects/Guitar.tscn" id="4_cm0pq"]
[ext_resource type="PackedScene" uid="uid://dxnty4qdey1la" path="res://objects/horse.tscn" id="5_fos0i"]
[ext_resource type="PackedScene" uid="uid://bggp3whsy8eji" path="res://objects/shark.tscn" id="6_3dxm6"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_glv2v"]
albedo_color = Color(0.356863, 1, 1, 1)
[sub_resource type="PlaneMesh" id="PlaneMesh_uu6xs"]
material = SubResource("StandardMaterial3D_glv2v")
size = Vector2(30, 30)
[sub_resource type="CylinderShape3D" id="CylinderShape3D_glv2v"]
height = 1.0
radius = 200.0
[node name="Main" type="Node3D"]
[node name="Camera3D" type="Camera3D" parent="."]
transform = Transform3D(-0.000329031, -0.999888, -0.0149358, 0.0220218, -0.0149394, 0.999646, -0.999757, 1.8631e-09, 0.0220242, -0.213372, 22.4613, 0)
[node name="RayCast3D" type="RayCast3D" parent="Camera3D"]
[node name="RigidBody3D" parent="." instance=ExtResource("1_glv2v")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.822342, 0)
[node name="RigidBody3D2" parent="." instance=ExtResource("1_glv2v")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.70702, 1.18342, 2.50972)
[node name="StaticBody3D" type="StaticBody3D" parent="."]
[node name="MeshInstance3D" type="MeshInstance3D" parent="StaticBody3D"]
mesh = SubResource("PlaneMesh_uu6xs")
[node name="CollisionShape3D" type="CollisionShape3D" parent="StaticBody3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.494415, 0)
shape = SubResource("CylinderShape3D_glv2v")
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
transform = Transform3D(0.177645, -0.645417, 0.742886, -0.293885, 0.685651, 0.665968, -0.939188, -0.336629, -0.067876, 15.6558, 10.5503, -0.157694)
[node name="Rotatable" parent="." instance=ExtResource("2_uu6xs")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.40892, 0.593454, -0.355954)
physics_material_override = null
yTorqueMult = 100.0
zTorqueMult = 100.0
[node name="Rotatable2" parent="." instance=ExtResource("2_uu6xs")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -5.89273, 0.00558472, 0.652737)
physics_material_override = null
yTorqueMult = 100.0
zTorqueMult = 100.0
[node name="Rotatable3" parent="." instance=ExtResource("3_r0du0")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 4.16635, 1.11456, -2.11353)
mass = 5.0
physics_material_override = null
[node name="Guitar" parent="." instance=ExtResource("4_cm0pq")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.11599, 0.997873, 3.88009)
physics_material_override = null
[node name="Horse" parent="." instance=ExtResource("5_fos0i")]
transform = Transform3D(0.146601, 0, 0.989196, 0, 1, 0, -0.989196, 0, 0.146601, -0.288846, 0.43723, -4.17931)
[node name="Horse2" parent="." instance=ExtResource("6_3dxm6")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.81449, 3.35932, 6.69674)

1
icon.svg Normal file
View file

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="128" height="128"><rect width="124" height="124" x="2" y="2" fill="#363d52" stroke="#212532" stroke-width="4" rx="14"/><g fill="#fff" transform="translate(12.322 12.322)scale(.101)"><path d="M105 673v33q407 354 814 0v-33z"/><path fill="#478cbf" d="m105 673 152 14q12 1 15 14l4 67 132 10 8-61q2-11 15-15h162q13 4 15 15l8 61 132-10 4-67q3-13 15-14l152-14V427q30-39 56-81-35-59-83-108-43 20-82 47-40-37-88-64 7-51 8-102-59-28-123-42-26 43-46 89-49-7-98 0-20-46-46-89-64 14-123 42 1 51 8 102-48 27-88 64-39-27-82-47-48 49-83 108 26 42 56 81zm0 33v39c0 276 813 276 814 0v-39l-134 12-5 69q-2 10-14 13l-162 11q-12 0-16-11l-10-65H446l-10 65q-4 11-16 11l-162-11q-12-3-14-13l-5-69z"/><path d="M483 600c0 34 58 34 58 0v-86c0-34-58-34-58 0z"/><circle cx="725" cy="526" r="90"/><circle cx="299" cy="526" r="90"/></g><g fill="#414042" transform="translate(12.322 12.322)scale(.101)"><circle cx="307" cy="532" r="60"/><circle cx="717" cy="532" r="60"/></g></svg>

After

Width:  |  Height:  |  Size: 994 B

37
icon.svg.import Normal file
View file

@ -0,0 +1,37 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://b4232ihw25waq"
path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://icon.svg"
dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
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=1
svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

BIN
models/guitar.glb Normal file

Binary file not shown.

37
models/guitar.glb.import Normal file
View file

@ -0,0 +1,37 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://y30drmuq4l0n"
path="res://.godot/imported/guitar.glb-7d0a07b79e823975fa7fa24a23636f96.scn"
[deps]
source_file="res://models/guitar.glb"
dest_files=["res://.godot/imported/guitar.glb-7d0a07b79e823975fa7fa24a23636f96.scn"]
[params]
nodes/root_type=""
nodes/root_name=""
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
nodes/use_node_type_suffixes=true
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=false
animation/remove_immutable_tracks=true
animation/import_rest_as_RESET=false
import_script/path=""
_subresources={}
gltf/naming_version=1
gltf/embedded_image_handling=1

BIN
models/horse.glb Normal file

Binary file not shown.

37
models/horse.glb.import Normal file
View file

@ -0,0 +1,37 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://djppmw257tqac"
path="res://.godot/imported/horse.glb-43692f818ba2a3d8b061139c4d8cf5c8.scn"
[deps]
source_file="res://models/horse.glb"
dest_files=["res://.godot/imported/horse.glb-43692f818ba2a3d8b061139c4d8cf5c8.scn"]
[params]
nodes/root_type=""
nodes/root_name=""
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
nodes/use_node_type_suffixes=true
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=false
animation/remove_immutable_tracks=true
animation/import_rest_as_RESET=false
import_script/path=""
_subresources={}
gltf/naming_version=1
gltf/embedded_image_handling=1

BIN
models/shark.glb Normal file

Binary file not shown.

37
models/shark.glb.import Normal file
View file

@ -0,0 +1,37 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://4xn3j7i2njxp"
path="res://.godot/imported/shark.glb-4087c768ca5ed9bea0a7dbe21c534941.scn"
[deps]
source_file="res://models/shark.glb"
dest_files=["res://.godot/imported/shark.glb-4087c768ca5ed9bea0a7dbe21c534941.scn"]
[params]
nodes/root_type=""
nodes/root_name=""
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
nodes/use_node_type_suffixes=true
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=false
animation/remove_immutable_tracks=true
animation/import_rest_as_RESET=false
import_script/path=""
_subresources={}
gltf/naming_version=1
gltf/embedded_image_handling=1

27
objects/Guitar.tscn Normal file

File diff suppressed because one or more lines are too long

26
objects/Rotatable.gd Normal file
View file

@ -0,0 +1,26 @@
extends RigidBody3D
@export var initialMass:float = 3
@export var yTorqueMult:float = 100
@export var zTorqueMult:float = 100
var prev_mouse_position
var next_mouse_position
func _ready() -> void:
mass = initialMass
func _process(delta):
if GlobalVariables.selectedObject == self:
next_mouse_position = get_viewport().get_mouse_position()
var torque = Vector3()
torque.y = (next_mouse_position.x - prev_mouse_position.x) * yTorqueMult * delta
torque.z = (next_mouse_position.y - prev_mouse_position.y) * zTorqueMult * delta
prev_mouse_position = next_mouse_position
apply_torque(torque)
func _on_input_event(camera: Node, event: InputEvent, event_position: Vector3, normal: Vector3, shape_idx: int) -> void:
if event is InputEventMouseButton and event.button_index == MOUSE_BUTTON_LEFT:
prev_mouse_position = get_viewport().get_mouse_position()
GlobalVariables.selectedObject = self

1
objects/Rotatable.gd.uid Normal file
View file

@ -0,0 +1 @@
uid://cvqlceaui3krb

27
objects/Rotatable.tscn Normal file
View file

@ -0,0 +1,27 @@
[gd_scene load_steps=5 format=3 uid="uid://du8lkrvnc16gl"]
[ext_resource type="Script" uid="uid://cvqlceaui3krb" path="res://objects/Rotatable.gd" id="1_vn420"]
[sub_resource type="PhysicsMaterial" id="PhysicsMaterial_vn420"]
friction = 0.26
[sub_resource type="BoxShape3D" id="BoxShape3D_vn420"]
size = Vector3(1, 1.22449, 1.01085)
[sub_resource type="BoxMesh" id="BoxMesh_gxu5i"]
[node name="Rotatable" type="RigidBody3D"]
physics_material_override = SubResource("PhysicsMaterial_vn420")
script = ExtResource("1_vn420")
yTorqueMult = 30.0
zTorqueMult = 30.0
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.66452, 0.0126419)
shape = SubResource("BoxShape3D_vn420")
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.676347, 0)
mesh = SubResource("BoxMesh_gxu5i")
[connection signal="input_event" from="." to="." method="_on_input_event"]

24
objects/horse.tscn Normal file

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,18 @@
[gd_scene load_steps=3 format=3 uid="uid://dqu5h8wloab26"]
[ext_resource type="PackedScene" uid="uid://du8lkrvnc16gl" path="res://objects/Rotatable.tscn" id="1_6b465"]
[sub_resource type="BoxShape3D" id="BoxShape3D_6b465"]
size = Vector3(1, 1, 5.99051)
[node name="Rotatable" instance=ExtResource("1_6b465")]
initialMass = 6.0
yTorqueMult = 200.0
zTorqueMult = 80.0
[node name="CollisionShape3D" parent="." index="0"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.66452, -0.00264168)
shape = SubResource("BoxShape3D_6b465")
[node name="MeshInstance3D" parent="." index="1"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 5.96618, 0, 0.676347, 0)

View file

@ -0,0 +1,17 @@
[gd_scene load_steps=4 format=3 uid="uid://cbl4jcbilihv"]
[ext_resource type="PackedScene" uid="uid://du8lkrvnc16gl" path="res://objects/Rotatable.tscn" id="1_w404d"]
[sub_resource type="SphereShape3D" id="SphereShape3D_5yy8w"]
[sub_resource type="SphereMesh" id="SphereMesh_rq261"]
[node name="Rotatable" instance=ExtResource("1_w404d")]
yTorqueMult = 20.0
zTorqueMult = 20.0
[node name="CollisionShape3D" parent="." index="0"]
shape = SubResource("SphereShape3D_5yy8w")
[node name="MeshInstance3D" parent="." index="1"]
mesh = SubResource("SphereMesh_rq261")

24
objects/shark.tscn Normal file

File diff suppressed because one or more lines are too long

33
project.godot Normal file
View file

@ -0,0 +1,33 @@
; Engine configuration file.
; It's best edited using the editor UI and not directly,
; since the parameters that go here are not all obvious.
;
; Format:
; [section] ; section goes between []
; param=value ; assign values to parameters
config_version=5
[application]
config/name="ShapeEscape"
run/main_scene="uid://bt5a8babn8gyn"
config/features=PackedStringArray("4.4", "GL Compatibility")
config/icon="res://icon.svg"
[autoload]
GlobalVariables="*res://GlobalVariables.gd"
[input]
LMB={
"deadzone": 0.2,
"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)
]
}
[rendering]
renderer/rendering_method="gl_compatibility"
renderer/rendering_method.mobile="gl_compatibility"