Physics proof of concept

This commit is contained in:
karl 2020-01-31 23:46:09 +01:00
parent 3a9b2ee771
commit ace68cfa4d
4 changed files with 43 additions and 22 deletions

View File

@ -3,6 +3,17 @@ extends RigidBody
onready var anim = get_node("AnimationPlayer") onready var anim = get_node("AnimationPlayer")
onready var skeleton = get_node("Armature/Skeleton") onready var skeleton = get_node("Armature/Skeleton")
onready var area = get_node("Armature/Skeleton/BoneAttachment/TouchArea")
func _ready():
area.connect("body_entered", self, "arm_collided")
func arm_collided(body):
if body.name != "Arm":
print("Entered")
apply_impulse(area.transform.origin, Vector3.UP * 10.0)
func _unhandled_input(event): func _unhandled_input(event):

File diff suppressed because one or more lines are too long

View File

@ -5,8 +5,8 @@
[sub_resource type="PlaneMesh" id=1] [sub_resource type="PlaneMesh" id=1]
size = Vector2( 10, 10 ) size = Vector2( 10, 10 )
[sub_resource type="ConcavePolygonShape" id=2] [sub_resource type="BoxShape" id=2]
data = PoolVector3Array( 5, 0, 5, -5, 0, 5, 5, 0, -5, -5, 0, 5, -5, 0, -5, 5, 0, -5 ) extents = Vector3( 5, 1, 5 )
[node name="Spatial" type="Spatial"] [node name="Spatial" type="Spatial"]
@ -18,14 +18,15 @@ material/0 = null
[node name="StaticBody" type="StaticBody" parent="MeshInstance"] [node name="StaticBody" type="StaticBody" parent="MeshInstance"]
[node name="CollisionShape" type="CollisionShape" parent="MeshInstance/StaticBody"] [node name="CollisionShape" type="CollisionShape" parent="MeshInstance/StaticBody"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1, 0 )
shape = SubResource( 2 ) shape = SubResource( 2 )
[node name="Camera" type="Camera" parent="."] [node name="Camera" type="Camera" parent="."]
transform = Transform( 1, 0, 0, 0, 0.866025, 0.5, 0, -0.5, 0.866025, 0, 6, 8 ) transform = Transform( 1, 0, 0, 0, 0.866025, 0.5, 0, -0.5, 0.866025, 0, 9, 18 )
[node name="Arm" parent="." instance=ExtResource( 1 )]
transform = Transform( 3.87553e-08, -0.0559087, -0.998436, -8.97299e-08, -0.998436, 0.0559087, -1, 8.74228e-08, -4.37114e-08, 0, 4, 0 )
[node name="DirectionalLight" type="DirectionalLight" parent="."] [node name="DirectionalLight" type="DirectionalLight" parent="."]
transform = Transform( 0.999532, 0.0126075, 0.027872, -0.0305909, 0.411942, 0.910697, 0, -0.911123, 0.412135, 0, 0, 0 ) transform = Transform( 0.999532, 0.0126075, 0.027872, -0.0305909, 0.411942, 0.910697, 0, -0.911123, 0.412135, 0, 0, 0 )
shadow_enabled = true shadow_enabled = true
[node name="Arm" parent="." instance=ExtResource( 1 )]
transform = Transform( 0.652297, -0.343448, 0.675686, 0, 0.89145, 0.453119, -0.757964, -0.295568, 0.58149, 0, 11.9276, 0 )

View File

@ -16,6 +16,7 @@ _global_script_class_icons={
[application] [application]
config/name="BodyPartFighter" config/name="BodyPartFighter"
run/main_scene="res://Ingame/Testing.tscn"
config/icon="res://icon.png" config/icon="res://icon.png"
[rendering] [rendering]