diff --git a/3D Input/Fertige GLBs/Kopf_Huhn.glb b/3D Input/Fertige GLBs/Kopf_Huhn.glb new file mode 100644 index 0000000..b5bf766 Binary files /dev/null and b/3D Input/Fertige GLBs/Kopf_Huhn.glb differ diff --git a/3D Input/huhntextur.png.import b/3D Input/huhntextur.png.import new file mode 100644 index 0000000..be3a926 --- /dev/null +++ b/3D Input/huhntextur.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/huhntextur.png-a31af8e4947b19bec12f70e34f5f09d2.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://3D Input/huhntextur.png" +dest_files=[ "res://.import/huhntextur.png-a31af8e4947b19bec12f70e34f5f09d2.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/hühnchen kopf unwrapped and rigged.blend b/3D Input/hühnchen kopf unwrapped and rigged.blend index 084b28e..68d1d38 100644 Binary files a/3D Input/hühnchen kopf unwrapped and rigged.blend and b/3D Input/hühnchen kopf unwrapped and rigged.blend differ diff --git a/3D Input/hühnchen kopf unwrapped.blend b/3D Input/hühnchen kopf unwrapped and rigged.blend1 similarity index 59% rename from 3D Input/hühnchen kopf unwrapped.blend rename to 3D Input/hühnchen kopf unwrapped and rigged.blend1 index af581bd..2e5fadd 100644 Binary files a/3D Input/hühnchen kopf unwrapped.blend and b/3D Input/hühnchen kopf unwrapped and rigged.blend1 differ diff --git a/3D Input/hühnchen kopf unwrapped.blend1 b/3D Input/hühnchen kopf unwrapped.blend1 deleted file mode 100644 index 1c319d4..0000000 Binary files a/3D Input/hühnchen kopf unwrapped.blend1 and /dev/null differ diff --git a/BodyConfig/bodyBuilderMenu.tscn b/BodyConfig/bodyBuilderMenu.tscn index e933787..a8fceec 100644 --- a/BodyConfig/bodyBuilderMenu.tscn +++ b/BodyConfig/bodyBuilderMenu.tscn @@ -67,16 +67,28 @@ custom_styles/normal = ExtResource( 8 ) custom_fonts/font = ExtResource( 5 ) text = "Start Game" -[node name="Delete" type="Button" parent="GUI/HBoxC/VBoxC"] +[node name="Spacing" type="Control" parent="GUI/HBoxC/VBoxC"] margin_top = 84.0 margin_right = 301.0 -margin_bottom = 122.0 +margin_bottom = 104.0 +rect_min_size = Vector2( 0, 20 ) + +[node name="Delete" type="Button" parent="GUI/HBoxC/VBoxC"] +margin_top = 108.0 +margin_right = 301.0 +margin_bottom = 146.0 custom_styles/hover = ExtResource( 6 ) custom_styles/pressed = ExtResource( 7 ) custom_styles/normal = ExtResource( 8 ) custom_fonts/font = ExtResource( 5 ) text = "Delete" +[node name="Spacing2" type="Control" parent="GUI/HBoxC/VBoxC"] +margin_top = 150.0 +margin_right = 301.0 +margin_bottom = 170.0 +rect_min_size = Vector2( 0, 20 ) + [node name="ViewportContainer" type="ViewportContainer" parent="GUI/HBoxC"] margin_left = 305.0 margin_right = 1024.0 diff --git a/BodyParts/HorseLeg.gd b/BodyParts/HorseLeg.gd new file mode 100644 index 0000000..26f871c --- /dev/null +++ b/BodyParts/HorseLeg.gd @@ -0,0 +1,31 @@ +extends PushingBodyPart + + +onready var anim = get_node("Mesh/AnimationPlayer") + + +# Called when the node enters the scene tree for the first time. +func _ready() -> void: + pass # Replace with function body. + + +func _is_animation_playing(): + return anim.is_playing() + + +func action(): + anim.play("ArmatureAction") + + # Apply a slight counter force + var offset = transform.basis.xform(Vector3.ZERO) #transform.basis.xform(touch_area.global_transform.origin - base.global_transform.origin) * 0.5 + var direction = -(base.transform.basis.y - base.transform.basis.z).normalized() * 0.5 + + base.apply_impulse(offset, direction) + + +func push(body): + # We multiply by 0.1 because we only want it to spin slightly, it should mostly go up + var offset = transform.basis.xform(Vector3.ZERO) #transform.basis.xform(touch_area.global_transform.origin - base.global_transform.origin) * 0.5 + var direction = (base.transform.basis.y - base.transform.basis.z).normalized() * 19.0 + + base.apply_impulse(offset, direction) diff --git a/BodyParts/HorseLeg.tscn b/BodyParts/HorseLeg.tscn new file mode 100644 index 0000000..d4fa328 --- /dev/null +++ b/BodyParts/HorseLeg.tscn @@ -0,0 +1,49 @@ +[gd_scene load_steps=8 format=2] + +[ext_resource path="res://3D Input/Fertige GLBs/Bein_Pferd.glb" type="PackedScene" id=1] +[ext_resource path="res://BodyParts/PushingBodyPart.tscn" type="PackedScene" id=2] +[ext_resource path="res://3D Input/pferdtextur.png" type="Texture" id=3] +[ext_resource path="res://BodyParts/HorseLeg.gd" type="Script" id=4] + +[sub_resource type="BoxShape" id=2] +extents = Vector3( 0.452502, 2.45458, 0.822059 ) + +[sub_resource type="SphereShape" id=3] +radius = 0.195173 + +[sub_resource type="SpatialMaterial" id=1] +albedo_texture = ExtResource( 3 ) + +[node name="HorseLeg" instance=ExtResource( 2 )] +transform = Transform( -1, -3.89414e-07, -1.70218e-14, 0, -4.37114e-08, 1, -3.89414e-07, 1, 4.37114e-08, -0.194821, -0.336704, 1.57652 ) +script = ExtResource( 4 ) + +[node name="PartCollider" parent="." index="0"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 1.35601e-06, -3.54662, -8.9407e-08 ) +shape = SubResource( 2 ) + +[node name="TouchArea" parent="." index="1"] +transform = Transform( -2.11393, -0.0496973, -0.00818296, 0.0470731, -1.82726, -1.06308, 0.017914, -1.06296, 1.82785, -0.011488, -5.48132, 0.244033 ) + +[node name="CollisionShape" type="CollisionShape" parent="TouchArea" index="0"] +transform = Transform( 1, 0, -1.86265e-09, 1.86265e-09, 1, 0, 0, -2.98023e-08, 1, 0, 0, 0 ) +shape = SubResource( 3 ) + +[node name="Mesh" parent="." index="4" instance=ExtResource( 1 )] +transform = Transform( 0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, -7, 0 ) + +[node name="Skeleton" parent="Mesh/Armature" index="0"] +bones/2/bound_children = [ NodePath("BoneAttachment") ] + +[node name="Cube" parent="Mesh/Armature/Skeleton" index="0"] +transform = Transform( 1, -2.84217e-14, -3.55271e-15, -2.84217e-14, 1, 0, 0, 0, 1, 0, 0, 0 ) +material/0 = SubResource( 1 ) + +[node name="BoneAttachment" type="BoneAttachment" parent="Mesh/Armature/Skeleton" index="1"] +transform = Transform( -0.999716, -0.0235028, -0.00386987, -0.0209347, 0.789477, 0.613423, -0.011362, 0.61333, -0.789745, -0.00543287, 1.86361, 0.173834 ) +bone_name = "bone_2" + +[node name="RemoteTransform" type="RemoteTransform" parent="Mesh/Armature/Skeleton/BoneAttachment" index="0"] +remote_path = NodePath("../../../../../TouchArea") + +[editable path="Mesh"] diff --git a/Global/BodyPartLoader.gd b/Global/BodyPartLoader.gd index da58f9d..59a6298 100644 --- a/Global/BodyPartLoader.gd +++ b/Global/BodyPartLoader.gd @@ -8,3 +8,4 @@ func _ready(): bodyparts["Human Leg"] = load("res://BodyParts/HumanLeg.tscn") bodyparts["Frog Leg"] = load("res://BodyParts/FrogLeg.tscn") bodyparts["Gorilla Arm"] = load("res://BodyParts/GorillaArm.tscn") + bodyparts["Horse Leg"] = load("res://BodyParts/HorseLeg.tscn")