def square( recipients, delay, start, end, model_index, halo_index, start_frame, frame_rate, life, width, end_width, fade_length, amplitude, red, green, blue, alpha, speed): """Create a square by using _TempEntities.beam_points().""" if not isinstance(start, Vector) or not isinstance(end, Vector): raise TypeError('"start" and "end" must be Vector objects.') x1, y1, z1 = tuple(start) x2, y2, z2 = tuple(end) a = start b = Vector(x2, y2, z1) c = Vector(x1, y1, z2) d = end lines = ( (a, b), (b, d), (d, c), (c, a), ) for p1, p2 in lines: temp_entities.beam_points( recipients, delay, p1, p2, model_index, halo_index, start_frame, frame_rate, life, width, end_width, fade_length, amplitude, red, green, blue, alpha, speed)
def box( recipients, delay, start, end, model_index, halo_index, start_frame, frame_rate, life, width, end_width, fade_length, amplitude, red, green, blue, alpha, speed): """Create a box by using _TempEntities.beam_points().""" if not isinstance(start, Vector) or not isinstance(end, Vector): raise TypeError('"start" and "end" must be Vector objects.') x1, y1, z1 = tuple(start) x2, y2, z2 = tuple(end) a = start b = Vector(x2, y1, z1) c = Vector(x2, y1, z2) d = Vector(x1, y1, z2) e = Vector(x1, y2, z1) f = Vector(x2, y2, z1) h = Vector(x1, y2, z2) g = end lines = ( # First square (a, b), (b, c), (c, d), (d, a), # Second square (e, f), (f, g), (g, h), (h, e), # Connection between both squares (a, e), (b, f), (c, g), (d, h) ) for p1, p2 in lines: temp_entities.beam_points( recipients, delay, p1, p2, model_index, halo_index, start_frame, frame_rate, life, width, end_width, fade_length, amplitude, red, green, blue, alpha, speed)