Skip to content

Commit

Permalink
--use new debugLineRenderer function for axes
Browse files Browse the repository at this point in the history
  • Loading branch information
jturner65 committed Dec 16, 2024
1 parent 3773f32 commit 9fec20c
Showing 1 changed file with 3 additions and 36 deletions.
39 changes: 3 additions & 36 deletions src_python/habitat_sim/utils/classes/object_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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):
Expand All @@ -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"):
"""
Expand Down

0 comments on commit 9fec20c

Please sign in to comment.