diff --git a/3D Input/hühnchen kopf unwrapped and rigged.blend b/3D Input/hühnchen kopf unwrapped and rigged.blend index 68d1d38..755f692 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 and rigged.blend1 b/3D Input/hühnchen kopf unwrapped and rigged.blend1 index 2e5fadd..68d1d38 100644 Binary files a/3D Input/hühnchen kopf unwrapped and rigged.blend1 and b/3D Input/hühnchen kopf unwrapped and rigged.blend1 differ diff --git a/3D Input/stiertextur.png.import b/3D Input/stiertextur.png.import index eb77ea9..98a62bb 100644 --- a/3D Input/stiertextur.png.import +++ b/3D Input/stiertextur.png.import @@ -2,33 +2,35 @@ importer="texture" type="StreamTexture" -path="res://.import/stiertextur.png-deb6038266d9a20bfe850d7c34f3aec9.stex" +path.s3tc="res://.import/stiertextur.png-deb6038266d9a20bfe850d7c34f3aec9.s3tc.stex" +path.etc2="res://.import/stiertextur.png-deb6038266d9a20bfe850d7c34f3aec9.etc2.stex" metadata={ -"vram_texture": false +"imported_formats": [ "s3tc", "etc2" ], +"vram_texture": true } [deps] source_file="res://3D Input/stiertextur.png" -dest_files=[ "res://.import/stiertextur.png-deb6038266d9a20bfe850d7c34f3aec9.stex" ] +dest_files=[ "res://.import/stiertextur.png-deb6038266d9a20bfe850d7c34f3aec9.s3tc.stex", "res://.import/stiertextur.png-deb6038266d9a20bfe850d7c34f3aec9.etc2.stex" ] [params] -compress/mode=0 +compress/mode=2 compress/lossy_quality=0.7 compress/hdr_mode=0 compress/bptc_ldr=0 compress/normal_map=0 -flags/repeat=0 +flags/repeat=true flags/filter=true -flags/mipmaps=false +flags/mipmaps=true flags/anisotropic=false -flags/srgb=2 +flags/srgb=1 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 +detect_3d=false svg/scale=1.0 diff --git a/BodyParts/Arm.tscn b/BodyParts/Arm.tscn index 63e9496..7656947 100644 --- a/BodyParts/Arm.tscn +++ b/BodyParts/Arm.tscn @@ -13,6 +13,7 @@ radius = 0.591769 [node name="Arm" instance=ExtResource( 1 )] script = ExtResource( 3 ) +cost = 10.0 [node name="PartCollider" parent="." index="0"] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -2.83 ) @@ -26,6 +27,9 @@ visible = false [node name="Armature" parent="Mesh" index="1"] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) +[node name="Skeleton" parent="Mesh/Armature" index="0"] +bones/2/bound_children = [ NodePath("BoneAttachment") ] + [node name="BoneAttachment" type="BoneAttachment" parent="Mesh/Armature/Skeleton" index="1"] 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" diff --git a/BodyParts/BullHead.gd b/BodyParts/BullHead.gd new file mode 100644 index 0000000..26f871c --- /dev/null +++ b/BodyParts/BullHead.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/BullHead.tscn b/BodyParts/BullHead.tscn new file mode 100644 index 0000000..6cbc0a1 --- /dev/null +++ b/BodyParts/BullHead.tscn @@ -0,0 +1,40 @@ +[gd_scene load_steps=7 format=2] + +[ext_resource path="res://BodyParts/PushingBodyPart.tscn" type="PackedScene" id=1] +[ext_resource path="res://BodyParts/BullHead.gd" type="Script" id=2] +[ext_resource path="res://3D Input/Fertige GLBs/Kopf_Stier.glb" type="PackedScene" id=3] +[ext_resource path="res://3D Input/stiertextur.png" type="Texture" id=4] + +[sub_resource type="CylinderShape" id=1] +height = 1.94931 + +[sub_resource type="SpatialMaterial" id=2] +albedo_texture = ExtResource( 4 ) + +[node name="Bullhead" instance=ExtResource( 1 )] +transform = Transform( -1, 3.25841e-07, 0, 5.30863e-14, 1.62921e-07, -1, -3.25841e-07, -1, -1.62921e-07, 0, -3.28412, 0.289329 ) +script = ExtResource( 2 ) + +[node name="TouchArea" parent="." index="1"] +transform = Transform( -1.71568, 8.52651e-14, 1.49989e-07, 1.27871e-07, -0.89673, 1.46268, 7.83945e-08, 1.46267, 0.89673, -0.002635, -0.0220304, -0.00495291 ) + +[node name="CollisionShape" type="CollisionShape" parent="TouchArea" index="0"] +transform = Transform( 1, 0, 8.88178e-15, 0, 1, -2.98023e-08, -1.06581e-14, 0, 1, 0, 0, 0 ) +shape = SubResource( 1 ) + +[node name="Mesh" parent="." index="4" instance=ExtResource( 3 )] + +[node name="Skeleton" parent="Mesh/Armature" index="0"] +bones/2/bound_children = [ NodePath("BoneAttachment") ] + +[node name="Cube" parent="Mesh/Armature/Skeleton" index="0"] +material/0 = SubResource( 2 ) + +[node name="BoneAttachment" type="BoneAttachment" parent="Mesh/Armature/Skeleton" index="1"] +transform = Transform( -1, 2.84217e-14, 8.74227e-08, 3.11325e-08, 0.934442, 0.356115, -8.16914e-08, 0.356115, -0.934442, 1.59719e-14, 1.68091, 0.12745 ) +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/BodyParts/HorseLeg.tscn b/BodyParts/HorseLeg.tscn index d4fa328..dd35837 100644 --- a/BodyParts/HorseLeg.tscn +++ b/BodyParts/HorseLeg.tscn @@ -5,29 +5,31 @@ [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] +[sub_resource type="BoxShape" id=1] extents = Vector3( 0.452502, 2.45458, 0.822059 ) -[sub_resource type="SphereShape" id=3] +[sub_resource type="SphereShape" id=2] radius = 0.195173 -[sub_resource type="SpatialMaterial" id=1] +[sub_resource type="SpatialMaterial" id=3] 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 ) +cost = 35.0 +damage = 15.0 [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 ) +shape = SubResource( 1 ) [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 ) +transform = Transform( -2.11393, -0.0496968, -0.0081882, 0.0470753, -1.82726, -1.06308, 0.0179093, -1.06296, 1.82785, -0.0114926, -5.48133, 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 ) +shape = SubResource( 2 ) [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 ) @@ -37,10 +39,10 @@ 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 ) +material/0 = SubResource( 3 ) [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 ) +transform = Transform( -0.999716, -0.0235025, -0.00387234, -0.020936, 0.789477, 0.613423, -0.0113599, 0.61333, -0.789745, -0.00543504, 1.86361, 0.173834 ) bone_name = "bone_2" [node name="RemoteTransform" type="RemoteTransform" parent="Mesh/Armature/Skeleton/BoneAttachment" index="0"] diff --git a/Global/BodyPartLoader.gd b/Global/BodyPartLoader.gd index 59a6298..fd7ec80 100644 --- a/Global/BodyPartLoader.gd +++ b/Global/BodyPartLoader.gd @@ -9,3 +9,5 @@ func _ready(): bodyparts["Frog Leg"] = load("res://BodyParts/FrogLeg.tscn") bodyparts["Gorilla Arm"] = load("res://BodyParts/GorillaArm.tscn") bodyparts["Horse Leg"] = load("res://BodyParts/HorseLeg.tscn") + + bodyparts["Bull Head"] = load("res://BodyParts/BullHead.tscn")