Anonymous
public text v1 · immutablefloat rotationSpeed = 5.0;
float three(float x) { return 3.0;}
class blah {
public:
blah() {
Expr::varmap_t vars;
vars[tString("rot")] = &rotationSpeed;
Expr::funcmap_t functions;
functions[tString("three")] = &three;
Expr posX(tString("250+50*cos(3.14*2/rot)"), vars, functions);
Expr posY(tString("250+50*sin(three*3.14*2)"), vars, functions);
std::cerr << posX.GetFloat() << " : " ;
std::cerr << posY.GetFloat() << std::endl;
}
};
blah asdf;