From acc423c3ead0b649dc1e85fe21e8d6ea487e41fb Mon Sep 17 00:00:00 2001 From: John Turner <7strbass@gmail.com> Date: Wed, 4 Sep 2024 11:12:56 -0400 Subject: [PATCH] --fix adding object duplicates (should place them right above original) --- src_python/habitat_sim/utils/classes/object_editor.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src_python/habitat_sim/utils/classes/object_editor.py b/src_python/habitat_sim/utils/classes/object_editor.py index a910475c35..5e768b2ea0 100644 --- a/src_python/habitat_sim/utils/classes/object_editor.py +++ b/src_python/habitat_sim/utils/classes/object_editor.py @@ -802,10 +802,15 @@ def build_objects(self, navmesh_dirty: bool, build_loc: mn.Vector3): if new_obj is not None: # set new object location to be above location of copied object new_obj_translation = mn.Vector3(0.0, 1.0, 0.0) + # set new object rotation to match copied object's rotation + new_obj_rotation = obj.rotation * new_obj.rotation.inverted() new_obj.motion_type = obj.motion_type # move new object to appropriate location new_navmesh_dirty = self._move_one_object( - new_obj, navmesh_dirty, new_obj_translation + new_obj, + navmesh_dirty, + translation=new_obj_translation, + rotation=new_obj_rotation, ) navmesh_dirty = new_navmesh_dirty or navmesh_dirty res_objs.append(new_obj)