CHICKEN IN.

This commit is contained in:
mathias 2020-02-02 16:13:11 +01:00
parent 2ebc50625f
commit 61d71ea4db
4 changed files with 91 additions and 9 deletions

View File

@ -2,33 +2,35 @@
importer="texture"
type="StreamTexture"
path="res://.import/huhntextur.png-a31af8e4947b19bec12f70e34f5f09d2.stex"
path.s3tc="res://.import/huhntextur.png-a31af8e4947b19bec12f70e34f5f09d2.s3tc.stex"
path.etc2="res://.import/huhntextur.png-a31af8e4947b19bec12f70e34f5f09d2.etc2.stex"
metadata={
"vram_texture": false
"imported_formats": [ "s3tc", "etc2" ],
"vram_texture": true
}
[deps]
source_file="res://3D Input/huhntextur.png"
dest_files=[ "res://.import/huhntextur.png-a31af8e4947b19bec12f70e34f5f09d2.stex" ]
dest_files=[ "res://.import/huhntextur.png-a31af8e4947b19bec12f70e34f5f09d2.s3tc.stex", "res://.import/huhntextur.png-a31af8e4947b19bec12f70e34f5f09d2.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

31
BodyParts/ChickenHead.gd Normal file
View File

@ -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)

View File

@ -0,0 +1,49 @@
[gd_scene load_steps=8 format=2]
[ext_resource path="res://3D Input/Fertige GLBs/Kopf_Huhn.glb" type="PackedScene" id=1]
[ext_resource path="res://BodyParts/PushingBodyPart.tscn" type="PackedScene" id=2]
[ext_resource path="res://3D Input/huhntextur.png" type="Texture" id=3]
[ext_resource path="res://BodyParts/ChickenHead.gd" type="Script" id=4]
[sub_resource type="CapsuleShape" id=1]
radius = 2.24173
height = 1.97047
[sub_resource type="SphereShape" id=2]
radius = 1.42519
[sub_resource type="SpatialMaterial" id=3]
albedo_texture = ExtResource( 3 )
[node name="PushingBodyPart" instance=ExtResource( 2 )]
transform = Transform( 1.59259e-14, 9.77524e-08, -0.6, 0.6, -9.77524e-08, 0, -9.77524e-08, -0.6, -9.77524e-08, 0, -1.20668, -0.531835 )
script = ExtResource( 4 )
[node name="PartCollider" parent="." index="0"]
transform = Transform( 0.915992, 6.53632e-08, -0.401197, 0.401197, -1.49234e-07, 0.915992, 1.42109e-14, -1, -1.62921e-07, 0, 0, 0 )
shape = SubResource( 1 )
[node name="TouchArea" parent="." index="1"]
transform = Transform( 0.850008, -0.52677, 6.77808e-09, 0.52677, 0.850008, -6.12467e-09, -2.53514e-09, 8.77651e-09, 1, 0.080676, 1.20809, 0.184276 )
[node name="CollisionShape" type="CollisionShape" parent="TouchArea" index="0"]
transform = Transform( 1, -2.22497e-17, 2.22045e-16, -2.22497e-17, 1, 8.88178e-16, -4.44089e-16, -8.88178e-16, 1, 0, 0, 0 )
shape = SubResource( 2 )
[node name="Mesh" parent="." index="4" instance=ExtResource( 1 )]
[node name="Skeleton" parent="Mesh/Armature" index="0"]
bones/2/bound_children = [ NodePath("BoneAttachment") ]
[node name="Sphere" parent="Mesh/Armature/Skeleton" index="0"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.38419e-07, 0 )
material/0 = SubResource( 3 )
[node name="BoneAttachment" type="BoneAttachment" parent="Mesh/Armature/Skeleton" index="1"]
transform = Transform( 0.850008, -0.52677, 6.77809e-09, 0.52677, 0.850008, -6.12466e-09, -2.53514e-09, 8.7765e-09, 1, -1.2109, 4.72113, 5.44753e-07 )
bone_name = "end"
[node name="RemoteTransform" type="RemoteTransform" parent="Mesh/Armature/Skeleton/BoneAttachment" index="0"]
remote_path = NodePath("../../../../../TouchArea")
[editable path="Mesh"]

View File

@ -9,5 +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["Chicken Head"] = load("res://BodyParts/ChickenHead.tscn")
bodyparts["Bull Head"] = load("res://BodyParts/BullHead.tscn")