def create(parent: NodePath, node: Node) -> NodePath: """Create node for given node and attach it to the parent.""" geom = _generate_mesh(node) node_ = GeomNode(str(node.id)) node_.add_geom(geom) node_.adjust_draw_mask(0x00000000, 0x00010000, 0xfffeffff) node_path = parent.attach_new_node(node_) node_path.set_texture(textures.get('intersection')) return node_path
def create(parent: NodePath, way: Way) -> NodePath: """Create node for given way and attach it to the parent.""" geom = _generate_mesh(way) node = GeomNode(str(way.id)) node.add_geom(geom) node.adjust_draw_mask(0x00000000, 0x00010000, 0xfffeffff) node_path = parent.attach_new_node(node) node_path.set_texture(textures.get('road'), 1) return node_path
def create(parent: NodePath, path: Path) -> NodePath: """Create node for given path and attach it to the parent.""" points = path.oriented_points() if len(points) >= 2: geom = _generate_mesh(points) node = GeomNode('path') node.add_geom(geom) node.adjust_draw_mask(0x00000000, 0x00010000, 0xfffeffff) node_path = parent.attach_new_node(node) node_path.set_light_off() # Setting depth write to false solves the problem of this big flat # polygon obscuring other semi-transparent things (like the lane # connections card) depending on the camera angle. See: # https://docs.panda3d.org/1.10/python/programming/texturing/transparency-and-blending node_path.set_depth_write(False) node_path.set_transparency(TransparencyAttrib.M_alpha) else: node_path = None return node_path