Skip to content

Commit

Permalink
--fix adding object duplicates (should place them right above original)
Browse files Browse the repository at this point in the history
  • Loading branch information
jturner65 committed Sep 4, 2024
1 parent e346aa0 commit 0d131bb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src_python/habitat_sim/utils/classes/object_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 0d131bb

Please sign in to comment.