Add basic arm with new structure

This commit is contained in:
karl committed 2020-02-01 10:49:43 +01:00
1 parent ee8d7b789d
commit 5e9fcc38d2
6 files changed
+76 -157

No files matched your search

+10 -20
View File
@@ -1,26 +1,16 @@
extends RigidBody
extends "res://Ingame/BodyParts/PushingBodyPart.gd"
onready var anim = get_node("AnimationPlayer")
onready var skeleton = get_node("Armature/Skeleton")
onready var area = get_node("Armature/Skeleton/BoneAttachment/TouchArea")
# Declare member variables here. Examples:
# var a: int = 2
# var b: String = "text"
func _ready():
area.connect("body_entered", self, "arm_collided")
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
func arm_collided(body):
if body.name != "Arm":
print("Entered")
apply_impulse(area.transform.origin, -transform.basis.y * 10.0)
func _unhandled_input(event):
if event is InputEventKey:
if event.pressed and event.scancode == KEY_A:
play()
func play():
anim.play("ArmatureAction001")
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta: float) -> void:
# pass
+38 -131
View File
@@ -1,151 +1,58 @@
[gd_scene load_steps=9 format=2]
[gd_scene load_steps=6 format=2]
[ext_resource path="res://Ingame/BodyParts/Arm.gd" type="Script" id=1]
[ext_resource path="res://Ingame/BodyParts/PushingBodyPart.tscn" type="PackedScene" id=1]
[ext_resource path="res://3D Input/untitled.glb" type="PackedScene" id=2]
[sub_resource type="ArrayMesh" id=1]
resource_name = "Sphere"
surfaces/0 = {
"aabb": AABB( -1, -1, -1, 2, 2, 2 ),
"array_data": PoolByteArray( 79, 43, 192, 62, 186, 197, 71, 190, 248, 247, 103, 191, 47, 232, 141, 0, 139, 0, 208, 127, 128, 57, 127, 56, 0, 0, 0, 0, 16, 239, 195, 190, 95, 131, 108, 191, 0, 208, 139, 0, 129, 0, 0, 127, 0, 58, 255, 56, 248, 4, 181, 62, 16, 239, 195, 190, 122, 130, 90, 191, 44, 208, 148, 0, 139, 0, 208, 127, 128, 57, 255, 56, 79, 43, 192, 62, 186, 197, 71, 190, 248, 247, 103, 191, 47, 232, 141, 0, 139, 0, 208, 127, 128, 57, 127, 56, 0, 0, 0, 0, 186, 197, 71, 190, 191, 20, 123, 191, 0, 232, 132, 0, 129, 0, 0, 127, 0, 58, 127, 56, 0, 0, 0, 0, 16, 239, 195, 190, 95, 131, 108, 191, 0, 208, 139, 0, 129, 0, 0, 127, 0, 58, 255, 56, 35, 246, 21, 62, 94, 131, 108, 63, 243, 4, 181, 190, 19, 116, 210, 0, 139, 0, 208, 127, 127, 57, 0, 48, 212, 241, 178, 52, 49, 219, 84, 63, 216, 57, 14, 191, 0, 104, 185, 0, 130, 0, 0, 127, 255, 57, 0, 50, 211, 181, 89, 62, 49, 219, 84, 63, 81, 102, 3, 191, 27, 104, 190, 0, 139, 0, 208, 127, 127, 57, 0, 50, 35, 246, 21, 62, 94, 131, 108, 63, 243, 4, 181, 190, 19, 116, 210, 0, 139, 0, 208, 127, 127, 57, 0, 48, 167, 227, 37, 52, 94, 131, 108, 63, 16, 239, 195, 190, 0, 116, 207, 0, 130, 0, 0, 127, 255, 57, 0, 48, 212, 241, 178, 52, 49, 219, 84, 63, 216, 57, 14, 191, 0, 104, 185, 0, 130, 0, 0, 127, 255, 57, 0, 50, 248, 4, 181, 62, 16, 239, 195, 190, 122, 130, 90, 191, 44, 208, 148, 0, 139, 0, 208, 127, 128, 57, 255, 56, 0, 0, 0, 0, 217, 57, 14, 191, 50, 219, 84, 191, 0, 187, 150, 0, 130, 0, 0, 127, 0, 58, 127, 57, 198, 233, 162, 62, 217, 57, 14, 191, 76, 167, 68, 191, 40, 187, 159, 0, 139, 0, 208, 127, 127, 57, 127, 57, 248, 4, 181, 62, 16, 239, 195, 190, 122, 130, 90, 191, 44, 208, 148, 0, 139, 0, 208, 127, 128, 57, 255, 56, 0, 0, 0, 0, 16, 239, 195, 190, 95, 131, 108, 191, 0, 208, 139, 0, 129, 0, 0, 127, 0, 58, 255, 56, 0, 0, 0, 0, 217, 57, 14, 191, 50, 219, 84, 191, 0, 187, 150, 0, 130, 0, 0, 127, 0, 58, 127, 57, 216, 139, 138, 62, 243, 4, 53, 63, 116, 61, 39, 191, 34, 89, 173, 0, 139, 0, 208, 127, 127, 57, 0, 52, 212, 241, 178, 52, 49, 219, 84, 63, 216, 57, 14, 191, 0, 104, 185, 0, 130, 0, 0, 127, 255, 57, 0, 50, 0, 0, 0, 0, 243, 4, 53, 63, 243, 4, 53, 191, 0, 89, 166, 0, 130, 0, 0, 127, 0, 58, 255, 51, 211, 181, 89, 62, 49, 219, 84, 63, 81, 102, 3, 191, 27, 104, 190, 0, 139, 0, 208, 127, 127, 57, 0, 50, 212, 241, 178, 52, 49, 219, 84, 63, 216, 57, 14, 191, 0, 104, 185, 0, 130, 0, 0, 127, 255, 57, 0, 50, 216, 139, 138, 62, 243, 4, 53, 63, 116, 61, 39, 191, 34, 89, 173, 0, 139, 0, 208, 127, 127, 57, 0, 52, 216, 139, 138, 62, 243, 4, 53, 191, 116, 61, 39, 191, 34, 167, 173, 0, 139, 0, 208, 127, 127, 57, 0, 58, 0, 0, 0, 0, 217, 57, 14, 191, 50, 219, 84, 191, 0, 187, 150, 0, 130, 0, 0, 127, 0, 58, 127, 57, 0, 0, 0, 0, 243, 4, 53, 191, 243, 4, 53, 191, 0, 167, 166, 0, 129, 0, 0, 127, 0, 58, 0, 58, 198, 233, 162, 62, 217, 57, 14, 191, 76, 167, 68, 191, 40, 187, 159, 0, 139, 0, 208, 127, 127, 57, 127, 57, 0, 0, 0, 0, 217, 57, 14, 191, 50, 219, 84, 191, 0, 187, 150, 0, 130, 0, 0, 127, 0, 58, 127, 57, 216, 139, 138, 62, 243, 4, 53, 191, 116, 61, 39, 191, 34, 167, 173, 0, 139, 0, 208, 127, 127, 57, 0, 58, 216, 139, 138, 62, 243, 4, 53, 63, 116, 61, 39, 191, 34, 89, 173, 0, 139, 0, 208, 127, 127, 57, 0, 52, 0, 0, 0, 0, 217, 57, 14, 63, 50, 219, 84, 191, 0, 69, 150, 0, 130, 0, 0, 127, 0, 58, 0, 53, 198, 233, 162, 62, 217, 57, 14, 63, 76, 167, 68, 191, 40, 69, 159, 0, 139, 0, 208, 127, 127, 57, 0, 53, 216, 139, 138, 62, 243, 4, 53, 63, 116, 61, 39, 191, 34, 89, 173, 0, 139, 0, 208, 127, 127, 57, 0, 52, 0, 0, 0, 0, 243, 4, 53, 63, 243, 4, 53, 191, 0, 89, 166, 0, 130, 0, 0, 127, 0, 58, 255, 51, 0, 0, 0, 0, 217, 57, 14, 63, 50, 219, 84, 191, 0, 69, 150, 0, 130, 0, 0, 127, 0, 58, 0, 53, 216, 139, 138, 62, 243, 4, 53, 191, 116, 61, 39, 191, 34, 167, 173, 0, 139, 0, 208, 127, 127, 57, 0, 58, 0, 0, 0, 0, 50, 219, 84, 191, 217, 57, 14, 191, 0, 152, 185, 0, 130, 0, 0, 127, 0, 58, 128, 58, 209, 181, 89, 62, 50, 219, 84, 191, 80, 102, 3, 191, 27, 152, 190, 0, 139, 0, 208, 127, 127, 57, 128, 58, 216, 139, 138, 62, 243, 4, 53, 191, 116, 61, 39, 191, 34, 167, 173, 0, 139, 0, 208, 127, 127, 57, 0, 58, 0, 0, 0, 0, 243, 4, 53, 191, 243, 4, 53, 191, 0, 167, 166, 0, 129, 0, 0, 127, 0, 58, 0, 58, 0, 0, 0, 0, 50, 219, 84, 191, 217, 57, 14, 191, 0, 152, 185, 0, 130, 0, 0, 127, 0, 58, 128, 58, 198, 233, 162, 62, 217, 57, 14, 63, 76, 167, 68, 191, 40, 69, 159, 0, 139, 0, 208, 127, 127, 57, 0, 53, 0, 0, 0, 0, 21, 239, 195, 62, 94, 131, 108, 191, 0, 48, 139, 0, 129, 0, 0, 127, 0, 58, 0, 54, 248, 4, 181, 62, 21, 239, 195, 62, 121, 130, 90, 191, 44, 48, 148, 0, 139, 0, 208, 127, 128, 57, 0, 54, 198, 233, 162, 62, 217, 57, 14, 63, 76, 167, 68, 191, 40, 69, 159, 0, 139, 0, 208, 127, 127, 57, 0, 53, 0, 0, 0, 0, 217, 57, 14, 63, 50, 219, 84, 191, 0, 69, 150, 0, 130, 0, 0, 127, 0, 58, 0, 53, 0, 0, 0, 0, 21, 239, 195, 62, 94, 131, 108, 191, 0, 48, 139, 0, 129, 0, 0, 127, 0, 58, 0, 54, 209, 181, 89, 62, 50, 219, 84, 191, 80, 102, 3, 191, 27, 152, 190, 0, 139, 0, 208, 127, 127, 57, 128, 58, 0, 0, 0, 0, 96, 131, 108, 1Line truncated
"array_index_data": PoolByteArray( ),
"blend_shape_data": [ ],
"format": 97303,
"index_count": 0,
"primitive": 4,
"skeleton_aabb": [ ],
"vertex_count": 1440
}
[sub_resource type="GDScript" id=1]
script/source = "extends PushingBodyPart
[sub_resource type="SphereShape" id=2]
[sub_resource type="ArrayMesh" id=3]
surfaces/0 = {
"aabb": AABB( -0.184739, -0.121198, -8.55993, 0.64686, 0.242406, 6.0141 ),
"array_data": PoolByteArray( 48, 44, 61, 190, 183, 54, 248, 61, 52, 24, 156, 192, 129, 0, 0, 0, 0, 127, 0, 127, 0, 57, 0, 58, 0, 0, 0, 0, 255, 255, 0, 0, 0, 0, 0, 0, 48, 44, 61, 190, 183, 54, 248, 189, 210, 238, 34, 192, 129, 0, 0, 0, 0, 127, 0, 127, 0, 54, 0, 60, 0, 0, 0, 0, 255, 255, 0, 0, 0, 0, 0, 0, 48, 44, 61, 190, 183, 54, 248, 189, 52, 24, 156, 192, 129, 0, 0, 0, 0, 127, 0, 127, 0, 54, 0, 58, 0, 0, 0, 0, 255, 255, 0, 0, 0, 0, 0, 0, 48, 44, 61, 190, 183, 54, 248, 61, 52, 24, 156, 192, 129, 0, 0, 0, 0, 127, 0, 127, 0, 57, 0, 58, 0, 0, 0, 0, 255, 255, 0, 0, 0, 0, 0, 0, 48, 44, 61, 190, 183, 54, 248, 61, 210, 238, 34, 192, 129, 0, 0, 0, 0, 127, 0, 127, 0, 57, 0, 60, 0, 0, 0, 0, 255, 255, 0, 0, 0, 0, 0, 0, 48, 44, 61, 190, 183, 54, 248, 189, 210, 238, 34, 192, 129, 0, 0, 0, 0, 127, 0, 127, 0, 54, 0, 60, 0, 0, 0, 0, 255, 255, 0, 0, 0, 0, 0, 0, 48, 44, 61, 62, 183, 54, 248, 61, 52, 24, 156, 192, 0, 0, 129, 0, 0, 127, 0, 127, 0, 57, 0, 56, 0, 0, 0, 0, 255, 255, 0, 0, 0, 0, 0, 0, 48, 44, 61, 190, 183, 54, 248, 189, 52, 24, 156, 192, 0, 0, 129, 0, 0, 127, 0, 127, 0, 54, 0, 58, 0, 0, 0, 0, 255, 255, 0, 0, 0, 0, 0, 0, 48, 44, 61, 62, 183, 54, 248, 189, 52, 24, 156, 192, 0, 0, 129, 0, 0, 127, 0, 127, 0, 54, 0, 56, 0, 0, 0, 0, 255, 255, 0, 0, 0, 0, 0, 0, 48, 44, 61, 62, 183, 54, 248, 61, 52, 24, 156, 192, 0, 0, 129, 0, 0, 127, 0, 127, 0, 57, 0, 56, 0, 0, 0, 0, 255, 255, 0, 0, 0, 0, 0, 0, 48, 44, 61, 190, 183, 54, 248, 61, 52, 24, 156, 192, 0, 0, 129, 0, 0, 127, 0, 127, 0, 57, 0, 58, 0, 0, 0, 0, 255, 255, 0, 0, 0, 0, 0, 0, 48, 44, 61, 190, 183, 54, 248, 189, 52, 24, 156, 192, 0, 0, 129, 0, 0, 127, 0, 127, 0, 54, 0, 58, 0, 0, 0, 0, 255, 255, 0, 0, 0, 0, 0, 0, 48, 44, 61, 62, 183, 54, 248, 61, 210, 238, 34, 192, 127, 0, 0, 0, 0, 127, 0, 127, 0, 57, 0, 52, 0, 0, 0, 0, 255, 255, 0, 0, 0, 0, 0, 0, 48, 44, 61, 62, 183, 54, 248, 189, 52, 24, 156, 192, 127, 0, 0, 0, 0, 127, 0, 127, 0, 54, 0, 56, 0, 0, 0, 0, 255, 255, 0, 0, 0, 0, 0, 0, 48, 44, 61, 62, 183, 54, 248, 189, 210, 238, 34, 192, 127, 0, 0, 0, 0, 127, 0, 127, 0, 54, 0, 52, 0, 0, 0, 0, 255, 255, 0, 0, 0, 0, 0, 0, 48, 44, 61, 62, 183, 54, 248, 61, 210, 238, 34, 192, 127, 0, 0, 0, 0, 127, 0, 127, 0, 57, 0, 52, 0, 0, 0, 0, 255, 255, 0, 0, 0, 0, 0, 0, 48, 44, 61, 62, 183, 54, 248, 61, 52, 24, 156, 192, 127, 0, 0, 0, 0, 127, 0, 127, 0, 57, 0, 56, 0, 0, 0, 0, 255, 255, 0, 0, 0, 0, 0, 0, 48, 44, 61, 62, 183, 54, 248, 189, 52, 24, 156, 192, 127, 0, 0, 0, 0, 127, 0, 127, 0, 54, 0, 56, 0, 0, 0, 0, 255, 255, 0, 0, 0, 0, 0, 0, 48, 44, 61, 190, 183, 54, 248, 61, 210, 238, 34, 192, 0, 0, 127, 0, 0, 127, 0, 127, 0, 57, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 0, 0, 0, 0, 48, 44, 61, 62, 183, 54, 248, 189, 210, 238, 34, 192, 0, 0, 127, 0, 0, 127, 0, 127, 0, 54, 0, 52, 0, 0, 0, 0, 255, 255, 0, 0, 0, 0, 0, 0, 48, 44, 61, 190, 183, 54, 248, 189, 210, 238, 34, 192, 0, 0, 127, 0, 0, 127, 0, 127, 0, 54, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 0, 0, 0, 0, 48, 44, 61, 190, 183, 54, 248, 61, 210, 238, 34, 192, 0, 0, 127, 0, 0, 127, 0, 127, 0, 57, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 0, 0, 0, 0, 48, 44, 61, 62, 183, 54, 248, 61, 210, 238, 34, 192, 0, 0, 127, 0, 0, 127, 0, 127, 0, 57, 0, 52, 0, 0, 0, 0, 255, 255, 0, 0, 0, 0, 0, 0, 48, 44, 61, 62, 183, 54, 248, 189, 210, 238, 34, 192, 0, 0, 127, 0, 0, 127, 0, 127, 0, 54, 0, 52, 0, 0, 0, 0, 255, 255, 0, 0, 0, 0, 0, 0, 48, 44, 61, 190, 183, 54, 248, 189, 210, 238, 34, 192, 0, 129, 0, 0, 127, 0, 0, 127, 0, 48, 0, 52, 0, 0, 0, 0, 255, 255, 0, 0, 0, 0, 0, 0, 48, 44, 61, 62, 183, 54, 248, 189, 52, 24, 156, 192, 0, 129, 0, 0, 127, 0, 0, 127, 0, 54, 0, 56, 0, 0, 0, 0, 255, 255, 0, 0, 0, 0, 0, 0, 48, 44, 61, 190, 183, 54, 248, 189, 52, 24, 156, 192, 0, 129, 0, 0, 127, 0, 0, 127, 0, 48, 0, 56, 0, 0, 0, 0, 255, 255, 0, 0, 0, 0, 0, 0, 48, 44, 61, 190, 183, 54, 248, 189, 210, 238, 34, 192, 0, 129, 0, 0, 127, 0, 0, 127, 0, 48, 0, 52, 0, 0, 0, 0, 255, 255, 0, 0, 0, 0, 0, 0, 48, 44, 61, 62, 183, 54, 248, 189, 210, 238, 34, 192, 0, 129, 0, 0, 127, 0, 0, 127, 0, 54, 0, 52, 0, 0, 0, 0, 255, 255, 0, 0, 0, 0, 0, 0, 48, 44, 61, 62, 183, 54, 248, 189, 52, 24, 156, 192, 0, 129, 0, 0, 127, 0, 0, 127, 0, 54, 0, 56, 0, 0, 0, 0, 255, 255, 0, 0, 0, 0, 0, 0, 48, 44, 61, 62, 183, 54, 248, 61, 210, 238, 34, 192, 0, 127, 0, 0, 129, 0, 0, 127, 0, 57, 0, 52, 0, 0, 0, 0, 255, 255, 0, 0, 0, 0, 0, 0, 48, 44, 61, 190, 183, 54, 248, 61, 52, 24, 156, 192, 0, 127, 0, 0, 129, 0, 0, 127, 0, 59, 0, 56, 0, 0, 0, 0, 255, 255, 0, 0, 0, 0, 0, 0, 48, 44, 61, 62, 183, 54, 248, 61, 52, 24, 156, 192, 0, 127, 0, 0, 129, 0, 0, 127, 0, 57, 0, 56, 0, 0, 0, 0, 255, 255, 0, 0, 0, 0, 0, 0, 48, 44, 61, 62, 183, 54, 248, 61, 210, 238, 34, 192, 0, 127, 0, 0, 129, 0, 0, 127, 0, 57, 0, 52, 0, 0, 0, 0, 255, 255, 0, 0, 0, 0, 0, 0, 48, 44, 61, 190, 183, 54, 248, 61, 210, 238, 34, 192, 0, 127, 0, 0, 129, 0, 0, 127, 0, 59, 0, 52, 0, 0, 0, 0, 255, 255, 0, 0, 0, 0, 0, 0, 48, 44, 61, 190, 183, 54, 248, 61, 52, 24, 156, 192, 0, 127, 0, 0, 129, 0, 0, 127, 0, 59, 0, 56, 0, 0, 0, 0, 255, 255, 0, 0, 0, 0, 0, 0, 48, 44, 61, 190, 183, 5Line truncated
"array_index_data": PoolByteArray( ),
"blend_shape_data": [ ],
"format": 97495,
"index_count": 0,
"primitive": 4,
"skeleton_aabb": [ AABB( -0.184739, -0.121198, -4.87795, 0.369478, 0.242406, 2.33213 ), AABB( -0.184739, -0.121198, -7.96762, 0.64686, 0.242406, 2.84808 ), AABB( -0.184739, -0.121198, -8.55993, 0.64686, 0.242406, 0.829783 ) ],
"vertex_count": 156
}
onready var anim = get_node(\"Mesh/AnimationPlayer\")
[sub_resource type="Skin" id=4]
bind_count = 5
bind/0/bone = 0
bind/0/pose = Transform( 1, 9.17561e-19, -9.16646e-17, -9.16646e-17, 0.020018, -0.9998, 9.17561e-19, 0.9998, 0.020018, -2.33362e-16, -2.54532, 0.0509622 )
bind/1/bone = 1
bind/1/pose = Transform( 1, -9.60376e-26, 5.10854e-24, 4.28191e-24, -0.0216853, -0.999765, 9.28764e-26, 0.999765, -0.0216853, 2.23781e-16, -4.98441, -0.156995 )
bind/2/bone = 2
bind/2/pose = Transform( 1, 1.2326e-32, 1.34045e-31, -8.25617e-25, 0, -1, -9.60376e-26, 1, 0, 2.23781e-16, -7.60024, 0.00782001 )
bind/3/bone = 3
bind/3/pose = Transform( 1, 0, 0, 0, 0, -1, 0, 1, 0, 2.23781e-16, -8.54317, 0.00782001 )
bind/4/bone = 4
bind/4/pose = Transform( 1, 0, -2.38419e-07, -2.84217e-14, 1, -1.19209e-07, 2.38419e-07, 0, 1, -1.18891e-06, -1.48879, 4.98664 )
[sub_resource type="SphereShape" id=5]
radius = 0.713315
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
[sub_resource type="Animation" id=6]
length = 0.583333
tracks/0/type = "transform"
tracks/0/path = NodePath("Armature/Skeleton:bone_2")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = PoolRealArray( 0, 1, 0, 0, 0, 0, 0, 6.70224e-32, 1, 1, 1, 1, 0.0666667, 1, 2.64698e-23, -2.38419e-07, -4.09782e-08, -0.0709697, 8.32486e-25, -9.7737e-26, 0.997478, 1, 1, 1, 0.133333, 1, -5.29396e-24, 0, -1.19209e-07, -0.21111, 1.34947e-24, -7.81775e-26, 0.977462, 1, 1, 1, 0.2, 1, 1.58819e-23, 0, 7.07805e-08, -0.338457, -3.53586e-24, -8.01725e-25, 0.940982, 1, 1, 1, 0.266667, 1, -2.24993e-23, 0, -7.45058e-08, -0.360446, -8.45813e-17, -1.41886e-23, 0.93278, 1, 1, 1, 0.333333, 1, -1.32349e-23, 0, -2.38419e-07, -0.21312, -8.84992e-17, -1.18528e-23, 0.977026, 1, 1, 1, 0.4, 1, 3.17637e-23, 0, 0, 0.0627816, -8.98846e-17, -1.05674e-23, 0.998027, 1, 1, 1, 0.466667, 1, 7.94093e-24, 0, 2.23517e-08, 0.265486, -5.55692e-17, -1.11536e-23, 0.964115, 1, 1, 1, 0.533333, 1, 7.94092e-24, 0, -2.6077e-08, 0.123094, 6.82008e-17, -2.50056e-24, 0.992395, 1, 1, 1, 0.583333, 1, -2.64698e-23, 0, 3.72529e-09, -0.148111, -3.28872e-17, 2.71832e-24, 0.988971, 1, 1, 1 )
tracks/1/type = "transform"
tracks/1/path = NodePath("Armature/Skeleton:bone_1")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = PoolRealArray( 0, 1, 2.64698e-23, 0, 0, 0, -5.16988e-26, -7.54479e-25, 1, 1, 1, 1, 0.0666667, 1, 0, 0, 0, -0.0853115, 8.36189e-25, -1.40079e-23, 0.996354, 1, 1, 1, 0.133333, 1, 2.64698e-23, 0, 7.45058e-09, -0.254366, 3.61377e-24, -1.35364e-23, 0.967108, 1, 1, 1, 0.2, 1, -2.64698e-23, 0, 1.49012e-08, -0.405631, 2.85703e-24, -6.82032e-24, 0.914037, 1, 1, 1, 0.266667, 1, -5.29396e-23, 0, 5.96046e-08, -0.435911, -1.0091e-16, -2.18878e-18, 0.89999, 1, 1, 1, 0.333333, 1, 2.64698e-23, -2.38419e-07, 1.49012e-08, -0.304449, -1.04914e-16, -2.27563e-18, 0.952529, 1, 1, 1, 0.4, 1, 0, 2.38419e-07, 6.70552e-08, -0.0558202, -1.06395e-16, -2.30775e-18, 0.998441, 1, 1, 1, 0.466667, 1, 0, 0, -1.49012e-08, 0.133794, -7.46471e-17, -1.61913e-18, 0.991009, 1, 1, 1, 0.533333, 1, 0, 0, 0, 0.10452, 3.73489e-17, 8.10109e-19, 0.994523, 1, 1, 1, 0.583333, 1, 0, 0, 0, 0.00890188, 1.97616e-18, 4.2858e-20, 0.99996, 1, 1, 1 )
tracks/2/type = "transform"
tracks/2/path = NodePath("Armature/Skeleton:bone")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/keys = PoolRealArray( 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0.0666667, 1, 0, 0, 0, 0.163554, -1.63208e-24, 2.70578e-25, 0.986534, 1, 1, 1, 0.133333, 1, 0, 0, 0, 0.500252, 7.16239e-25, -4.13799e-25, 0.86588, 1, 1, 1, 0.2, 1, 0, 0, 0, 0.754199, -7.62209e-24, -6.36202e-24, 0.656646, 1, 1, 1, 0.266667, 1, 0, 0, 0, 0.799103, 1.07382e-16, -2.90615e-18, 0.601194, 1, 1, 1, 0.333333, 1, 0, 0, 0, 0.65835, 1.15743e-16, -3.13242e-18, 0.752712, 1, 1, 1, 0.4, 1, 0, 0, 0, 0.324848, 1.17969e-16, -3.19264e-18, 0.945766, 1, 1, 1, 0.466667, 1, 0, 0, 0, 0.0515224, 8.74589e-17, -2.36693e-18, 0.998672, 1, 1, 1, 0.533333, 1, 0, 0, 0, 0.00191568, 2.49658e-19, -6.75492e-21, 0.999998, 1, 1, 1, 0.583333, 1, 0, 0, 0, 0.00191565, 2.49661e-19, -6.75492e-21, 0.999998, 1, 1, 1 )
tracks/3/type = "transform"
tracks/3/path = NodePath("Armature/Skeleton:hand_ik")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/keys = PoolRealArray( 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0.583333, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1 )
tracks/4/type = "transform"
tracks/4/path = NodePath("Armature/Skeleton:handpole")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/keys = PoolRealArray( 0, 1, 5.68434e-14, 0, 0, -9.0278e-36, -7.10543e-15, 4.23516e-22, 1, 1, 1, 1, 0.583333, 1, 5.68434e-14, 0, 0, -9.0278e-36, -7.10543e-15, 4.23516e-22, 1, 1, 1, 1 )
[sub_resource type="SphereShape" id=7]
func action():
anim.play(\"ArmatureAction001\")
[node name="Arm" type="RigidBody"]
script = ExtResource( 1 )
[node name="Sphere" type="MeshInstance" parent="."]
transform = Transform( 1.9959, 0, 0, 0, 1.9959, 0, 0, 0, 1.9959, 0, 0, 0 )
mesh = SubResource( 1 )
material/0 = null
func push(body):
base.apply_impulse(touch_area.transform.origin, base.transform.basis.y * 6.0)
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta: float) -> void:
# pass
"
[node name="CollisionShape" type="CollisionShape" parent="."]
transform = Transform( 1.9959, 0, 0, 0, 1.9959, 0, 0, 0, 1.9959, 0, 0, 0 )
shape = SubResource( 2 )
[sub_resource type="SphereShape" id=4]
[node name="Armature" type="Spatial" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -2.54583 )
[sub_resource type="SphereShape" id=3]
radius = 0.803016
[node name="Skeleton" type="Skeleton" parent="Armature"]
bones/0/name = "bone"
bones/0/parent = -1
bones/0/rest = Transform( 1, -9.16646e-17, 9.17558e-19, 9.17558e-19, 0.0200179, 0.9998, -9.16646e-17, -0.9998, 0.0200179, 0, 0, 0 )
bones/0/enabled = true
bones/0/bound_children = [ ]
bones/1/name = "bone_1"
bones/1/parent = 0
bones/1/rest = Transform( 1, 9.16231e-17, 2.90512e-18, -9.16646e-17, 0.99913, 0.0416942, 9.17561e-19, -0.0416942, 0.99913, 1.2957e-24, 2.4413, 0 )
bones/1/enabled = true
bones/1/bound_children = [ ]
bones/2/name = "bone_2"
bones/2/parent = 1
bones/2/rest = Transform( 1, -5.10854e-24, -9.60376e-26, 5.10525e-24, 0.999765, -0.0216853, 2.06795e-25, 0.0216853, 0.999765, 2.71197e-23, 2.61421, -1.86265e-09 )
bones/2/enabled = true
bones/2/bound_children = [ NodePath("BoneAttachment") ]
bones/3/name = "hand_ik"
bones/3/parent = -1
bones/3/rest = Transform( 1, 0, 0, 0, 0, 1, 0, -1, 0, -2.23781e-16, -0.00782001, -5.99735 )
bones/3/enabled = true
bones/3/bound_children = [ ]
bones/4/name = "handpole"
bones/4/parent = -1
bones/4/rest = Transform( 1, -7.10543e-15, 2.38419e-07, -7.10543e-15, 1, 5.96046e-08, -2.38419e-07, -5.96046e-08, 1, -2.23781e-16, 1.48879, -2.44081 )
bones/4/enabled = true
bones/4/bound_children = [ ]
[node name="Arm" instance=ExtResource( 1 )]
script = SubResource( 1 )
[node name="Cube" type="MeshInstance" parent="Armature/Skeleton"]
mesh = SubResource( 3 )
skin = SubResource( 4 )
material/0 = null
[node name="PartCollider" parent="." index="0"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -8 )
shape = SubResource( 4 )
[node name="BoneAttachment" type="BoneAttachment" parent="Armature/Skeleton"]
transform = Transform( 1, -1.98031e-23, -2.87996e-24, 2.78437e-24, -8.3819e-08, 1, 3.22164e-23, -1, -8.3819e-08, -2.23781e-16, -0.00782044, -5.05441 )
[node name="Mesh" parent="." index="1" instance=ExtResource( 2 )]
[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"
[node name="TouchArea" type="Area" parent="Armature/Skeleton/BoneAttachment"]
[node name="RemoteTransform" type="RemoteTransform" parent="Mesh/Armature/Skeleton/BoneAttachment" index="0"]
remote_path = NodePath("../../../../../TouchArea")
[node name="CollisionShape" type="CollisionShape" parent="Armature/Skeleton/BoneAttachment/TouchArea"]
shape = SubResource( 5 )
[node name="TouchArea" parent="." index="2"]
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, -7.60024 )
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
anims/ArmatureAction001 = SubResource( 6 )
[node name="CollisionShape" type="CollisionShape" parent="TouchArea" index="0"]
transform = Transform( 1, 2.98291e-24, -1.98247e-23, -2.07684e-23, -9.49949e-08, -1, -6.50669e-24, 1, -9.49949e-08, 2.23781e-16, 0.399765, 0.00782054 )
shape = SubResource( 3 )
[node name="CollisionShape2" type="CollisionShape" parent="."]
transform = Transform( 1, -1.97986e-23, -2.67322e-24, 2.57758e-24, -8.3819e-08, 1, 3.22115e-23, -1, -8.3819e-08, -2.23781e-16, -0.00782044, -7.60024 )
shape = SubResource( 7 )
[editable path="Mesh"]
+16 -2
View File
@@ -1,6 +1,20 @@
[gd_scene load_steps=2 format=2]
[gd_scene load_steps=4 format=2]
[ext_resource path="res://Ingame/BodyParts/BodyBase.gd" type="Script" id=1]
[node name="BodyBase" type="Spatial"]
[sub_resource type="CapsuleMesh" id=1]
[sub_resource type="ConvexPolygonShape" id=2]
points = PoolVector3Array( -0.976555, -0.115531, 0.676252, -0.97477, 0.129786, 0.675025, -0.972729, 0.170391, -0.632762, -0.930705, -0.318757, -0.672787, -0.884938, -0.438707, 0.628485, -0.852838, 0.129915, 1.00335, -0.849191, 0.496531, -0.672869, -0.803433, 0.574508, 0.628223, -0.768518, 0.129545, -1.12264, -0.725725, -0.3591, 1.07922, -0.721015, -0.680519, -0.586622, -0.683166, 0.534891, 0.994835, -0.648419, -0.115498, -1.24963, -0.562995, -0.807204, 0.672059, -0.526953, 0.130336, 1.33554, -0.480814, 0.617232, -1.11842, -0.479804, 0.859538, -0.669774, -0.479803, 0.859536, 0.669773, -0.440687, -0.603552, -1.16064, -0.43878, -0.884893, -0.628588, -0.317763, -0.885919, 0.832213, -0.282246, -0.240683, 1.42608, -0.198218, 0.335642, -1.41718, -0.197532, -0.975449, 0.552572, -0.15707, 0.581984, 1.29355, -0.156757, -0.525388, -1.33211, -0.156757, -0.525388, 1.33211, -0.117117, -0.199568, -1.46926, -0.116847, 0.213598, 1.46606, -0.11591, -0.976507, -0.67622, -0.115807, 0.826041, -1.04422, -0.115565, 0.988039, -0.551618, -0.0747357, 0.947977, 0.797463, 0.12956, -0.768424, -1.12278, 0.129786, -0.97477, 0.675025, 0.171135, 0.58102, -1.29182, 0.172267, 0.172267, -1.46605, 0.2128, -0.321832, 1.41923, 0.25284, 0.825812, -1.0032, 0.253122, 0.949838, 0.676403, 0.29257, -0.686201, 1.16252, 0.332014, 0.94129, -0.507643, 0.33379, 0.61975, 1.20479, 0.335646, -0.19822, -1.41719, 0.378044, -0.0339178, 1.42212, 0.413277, -0.845586, -0.832511, 0.453569, -0.885709, -0.54779, 0.496551, -0.441258, -1.24375, 0.496608, -0.849134, 0.672975, 0.572962, 0.775053, 0.747599, 0.577133, 0.332796, -1.24188, 0.654399, 0.735187, -0.667508, 0.700886, 0.25188, 1.16319, 0.736328, -0.560023, 0.871037, 0.742227, -0.237757, -1.12308, 0.742233, -0.237759, 1.12309, 0.85642, 0.492308, 0.626846, 0.856435, 0.492317, -0.626858, 0.859536, -0.479803, -0.669773, 0.866929, 0.170866, -0.962149, 0.899981, -0.398467, 0.669636, 0.990148, -0.0336554, -0.593795, 0.990984, 0.0890012, 0.553274, 0.991375, 0.00714278, 0.594536 )
[node name="BodyBase" type="RigidBody"]
script = ExtResource( 1 )
[node name="MeshInstance" type="MeshInstance" parent="."]
transform = Transform( 1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, 0 )
mesh = SubResource( 1 )
material/0 = null
[node name="BaseCollider" type="CollisionShape" parent="."]
transform = Transform( 1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, 0 )
shape = SubResource( 2 )
+10 -2
View File
@@ -5,15 +5,23 @@ class_name BodyPart
onready var base = get_parent()
onready var physics_shape = get_node("CollisionShape")
onready var physics_shape = get_node("PartCollider")
export(int) var key
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
assert(base is BodyBase)
base.add_child(physics_shape)
remove_child(physics_shape)
base.call_deferred("add_child", physics_shape)
func _unhandled_input(event):
if event is InputEventKey:
if event.pressed and event.scancode == key:
action()
# Do something with the base
+1 -1
View File
@@ -5,4 +5,4 @@
[node name="BodyPart" type="Spatial"]
script = ExtResource( 1 )
[node name="CollisionShape" type="CollisionShape" parent="."]
[node name="PartCollider" type="CollisionShape" parent="."]
+1 -1
View File
@@ -1,5 +1,5 @@
extends BodyPart
class_name PushingBodyPart
onready var touch_area = get_node("TouchArea")