def __init__(self, TOOL=None, PARENT_NODE=None, VIEW_CONTEXT=None, TOOL_THICKNESS=0.01): # call base-class constructor ToolResource.__init__(self, TOOL=TOOL, PARENT_NODE=PARENT_NODE, VIEW_CONTEXT=VIEW_CONTEXT) ### further resources ### ## init flashlight geometries self.cursor_geometry = builtins.TRIMESH_LOADER.create_geometry_from_file( "light_cursor_geometry", "data/objects/cube.obj", avango.gua.LoaderFlags.DEFAULTS) self.cursor_geometry.Material.value.set_uniform("Emissivity", 0.5) self.cursor_geometry.ShadowMode.value = 0 # disable for shadowing ToolResource.get_node(self).Children.value.append(self.cursor_geometry) ### set further initial states ### self.set_color(COLOR=self.VIEW_CONTEXT.get_color()) self.set_thickness(TOOL_THICKNESS)
def __init__( self , TOOL = None , PARENT_NODE = None , VIEW_CONTEXT = None , TOOL_THICKNESS = 0.01 ): # call base-class constructor ToolResource.__init__( self , TOOL = TOOL , PARENT_NODE = PARENT_NODE , VIEW_CONTEXT = VIEW_CONTEXT ) ### further resources ### ## init flashlight geometries self.cursor_geometry = builtins.TRIMESH_LOADER.create_geometry_from_file("light_cursor_geometry", "data/objects/cube.obj", avango.gua.LoaderFlags.DEFAULTS) self.cursor_geometry.Material.value.set_uniform("Emissivity", 0.5) self.cursor_geometry.ShadowMode.value = 0 # disable for shadowing ToolResource.get_node(self).Children.value.append(self.cursor_geometry) ### set further initial states ### self.set_color(COLOR = self.VIEW_CONTEXT.get_color()) self.set_thickness(TOOL_THICKNESS)
def set_color(self, COLOR = avango.gua.Color(), VIEW_ID = None): if VIEW_ID is None: ToolResource.set_color(self, COLOR) # call base-class function self.cursor_geometry.Material.value.set_uniform("Color", avango.gua.Vec4(self.color.r, self.color.g, self.color.b, 1.0)) else: # set view dependant color self.cursor_geometry.Material.value.set_view_uniform("Color", avango.gua.Vec4(COLOR.r, COLOR.g, COLOR.b, 1.0), VIEW_ID)
def set_color(self, COLOR=avango.gua.Color(), VIEW_ID=None): if VIEW_ID is None: ToolResource.set_color(self, COLOR) # call base-class function self.cursor_geometry.Material.value.set_uniform( "Color", avango.gua.Vec4(self.color.r, self.color.g, self.color.b, 1.0)) else: # set view dependant color self.cursor_geometry.Material.value.set_view_uniform( "Color", avango.gua.Vec4(COLOR.r, COLOR.g, COLOR.b, 1.0), VIEW_ID)