|
@@ -621,50 +621,50 @@ def getonboard():
|
621
|
621
|
fliplay3 = fliplay2 + 1
|
622
|
622
|
if dropinCol.positive == True:
|
623
|
623
|
|
624
|
|
-# nearestObject = None
|
625
|
|
-# grindEmpty = scene.objects['grindEmpty']
|
626
|
|
-# grindDar = grindEmpty.sensors['grindDar2']
|
627
|
|
-# minDist = None
|
628
|
|
-# if grindDar.positive:
|
629
|
|
-# detectedObjects = grindDar.hitObjectList
|
630
|
|
-# dist = 0
|
631
|
|
-# for obj in detectedObjects:
|
632
|
|
-# dist = own.getDistanceTo(obj)
|
633
|
|
-# if (minDist is None or dist < minDist):
|
634
|
|
-# nearestObject = obj
|
635
|
|
-# minDist = dist
|
636
|
|
-# if nearestObject != None:
|
637
|
|
-# print(nearestObject)
|
638
|
|
-# obj = nearestObject
|
639
|
|
-# player_e = own.worldOrientation.to_euler()
|
640
|
|
-# player_pos = own.worldPosition
|
641
|
|
-# player_rotz = math.degrees(player_e[2])
|
642
|
|
-# grinder_e = obj.worldOrientation.to_euler()
|
643
|
|
-# grinder_rotz = math.degrees(grinder_e[2])
|
644
|
|
-# rot = player_rotz - grinder_rotz
|
645
|
|
-#
|
646
|
|
-#
|
647
|
|
-# grinder_pos = obj.worldPosition
|
648
|
|
-# worldVect = [1, 0, 0]
|
649
|
|
-# vect = obj.getAxisVect(worldVect)
|
650
|
|
-# go = obj.worldOrientation
|
651
|
|
-# grinder_axis = [1,0,0]
|
652
|
|
-# try:
|
653
|
|
-# delta = player_pos - grinder_pos
|
654
|
|
-#
|
655
|
|
-# delta = delta.cross(vect)
|
656
|
|
-# if delta[2] >= 0:
|
657
|
|
-# grindside = "right"
|
658
|
|
-# else:
|
659
|
|
-# grindside = "left"
|
660
|
|
-# deltamove = delta[2] * .1#.25
|
661
|
|
-# move = [0, deltamove, 0]
|
662
|
|
-# print("1deltamove", deltamove)
|
663
|
|
-# own.applyMovement(move, True)
|
664
|
|
-# except:
|
665
|
|
-# print("delta broke: ", player_pos, grinder_pos)
|
666
|
|
-# #pass
|
667
|
|
-
|
|
624
|
+ nearestObject = None
|
|
625
|
+ grindEmpty = scene.objects['grindEmpty']
|
|
626
|
+ grindDar = grindEmpty.sensors['grindDar2']
|
|
627
|
+ minDist = None
|
|
628
|
+ if grindDar.positive:
|
|
629
|
+ detectedObjects = grindDar.hitObjectList
|
|
630
|
+ dist = 0
|
|
631
|
+ for obj in detectedObjects:
|
|
632
|
+ dist = own.getDistanceTo(obj)
|
|
633
|
+ if (minDist is None or dist < minDist):
|
|
634
|
+ nearestObject = obj
|
|
635
|
+ minDist = dist
|
|
636
|
+ if nearestObject != None:
|
|
637
|
+ print(nearestObject)
|
|
638
|
+ obj = nearestObject
|
|
639
|
+ player_e = own.worldOrientation.to_euler()
|
|
640
|
+ player_pos = own.worldPosition
|
|
641
|
+ player_rotz = math.degrees(player_e[2])
|
|
642
|
+ grinder_e = obj.worldOrientation.to_euler()
|
|
643
|
+ grinder_rotz = math.degrees(grinder_e[2])
|
|
644
|
+ rot = player_rotz - grinder_rotz
|
|
645
|
+
|
|
646
|
+
|
|
647
|
+ grinder_pos = obj.worldPosition
|
|
648
|
+ worldVect = [1, 0, 0]
|
|
649
|
+ vect = obj.getAxisVect(worldVect)
|
|
650
|
+ go = obj.worldOrientation
|
|
651
|
+ grinder_axis = [1,0,0]
|
|
652
|
+ try:
|
|
653
|
+ delta = player_pos - grinder_pos
|
|
654
|
+
|
|
655
|
+ delta = delta.cross(vect)
|
|
656
|
+ if delta[2] >= 0:
|
|
657
|
+ grindside = "right"
|
|
658
|
+ else:
|
|
659
|
+ grindside = "left"
|
|
660
|
+ deltamove = delta[2] * .1#.25
|
|
661
|
+ move = [-deltamove, 0, 0]
|
|
662
|
+ #print("1deltamove", deltamove)
|
|
663
|
+ own.applyMovement(move, True)
|
|
664
|
+ except:
|
|
665
|
+ #print("delta broke: ", player_pos, grinder_pos)
|
|
666
|
+ pass
|
|
667
|
+
|
668
|
668
|
if STANCE == 0:
|
669
|
669
|
own['requestAction'] ='reg_dropin_pos'
|
670
|
670
|
own['dropinTimer'] = 60
|