|
@@ -3,11 +3,12 @@ import bge
|
3
|
3
|
def update_whiskers(self):
|
4
|
4
|
o = self
|
5
|
5
|
|
6
|
|
- color = [1,1,0]
|
|
6
|
+ color = [0,1,0]
|
7
|
7
|
iter = 0
|
|
8
|
+
|
|
9
|
+ #cast all whisker rays
|
8
|
10
|
for w in self.whisker_objs:
|
9
|
|
- rc = o.cont.rayCast(
|
10
|
|
- w.worldPosition,
|
|
11
|
+ rc = o.cont.rayCast(w.worldPosition,
|
11
|
12
|
o.cont.worldPosition,
|
12
|
13
|
dist = 0,
|
13
|
14
|
prop = 'collision',
|
|
@@ -17,73 +18,13 @@ def update_whiskers(self):
|
17
|
18
|
mask = 1)
|
18
|
19
|
|
19
|
20
|
self.whiskers[iter] = rc
|
20
|
|
-
|
21
|
21
|
iter += 1
|
22
|
22
|
iter = 0
|
|
23
|
+
|
|
24
|
+ #draw debug
|
23
|
25
|
for w in self.whiskers:
|
24
|
26
|
if w[0] is not None:
|
25
|
27
|
color = [1,0,0]
|
26
|
28
|
print(self.whiskers)
|
27
|
29
|
bge.render.drawLine(o.cont.worldPosition, self.whisker_objs[iter].worldPosition, color)
|
28
|
|
- iter += 1
|
29
|
|
-
|
30
|
|
- # wco = o.whisker_c_obj
|
31
|
|
- # wro = o.whisker_r_obj
|
32
|
|
- # wlo = o.whisker_l_obj
|
33
|
|
- # wc = o.whisker_c
|
34
|
|
- # wr = o.whisker_r
|
35
|
|
- # wl = o.whisker_l
|
36
|
|
-
|
37
|
|
- # cc = [0,0,1]
|
38
|
|
- # rc = [0,1,0]
|
39
|
|
- # lc = [0,1,0]
|
40
|
|
-
|
41
|
|
-
|
42
|
|
- # wc = o.cont.rayCast(wco.worldPosition,
|
43
|
|
- # o.cont.worldPosition,
|
44
|
|
- # dist = 0,
|
45
|
|
- # prop = 'collisionadf',
|
46
|
|
- # face = 0,
|
47
|
|
- # xray = 1,
|
48
|
|
- # poly = 0,
|
49
|
|
- # mask = 1)
|
50
|
|
-
|
51
|
|
-
|
52
|
|
- # wr = o.cont.rayCast(wro.worldPosition,
|
53
|
|
- # o.cont.worldPosition,
|
54
|
|
- # dist = 0,
|
55
|
|
- # prop = 'collision',
|
56
|
|
- # face = 0,
|
57
|
|
- # xray = 1,
|
58
|
|
- # poly = 0,
|
59
|
|
- # mask = 1)
|
60
|
|
-
|
61
|
|
-
|
62
|
|
- # wl = o.cont.rayCast(wlo.worldPosition,
|
63
|
|
- # o.cont.worldPosition,
|
64
|
|
- # dist = 0,
|
65
|
|
- # prop = 'collision',
|
66
|
|
- # face = 0,
|
67
|
|
- # xray = 1,
|
68
|
|
- # poly = 0,
|
69
|
|
- # mask = 1)
|
70
|
|
-
|
71
|
|
-
|
72
|
|
- # if wc[0]:
|
73
|
|
- # cc = [1,0,0]
|
74
|
|
- # if 'puck' in wc[0]:
|
75
|
|
- # cc = [1,1,0]
|
76
|
|
- # if wr[0]:
|
77
|
|
- # rc = [1,0,0]
|
78
|
|
- # if 'puck' in wr[0]:
|
79
|
|
- # cc = [1,1,0]
|
80
|
|
- # if wl[0]:
|
81
|
|
- # lc = [1,0,0]
|
82
|
|
- # if 'puck' in wl[0]:
|
83
|
|
- # cc = [1,1,0]
|
84
|
|
- # #print(wl[0])
|
85
|
|
-
|
86
|
|
- #bge.render.drawLine(o.cont.worldPosition, wco.worldPosition, cc)
|
87
|
|
- #bge.render.drawLine(o.cont.worldPosition, wlo.worldPosition, lc)
|
88
|
|
- #bge.render.drawLine(o.cont.worldPosition, wro.worldPosition, rc)
|
89
|
|
-
|
|
30
|
+ iter += 1
|