Primitives (quads, elipse, line, etc)
by Alex Parker · in Torque Game Builder · 04/03/2005 (9:52 pm) · 8 replies
I assume that somewhere in the code is a place for creating vertex lists that can be used to construct primitives, because you can set debug mode to display the collision poly's right? Is there any way to access this via script? If not, where should I look at the engine source to gain access to these functions, if possible?
Cheers
Cheers
#2
Hope you find a way to use them.
04/04/2005 (3:48 am)
Oh yeah, would be very useful. Just the 2D lines would be great, for debugging information and such.Hope you find a way to use them.
#3
[url=http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=2982][/url]
04/04/2005 (5:42 am)
You should be able to use the consoleFunction() macro to expose these to script.[url=http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=2982][/url]
#4
So basically, the bit should parse the arguments and call the dglDrawLine function, but I'm not quite sure how to do this.
04/04/2005 (5:47 am)
In the file dgl.cc at the bottom of the file, try addingConsoleFunction(dglDrawLine,void,5,5,"(S32 x1, S32 y1, S32 x2, S32 y2, const ColorI &color)")
{
if(argc == 5)
{
<do something?>
}
else
{
Con::printf("dglDrawLine() - Invalid number of parameters!\n"); }
}So basically, the
#5
We'll be creating T2D objects to do just that.
- Melv.
04/04/2005 (11:17 am)
There would be no point in doing this as the line wouldn't be persistent. These calls are for objects that want to draw to the framebuffer, they don't create persistent primitives.We'll be creating T2D objects to do just that.
- Melv.
#6
How soon before this functionality is added? If its going to take a while, I might as well impliment something to get me by. Probably involving a new datablock of some kind.
04/04/2005 (12:25 pm)
I figured as much, around about the time when I'd written the function declaration, compiled it and saw that nothing happened :) oh well.How soon before this functionality is added? If its going to take a while, I might as well impliment something to get me by. Probably involving a new datablock of some kind.
#7
I will try to fit this in literally as soon as possible. Oh hell, I'll try to get something together after the next update.
- Melv.
04/05/2005 (2:33 am)
It will take a while before we get to it but I'd like to "fit it in" between some bigger features. It won't be something at the end of the project, more near the beginning.I will try to fit this in literally as soon as possible. Oh hell, I'll try to get something together after the next update.
- Melv.
#8
04/05/2005 (3:00 am)
Or you could wait longer and enjoy laughing at my feeble hacked attempts :)
Torque Owner Alex Parker
Are these accessible from script? Where would I go to enable scripting of these functions? Or am I barking up the wrong tree here?
I'll continue to chip away at this, since primitives are extremely useful. If I crack it, I'll let you all know.