本文整理汇总了Python中morse.builder.creator.SensorCreator.rotate方法的典型用法代码示例。如果您正苦于以下问题:Python SensorCreator.rotate方法的具体用法?Python SensorCreator.rotate怎么用?Python SensorCreator.rotate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类morse.builder.creator.SensorCreator
的用法示例。
在下文中一共展示了SensorCreator.rotate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from morse.builder.creator import SensorCreator [as 别名]
# 或者: from morse.builder.creator.SensorCreator import rotate [as 别名]
def __init__(self, name=None):
SensorCreator.__init__(self, name)
self.camera = Camera("CameraRobot")
self.camera.name = "CameraRobot"
self.append(self.camera)
self.properties(cam_width = 256, cam_height = 256, cam_focal = 35.0,
capturing = True, Vertical_Flip = True)
# set the frequency to 20 Hz
self.frequency(20)
# add toggle capture action (`Space` key)
bpymorse.add_sensor(type="KEYBOARD")
obj = bpymorse.get_context_object()
sensor = obj.game.sensors[-1]
sensor.key = 'SPACE'
bpymorse.add_controller(type='LOGIC_AND')
controller = obj.game.controllers[-1]
bpymorse.add_actuator(type='PROPERTY')
actuator = obj.game.actuators[-1]
actuator.mode = 'TOGGLE'
actuator.property = 'capturing'
controller.link(sensor = sensor, actuator = actuator)
# looking in +X
SensorCreator.rotate(self, x=math.pi/2, z=math.pi/2)
# append CameraMesh with its textures
self.append_meshes(['CameraMesh'], "camera")
self.rotate(z=math.pi)
示例2: rotate
# 需要导入模块: from morse.builder.creator import SensorCreator [as 别名]
# 或者: from morse.builder.creator.SensorCreator import rotate [as 别名]
def rotate(self, x=0, y=0, z=0):
SensorCreator.rotate(self, x=y, y=z, z=x)