Snippet name : VisualRay Author : dberube4 (duh) Snippet : http://www.pasteall.org/38877/python Example : visualray.blend (467 KB) Description: Represents rays casted in the game engine at runtime (it do not cast the ray itself) .
Basically its just a drawline function that last for a set number of frames. Options (also in the snippet):
<b>start</b> ( 3-tuple (x, y, z) ): Coord where the ray starts
<b>end</b> ( 3-tuple (x, y, z) ): Coord where the ray ends
<b>life</b> ( int ): Number of frames the line will live (ex: With 200, 50 fps = 2 seconds). Default value : 200
<b>color</b> ( 3-tuple (r, g, b) ): The color of the line. Default value : (1,1,1) (white)
Yes. That would be possible.
I might also rewrite the entire script to be more memory wise.
Instead of using multiple classes, I could create a single debug class that store the lines to draw and the debug level.
Each line could have a debug property that shows whether they should be drawed or not.
I think I will use flags.