diff --git a/BodyParts/BodyBase/BodyBase.gd b/BodyParts/BodyBase/BodyBase.gd index 42bfcb2..3f4df9b 100644 --- a/BodyParts/BodyBase/BodyBase.gd +++ b/BodyParts/BodyBase/BodyBase.gd @@ -22,9 +22,14 @@ func _physics_process(delta): for body in get_colliding_bodies(): if body.name == "StaticBody": - if current_angle > 0.3: + if current_angle > 0.3: apply_torque_impulse(rot_vector * current_angle * 7) + apply_impulse(transform.basis.xform(Vector3.ZERO), -(transform.basis.y) * 0.05) elif current_angle > 0.05: - apply_torque_impulse(-(rot_vector * current_angle * 20)) + apply_torque_impulse(-(rot_vector * current_angle * 5)) else: angular_velocity = Vector3.ZERO + + for axis in angular_velocity: + if axis > 10: + axis -= axis * 0.75 diff --git a/BodyParts/FrogLeg.tscn b/BodyParts/FrogLeg.tscn index c024d86..ef0c45a 100644 --- a/BodyParts/FrogLeg.tscn +++ b/BodyParts/FrogLeg.tscn @@ -5,30 +5,30 @@ [ext_resource path="res://3D Input/Fertige GLBs/Bein_Frosch.glb" type="PackedScene" id=3] [ext_resource path="res://3D Input/froschtexture.png" type="Texture" id=4] -[sub_resource type="BoxShape" id=2] -extents = Vector3( 0.649825, 2.07811, 1.64282 ) +[sub_resource type="BoxShape" id=1] +extents = Vector3( 0.666, 2.41488, 1.57924 ) -[sub_resource type="SphereShape" id=3] +[sub_resource type="SphereShape" id=2] radius = 0.115004 -[sub_resource type="SpatialMaterial" id=1] +[sub_resource type="SpatialMaterial" id=3] albedo_texture = ExtResource( 4 ) roughness = 0.3 [node name="FrogLeg" instance=ExtResource( 1 )] -transform = Transform( -1, 8.74228e-08, 0, -8.74228e-08, -1, 0, 0, 0, 1, 0, 0, 0 ) +transform = Transform( -1, 8.74228e-08, 0, -8.48803e-08, -0.970917, 0.239415, 2.09303e-08, 0.239415, 0.970917, 0, 0, 0 ) script = ExtResource( 2 ) cost = 30.0 [node name="PartCollider" parent="." index="0"] -transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.21377, -0.911304, -3.94992 ) -shape = SubResource( 2 ) +transform = Transform( 1, -6.77822e-08, -8.51879e-08, -6.77823e-08, 0.224662, -0.974437, 8.5188e-08, 0.974437, 0.224662, 1.61495e-07, -1.52524, -2.85154 ) +shape = SubResource( 1 ) [node name="TouchArea" parent="." index="1"] -transform = Transform( 2.2019, -0.624093, -2.57245, 1.35866, 3.13817, 0.40161, 2.27179, -1.27191, 2.25313, 0.307055, -2.49965, -4.98782 ) +transform = Transform( 2.20191, -0.624093, -2.57245, 1.26297, 3.18838, 0.307522, 2.32635, -1.14024, 2.26789, 0.307056, -2.38919, -4.91366 ) [node name="CollisionShape" type="CollisionShape" parent="TouchArea" index="0"] -shape = SubResource( 3 ) +shape = SubResource( 2 ) [node name="Mesh" parent="." index="2" instance=ExtResource( 3 )] transform = Transform( -1.13133e-08, 4.2222e-08, 1, 0.965926, 0.258819, 0, -0.258819, 0.965926, -4.37114e-08, 0.734499, -2.94707, -2.68774 ) @@ -37,11 +37,11 @@ transform = Transform( -1.13133e-08, 4.2222e-08, 1, 0.965926, 0.258819, 0, -0.25 bones/3/bound_children = [ NodePath("BoneAttachment") ] [node name="froschbein" parent="Mesh/Armature/Skeleton" index="0"] -transform = Transform( 1, -1.49012e-08, 0, 0, 1, -5.96046e-08, 0, 2.98023e-08, 1, 0, 0, 0 ) -material/0 = SubResource( 1 ) +transform = Transform( 1, -1.11759e-08, 0, 1.86265e-09, 1, -5.96046e-08, 1.86265e-09, 0, 1, 0, 0, 0 ) +material/0 = SubResource( 3 ) [node name="BoneAttachment" type="BoneAttachment" parent="Mesh/Armature/Skeleton" index="1"] -transform = Transform( -0.207654, -0.97489, 0.0804374, -0.106263, -0.059262, -0.99257, 0.972414, -0.214658, -0.091288, 0.208948, 1.33566, -0.895561 ) +transform = Transform( -0.176573, -0.978358, 0.107882, -0.111435, -0.0890297, -0.989776, 0.97796, -0.186789, -0.0933024, 0.184057, 1.31383, -0.875628 ) bone_name = "bone_3" [node name="RemoteTransform" type="RemoteTransform" parent="Mesh/Armature/Skeleton/BoneAttachment" index="0"] @@ -50,4 +50,9 @@ remote_path = NodePath("../../../../../TouchArea") [node name="AnimationPlayer" parent="Mesh" index="2"] playback_speed = 2.0 +[node name="CollisionPolygon" type="CollisionPolygon" parent="." index="3"] +__meta__ = { +"_edit_group_": true +} + [editable path="Mesh"] diff --git a/BodyParts/HumanLeg.tscn b/BodyParts/HumanLeg.tscn index cfe7bc2..4cd8b4f 100644 --- a/BodyParts/HumanLeg.tscn +++ b/BodyParts/HumanLeg.tscn @@ -6,7 +6,7 @@ [ext_resource path="res://3D Input/beinimage.png" type="Texture" id=4] [sub_resource type="BoxShape" id=1] -extents = Vector3( 0.666, 2.41488, 1.555 ) +extents = Vector3( 0.666, 2.5097, 1.57924 ) [sub_resource type="SphereShape" id=2] radius = 0.108468 @@ -36,9 +36,6 @@ transform = Transform( 2, 0, 0, 0, 2, 0, 0, 0, 2, -2.84217e-14, -4.37555, -0.049 [node name="Armature" parent="Mesh" index="2"] transform = Transform( 1.97878, 0, 0, 0, -1.97636, 0.0978612, 8.47033e-22, -0.0978612, -1.97636, -1.33227e-14, 2.34477, 0.0119585 ) -[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, 0, -8.88178e-16, -1.42109e-14, 1, -2.23517e-08, 4.44089e-16, 2.23517e-08, 1, 0, 0, 0 ) material/0 = SubResource( 3 )