diff --git a/3D Input/Stierbg.jpg.import b/3D Input/Stierbg.jpg.import new file mode 100644 index 0000000..32194f2 --- /dev/null +++ b/3D Input/Stierbg.jpg.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/Stierbg.jpg-b439c056e778b8fb16ae62aa15547147.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://3D Input/Stierbg.jpg" +dest_files=[ "res://.import/Stierbg.jpg-b439c056e778b8fb16ae62aa15547147.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/3D Input/horselegimg.jpg.import b/3D Input/horselegimg.jpg.import new file mode 100644 index 0000000..a0556e9 --- /dev/null +++ b/3D Input/horselegimg.jpg.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/horselegimg.jpg-8935d9a9effef767d66fb9866f38d2c4.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://3D Input/horselegimg.jpg" +dest_files=[ "res://.import/horselegimg.jpg-8935d9a9effef767d66fb9866f38d2c4.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/BodyConfig/LoadBodyParts.gd b/BodyConfig/LoadBodyParts.gd index f84967f..232e710 100644 --- a/BodyConfig/LoadBodyParts.gd +++ b/BodyConfig/LoadBodyParts.gd @@ -5,9 +5,10 @@ extends VBoxContainer func _ready(): for entry in BodyPartLoader.bodyparts: var button = Button.new() - button.text = entry.key + button.text = entry + add_child(button) + button.connect("pressed", get_parent().get_parent().get_parent(), "body_part_chosen", [button.text]) -# Called every frame. 'delta' is the elapsed time since the previous frame. -#func _process(delta): -# pass +func button_pressed(params): + emit_signal("choose_bodypart", params[0]) diff --git a/BodyConfig/bodyBuilderMenu.tscn b/BodyConfig/bodyBuilderMenu.tscn index bb409dc..fa7ab78 100644 --- a/BodyConfig/bodyBuilderMenu.tscn +++ b/BodyConfig/bodyBuilderMenu.tscn @@ -47,7 +47,7 @@ handle_input_locally = false render_target_update_mode = 3 [node name="Camera" type="Camera" parent="GUI/HBoxC/ViewportContainer/Viewport"] -transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 3 ) +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 4.16872 ) [node name="MouseLook" type="RayCast" parent="GUI/HBoxC/ViewportContainer/Viewport"] enabled = true @@ -55,3 +55,5 @@ collide_with_areas = true collide_with_bodies = false [node name="Torso" parent="." instance=ExtResource( 1 )] + +[editable path="Torso"] diff --git a/BodyConfig/bodyBuildingScript.gd b/BodyConfig/bodyBuildingScript.gd index e0139a8..9564bc6 100644 --- a/BodyConfig/bodyBuildingScript.gd +++ b/BodyConfig/bodyBuildingScript.gd @@ -18,6 +18,7 @@ var _viewport : Viewport var _velx = 0 var _vely = 0 +var _attachment_point : Spatial # Called when the node enters the scene tree for the first time. @@ -66,6 +67,7 @@ func _physics_process(delta): if _rayCast.is_colliding(): # collider will be the node hit + _attachment_point = _rayCast.get_collider().get_parent() print(_rayCast.get_collider()) @@ -79,4 +81,7 @@ func _input(event): else: print("mouse unpressed at: ", event.position) _viewRot = false - + + +func body_part_chosen(params): + _attachment_point.add_child(BodyPartLoader.bodyparts[params].instance()) diff --git a/BodyParts/Arm.tscn b/BodyParts/Arm.tscn index eda4bfe..17eb018 100644 --- a/BodyParts/Arm.tscn +++ b/BodyParts/Arm.tscn @@ -4,7 +4,6 @@ [ext_resource path="res://3D Input/untitled.glb" type="PackedScene" id=2] [ext_resource path="res://BodyParts/Arm.gd" type="Script" id=3] - [sub_resource type="SphereShape" id=1] [sub_resource type="SphereShape" id=2] @@ -20,14 +19,14 @@ shape = SubResource( 1 ) [node name="Mesh" parent="." index="1" instance=ExtResource( 2 )] [node name="BoneAttachment" type="BoneAttachment" parent="Mesh/Armature/Skeleton" index="1"] -transform = Transform( 1, -1.98292e-23, -3.18966e-24, 6.71348e-24, -9.49949e-08, 1, -2.07636e-23, -1, -9.49949e-08, -2.23781e-16, -0.0078205, -5.05441 ) +transform = Transform( 1, -1.98247e-23, -2.98292e-24, 6.50669e-24, -9.49949e-08, 1, -2.07684e-23, -1, -9.49949e-08, -2.23781e-16, -0.0078205, -5.05441 ) bone_name = "bone_2" [node name="RemoteTransform" type="RemoteTransform" parent="Mesh/Armature/Skeleton/BoneAttachment" index="0"] remote_path = NodePath("../../../../../TouchArea") [node name="TouchArea" parent="." index="2"] -transform = Transform( 1, -1.98292e-23, -3.18966e-24, 6.71348e-24, -9.49949e-08, 1, -2.07636e-23, -1, -9.49949e-08, -2.23781e-16, -0.0078205, -7.60024 ) +transform = Transform( 1, -1.98247e-23, -2.98292e-24, 6.50669e-24, -9.49949e-08, 1, -2.07684e-23, -1, -9.49949e-08, -2.23781e-16, -0.0078205, -7.60024 ) [node name="CollisionShape" type="CollisionShape" parent="TouchArea" index="0"] transform = Transform( 1, 2.98291e-24, -1.98247e-23, -2.07684e-23, -9.49949e-08, -1, -6.50669e-24, 1, -9.49949e-08, 2.23781e-16, 0.399765, 0.00782054 ) diff --git a/BodyParts/BodyBase/BodyBase.tscn b/BodyParts/BodyBase/BodyBase.tscn index d7e8c79..f6859cf 100644 --- a/BodyParts/BodyBase/BodyBase.tscn +++ b/BodyParts/BodyBase/BodyBase.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=7 format=2] +[gd_scene load_steps=8 format=2] [ext_resource path="res://BodyParts/BodyBase/BodyBase.gd" type="Script" id=1] @@ -8,6 +8,8 @@ [sub_resource type="SphereMesh" id=3] +[sub_resource type="GDScript" id=6] + [sub_resource type="SphereShape" id=4] [sub_resource type="SphereShape" id=5] @@ -32,6 +34,7 @@ mesh = SubResource( 3 ) material/0 = null [node name="Area" type="Area" parent="FrontLeft"] +script = SubResource( 6 ) [node name="CollisionShape" type="CollisionShape" parent="FrontLeft/Area"] transform = Transform( 0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0, 0 ) diff --git a/Global/BodyPartLoader.gd b/Global/BodyPartLoader.gd index 9e968b2..4bc3b22 100644 --- a/Global/BodyPartLoader.gd +++ b/Global/BodyPartLoader.gd @@ -5,3 +5,4 @@ var bodyparts : Dictionary # Called when the node enters the scene tree for the first time. func _ready(): bodyparts["Arm"] = load("res://BodyParts/Arm.tscn") +