diff --git a/kubric/core/objects.py b/kubric/core/objects.py index cd06f665..5570425b 100644 --- a/kubric/core/objects.py +++ b/kubric/core/objects.py @@ -124,6 +124,7 @@ def __init__(self, position=(0., 0., 0.), quaternion=None, up="Y", front="-Z", look_at=None, euler=None, **kwargs): if look_at is not None: assert quaternion is None and euler is None + self.lookat = look_at quaternion = look_at_quat(position, look_at, up, front) elif euler is not None: assert look_at is None and quaternion is None @@ -137,6 +138,11 @@ def __init__(self, position=(0., 0., 0.), quaternion=None, def look_at(self, target): self.quaternion = look_at_quat(self.position, target, self.up, self.front) + def set_position(self, value): + self.position = value + self.look_at(self.lookat) + return None + @property def rotation_matrix(self): """ Returns the rotation matrix corresponding to self.quaternion."""