Fixed boolean objects to determine if rays start inside or outside the boolean; changed constructors to accept a list of shapes instead of just two shapes; changed parser to accept any number of top-level shapes inside of a boolean shape block; changed scenes/die.fart to reflect this change (a drastic simplification)

git-svn-id: svn://anubis/fart/trunk@215 7f9b0f55-74a9-4bce-be96-3c2cd072584d
This commit is contained in:
Josh Holtrop committed 2009-03-15 19:51:21 +00:00
1 parent f103b71ed6
commit 5590c533ce
12 files changed
+203 -173

No files matched your search

+18 -12
View File
@@ -103,6 +103,18 @@ scene: SCENE LCURLY scene_items RCURLY {
}
;
bool_items: /* empty */
| bool_item bool_items {
$$ = new ItemsNode();
$$->addChild($1);
$$->addChildren($2);
}
;
bool_item: shape
| shape_item
;
box: BOX LCURLY box_items RCURLY {
$$ = new BoxNode();
$$->addChildren($3);
@@ -171,11 +183,9 @@ cyl_item: SIZE vector {
| shape_item { $$ = $1; }
;
intersect: INTERSECT LCURLY shape shape shape_items RCURLY {
intersect: INTERSECT LCURLY bool_items RCURLY {
$$ = new IntersectNode();
$$->addChild($3);
$$->addChild($4);
$$->addChildren($5);
$$->addChildren($3);
}
;
@@ -368,11 +378,9 @@ sphere_item: radius { $$ = $1; }
| shape_item { $$ = $1; }
;
subtract: SUBTRACT LCURLY shape shape shape_items RCURLY {
subtract: SUBTRACT LCURLY bool_items RCURLY {
$$ = new SubtractNode();
$$->addChild($3);
$$->addChild($4);
$$->addChildren($5);
$$->addChildren($3);
}
;
@@ -414,11 +422,9 @@ transform_block_item: transform_block { $$ = $1; }
| shape { $$ = $1; }
;
union: UNION LCURLY shape shape shape_items RCURLY {
union: UNION LCURLY bool_items RCURLY {
$$ = new UnionNode();
$$->addChild($3);
$$->addChild($4);
$$->addChildren($5);
$$->addChildren($3);
}
;