本文整理汇总了Python中Camera.reset方法的典型用法代码示例。如果您正苦于以下问题:Python Camera.reset方法的具体用法?Python Camera.reset怎么用?Python Camera.reset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Camera
的用法示例。
在下文中一共展示了Camera.reset方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Game
# 需要导入模块: import Camera [as 别名]
# 或者: from Camera import reset [as 别名]
#.........这里部分代码省略.........
def timer(self):
self.clock.tick()
def key_handler(self,keys):
self.camera.strafe = self.camera.forward = self.camera.up= 0
vel = 0.3
if pygame.key.get_pressed()[pygame.K_z]:
vel = 10
if keys[ord('a')]:
self.camera.MoveX(-vel)
if keys[ord('d')]:
self.camera.MoveX(vel)
if keys[ord('w')]:
self.camera.MoveZ(vel)
if keys[ord('s')]:
self.camera.MoveZ(-vel)
if keys[ord('q')]:
self.camera.Roll(-vel)
if keys[ord('e')]:
self.camera.Roll(vel)
if keys[K_UP]:
self.camera.Pitch(-vel)
if keys[K_DOWN]:
self.camera.Pitch(vel)
if keys[K_LEFT]:
self.camera.Yaw(-vel)
if keys[K_RIGHT]:
self.camera.Yaw(vel)
if keys[ord('r')]:
self.camera.reset()
if keys[K_SPACE]:
self.camera.MoveY(vel)
if keys[K_LSHIFT]:
self.camera.MoveY(-vel)
def mouse_handler(self,mouse):
pass
def event_handler(self,events):
for event in events:
if event.type == QUIT:
self.running = False
elif event.type == KEYDOWN:
if event.key == K_ESCAPE:
self.running = False
elif event.key == K_RETURN:
try:
print("return:",eval(input("Enter Command:\n")))
except:
print("Command failed")
else:
print("Command excuted")
elif event.key == K_1:
self.ID = 1
elif event.key == K_2:
self.ID = 2
elif event.key == K_3:
self.ID = 3
elif event.key == K_4:
self.ID = 4
elif event.key == K_5:
self.ID = 5