|
![](/i/fill.gif) |
In article <3A953C06.F7A4B59D@gmx.de>, Christoph Hormann
<chr### [at] gmx de> wrote:
> (maybe it would be a good idea to make the Inside_Object()
> function available in POV script just like trace()).
I haven't done it before, since this macro is pretty easy:
#macro InObj(Pt, Obj) eval_pattern(object {Obj}, Pt) #end
But all it should take is adding a "inside_object" token to parse.h and
tokenize.c, and adding this case to Parse_Num_Factor() in express.c
(make sure you put it with the float functions):
case INSIDE_OBJECT_TOKEN:
{
OBJECT * Object;
VECTOR Point;
GET(LEFT_PAREN_TOKEN);
Parse_Vector(Point);
Parse_Comma();
EXPECT
CASE(OBJECT_ID_TOKEN)
Object = Token.Data;
EXIT
END_CASE
OTHERWISE
Object = NULL;
UNGET
EXIT
END_CASE
END_EXPECT
if(Object == NULL)
{ Error ("Object Identifier Expected.");}
GET(RIGHT_PAREN_TOKEN);
Val = Inside_Object(Point, Object);
}
break;
I haven't tested this patch (I haven't even compiled it), but it should
work.
--
Christopher James Huff
Personal: chr### [at] mac com, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tag povray org, http://tag.povray.org/
<><
Post a reply to this message
|
![](/i/fill.gif) |