|
@@ -139,8 +139,8 @@ def main():
|
139
|
139
|
if rot >= 270 and rot < 315:
|
140
|
140
|
grindvect = "pos"
|
141
|
141
|
grindyvect = "neg"
|
142
|
|
- if rot >= 315: grindvect = "pos"
|
143
|
|
-
|
|
142
|
+ if rot >= 315:
|
|
143
|
+ grindvect = "pos"
|
144
|
144
|
if rot < 0 and rot >= -45:
|
145
|
145
|
grindvect = "pos"
|
146
|
146
|
if rot < -45 and rot >= -90:
|
|
@@ -218,7 +218,8 @@ def main():
|
218
|
218
|
|
219
|
219
|
#z align
|
220
|
220
|
#print("zalign")
|
221
|
|
- player.alignAxisToVect(grinder_vectz, 2, .15)
|
|
221
|
+ stre = .15
|
|
222
|
+ player.alignAxisToVect(grinder_vectz, 2, stre)
|
222
|
223
|
|
223
|
224
|
if rot >= 0 and rot < 45:
|
224
|
225
|
player.alignAxisToVect(grinder_vect, 0, align_strength)
|
|
@@ -226,173 +227,126 @@ def main():
|
226
|
227
|
#player.applyForce([0, 0, 0], True)
|
227
|
228
|
player.setLinearVelocity([velxb, 0.0, zvel], 1)
|
228
|
229
|
grindpos = "reg_5050"
|
|
230
|
+ print("50-1")
|
229
|
231
|
|
230
|
232
|
|
231
|
|
- if rot >= 45 and rot < 90:
|
232
|
|
- #90 degrees CW about z-axis: (x, y, z) -> (y, -x, z)
|
233
|
|
- #90 degrees CCW about z-axis: (x, y, z) -> (-y, x, z)
|
234
|
|
- #grinder_vect2 =
|
235
|
|
- player.alignAxisToVect([-grinder_vect.y, grinder_vect.x, grinder_vect.z], 0, align_strength)
|
236
|
|
- #print("1")
|
|
233
|
+ elif rot >= 45 and rot < 90:
|
|
234
|
+ player.alignAxisToVect([-grinder_vect.y, grinder_vect.x, 0], 0, align_strength)
|
237
|
235
|
grindvect = "pos"
|
238
|
|
- #player.applyRotation(bsrot, 1)
|
239
|
|
- align = "pos"
|
240
|
|
- #player.applyForce([0, 0, 0], True)
|
|
236
|
+ align = "pos"
|
241
|
237
|
player.setLinearVelocity([0, convely, zvel], 1)
|
242
|
238
|
grindpos = "reg_board"
|
243
|
239
|
grindyvect = "pos"
|
244
|
240
|
#print("bs1, don't switch")
|
245
|
|
- #print("boardslide")
|
246
|
241
|
|
247
|
|
- if rot >= 90 and rot < 135:
|
248
|
|
- #print(STANCE, "2")
|
|
242
|
+ elif rot >= 90 and rot < 135:
|
249
|
243
|
grinder_vect = grinder_vect * -1
|
250
|
|
- player.alignAxisToVect([grinder_vect.y, -grinder_vect.x, grinder_vect.z], 0, align_strength)
|
|
244
|
+ player.alignAxisToVect([grinder_vect.y, -grinder_vect.x, 0], 0, align_strength)
|
251
|
245
|
grindvect = "neg"
|
252
|
|
- #print("2")
|
253
|
|
- #player.applyRotation(negbsrot, 1)
|
254
|
246
|
align = "neg"
|
255
|
247
|
grindyvect = "neg"
|
256
|
|
- #player.applyForce([0, 0, 0], True)
|
257
|
248
|
player.setLinearVelocity([0, convely, zvel], 1)
|
258
|
249
|
grindpos = "reg_board"
|
259
|
250
|
#print("-bs2, don't switch?")
|
260
|
|
- #print("boardslide")
|
261
|
251
|
|
262
|
|
- if rot >= 135 and rot < 180:
|
|
252
|
+ elif rot >= 135 and rot < 180:
|
263
|
253
|
player.alignAxisToVect(-grinder_vect, 0, align_strength)
|
264
|
254
|
grindvect = "neg"
|
265
|
|
- #player.applyForce([0, 0, 0], True)
|
266
|
255
|
player.setLinearVelocity([velxb, 0.0, zvel], 1)
|
267
|
256
|
grindpos = "reg_5050"
|
|
257
|
+ #print("50-2")
|
268
|
258
|
|
269
|
|
- if rot >= 180 and rot < 225:
|
|
259
|
+ elif rot >= 180 and rot < 225:
|
270
|
260
|
player.alignAxisToVect(-grinder_vect, 0, align_strength)
|
271
|
261
|
grindvect = "neg"
|
272
|
|
- #player.applyForce([0, 0, 0], True)
|
273
|
262
|
player.setLinearVelocity([velxb, 0.0, zvel], 1)
|
274
|
263
|
grindpos = "reg_5050"
|
|
264
|
+ #print("50-3")
|
275
|
265
|
|
276
|
|
- if rot >= 225 and rot < 270:
|
277
|
|
- #print(STANCE, "3")
|
278
|
|
- #grinder_vect = grinder_vect * -1
|
279
|
|
- player.alignAxisToVect([grinder_vect.y, -grinder_vect.x, grinder_vect.z], 0, align_strength)
|
280
|
|
- #print("3")
|
|
266
|
+ elif rot >= 225 and rot < 270:
|
|
267
|
+ player.alignAxisToVect([grinder_vect.y, -grinder_vect.x, 0], 0, align_strength)
|
281
|
268
|
grindvect = "neg"
|
282
|
|
- #player.applyRotation(bsrot, 1)
|
283
|
269
|
align = "pos"
|
284
|
|
- #player.applyForce([0, 0, 0], True)
|
285
|
270
|
player.setLinearVelocity([0, convely, zvel], 1)
|
286
|
271
|
grindpos = "reg_board"
|
287
|
272
|
grindyvect = "pos"
|
288
|
|
- print("bs3")
|
289
|
|
- #print("boardslide")
|
|
273
|
+ #print("bs3")
|
290
|
274
|
|
291
|
|
- if rot >= 270 and rot < 315:
|
292
|
|
- #print(STANCE, "4")
|
293
|
|
- player.alignAxisToVect([grinder_vect.y, -grinder_vect.x, grinder_vect.z], 0, align_strength)
|
294
|
|
- grindvect = "pos"
|
295
|
|
- #player.applyRotation(negbsrot, 1)
|
296
|
|
- #print("4")
|
|
275
|
+ elif rot >= 270 and rot < 315:
|
|
276
|
+ player.alignAxisToVect([grinder_vect.y, -grinder_vect.x, 0], 0, align_strength)
|
|
277
|
+ grindvect = "pos"
|
297
|
278
|
align = "neg"
|
298
|
|
- #player.applyForce([0, 0, 0], True)
|
299
|
279
|
player.setLinearVelocity([0, convely, zvel], 1)
|
300
|
280
|
grindpos = "reg_board"
|
301
|
281
|
grindyvect = "neg"
|
302
|
|
- #print("-bs4")
|
303
|
|
- #print("boardslide")
|
|
282
|
+ #print("-bs4")
|
304
|
283
|
|
305
|
|
- if rot >= 315:
|
|
284
|
+ elif rot >= 315:
|
306
|
285
|
player.alignAxisToVect(grinder_vect, 0, align_strength)
|
307
|
286
|
grindvect = "pos"
|
308
|
|
- #player.applyForce([0, 0, 0], True)
|
309
|
287
|
player.setLinearVelocity([velxb, 0.0, zvel], 1)
|
310
|
288
|
grindpos = "reg_5050"
|
|
289
|
+ #print("50-4")
|
311
|
290
|
|
312
|
291
|
#-------------------------------------------------------------
|
313
|
|
- if rot < 0 and rot >= -45:
|
|
292
|
+ elif rot < 0 and rot >= -45:
|
314
|
293
|
player.alignAxisToVect(grinder_vect, 0, align_strength)
|
315
|
294
|
grindvect = "pos"
|
316
|
|
- #player.applyForce([0, 0, 0], True)
|
317
|
295
|
player.setLinearVelocity([velxb, 0.0, zvel], 1)
|
318
|
|
- grindpos = "reg_5050"
|
319
|
|
-
|
320
|
|
- if rot < -45 and rot >= -90:
|
321
|
|
- #print(STANCE, "5")
|
|
296
|
+ grindpos = "reg_5050"
|
|
297
|
+ #print("50-5")
|
|
298
|
+ elif rot < -45 and rot >= -90:
|
322
|
299
|
grinder_vect = grinder_vect * -1
|
323
|
|
- player.alignAxisToVect([-grinder_vect.y, grinder_vect.x, grinder_vect.z], 0, align_strength)
|
|
300
|
+ player.alignAxisToVect([-grinder_vect.y, grinder_vect.x, 0], 0, align_strength)
|
324
|
301
|
grindvect = "pos"
|
325
|
|
- #player.applyRotation(negbsrot, 1)
|
326
|
|
- #print("5")
|
327
|
302
|
align = "neg"
|
328
|
|
- #player.applyForce([0, 0, 0], True)
|
329
|
303
|
player.setLinearVelocity([0, convely, zvel], 1)
|
330
|
304
|
grindpos = "reg_board"
|
331
|
305
|
#print("-bs5")
|
332
|
|
- #print("boardslide")
|
333
|
|
-
|
334
|
306
|
grindyvect = "neg"
|
335
|
|
- if rot < -90 and rot >= -135:
|
336
|
|
- #print(STANCE, "6")
|
337
|
|
- #grinder_vect = grinder_vect * -1
|
338
|
|
- player.alignAxisToVect([grinder_vect.y, -grinder_vect.x, grinder_vect.z], 0, align_strength)
|
|
307
|
+ elif rot < -90 and rot >= -135:
|
|
308
|
+ player.alignAxisToVect([grinder_vect.y, -grinder_vect.x, 0], 0, align_strength)
|
339
|
309
|
grindvect = "neg"
|
340
|
|
- #print("6")
|
341
|
|
- #player.applyRotation(bsrot, 1)
|
342
|
310
|
align = "pos"
|
343
|
|
- #player.applyForce([0, 0, 0], True)
|
344
|
311
|
player.setLinearVelocity([0, convely, zvel], 1)
|
345
|
312
|
grindpos = "reg_board"
|
346
|
313
|
grindyvect = "pos"
|
347
|
|
- #print("bs6")
|
348
|
|
- #print("boardslide")
|
349
|
|
-
|
350
|
|
- if rot < -135 and rot >= -180:
|
|
314
|
+ #print("bs6")
|
|
315
|
+ elif rot < -135 and rot >= -180:
|
351
|
316
|
player.alignAxisToVect(-grinder_vect, 0, align_strength)
|
352
|
317
|
grindvect = "neg"
|
353
|
|
- #player.applyForce([0, 0, 0], True)
|
354
|
318
|
player.setLinearVelocity([velxb, 0.0, zvel], 1)
|
355
|
319
|
grindpos = "reg_5050"
|
356
|
|
-
|
357
|
|
- if rot < -180 and rot >= -225:
|
|
320
|
+ #print("50-6")
|
|
321
|
+ elif rot < -180 and rot >= -225:
|
358
|
322
|
player.alignAxisToVect(-grinder_vect, 0, align_strength)
|
359
|
323
|
grindvect = "neg"
|
360
|
|
- #player.applyForce([0, 0, 0], True)
|
361
|
324
|
player.setLinearVelocity([velxb, 0.0, zvel], 1)
|
362
|
325
|
grindpos = "reg_5050"
|
363
|
|
- if rot < -225 and rot >= -270:
|
364
|
|
- #print(STANCE, "7")
|
|
326
|
+ #print("50-7")
|
|
327
|
+ elif rot < -225 and rot >= -270:
|
365
|
328
|
grinder_vect = grinder_vect * -1
|
366
|
|
- player.alignAxisToVect([grinder_vect.y, -grinder_vect.x, grinder_vect.z], 0, align_strength)
|
|
329
|
+ player.alignAxisToVect([grinder_vect.y, -grinder_vect.x, 0], 0, align_strength)
|
367
|
330
|
grindvect = "neg"
|
368
|
|
- #player.applyRotation(negbsrot, 1)
|
369
|
|
- #print("7")
|
370
|
331
|
align = "neg"
|
371
|
|
- #player.applyForce([0, 0, 0], True)
|
372
|
332
|
player.setLinearVelocity([0, convely, zvel], 1)
|
373
|
333
|
grindpos = "reg_board"
|
374
|
334
|
grindyvect = "neg"
|
375
|
|
- #print("-bs7")
|
376
|
|
- #print("boardslide")
|
377
|
|
- if rot < -270 and rot >= -315:
|
378
|
|
- #print(STANCE, "8")
|
379
|
|
- player.alignAxisToVect([-grinder_vect.y, grinder_vect.x, grinder_vect.z], 0, align_strength)
|
|
335
|
+ #print("-bs7")
|
|
336
|
+ elif rot < -270 and rot >= -315:
|
|
337
|
+ player.alignAxisToVect([-grinder_vect.y, grinder_vect.x, 0], 0, align_strength)
|
380
|
338
|
grindvect = "pos"
|
381
|
|
- #player.applyRotation(bsrot, 1)
|
382
|
|
- #print("8")
|
383
|
339
|
align = "pos"
|
384
|
|
- #player.applyForce([0, 0, 0], True)
|
385
|
340
|
player.setLinearVelocity([0, convely, zvel], 1)
|
386
|
341
|
grindpos = "reg_board"
|
387
|
342
|
grindyvect = "pos"
|
388
|
|
- #print("bs8")
|
389
|
|
- #print("boardslide")
|
390
|
|
- if rot < -315:
|
|
343
|
+ #print("bs8")
|
|
344
|
+ elif rot < -315:
|
391
|
345
|
player.alignAxisToVect(grinder_vect, 0, align_strength)
|
392
|
346
|
grindvect = "pos"
|
393
|
|
- #player.applyForce([0, 0, 0], True)
|
394
|
347
|
player.setLinearVelocity([velxb, 0.0, zvel], 1)
|
395
|
348
|
grindpos = "reg_5050"
|
|
349
|
+ #print("50-8")
|
396
|
350
|
|
397
|
351
|
own['grindpos'] = grindpos
|
398
|
352
|
own['grindvect'] = grindvect
|
|
@@ -451,7 +405,8 @@ def main():
|
451
|
405
|
player_rotz = math.degrees(player_e[2])
|
452
|
406
|
grinder_e = obj.worldOrientation.to_euler()
|
453
|
407
|
grinder_rotz = math.degrees(grinder_e[2])
|
454
|
|
- deltamove = delta[2] * .3#.25
|
|
408
|
+ deltamove = delta[2] * .3
|
|
409
|
+ #print(round(deltamove, 4), "deltamove")
|
455
|
410
|
#5050
|
456
|
411
|
if own["grindpos"] == "reg_5050":
|
457
|
412
|
#print("missing delta")
|
|
@@ -558,9 +513,11 @@ def main():
|
558
|
513
|
if grindTouch.positive:
|
559
|
514
|
nearpos = nearestObject.worldPosition
|
560
|
515
|
if hitNormal != None:
|
561
|
|
- own.alignAxisToVect(hitNormal, 2, .05)
|
|
516
|
+ stre = .05
|
|
517
|
+ own.alignAxisToVect(hitNormal, 2, stre)
|
562
|
518
|
print("align")
|
563
|
519
|
own.worldPosition = [nearpos.x, nearpos.y, nearpos.z + .2975]
|
|
520
|
+ print('moving world')
|
564
|
521
|
|
565
|
522
|
grindold = True
|
566
|
523
|
own['grindold_timer'] = 0
|