|
@@ -59,12 +59,12 @@ def main():
|
59
|
59
|
own['last_rot_z'] = 0
|
60
|
60
|
own['idlecampos_x'] = 0
|
61
|
61
|
own['speed_mult'] = 1.00
|
62
|
|
- controlcube['driving'] = False
|
|
62
|
+ controlcube['driving'] = False
|
|
63
|
+ dict['cur_ccH_min'] = dict['cam_walk_min']
|
|
64
|
+ dict['cur_ccH_max'] = dict['cam_walk_max']
|
|
65
|
+ cam.height = dict['cam_height']
|
63
|
66
|
acam = scene.active_camera
|
64
|
|
- focallength = dict['focal_length']
|
65
|
|
- cam1.lens = focallength
|
66
|
|
- cam2.lens = focallength
|
67
|
|
- cam3.lens = focallength
|
|
67
|
+
|
68
|
68
|
|
69
|
69
|
|
70
|
70
|
#if 1 == 1:
|
|
@@ -110,8 +110,8 @@ def main():
|
110
|
110
|
pass
|
111
|
111
|
controlcube['lastCamheight'] = cam.height
|
112
|
112
|
#########
|
113
|
|
- cam.min = dict['cam_min']
|
114
|
|
- cam.max = dict['cam_max']
|
|
113
|
+ #cam.min = dict['cam_min']
|
|
114
|
+ #cam.max = dict['cam_max']
|
115
|
115
|
cont.activate(own.actuators['Camera'])
|
116
|
116
|
########
|
117
|
117
|
|
|
@@ -240,33 +240,26 @@ def main():
|
240
|
240
|
if rot_y == 0 and own['last_rot_y'] != 0:
|
241
|
241
|
rot_y = own['last_rot_y'] * damping
|
242
|
242
|
|
243
|
|
-
|
244
|
243
|
move = [move_y, 0, move_x]
|
245
|
244
|
freecam.applyMovement( move, True)
|
246
|
245
|
freecam.applyMovement([0, 0, move_z], False)
|
247
|
246
|
freecam.applyRotation([rot_x, 0, 0],True)
|
248
|
247
|
freecam.applyRotation([0, 0, rot_y],False)
|
249
|
|
-
|
250
|
|
-# mult = .1 #* own['speed_mult']
|
251
|
|
-# if lBump == True and own['lBump'] == False:
|
252
|
|
-# if own['speed_mult'] > .1:
|
253
|
|
-# own['speed_mult'] = round(own['speed_mult'] - mult, 2)
|
254
|
|
-# if rBump == True and own['rBump'] == False:
|
255
|
|
-# if own['speed_mult'] < 5.5:
|
256
|
|
-# own['speed_mult'] = round(own['speed_mult'] + mult, 2)
|
257
|
|
-
|
258
|
|
-
|
|
248
|
+
|
259
|
249
|
|
260
|
250
|
################
|
261
|
251
|
#print(dict['walk'], 'walk')
|
262
|
252
|
multer = .02
|
263
|
253
|
if dict['walk'] == 1:
|
264
|
|
- if dict['cur_ccH_targetHeight'] < .8:
|
265
|
|
- dist = .8 - dict['cur_ccH_targetHeight']
|
|
254
|
+ if dict['cur_ccH_targetHeight'] < dict['cam_walk_height']:
|
|
255
|
+ dist = dict['cam_walk_height'] - dict['cur_ccH_targetHeight']
|
266
|
256
|
|
267
|
257
|
dict['cur_ccH_targetHeight'] = dict['cur_ccH_targetHeight'] + (dist * multer)
|
268
|
|
- if dict['cur_ccH_targetHeight'] > .799:
|
269
|
|
- dict['cur_ccH_targetHeight'] = .8
|
|
258
|
+ if dict['cur_ccH_targetHeight'] > dict['cam_walk_height']:
|
|
259
|
+ dict['cur_ccH_targetHeight'] = dict['cam_walk_height']
|
|
260
|
+
|
|
261
|
+ cam.min = dict['cam_walk_min']
|
|
262
|
+ cam.max = dict['cam_walk_max']
|
270
|
263
|
#ccH_targetHeight = .9
|
271
|
264
|
else:
|
272
|
265
|
|
|
@@ -299,15 +292,72 @@ def main():
|
299
|
292
|
camCube.localPosition.z += num
|
300
|
293
|
#if camHeightSet not in own:
|
301
|
294
|
if 1 == 1:
|
302
|
|
- #if ccheight != ccH_targetHeight:
|
303
|
295
|
num = ccH_targetHeight - ccheight
|
304
|
|
- #camCube.worldPosition.x = controlcube.worldPosition.x
|
305
|
|
- #camCube.worldPosition.y = controlcube.worldPosition.y
|
306
|
|
- #camCube.worldPosition.z = controlcube.worldPosition.z + num
|
307
|
296
|
else:
|
308
|
297
|
own['camHeightSet'] = True
|
309
|
298
|
|
310
|
299
|
if dict['npause'] == False:
|
311
|
300
|
cont.activate(own.actuators['Camera'])
|
312
|
|
- controlcube['camera'] = 0
|
|
301
|
+ controlcube['camera'] = 0
|
|
302
|
+
|
|
303
|
+ cur_lens = cam1.lens
|
|
304
|
+ cur_min = cam.min
|
|
305
|
+ cur_max = cam.max
|
|
306
|
+ #print(cur_lens)
|
|
307
|
+ inc = .025
|
|
308
|
+ if walk == 1:
|
|
309
|
+ #lens
|
|
310
|
+ if dict['walk_focal_length'] > cur_lens:
|
|
311
|
+ new_lens = cur_lens + inc
|
|
312
|
+ else:
|
|
313
|
+ new_lens = cur_lens - inc
|
|
314
|
+ if cur_lens > (dict['walk_focal_length'] - .1) and cur_lens < (dict['walk_focal_length'] + .1):
|
|
315
|
+ new_lens = dict['walk_focal_length']
|
|
316
|
+
|
|
317
|
+ #distance
|
|
318
|
+ inc = .025
|
|
319
|
+ if cur_min > (dict['cam_walk_min'] - inc):
|
|
320
|
+ new_min = cur_min - inc
|
|
321
|
+ if cur_min < (dict['cam_walk_min'] + inc):
|
|
322
|
+ new_min = cur_min + inc
|
|
323
|
+ if cur_max > (dict['cam_walk_max'] - inc):
|
|
324
|
+ new_max = cur_min - inc
|
|
325
|
+ if cur_max < (dict['cam_walk_max'] + inc):
|
|
326
|
+ new_max = cur_min + inc
|
|
327
|
+ else:
|
|
328
|
+ #lens
|
|
329
|
+ if dict['focal_length'] > cur_lens:
|
|
330
|
+ new_lens = cur_lens + inc
|
|
331
|
+ else:
|
|
332
|
+ new_lens = cur_lens - inc
|
|
333
|
+ if cur_lens > (dict['focal_length'] - .1) and cur_lens < (dict['focal_length'] + .1):
|
|
334
|
+ new_lens = dict['focal_length']
|
|
335
|
+
|
|
336
|
+ #distance
|
|
337
|
+ inc = .025
|
|
338
|
+ if cur_min > (dict['cam_min'] - inc):
|
|
339
|
+ new_min = cur_min - inc
|
|
340
|
+ if cur_min < (dict['cam_min'] + inc):
|
|
341
|
+ new_min = cur_min + inc
|
|
342
|
+ if cur_max > (dict['cam_max'] - inc):
|
|
343
|
+ new_max = cur_min - inc
|
|
344
|
+ if cur_max < (dict['cam_max'] + inc):
|
|
345
|
+ new_max = cur_min + inc
|
|
346
|
+
|
|
347
|
+
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
|
|
351
|
+ focallength = new_lens
|
|
352
|
+ cam1.lens = focallength
|
|
353
|
+ cam2.lens = focallength
|
|
354
|
+ cam3.lens = focallength
|
|
355
|
+ try:
|
|
356
|
+ cam.min = new_min
|
|
357
|
+ cam.max = new_max
|
|
358
|
+ #print(new_min, new_max)
|
|
359
|
+ except:
|
|
360
|
+ pass
|
|
361
|
+
|
|
362
|
+
|
313
|
363
|
main()
|