added "refraction" to parser, added RefractionNode node type

git-svn-id: svn://anubis/fart/trunk@373 7f9b0f55-74a9-4bce-be96-3c2cd072584d
This commit is contained in:
Josh Holtrop committed 2010-10-11 15:36:02 +00:00
1 parent ed58d2ec7a
commit 3594dace7f
4 files changed
+14 -1

No files matched your search

+10
View File
@@ -410,6 +410,16 @@ class ReflectanceNode : public NumberNode
}
};
class RefractionNode : public NumberNode
{
public:
RefractionNode(NodeRef e) : NumberNode(e) {}
virtual NodeRef evaluate()
{
return new RefractionNode(m_expr->evaluate());
}
};
class RotateNode : public VectorNode
{
public:
+1
View File
@@ -76,6 +76,7 @@ polygon return POLYGON;
position return POSITION;
radius return RADIUS;
reflectance return REFLECTANCE;
refraction return REFRACTION;
rotate return ROTATE;
scale return SCALE;
scene return SCENE;
+2
View File
@@ -94,6 +94,7 @@ refptr<Scope> parser_scope;
%token POSITION;
%token RADIUS;
%token REFLECTANCE;
%token REFRACTION;
%token ROTATE;
%token SCALE;
%token SCENE;
@@ -197,6 +198,7 @@ general_item: AMBIENT vector3 { $$ = new AmbientNode($2); }
}
| RADIUS expression { $$ = new RadiusNode($2); }
| REFLECTANCE expression { $$ = new ReflectanceNode($2); }
| REFRACTION expression { $$ = new RefractionNode($2); }
| ROTATE expression COMMA vector3 { $$ = new RotateNode($2, $4); }
| SCALE expression { $$ = new ScaleNode(new ScaleScalarNode($2)); }
| SCALE vector2 { $$ = new ScaleNode($2); }