Commit 6ef546fc authored by Chloé Paris's avatar Chloé Paris

left hand shape in animatioin 3D

parent 8b3f5dbf
......@@ -91,48 +91,38 @@ func _input(event):
if !DH_shape.ignore and !NDH_shape.ignore:
#if it is actually keyboard input and it was just pressed (avoid redundance)
if event.is_class("InputEventKey") and event.is_pressed() and not event.is_echo():
if event.is_action("2letters"):
if Input.is_action_pressed("A") and Input.is_action_pressed("E"):
get_node("Viewport/hand_model/AnimationPlayer").play("AE")
elif Input.is_action_pressed("B"):
print("b")
if Input.is_action_pressed("G"):
print("g")
get_node("Viewport/hand_model/AnimationPlayer").play("BG")
if Input.is_action_pressed("L"):
print("l")
get_node("Viewport/hand_model/AnimationPlayer").play("BL")
elif Input.is_action_pressed("L") and Input.is_action_pressed("U"):
get_node("Viewport/hand_model/AnimationPlayer").play("LU")
#if letter of alphabet -> want hand to display the shape of this letter
elif event.is_action("letter"):
# 'which' knows which hand needs to deal with the input
if which == 0:
# play letter
get_node("Viewport/hand_model/AnimationPlayer").play("Lettre-"+event.as_text())
# actually register the change
signVar.DHanimShape = event.as_text()
else:
get_node("Viewport2/hand_model/AnimationPlayer").play("Lettre-"+event.as_text())
signVar.NDHanimShape = event.as_text()
elif event.is_action("1-5"):
var fingers
match event.as_text():
"Ampersand":
fingers = 1
"é":
fingers = 2
"QuoteDbl":
fingers = 3
"Apostrophe":
fingers = 4
"ParenLeft":
fingers = 5
"Colon":
fingers = 0
"Less":
fingers = 50
if which == 0:
# 'which' knows which hand needs to deal with the input
if which == 0:
if event.is_action("2letters"):
if Input.is_action_pressed("A") and Input.is_action_pressed("E"):
get_node("Viewport/hand_model/AnimationPlayer").play("AE")
elif Input.is_action_pressed("B"):
print("b")
if Input.is_action_pressed("G"):
print("g")
get_node("Viewport/hand_model/AnimationPlayer").play("BG")
if Input.is_action_pressed("L"):
print("l")
get_node("Viewport/hand_model/AnimationPlayer").play("BL")
elif Input.is_action_pressed("L") and Input.is_action_pressed("U"):
get_node("Viewport/hand_model/AnimationPlayer").play("LU")
elif event.is_action("1-5"):
var fingers
match event.as_text():
"Ampersand":
fingers = 1
"é":
fingers = 2
"QuoteDbl":
fingers = 3
"Apostrophe":
fingers = 4
"ParenLeft":
fingers = 5
"Colon":
fingers = 0
"Less":
fingers = 50
if Input.is_action_pressed("bec ferme"):
print("%d bec fermé" % fingers)
get_node("Viewport/hand_model/AnimationPlayer").play("BF-%d" % fingers)
......@@ -154,16 +144,81 @@ func _input(event):
get_node("Viewport/hand_model/AnimationPlayer").play("Chiffre-%d" % fingers)
# actually register the change
signVar.DHanimShape = "%d" % fingers
#if letter of alphabet -> want hand to display the shape of this letter
elif event.is_action("letter"):
# play letter
get_node("Viewport/hand_model/AnimationPlayer").play("Lettre-"+event.as_text())
# actually register the change
signVar.DHanimShape = event.as_text()
# Tab lets the user change the focus from one hand to the other
elif event.is_action("ui_next"):
which = 1-which
# other cases: print name of pushed key
else:
print("main gauche")
get_node("Viewport2/hand_model/AnimationPlayer").play("Chiffre-%d" % fingers)
signVar.NDHanimShape = "%d" % fingers
# Tab lets the user change the focus from one hand to the other
elif event.is_action("ui_next"):
which = 1-which
# other cases: print name of pushed key
print(event.as_text())
### left hand ###
else:
print(event.as_text())
if event.is_action("2letters"):
if Input.is_action_pressed("A") and Input.is_action_pressed("E"):
get_node("Viewport2/hand_model/AnimationPlayer").play("AE")
elif Input.is_action_pressed("B"):
if Input.is_action_pressed("G"):
get_node("Viewport2/hand_model/AnimationPlayer").play("BG")
if Input.is_action_pressed("L"):
get_node("Viewport2/hand_model/AnimationPlayer").play("BL")
elif Input.is_action_pressed("L") and Input.is_action_pressed("U"):
get_node("Viewport2/hand_model/AnimationPlayer").play("LU")
elif event.is_action("1-5"):
var fingers
match event.as_text():
"Ampersand":
fingers = 1
"é":
fingers = 2
"QuoteDbl":
fingers = 3
"Apostrophe":
fingers = 4
"ParenLeft":
fingers = 5
"Colon":
fingers = 0
"Less":
fingers = 50
if Input.is_action_pressed("bec ferme"):
print("%d bec fermé" % fingers)
get_node("Viewport2/hand_model/AnimationPlayer").play("BF-%d" % fingers)
elif Input.is_action_pressed("bec ouvert"):
print("%d bec ouvert" % fingers)
get_node("Viewport2/hand_model/AnimationPlayer").play("BO-%d" % fingers)
elif Input.is_action_pressed("cone"):
print("%d cone" % fingers)
get_node("Viewport2/hand_model/AnimationPlayer").play("Cone-%d" % fingers)
elif Input.is_action_pressed("plie"):
print("%d plié" % fingers)
get_node("Viewport2/hand_model/AnimationPlayer").play("Plié-%d" % fingers)
elif Input.is_action_pressed("rond"):
print("%d rond" % fingers)
get_node("Viewport2/hand_model/AnimationPlayer").play("Rond-%d" % fingers)
else:
print("%d normal" % fingers)
# play shape
get_node("Viewport2/hand_model/AnimationPlayer").play("Chiffre-%d" % fingers)
# actually register the change
signVar.DHanimShape = "%d" % fingers
#if letter of alphabet -> want hand to display the shape of this letter
elif event.is_action("letter"):
get_node("Viewport2/hand_model/AnimationPlayer").play("Lettre-"+event.as_text())
signVar.NDHanimShape = event.as_text()
# Tab lets the user change the focus from one hand to the other
elif event.is_action("ui_next"):
which = 1-which
# other cases: print name of pushed key
else:
print(event.as_text())
#'backbutton' lets user go back to Sign Panel
func _on_backbutton_pressed():
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment