|
@@ -43,7 +43,7 @@ def main():
|
43
|
43
|
#print(roty)
|
44
|
44
|
roty = abs(roty)
|
45
|
45
|
sub = 0
|
46
|
|
- align_strength = 1
|
|
46
|
+ align_strength = .4
|
47
|
47
|
align_strength2 = .3
|
48
|
48
|
touched = grindTouch.triggered
|
49
|
49
|
lgf = own['last_grind_frame']
|
|
@@ -218,10 +218,13 @@ def main():
|
218
|
218
|
|
219
|
219
|
|
220
|
220
|
if rot >= 45 and rot < 90:
|
221
|
|
- #90 degrees CW about z-axis: (x, y, z) -> (y, -x, z)
|
222
|
|
- player.alignAxisToVect(grinder_vect, 0, align_strength)
|
|
221
|
+ #90 degrees CW about z-axis: (x, y, z) -> (y, -x, z)
|
|
222
|
+ #90 degrees CCW about z-axis: (x, y, z) -> (-y, x, z)
|
|
223
|
+ #grinder_vect2 =
|
|
224
|
+ player.alignAxisToVect([-grinder_vect.y, grinder_vect.x, grinder_vect.z], 0, align_strength)
|
|
225
|
+ #print("1")
|
223
|
226
|
grindvect = "pos"
|
224
|
|
- player.applyRotation(bsrot, 1)
|
|
227
|
+ #player.applyRotation(bsrot, 1)
|
225
|
228
|
align = "pos"
|
226
|
229
|
#player.applyForce([0, 0, 0], True)
|
227
|
230
|
player.setLinearVelocity([0, convely, zvel], 1)
|
|
@@ -231,10 +234,12 @@ def main():
|
231
|
234
|
#print("boardslide")
|
232
|
235
|
|
233
|
236
|
if rot >= 90 and rot < 135:
|
234
|
|
- #print(STANCE, "2")
|
235
|
|
- player.alignAxisToVect(-grinder_vect, 0, align_strength)
|
|
237
|
+ #print(STANCE, "2")
|
|
238
|
+ grinder_vect = grinder_vect * -1
|
|
239
|
+ player.alignAxisToVect([grinder_vect.y, -grinder_vect.x, grinder_vect.z], 0, align_strength)
|
236
|
240
|
grindvect = "neg"
|
237
|
|
- player.applyRotation(negbsrot, 1)
|
|
241
|
+ #print("2")
|
|
242
|
+ #player.applyRotation(negbsrot, 1)
|
238
|
243
|
align = "neg"
|
239
|
244
|
grindyvect = "neg"
|
240
|
245
|
#player.applyForce([0, 0, 0], True)
|
|
@@ -259,9 +264,11 @@ def main():
|
259
|
264
|
|
260
|
265
|
if rot >= 225 and rot < 270:
|
261
|
266
|
#print(STANCE, "3")
|
262
|
|
- player.alignAxisToVect(-grinder_vect, 0, align_strength)
|
|
267
|
+ #grinder_vect = grinder_vect * -1
|
|
268
|
+ player.alignAxisToVect([grinder_vect.y, -grinder_vect.x, grinder_vect.z], 0, align_strength)
|
|
269
|
+ #print("3")
|
263
|
270
|
grindvect = "neg"
|
264
|
|
- player.applyRotation(bsrot, 1)
|
|
271
|
+ #player.applyRotation(bsrot, 1)
|
265
|
272
|
align = "pos"
|
266
|
273
|
#player.applyForce([0, 0, 0], True)
|
267
|
274
|
player.setLinearVelocity([0, convely, zvel], 1)
|
|
@@ -272,9 +279,10 @@ def main():
|
272
|
279
|
|
273
|
280
|
if rot >= 270 and rot < 315:
|
274
|
281
|
#print(STANCE, "4")
|
275
|
|
- player.alignAxisToVect(grinder_vect, 0, align_strength)
|
|
282
|
+ player.alignAxisToVect([-grinder_vect.y, grinder_vect.x, grinder_vect.z], 0, align_strength)
|
276
|
283
|
grindvect = "pos"
|
277
|
|
- player.applyRotation(negbsrot, 1)
|
|
284
|
+ #player.applyRotation(negbsrot, 1)
|
|
285
|
+ #print("4")
|
278
|
286
|
align = "neg"
|
279
|
287
|
#player.applyForce([0, 0, 0], True)
|
280
|
288
|
player.setLinearVelocity([0, convely, zvel], 1)
|
|
@@ -300,9 +308,11 @@ def main():
|
300
|
308
|
|
301
|
309
|
if rot < -45 and rot >= -90:
|
302
|
310
|
#print(STANCE, "5")
|
303
|
|
- player.alignAxisToVect(grinder_vect, 0, align_strength)
|
|
311
|
+ grinder_vect = grinder_vect * -1
|
|
312
|
+ player.alignAxisToVect([-grinder_vect.y, grinder_vect.x, grinder_vect.z], 0, align_strength)
|
304
|
313
|
grindvect = "pos"
|
305
|
|
- player.applyRotation(negbsrot, 1)
|
|
314
|
+ #player.applyRotation(negbsrot, 1)
|
|
315
|
+ #print("5")
|
306
|
316
|
align = "neg"
|
307
|
317
|
#player.applyForce([0, 0, 0], True)
|
308
|
318
|
player.setLinearVelocity([0, convely, zvel], 1)
|
|
@@ -313,9 +323,11 @@ def main():
|
313
|
323
|
grindyvect = "neg"
|
314
|
324
|
if rot < -90 and rot >= -135:
|
315
|
325
|
#print(STANCE, "6")
|
316
|
|
- player.alignAxisToVect(-grinder_vect, 0, align_strength)
|
|
326
|
+ #grinder_vect = grinder_vect * -1
|
|
327
|
+ player.alignAxisToVect([grinder_vect.y, -grinder_vect.x, grinder_vect.z], 0, align_strength)
|
317
|
328
|
grindvect = "neg"
|
318
|
|
- player.applyRotation(bsrot, 1)
|
|
329
|
+ #print("6")
|
|
330
|
+ #player.applyRotation(bsrot, 1)
|
319
|
331
|
align = "pos"
|
320
|
332
|
#player.applyForce([0, 0, 0], True)
|
321
|
333
|
player.setLinearVelocity([0, convely, zvel], 1)
|
|
@@ -339,9 +351,11 @@ def main():
|
339
|
351
|
grindpos = "reg_5050"
|
340
|
352
|
if rot < -225 and rot >= -270:
|
341
|
353
|
#print(STANCE, "7")
|
342
|
|
- player.alignAxisToVect(-grinder_vect, 0, align_strength)
|
|
354
|
+ grinder_vect = grinder_vect * -1
|
|
355
|
+ player.alignAxisToVect([grinder_vect.y, -grinder_vect.x, grinder_vect.z], 0, align_strength)
|
343
|
356
|
grindvect = "neg"
|
344
|
|
- player.applyRotation(negbsrot, 1)
|
|
357
|
+ #player.applyRotation(negbsrot, 1)
|
|
358
|
+ #print("7")
|
345
|
359
|
align = "neg"
|
346
|
360
|
#player.applyForce([0, 0, 0], True)
|
347
|
361
|
player.setLinearVelocity([0, convely, zvel], 1)
|
|
@@ -351,9 +365,10 @@ def main():
|
351
|
365
|
#print("boardslide")
|
352
|
366
|
if rot < -270 and rot >= -315:
|
353
|
367
|
#print(STANCE, "8")
|
354
|
|
- player.alignAxisToVect(grinder_vect, 0, align_strength)
|
|
368
|
+ player.alignAxisToVect([-grinder_vect.y, grinder_vect.x, grinder_vect.z], 0, align_strength)
|
355
|
369
|
grindvect = "pos"
|
356
|
|
- player.applyRotation(bsrot, 1)
|
|
370
|
+ #player.applyRotation(bsrot, 1)
|
|
371
|
+ #print("8")
|
357
|
372
|
align = "pos"
|
358
|
373
|
#player.applyForce([0, 0, 0], True)
|
359
|
374
|
player.setLinearVelocity([0, convely, zvel], 1)
|
|
@@ -570,13 +585,13 @@ def main():
|
570
|
585
|
hitObject, hitPoint, hitNormal = own.rayCast(nearestObject.worldPosition, own.worldPosition, .0, 'grind')
|
571
|
586
|
if grindold == 0:
|
572
|
587
|
if grindTouch.positive:
|
573
|
|
- print("set grind pos")
|
|
588
|
+ #print("set grind pos")
|
574
|
589
|
nearpos = nearestObject.worldPosition
|
575
|
590
|
if hitNormal != None:
|
576
|
|
- own.alignAxisToVect(hitNormal, 2, 1)
|
|
591
|
+ own.alignAxisToVect(hitNormal, 2, .05)
|
577
|
592
|
print("align")
|
578
|
|
- #own.worldPosition = [nearpos.x, nearpos.y, nearpos.z + .2975]
|
579
|
|
- print("setting pos")
|
|
593
|
+ own.worldPosition = [nearpos.x, nearpos.y, nearpos.z + .2975]
|
|
594
|
+ #print("setting pos")
|
580
|
595
|
|
581
|
596
|
#if hitNormal != None:
|
582
|
597
|
#own.alignAxisToVect(hitNormal, 2, .4)
|
|
@@ -592,7 +607,7 @@ def main():
|
592
|
607
|
grind_height_dif = (own.worldPosition[2] - nearestObject.worldPosition[2]) - .287
|
593
|
608
|
#print(grind_height_dif)
|
594
|
609
|
worldPos = own.worldPosition
|
595
|
|
- if grind_height_dif > -.02:
|
|
610
|
+ if grind_height_dif > -.02:#02:
|
596
|
611
|
#print("############################upping z")
|
597
|
612
|
#own.worldPosition = [worldPos.x, worldPos.y, worldPos.z + .1]
|
598
|
613
|
|