Commit b807bfeb authored by L. E. Segovia's avatar L. E. Segovia

Fix SeExpr builtin functions

- Perlin functions are missing (or, at least, the "enhanced" version)
- Fix signature of dist (docs says two vectors, code says doubles)
parent 74737606
......@@ -1084,10 +1084,10 @@ class CachedVoronoiFunc : public ExprFuncSimple {
VoronoiFunc* _vfunc;
} voronoi(voronoiFn), cvoronoi(cvoronoiFn), pvoronoi(pvoronoiFn);
double dist(double ax, double ay, double az, double bx, double by, double bz) {
double x = ax - bx;
double y = ay - by;
double z = az - bz;
double dist(const Vec3d& a, const Vec3d& b) {
double x = a[0] - b[0];
double y = a[1] - b[1];
double z = a[2] - b[2];
return sqrt(x * x + y * y + z * z);
}
static const char* dist_docstring = QT_TRANSLATE_NOOP_UTF8("builtin",
......
......@@ -33,8 +33,6 @@
namespace SeExpr2 {
void initPerlin();
// trig
inline double deg(double angle) { return angle * (180 / M_PI); }
inline double rad(double angle) { return angle * (M_PI / 180); }
......@@ -88,7 +86,7 @@ Vec3d ccellnoise(const Vec3d& p);
double pnoise(const Vec3d& p, const Vec3d& period);
// vectors
double dist(double ax, double ay, double az, double bx, double by, double bz);
double dist(const Vec3d& a, const Vec3d& b);
double length(const Vec3d& v);
double hypot(double x, double y);
double dot(const Vec3d& a, const Vec3d& b);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment