Skip to content

Commit

Permalink
[builder] Provide a set_camera_speed method
Browse files Browse the repository at this point in the history
Call it by default in the environment ctor, so the camera has a
reasonnable speed by default (reported by Marc Hanheide).
Part of #405
  • Loading branch information
Arnaud Degroote committed Jun 18, 2013
1 parent a422b5b commit cfb79d0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/morse/builder/environment.py
Expand Up @@ -45,6 +45,7 @@ def __init__(self, filename, fastmode = False):
base = Component('props', 'basics')
self.set_blender_object(bpymorse.get_object('Scene_Script_Holder'))
# Write the name of the 'environment file'
self.set_camera_speed(2.0)

def _write_multinode(self, node_name):
""" Configure this node according to its name
Expand Down Expand Up @@ -163,6 +164,14 @@ def set_camera_clip(self, clip_start=0.1, clip_end=100):
camera_fp.data.clip_start = clip_start
camera_fp.data.clip_end = clip_end

def set_camera_speed(self, speed):
""" Set the simulator's Camera speed
:param speed: desired speed of the camera, in meter by second.
"""
camera_fp = bpymorse.get_object('CameraFP')
camera_fp.game.properties['Speed'].value = speed

def create(self, name=None):
""" Generate the scene configuration and insert necessary objects
Expand Down

0 comments on commit cfb79d0

Please sign in to comment.