Add human arm part (functionality not finished yet)

This commit is contained in:
karl 2020-02-01 19:36:41 +01:00
parent 8a82a2833f
commit 9bf34c8cc2
8 changed files with 1167 additions and 0 deletions

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -0,0 +1,36 @@
[remap]
importer="texture"
type="StreamTexture"
path.s3tc="res://.import/handTextur.png-033a3dd9ac9dc649dfe719b0dc401e9e.s3tc.stex"
path.etc2="res://.import/handTextur.png-033a3dd9ac9dc649dfe719b0dc401e9e.etc2.stex"
metadata={
"imported_formats": [ "s3tc", "etc2" ],
"vram_texture": true
}
[deps]
source_file="res://3D Input/handTextur.png"
dest_files=[ "res://.import/handTextur.png-033a3dd9ac9dc649dfe719b0dc401e9e.s3tc.stex", "res://.import/handTextur.png-033a3dd9ac9dc649dfe719b0dc401e9e.etc2.stex" ]
[params]
compress/mode=2
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=true
flags/filter=true
flags/mipmaps=true
flags/anisotropic=false
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=false
svg/scale=1.0

View File

@ -66,6 +66,9 @@ collide_with_areas = true
collide_with_bodies = false
[node name="Torso" parent="." instance=ExtResource( 1 )]
[node name="TorsoCollider" parent="Torso" index="0"]
shape = null
[connection signal="pressed" from="GUI/HBoxC/VBoxC/Start" to="." method="_on_Start_pressed"]
[editable path="Torso"]

View File

@ -5,6 +5,8 @@
[ext_resource path="res://3D Input/Torso.glb" type="PackedScene" id=3]
[sub_resource type="CapsuleShape" id=1]
radius = 0.855929
height = 1.48749
[node name="Torso" type="RigidBody" groups=[
"Player",

20
BodyParts/HumanArm.gd Normal file
View File

@ -0,0 +1,20 @@
extends PushingBodyPart
onready var anim = get_node("Mesh/AnimationPlayer")
func action():
anim.play("ArmatureAction")
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(touch_area.global_transform.origin - base.global_transform.origin) * 0.1
var direction = (base.transform.basis.y - base.transform.basis.z).normalized() * 5.0
base.apply_impulse(offset, direction)
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta: float) -> void:
# pass

43
BodyParts/HumanArm.tscn Normal file
View File

@ -0,0 +1,43 @@
[gd_scene load_steps=6 format=2]
[ext_resource path="res://BodyParts/PushingBodyPart.tscn" type="PackedScene" id=1]
[ext_resource path="res://BodyParts/HumanArm.gd" type="Script" id=2]
[ext_resource path="res://3D Input/Fertige GLBs/Arm_Mensch.glb" type="PackedScene" id=4]
[sub_resource type="BoxShape" id=1]
extents = Vector3( 0.533899, 0.203146, 2.17243 )
[sub_resource type="SphereShape" id=2]
radius = 0.125064
[node name="HumanArm" instance=ExtResource( 1 )]
transform = Transform( -4.37114e-08, 1, 4.37114e-08, 0, -4.37114e-08, 1, 1, 4.37114e-08, 1.91069e-15, 0, 0, 0 )
script = ExtResource( 2 )
[node name="PartCollider" parent="." index="0"]
transform = Transform( 0.796097, 0, -0.605169, 0, 1, -3.55271e-15, 0.605169, 8.35188e-23, 0.796097, -0.894889, 1.42109e-14, -2.6182 )
shape = SubResource( 1 )
[node name="TouchArea" parent="." index="1"]
transform = Transform( -0.114995, 2.15415, 2.55188, -3.31495, -0.382831, 0.173782, 0.404395, -2.52562, 2.15021, -0.0333271, -0.131349, -3.878 )
[node name="CollisionShape" type="CollisionShape" parent="TouchArea" index="0"]
shape = SubResource( 2 )
[node name="Mesh" parent="." index="2" instance=ExtResource( 4 )]
transform = Transform( 2, 0, 0, 0, 2, 0, 0, 0, 2, -0.357728, -8.51476, 0 )
[node name="Skeleton" parent="Mesh/Armature" index="0"]
bones/7/bound_children = [ NodePath("BoneAttachment") ]
[node name="BoneAttachment" type="BoneAttachment" parent="Mesh/Armature/Skeleton" index="1"]
transform = Transform( 0.0638506, -0.727912, -0.682691, -0.242273, 0.652315, -0.718184, 0.968104, 0.211254, -0.134703, 0.0541456, 1.16231, 0.134369 )
bone_name = "bone_6"
[node name="RemoteTransform" type="RemoteTransform" parent="Mesh/Armature/Skeleton/BoneAttachment" index="0"]
remote_path = NodePath("../../../../../TouchArea")
[node name="AnimationPlayer" parent="Mesh" index="2"]
playback_speed = 3.0
[editable path="Mesh"]

View File

@ -43,4 +43,5 @@ InGameState="*res://Global/InGameState.gd"
[rendering]
quality/shadows/filter_mode=2
environment/default_environment="res://default_env.tres"