From 9fec20ccffdf727df69bbbdac5040e36f0a1ada0 Mon Sep 17 00:00:00 2001 From: John Turner <7strbass@gmail.com> Date: Fri, 22 Nov 2024 11:49:32 -0500 Subject: [PATCH] --use new debugLineRenderer function for axes --- .../utils/classes/object_editor.py | 39 ++----------------- 1 file changed, 3 insertions(+), 36 deletions(-) diff --git a/src_python/habitat_sim/utils/classes/object_editor.py b/src_python/habitat_sim/utils/classes/object_editor.py index b2182f9da4..e74c2bf83e 100644 --- a/src_python/habitat_sim/utils/classes/object_editor.py +++ b/src_python/habitat_sim/utils/classes/object_editor.py @@ -873,36 +873,6 @@ def change_draw_box_types(self, toggle: bool): % ObjectEditor.ObjectTypeToDraw.NUM_VALS.value ) - def _draw_coordinate_axes(self, loc: mn.Vector3, debug_line_render): - # draw global coordinate axis - debug_line_render.draw_transformed_line( - loc - mn.Vector3.x_axis(), loc + mn.Vector3.x_axis(), mn.Color4.red() - ) - debug_line_render.draw_transformed_line( - loc - mn.Vector3.y_axis(), loc + mn.Vector3.y_axis(), mn.Color4.green() - ) - debug_line_render.draw_transformed_line( - loc - mn.Vector3.z_axis(), loc + mn.Vector3.z_axis(), mn.Color4.blue() - ) - debug_line_render.draw_circle( - loc + mn.Vector3.x_axis() * 0.95, - radius=0.05, - color=mn.Color4.red(), - normal=mn.Vector3.x_axis(), - ) - debug_line_render.draw_circle( - loc + mn.Vector3.y_axis() * 0.95, - radius=0.05, - color=mn.Color4.green(), - normal=mn.Vector3.y_axis(), - ) - debug_line_render.draw_circle( - loc + mn.Vector3.z_axis() * 0.95, - radius=0.05, - color=mn.Color4.blue(), - normal=mn.Vector3.z_axis(), - ) - def _draw_selected_obj(self, obj, debug_line_render, box_color): """ Draw a selection box around and axis frame at the origin of a single object @@ -924,9 +894,8 @@ def draw_selected_objects(self, debug_line_render): debug_line_render=debug_line_render, box_color=mn.Color4.yellow(), ) - self._draw_coordinate_axes( - sel_obj.translation, debug_line_render=debug_line_render - ) + debug_line_render.draw_axes(sel_obj.translation) + mag_color = mn.Color4.magenta() # draw all but last/target object for i in range(len(obj_list) - 1): @@ -935,9 +904,7 @@ def draw_selected_objects(self, debug_line_render): self._draw_selected_obj( obj, debug_line_render=debug_line_render, box_color=mag_color ) - self._draw_coordinate_axes( - obj.translation, debug_line_render=debug_line_render - ) + debug_line_render.draw_axes(obj.translation) def draw_box_around_objs(self, debug_line_render, agent_name: str = "hab_spot"): """