Bugfix : Composants mobiles à la bonne place lors de la ré-initialisation

This commit is contained in:
Philippe Roy 2022-12-29 10:08:55 +01:00
parent ff8c49096b
commit d1a829151c
9 changed files with 20 additions and 16 deletions

View File

@ -245,13 +245,12 @@ def system_reset ():
scene.objects['Led niveau 1-on'].setVisible(False,False) scene.objects['Led niveau 1-on'].setVisible(False,False)
# Cabine # Cabine
# applyRotationTo(scene.objects['System'], 0, 0, 0) scene.objects['Cabine'].worldPosition.x = scene.objects['Cabine']['init_lx']-scene.objects['System']['init_lx']+scene.objects['System'].worldPosition.x
scene.objects['Cabine'].worldPosition.x = scene.objects['Cabine']['init_lx'] scene.objects['Cabine'].worldPosition.y = scene.objects['Cabine']['init_ly']-scene.objects['System']['init_ly']+scene.objects['System'].worldPosition.y
scene.objects['Cabine'].worldPosition.y = scene.objects['Cabine']['init_ly'] scene.objects['Cabine'].worldPosition.z = scene.objects['Cabine']['init_lz']-scene.objects['System']['init_lz']+scene.objects['System'].worldPosition.z
scene.objects['Cabine'].worldPosition.z = scene.objects['Cabine']['init_lz'] scene.objects['Contrepoids'].worldPosition.x = scene.objects['Contrepoids']['init_lx']-scene.objects['System']['init_lx']+scene.objects['System'].worldPosition.x
scene.objects['Contrepoids'].worldPosition.x = scene.objects['Contrepoids']['init_lx'] scene.objects['Contrepoids'].worldPosition.y = scene.objects['Contrepoids']['init_ly']-scene.objects['System']['init_ly']+scene.objects['System'].worldPosition.y
scene.objects['Contrepoids'].worldPosition.y = scene.objects['Contrepoids']['init_ly'] scene.objects['Contrepoids'].worldPosition.z = scene.objects['Contrepoids']['init_lz']-scene.objects['System']['init_lz']+scene.objects['System'].worldPosition.z
scene.objects['Contrepoids'].worldPosition.z = scene.objects['Contrepoids']['init_lz']
# Moteur à l'état initial : pas utile # Moteur à l'état initial : pas utile

Binary file not shown.

Binary file not shown.

View File

@ -230,10 +230,9 @@ def system_init ():
def system_reset (): def system_reset ():
# Grille à l'état initial # Grille à l'état initial
# applyRotationTo(scene.objects['System'], 0, 0, 0) scene.objects['Portail'].worldPosition.x = scene.objects['Portail']['init_lx']-scene.objects['System']['init_lx']+scene.objects['System'].worldPosition.x
scene.objects['Portail'].worldPosition.x = scene.objects['Portail']['init_lx'] scene.objects['Portail'].worldPosition.y = scene.objects['Portail']['init_ly']-scene.objects['System']['init_ly']+scene.objects['System'].worldPosition.y
scene.objects['Portail'].worldPosition.y = scene.objects['Portail']['init_ly'] scene.objects['Portail'].worldPosition.z = scene.objects['Portail']['init_lz']-scene.objects['System']['init_lz']+scene.objects['System'].worldPosition.z
scene.objects['Portail'].worldPosition.z = scene.objects['Portail']['init_lz']
# Moteur à l'état initial # Moteur à l'état initial
rres=0.001 # resolution rotation rres=0.001 # resolution rotation

View File

@ -507,6 +507,13 @@ def cycle_run ():
# FIXME : Relancer la maquette # FIXME : Relancer la maquette
pass pass
def light_refresh(cont):
pass
# scene.objects['Sun'].applyMovement((0, 0, 0), True)
# scene.objects['System'].applyRotation((0, 0, 0), False)
# scene.objects['System'].applyMovement((0,0,0), False)
# pass
## ##
# Arrêt et réinitialisation du cycle (forçage) # Arrêt et réinitialisation du cycle (forçage)
## ##

View File

@ -1,7 +1,7 @@
<data> <data>
<screen> <screen>
<width>1480</width> <width>1458</width>
<height>832</height> <height>821</height>
<quality>1</quality> <quality>1</quality>
</screen> </screen>
</data> </data>

Binary file not shown.

View File

@ -73,11 +73,10 @@ def voy_auto (cont):
def mot (cont): def mot (cont):
if scene.objects['System']['run']: if scene.objects['System']['run']:
# scene.objects['System'].applyMovement((0, 0, 0), False)
# scene.objects['System'].applyRotation((0, 0, 0), True)
obj = cont.owner obj = cont.owner
# print (obj['frame_up'], obj['frame_down'])
layer = 0 layer = 0
# bge.render.drawLine([0,0,0],[1,1,1], (0.8, 0.8, 0.8, 1)) # Redraw pour l'éclairage de la scène
# Monter # Monter
if obj['up']: if obj['up']:
if obj['frame_down']<105: # Volet pas cassé if obj['frame_down']<105: # Volet pas cassé