40inline float Min(
float a,
float b)
45inline float Max(
float a,
float b)
62 Point(
float xx,
float yy,
float zz) :
x(xx),
y(yy),
z(zz) { }
66 float dx = fabs(p1.
x-p2.
x);
67 float dy = fabs(p1.
y-p2.
y);
68 float dz = fabs(p1.
z-p2.
z);
69 if (dx<0.001 &&
dy<0.001 && dz<0.001)
return true;
88 v.
x = aVec.
x*(1.0-aVal) + aVec2.
x*(aVal);
89 v.
y = aVec.
y*(1.0-aVal) + aVec2.
y*(aVal);
90 v.
z = aVec.
z*(1.0-aVal) + aVec2.
z*(aVal);
129 Vector(
float ddx,
float ddy,
float ddz) :
dx(ddx),
dy(ddy),
dz(ddz) { }
178 return aVec * aFloat;
182 return aVec * (1.0 / aFloat);
188 r = aVec.
dx * aVec2.
dx;
189 r += aVec.
dy * aVec2.
dy;
190 r += aVec.
dz * aVec2.
dz;
204 float a_length = u_x.
Dist()*cos(alfa);
210 float a_length = u_x.
Dist()*cos(alfa);
211 Vector a_vec = a_length * u_x;
212 Vector b_vec = -a_vec + u;
213 return std::make_pair(a_vec, b_vec);
289 for(
int i=0;i<16;i++)
298 for(
int i=0;i<16;i++)
299 if (std::fabs(m1.
matrix[i]-m2.
matrix[i])>0.000001)
return false;
313 static Matrix Perspective2(
float left,
float right,
float bottom,
float top,
float near,
float far);
314 static Matrix Ortho(
float left,
float right,
float bottom,
float top,
float near,
float far);
385 Color(
float r_,
float g_,
float b_,
float a_) :
r(255.0*r_),
g(255.0*g_),
b(255.0*b_),
alpha(255.0*a_) {
check(); }
386 Color(
double r_,
double g_,
double b_,
double a_) :
r(255.0*r_),
g(255.0*g_),
b(255.0*b_),
alpha(255.0*a_) {
check(); }
398 o <<
"(" << c.
r <<
"," << c.
g <<
"," << c.
b <<
"," << c.
alpha <<
")";
416 if (c2.
r>255) { c2.
r=255; }
417 if (c2.
g>255) { c2.
g=255; }
418 if (c2.
b>255) { c2.
b=255; }
420 if (c2.
r<0) { c2.
r=0; }
421 if (c2.
g<0) { c2.
g=0; }
422 if (c2.
b<0) { c2.
b=0; }
427 return (((
unsigned int)
alpha)<<24) + (((
unsigned int)
r) << 16) + (((
unsigned int)
g) << 8) + (
unsigned int)
b;
441 static unsigned int Average(std::vector<unsigned int> vec);
449 static unsigned int PixelCombine(
unsigned int pixel1,
unsigned int pixel2)
451 unsigned int b = pixel1 & 0xff;
452 unsigned int g = pixel1 & 0xff00;
453 unsigned int r = pixel1 & 0xff0000;
454 unsigned int a = pixel1 & 0xff000000;
455 unsigned int b2 = pixel2 & 0xff;
456 unsigned int g2 = pixel2 & 0xff00;
457 unsigned int r2 = pixel2 & 0xff0000;
458 unsigned int a2 = pixel2 & 0xff000000;
472 return r +
g +
b + a;
478 static unsigned int ColorCube(
float x,
float y,
float z,
float sizex,
float sizey,
float sizez)
487 unsigned int b = int(z) &0xff;
488 unsigned int g = (int(y)<<8) &0xff00;
489 unsigned int r = (int(x)<<16) &0xff0000;
490 unsigned int a = ((0xff)<<24) &0xff000000;
494 unsigned int source_upper,
495 unsigned int source_lower,
496 unsigned int range_upper,
497 unsigned int range_lower)
499 unsigned int b =
color & 0xff;
500 unsigned int g =
color & 0xff00;
501 unsigned int r =
color & 0xff0000;
502 unsigned int a =
color & 0xff000000;
505 unsigned int bsu = source_upper & 0xff;
506 unsigned int gsu = source_upper & 0xff00;
507 unsigned int rsu = source_upper & 0xff0000;
508 unsigned int asu = source_upper & 0xff000000;
510 unsigned int bsl = source_lower & 0xff;
511 unsigned int gsl = source_lower & 0xff00;
512 unsigned int rsl = source_lower & 0xff0000;
513 unsigned int asl = source_lower & 0xff000000;
515 unsigned int bu = range_upper & 0xff;
516 unsigned int gu = range_upper & 0xff00;
517 unsigned int ru = range_upper & 0xff0000;
518 unsigned int au = range_upper & 0xff000000;
520 unsigned int bl = range_lower & 0xff;
521 unsigned int gl = range_lower & 0xff00;
522 unsigned int rl = range_lower & 0xff0000;
523 unsigned int al = range_lower & 0xff000000;
531 float gf = float(
g>>8);
532 float rf = float(
r>>16);
533 float af = float(a>>24);
543 bf /= float(bsu-bsl);
544 gf /= float(gsu-gsl);
545 rf /= float(rsu-rsl);
546 af /= float(asu-asl);
548 unsigned int bc = bl + (
unsigned int)(
bf*(bu-bl));
549 unsigned int gc = gl + (
unsigned int)(
gf*(gu-gl));
550 unsigned int rc = rl + (
unsigned int)(
rf*(ru-rl));
551 unsigned int ac = al + (
unsigned int)(
af*(au-al));
555 ac = ac & 0xff000000;
563 unsigned int b = pixel1 & 0xff;
564 unsigned int g = pixel1 & 0xff00;
565 unsigned int r = pixel1 & 0xff0000;
566 unsigned int a = pixel1 & 0xff000000;
567 unsigned int b2 = pixel2 & 0xff;
568 unsigned int g2 = pixel2 & 0xff00;
569 unsigned int r2 = pixel2 & 0xff0000;
570 unsigned int a2 = pixel2 & 0xff000000;
602 float val1 = 1.0-val;
603 float b3 = val1*
bf + val*bf2;
604 float g3 = val1*
gf + val*gf2;
605 float r3 = val1*
rf + val*rf2;
606 float a3 = val1*
af + val*af2;
618 unsigned int b4 = b3;
619 unsigned int g4 = g3;
620 unsigned int r4 = r3;
621 unsigned int a4 = a3;
629 static unsigned int max_color(
unsigned int pixel1,
unsigned int pixel2)
631 unsigned int b = pixel1 & 0xff;
632 unsigned int g = pixel1 & 0xff00;
633 unsigned int r = pixel1 & 0xff0000;
634 unsigned int a = pixel1 & 0xff000000;
635 unsigned int b2 = pixel2 & 0xff;
636 unsigned int g2 = pixel2 & 0xff00;
637 unsigned int r2 = pixel2 & 0xff0000;
638 unsigned int a2 = pixel2 & 0xff000000;
640 unsigned int mb = std::max(
b,b2);
641 unsigned int mg = std::max(
g,g2);
642 unsigned int mr = std::max(
r,r2);
643 unsigned int ma = std::max(a,a2);
648 static unsigned int min_color(
unsigned int pixel1,
unsigned int pixel2)
650 unsigned int b = pixel1 & 0xff;
651 unsigned int g = pixel1 & 0xff00;
652 unsigned int r = pixel1 & 0xff0000;
653 unsigned int a = pixel1 & 0xff000000;
654 unsigned int b2 = pixel2 & 0xff;
655 unsigned int g2 = pixel2 & 0xff00;
656 unsigned int r2 = pixel2 & 0xff0000;
657 unsigned int a2 = pixel2 & 0xff000000;
659 unsigned int mb = std::min(
b,b2);
660 unsigned int mg = std::min(
g,g2);
661 unsigned int mr = std::min(
r,r2);
662 unsigned int ma = std::min(a,a2);
667 static unsigned int Interpolate(
unsigned int pixel1,
unsigned int pixel2,
float val)
670 unsigned int b = pixel1 & 0xff;
671 unsigned int g = pixel1 & 0xff00;
672 unsigned int r = pixel1 & 0xff0000;
673 unsigned int a = pixel1 & 0xff000000;
674 unsigned int b2 = pixel2 & 0xff;
675 unsigned int g2 = pixel2 & 0xff00;
676 unsigned int r2 = pixel2 & 0xff0000;
677 unsigned int a2 = pixel2 & 0xff000000;
682 float val1 = 1.0-val;
683 if (std::isnan(val)) { val=0.0; val1=1.0; }
684 unsigned int b3 = ((
unsigned int)(
b*val1 + b2*val)) & 0xff;
685 unsigned int g3 = ((
unsigned int)(
g*val1 + g2*val)) & 0xff00;
686 unsigned int r3 = ((
unsigned int)(
r*val1 + r2*val)) & 0xff0000;
687 unsigned int a3 = ((
unsigned int)(a*val1 + a2*val)) & 0x0ff00000;
694 if (aVal < 0.0f) aVal = 0.0f;
695 if (aVal > 1.0f) aVal = 1.0f;
697 v.
r = int(
float(aVec.
r)*(1.0f-aVal) +
float(aVec2.
r)*aVal);
698 v.
g = int(
float(aVec.
g)*(1.0f-aVal) +
float(aVec2.
g)*aVal);
699 v.
b = int(
float(aVec.
b)*(1.0f-aVal) +
float(aVec2.
b)*aVal);
719 for (
int i=0;i<
size;i++)
730 return Color(rr,gg,bb,aa);
732 float rf()
const {
return r/255.0; }
733 float gf()
const {
return g/255.0; }
734 float bf()
const {
return b/255.0; }
819 float angle = atan2(v.
dy,v.
dx);
825 float alfa = atan2(v.
dy,v.
dx);
826 if (fabs(v.
dx)<0.001) {
if (v.
dy<0.0f) alfa=-3.14159f/2.0;
else alfa=3.14159f/2.0; }
879 bool d = p.
x*p.
x+p.
y*p.
y+p.
z*p.
z < radius*radius;
893 float start_x = std::max(tl.x,tl2.
x);
894 float end_x = std::min(br.x, br2.
x);
895 if (start_x>end_x)
return false;
896 float start_y = std::max(tl.y, tl2.
y);
897 float end_y = std::min(br.y, br2.
y);
898 if (start_y>end_y)
return false;
959 float det = (p2.
x-p1.
x)*(p3.
y-p1.
y) - (p2.
y-p1.
y)*(p3.
x-p1.
x);
960 return det * ((p2.
x-p1.
x)*(p.
y-p1.
y) - (p2.
y-p1.
y)*(p.
x-p1.
x)) >= 0 &&
961 det * ((p3.
x-p2.
x)*(p.
y-p2.
y) - (p3.
y-p2.
y)*(p.
x-p2.
x))>=0 &&
962 det * ((p1.
x-p3.
x)*(p.
y-p3.
y) - (p1.
y-p3.
y)*(p.
x-p3.
x))>=0;
1045 res.
x = p.
x + p2.
dx;
1046 res.
y = p.
y + p2.
dy;
1086 float xx = a*a*(b*b+c*c-a*a);
1087 float yy = b*b*(c*c+a*a-b*b);
1088 float zz = c*c*(a*a+b*b-c*c);
1091 Point bary(xx,yy,zz);
1100 return a*b*c/sqrt((a+b+c)*(b+c-a)*(c+a-b)*(a+b-c));
1104 Point p(u,v,1.0-u-v);
1116 B.x = ((v2.
y-v3.
y)*(p.
x-v3.
x) + (v3.
x-v2.
x)*(p.
y-v3.
y))/ ((v2.
y-v3.
y)*(v1.
x-v3.
x) + (v3.
x-v2.
x)*(v1.
y-v3.
y));
1117 B.y = ((v3.
y-v1.
y)*(p.
x-v3.
x) + (v1.
x-v3.
x)*(p.
y-v3.
y)) /((v3.
y-v1.
y)*(v2.
x-v3.
x)+(v1.
x-v3.
x)*(v2.
y-v3.
y));
1123 return (bary.
x >= 0.0) && (bary.
x <=1.0) &&
1124 (bary.
y>=0.0) && (bary.
y<=1.0) &&
1125 (bary.
z>=0.0) && (bary.
z<=1.0);
1139 Point pp(p+normalized_center.
x*u_x+normalized_center.
y*u_y+z*u_z);
1140 return Plane(pp, u_x,u_y);
1144 Point pp(p+x*u_x+normalized_center.
x*u_y+normalized_center.
y*u_z);
1145 return Plane(pp, u_y, u_z);
1149 Point pp(p+normalized_center.
x*u_x+y*u_y+normalized_center.
y*u_z);
1150 return Plane(pp, u_x, u_z);
1175class LineCircleIntersection
1180 : center(center),
radius(
radius), line1(line1), line2(line2) { }
1199 return p1+
Vector(p2-p1)*x;
1266 for(
int y=0;y<
sy;y++)
1267 for(
int x=0;x<
sx;x++)
1276 for(
int y=0;y<
sy;y++)
1277 for(
int x=0;x<
sx;x++)
1295 static std::vector<float>
basis_vector(
int count,
float val);
1296 static float mul(std::vector<float> v1, std::vector<float> v2);
1298 static std::vector<float>
scale(std::vector<float> v,
float c);
1299 static std::vector<float>
add(std::vector<float> v1, std::vector<float> v2);
1305 Pid(
double p,
double i,
double d);
1306 Pid(
double p,
double i,
double d,
double f);
1308 void setP(
double p);
1309 void setI(
double i);
1310 void setD(
double d);
1311 void setF(
double f);
1312 void setPID(
double p,
double i,
double d);
1313 void setPID(
double p,
double i,
double d,
double f);
1319 double getOutput(
double actual,
double setpoint);
1326 double clamp(
double value,
double min,
double max);
1327 bool bounded(
double value,
double min,
double max);
1331 double maxIOutput, maxError, errorSum, maxOutput,minOutput,setpoint,lastActual;
1332 bool firstRun, reversed;
1333 double outputRampRate;
1335 double outputFilter;
1336 double setpointRange;
size dy
Definition GameApi_gui.cc:1727
@ ELine
Definition SeqApi.hh:12
Definition compiled_tests.cpp:1200
friend Color operator*(Color c, float val)
Definition VectorTools.hh:429
Color(double r_, double g_, double b_, double a_)
Definition VectorTools.hh:386
Color & operator=(Color &&x)
Definition VectorTools.hh:392
static unsigned int Interpolate(unsigned int pixel1, unsigned int pixel2, float val)
Definition VectorTools.hh:667
float af() const
Definition VectorTools.hh:735
unsigned int Pixel()
Definition VectorTools.hh:426
float bf() const
Definition VectorTools.hh:734
void check()
Definition VectorTools.cc:1113
int r
Definition VectorTools.hh:744
static Color Interpolate(const Color &aVec, const Color &aVec2, float aVal)
Definition VectorTools.hh:692
void operator*=(float k)
Definition VectorTools.hh:402
static Color AverageArray(Color *array, int size)
Definition VectorTools.hh:712
static unsigned short PixelConvert(unsigned int pixel)
Definition VectorTools.hh:442
static Color Darker(const Color &aVec, float aVal)
Definition VectorTools.hh:708
static unsigned int CubicInterpolate(unsigned int pixel1, unsigned int pixel2, float val)
Definition VectorTools.hh:559
static Color Transparent()
Definition VectorTools.hh:474
Color(const Color &x)
Definition VectorTools.hh:391
static unsigned int ColorCube(float x, float y, float z, float sizex, float sizey, float sizez)
Definition VectorTools.hh:478
static unsigned int Average(std::vector< unsigned int > vec)
Definition VectorTools.cc:1075
Color()
Definition VectorTools.hh:383
static Color CubeCenter()
Definition VectorTools.hh:477
int alpha
Definition VectorTools.hh:745
Color & operator=(const Color &x)
Definition VectorTools.hh:393
static unsigned int max_color(unsigned int pixel1, unsigned int pixel2)
Definition VectorTools.hh:629
static unsigned int min_color(unsigned int pixel1, unsigned int pixel2)
Definition VectorTools.hh:648
int g
Definition VectorTools.hh:744
static Color White()
Definition VectorTools.hh:476
friend std::ostream & operator<<(std::ostream &o, const Color &c)
Definition VectorTools.hh:396
static Color Lighter(const Color &aVec, float aVal)
Definition VectorTools.hh:704
float rf() const
Definition VectorTools.hh:732
Color(float r_, float g_, float b_, float a_)
Definition VectorTools.hh:385
static unsigned int PixelCombine(unsigned int pixel1, unsigned int pixel2)
Definition VectorTools.hh:449
Color clamp() const
Definition VectorTools.hh:413
Color(Color &&x)
Definition VectorTools.hh:390
friend bool operator==(const Color &c1, const Color &c2)
Definition VectorTools.hh:736
int b
Definition VectorTools.hh:744
float gf() const
Definition VectorTools.hh:733
static Color Black()
Definition VectorTools.hh:475
friend Color operator+(const Color &c1, const Color &c2)
Definition VectorTools.hh:403
friend Color operator*(float val, Color c)
Definition VectorTools.hh:435
static unsigned int RangeChange(unsigned int color, unsigned int source_upper, unsigned int source_lower, unsigned int range_upper, unsigned int range_lower)
Definition VectorTools.hh:493
Definition VectorTools.hh:51
float zm
Definition VectorTools.hh:53
float ym
Definition VectorTools.hh:53
float xm
Definition VectorTools.hh:53
Definition VectorTools.hh:1251
virtual void Draw(FlexibleCube c, GC3d *gc) const =0
Plane YZ(float x, Point2d normalized_center) const
Definition VectorTools.hh:1142
Plane XZ(float y, Point2d normalized_center) const
Definition VectorTools.hh:1147
CubePlanes(Point p, Vector u_x, Vector u_y, Vector u_z)
Definition VectorTools.hh:1136
Plane XY(float z, Point2d normalized_center) const
Definition VectorTools.hh:1137
Definition VectorTools.hh:1190
Point line1_p1
Definition VectorTools.hh:1192
static Point LinePoint(Point p1, Point p2, float x)
Definition VectorTools.hh:1197
Point line12_p2(float x) const
Definition VectorTools.hh:1195
Point line2_p2
Definition VectorTools.hh:1193
Point line12_p1(float x) const
Definition VectorTools.hh:1194
Point line2_p1
Definition VectorTools.hh:1193
Point line1_p2
Definition VectorTools.hh:1192
Definition VectorTools.hh:1234
virtual void Draw2dObject(int id, FlexiblePlane pl, void *data)=0
Definition VectorTools.hh:1240
virtual void Draw3dObject(int id, FlexibleCube c)=0
Definition VectorTools.hh:799
LineProperties(Point p1, Point p2)
Definition VectorTools.hh:801
Vector PerpendicularVector(float angle, float length)
Definition VectorTools.cc:1258
bool QuadIntersection(Point p1, Point p2, Point p3, Point p4, float &r)
Definition VectorTools.cc:1592
Matrix scale_length_in_2d() const
Definition VectorTools.hh:838
Matrix rotate_from_p1_in_3d() const
Definition VectorTools.hh:822
bool BoxIntersection(BOX &b, float &tmin, float &tmax)
Definition VectorTools.cc:1601
float LineCoords(Point p) const
Definition VectorTools.cc:1243
Point MiddlePoint(float x) const
Definition VectorTools.cc:1252
Plane PlaneFromLine(float x, float angle, float dist)
Definition VectorTools.cc:1233
bool TriangleIntersection(Point p1, Point p2, Point p3, float &r)
Definition VectorTools.cc:1648
Matrix rotate_z_from_p1_in_2d() const
Definition VectorTools.hh:816
Matrix translate_to_p2() const
Definition VectorTools.hh:815
float Dist(Point p)
Definition VectorTools.cc:1382
Matrix translate_to_p1() const
Definition VectorTools.hh:814
Matrix rotate_to_initial_pos() const
Definition VectorTools.hh:833
Definition VectorTools.hh:279
static Matrix PerspectiveProjection(float dist)
Definition VectorTools.cc:574
static float Determinant(const Matrix &m)
Definition VectorTools.cc:813
static Matrix Ortho(float left, float right, float bottom, float top, float near, float far)
Definition VectorTools.cc:656
float matrix[16]
Definition VectorTools.hh:343
friend Point operator*(const Point &p, const Matrix &m)
Definition VectorTools.cc:191
static Matrix Zero()
Definition VectorTools.cc:477
static Matrix XRotation(float rot)
Definition VectorTools.cc:498
static Matrix CartesianToSpherical(Point p)
Definition VectorTools.cc:686
static Matrix YRotation(float rot)
Definition VectorTools.cc:526
void operator*=(float v)
Definition VectorTools.hh:287
static Matrix ProjectionTrans(float z_min)
Definition VectorTools.cc:565
friend std::ostream & operator<<(std::ostream &o, const Matrix &m)
Definition VectorTools.cc:68
static Matrix Translate(float x, float y, float z)
Definition VectorTools.cc:547
static bool Equal(Matrix m1, Matrix m2)
Definition VectorTools.hh:296
static Matrix Perspective(float fovy, float aspect, float near, float far)
Definition VectorTools.cc:608
static Matrix Inverse(const Matrix &m)
Definition VectorTools.cc:859
static Matrix gluLookAt(Point eye, Point center, Vector up)
Definition VectorTools.cc:625
static bool has_nan(const Matrix &m)
Definition VectorTools.cc:429
static Matrix SphericalToCartesian(SphericalPoint p)
Definition VectorTools.cc:670
friend Matrix operator+(const Matrix &m1, const Matrix &m2)
Definition VectorTools.cc:217
static Matrix RotateAroundAxis(const Vector &v, float angle)
Definition VectorTools.cc:718
static Matrix ZRotation(float rot)
Definition VectorTools.cc:537
static Matrix Identity()
Definition VectorTools.cc:487
static Matrix Transpose(const Matrix &m)
Definition VectorTools.cc:1134
static Matrix Interpolate(const Matrix &m1, const Matrix &m2, float t)
Definition VectorTools.cc:983
Vector get_translate() const
Definition VectorTools.hh:329
static Matrix KeepRotation(const Matrix &m)
Definition VectorTools.cc:509
static Matrix Perspective2(float left, float right, float bottom, float top, float near, float far)
Definition VectorTools.cc:588
void set_translate(Vector v)
Definition VectorTools.hh:337
static AxisAngle FindAxisAngle(const Matrix &m)
Definition VectorTools.cc:1001
void operator*=(const Matrix &m)
Definition VectorTools.hh:292
static Matrix MultiplyMatrix(const Matrix &m, int count)
Definition VectorTools.cc:701
static Matrix Scale(float x, float y, float z)
Definition VectorTools.cc:556
static Matrix RotateAroundAxisPoint(const Point &p, const Vector &v, float angle)
Definition VectorTools.cc:711
void setOutputFilter(double strength)
Definition VectorTools.cc:2099
void setD(double d)
Definition VectorTools.cc:1966
void setOutputRampRate(double rate)
Definition VectorTools.cc:2091
double clamp(double value, double min, double max)
Definition VectorTools.cc:2105
bool bounded(double value, double min, double max)
Definition VectorTools.cc:2111
void setDirection(bool reversed)
Definition VectorTools.cc:2004
Pid(double p, double i, double d)
Definition VectorTools.cc:1921
void setOutputLimits(double output)
Definition VectorTools.cc:1992
void checkSigns()
Definition VectorTools.cc:2115
void setSetpointRange(double range)
Definition VectorTools.cc:2095
void setP(double p)
Definition VectorTools.cc:1950
void setI(double i)
Definition VectorTools.cc:1954
void setPID(double p, double i, double d)
Definition VectorTools.cc:1975
void setMaxIOutput(double maximum)
Definition VectorTools.cc:1985
void init()
Definition VectorTools.cc:1929
void setF(double f)
Definition VectorTools.cc:1970
void reset()
Definition VectorTools.cc:2086
double getOutput()
Definition VectorTools.cc:2078
void setSetpoint(double setpoint)
Definition VectorTools.cc:2008
float ProjectP1(Point2d p_in_plane1)
Definition VectorTools.cc:1369
Line Intersection() const
Definition VectorTools.cc:1365
float ProjectP2(Point2d p_in_plane2)
Definition VectorTools.cc:1375
PlaneIntersection(const Plane &p1, const Plane &p2)
Definition VectorTools.cc:1360
Definition VectorTools.hh:350
Vector Normal(float length) const
Definition VectorTools.cc:1401
Vector u_x
Definition VectorTools.hh:375
void Normalize()
Definition VectorTools.hh:360
float CoordsX(Point p) const
Definition VectorTools.cc:1031
bool WhichSideOfPlane(Point p) const
Definition VectorTools.cc:1011
bool TriangleIntersection(Point p1, Point p2, Point p3, Point2d &res1, Point2d &res2)
Definition VectorTools.cc:1501
Vector u_y
Definition VectorTools.hh:376
void RotateAroundNormal(float angle_in_rad)
Definition VectorTools.cc:1392
bool LineSegmentIntersection(Point p1, Point p2, Point2d &outP)
Definition VectorTools.cc:1476
Point Navigate(const Point2d &p)
Definition VectorTools.cc:1416
float Dist(Point p) const
Definition VectorTools.cc:1019
float Dist2(Point p)
Definition VectorTools.cc:1417
Plane(Point u_p, Vector v1, Vector v2)
Definition VectorTools.hh:352
Vector PlaneNormal()
Definition VectorTools.hh:369
float CoordsY(Point p) const
Definition VectorTools.cc:1038
Plane()
Definition VectorTools.hh:359
Plane(const Plane &p)
Definition VectorTools.hh:358
Point u_p
Definition VectorTools.hh:374
Definition VectorTools.hh:1257
static PolyMatrix ZeroMatrix(int sx, int sy)
Definition VectorTools.cc:1819
int sy
Definition VectorTools.hh:1288
PolyMatrix & operator=(const PolyMatrix &m)
Definition VectorTools.hh:1270
~PolyMatrix()
Definition VectorTools.hh:1286
float read_val(int x, int y) const
Definition VectorTools.hh:1285
int sx
Definition VectorTools.hh:1288
PolyMatrix(const PolyMatrix &m)
Definition VectorTools.hh:1262
static PolyMatrix df_per_dx(int sx, int sy)
Definition VectorTools.cc:1839
float * grid
Definition VectorTools.hh:1289
PolyMatrix(int sx, int sy)
Definition VectorTools.hh:1259
void set_val(int x, int y, float val)
Definition VectorTools.hh:1284
static PolyMatrix IdentityMatrix(int sx, int sy)
Definition VectorTools.cc:1829
Definition VectorTools.hh:1293
static std::vector< float > add(std::vector< float > v1, std::vector< float > v2)
Definition VectorTools.cc:1800
static std::vector< float > basis_vector(int count, float val)
Definition VectorTools.cc:1753
static float mul(std::vector< float > v1, std::vector< float > v2)
Definition VectorTools.cc:1764
static std::vector< float > mul_matrix(const PolyMatrix &m, std::vector< float > &v)
Definition VectorTools.cc:1776
static std::vector< float > scale(std::vector< float > v, float c)
Definition VectorTools.cc:1792
Definition VectorTools.hh:787
float x
Definition VectorTools.hh:789
static Matrix QuarToMatrix(const Quarternion &q)
Definition VectorTools.cc:1144
friend Quarternion operator*(const Quarternion &a, float x)
Definition VectorTools.cc:1217
static Quarternion MatrixToQuar(const Matrix &m)
Definition VectorTools.cc:1194
friend Quarternion operator+(const Quarternion &a, const Quarternion &b)
Definition VectorTools.cc:1208
float w
Definition VectorTools.hh:789
static Quarternion NLerp(const Quarternion &q, const Quarternion &q2, float t)
Definition VectorTools.cc:1227
float y
Definition VectorTools.hh:789
float z
Definition VectorTools.hh:789
bool IntersectRect(Point tl2, Point br2)
Definition VectorTools.hh:891
RectProperties(Point tl, Point br)
Definition VectorTools.hh:890
SphereProperties2(Point center, float radius)
Definition VectorTools.hh:876
bool InsideSphere(Point p) const
Definition VectorTools.hh:877
Definition VectorTools.hh:106
float r
Definition VectorTools.hh:113
float alfa
Definition VectorTools.hh:114
void FromPoint(Point v)
Definition VectorTools.cc:97
Point center
Definition VectorTools.hh:112
SphericalPoint(Point center)
Definition VectorTools.hh:108
float beta
Definition VectorTools.hh:115
Point ToPoint()
Definition VectorTools.cc:87
static Point uv_to_bary(float u, float v)
Definition VectorTools.hh:1102
bool is_inside_circum_sphere(Point p) const
Definition VectorTools.cc:1745
Point Center() const
Definition VectorTools.hh:1055
float side_length_1_2() const
Definition VectorTools.hh:1063
Point barycentric_to_point(Point bary) const
Definition VectorTools.hh:1108
float side_length_2_3() const
Definition VectorTools.hh:1068
float side_length_3_1() const
Definition VectorTools.hh:1073
static Point texture_to_barycentric(Point2d v1, Point2d v2, Point2d v3, Point2d p)
Definition VectorTools.hh:1113
TriangleProperties(Point p1, Point p2, Point p3)
Definition VectorTools.hh:1054
float circum_radius() const
Definition VectorTools.hh:1095
Point circum_center() const
Definition VectorTools.hh:1078
static bool is_inside_triangle(Point bary)
Definition VectorTools.hh:1121
Definition VectorTools.hh:119
float w
Definition VectorTools.hh:121
float y
Definition VectorTools.hh:121
float x
Definition VectorTools.hh:121
float z
Definition VectorTools.hh:121
Definition VectorTools.hh:125
Point operator()(Point p) const
Definition VectorTools.hh:132
void operator+=(const Vector &aVec)
Definition VectorTools.hh:143
Point ApplyPoint(Point p) const
Definition VectorTools.hh:135
void operator/=(const float &aFloat)
Definition VectorTools.hh:162
static float Angle(const Vector &aVec, const Vector &aVec2)
Definition VectorTools.cc:81
Vector UnitConvert(const Vector &u_x, const Vector &u_y, const Vector &u_z)
Definition VectorTools.cc:180
static Vector UnitZ()
Definition VectorTools.cc:171
friend Vector operator+(const Vector &aVec, const Vector &aVec2)
Definition VectorTools.hh:150
static std::pair< Vector, Vector > SplitToComponents(Vector u, Vector u_x)
Definition VectorTools.hh:207
static Vector UnitY()
Definition VectorTools.cc:163
float Dist() const
Definition VectorTools.cc:141
float dy
Definition VectorTools.hh:268
friend std::istream & operator>>(std::istream &i, Vector &p)
Definition VectorTools.cc:60
friend Vector operator*(const Vector &aVec, const float &aFloat)
Definition VectorTools.hh:170
friend Vector operator-(const Point &p1, const Point &p2)
Definition VectorTools.hh:257
static Vector UnitX()
Definition VectorTools.cc:155
Vector()
Definition VectorTools.hh:128
void ZMultiply(const ComponentMultipliers &aMult)
Definition VectorTools.hh:240
Vector(const Vector &aVec)
Definition VectorTools.hh:130
static float DotProduct(const Vector &aVec, const Vector &aVec2)
Definition VectorTools.hh:185
Vector operator-() const
Definition VectorTools.hh:219
friend float Dist(const Vector &a, const Vector &b)
Definition VectorTools.hh:248
static Vector CrossProduct(const Vector &aVec, const Vector &aVec2)
Definition VectorTools.hh:193
void operator*=(const float &aFloat)
Definition VectorTools.hh:156
float dz
Definition VectorTools.hh:268
friend Vector operator*(const float &aFloat, const Vector &aVec)
Definition VectorTools.hh:176
void YMultiply(const ComponentMultipliers &aMult)
Definition VectorTools.hh:234
static float FindProjectionLength(Vector u, Vector u_x)
Definition VectorTools.hh:201
Vector(float ddx, float ddy, float ddz)
Definition VectorTools.hh:129
friend Vector operator/(const Vector &aVec, const float &aFloat)
Definition VectorTools.hh:180
Vector(const Point &aPoint)
Definition VectorTools.hh:131
friend std::ostream & operator<<(std::ostream &o, const Vector &p)
Definition VectorTools.cc:54
float dx
Definition VectorTools.hh:268
void XMultiply(const ComponentMultipliers &aMult)
Definition VectorTools.hh:228
border radius
Definition gameapi_example.php:45
background color
Definition gameapi_example.php:46
d
Definition meshpage.php:3895
lazy data
Definition meshpage.php:1583
n< br > font size
Definition meshpage.php:3536
double f(const std::string &, double, bool) noexcept
Definition profile_cpp_calls_2.cpp:4
Definition VectorTools.hh:273
float angle
Definition VectorTools.hh:274
Vector axis
Definition VectorTools.hh:275
Definition VectorTools.hh:30
float end_x
Definition VectorTools.hh:32
float end_y
Definition VectorTools.hh:34
float start_z
Definition VectorTools.hh:35
float end_z
Definition VectorTools.hh:36
float start_y
Definition VectorTools.hh:33
float start_x
Definition VectorTools.hh:31
Definition VectorTools.hh:755
Point FindExternalCoords(Point internal_coords) const
Definition VectorTools.cc:1282
Vector u_y
Definition VectorTools.hh:762
Point FindInternalCoords(Point external_coords) const
Definition VectorTools.cc:1274
Point center
Definition VectorTools.hh:761
void Scale(float x)
Definition VectorTools.cc:1318
Vector u_x
Definition VectorTools.hh:762
void OrthoNormalize()
Definition VectorTools.cc:1287
void Reposition(Point p)
Definition VectorTools.hh:758
Vector u_z
Definition VectorTools.hh:762
Definition VectorTools.hh:1204
FlexiblePlane back_plane
Definition VectorTools.hh:1206
Point coords(float x, float y, float z)
Definition VectorTools.hh:1207
FlexiblePlane front_plane
Definition VectorTools.hh:1205
Point p
Definition VectorTools.hh:781
Vector dir
Definition VectorTools.hh:782
Definition VectorTools.hh:910
friend std::ostream & operator<<(std::ostream &o, const Point2d &p)
Definition VectorTools.cc:41
float x
Definition VectorTools.hh:911
float y
Definition VectorTools.hh:911
void operator+=(const Point2d &p)
Definition VectorTools.hh:914
void operator-=(const Point2d &p)
Definition VectorTools.hh:920
void operator*=(float k)
Definition VectorTools.hh:926
static Point2d FromVector(const Vector2d &v)
Definition VectorTools.hh:1035
friend std::istream & operator>>(std::istream &i, Point2d &p)
Definition VectorTools.cc:46
friend Point2d operator+(const Point2d &p, const Point2d &p2)
Definition VectorTools.hh:931
friend Point2d operator*(float x, const Point2d &p)
Definition VectorTools.hh:946
static Point2d NewPoint(float x, float y)
Definition VectorTools.hh:912
float x
Definition Parser.cc:60
float Dist() const
Definition VectorTools.cc:150
friend std::istream & operator>>(std::istream &i, Point &p)
Definition VectorTools.cc:35
static Point Origo()
Definition VectorTools.hh:84
friend Point operator+(const Point &p, const Vector &v)
Definition VectorTools.cc:120
friend bool operator==(const Point &p1, const Point &p2)
Definition VectorTools.hh:64
float y
Definition Parser.cc:60
friend bool operator!=(const Point &p1, const Point &p2)
Definition VectorTools.hh:72
void operator-=(const Vector &v)
Definition VectorTools.cc:127
void operator+=(const Vector &v)
Definition VectorTools.cc:110
friend Point operator-(const Point &p, const Vector &v)
Definition VectorTools.cc:133
float z
Definition Parser.cc:60
Point(float xx, float yy, float zz)
Definition VectorTools.hh:62
Point()
Definition VectorTools.hh:61
static Point Interpolate(const Point &aVec, const Point &aVec2, float aVal)
Definition VectorTools.hh:85
friend std::ostream & operator<<(std::ostream &o, const Point &p)
Definition VectorTools.cc:30
Point get_point(Point p1, Point p2) const
Definition VectorTools.hh:856
float dist
Definition VectorTools.hh:865
float span_pos
Definition VectorTools.hh:864
float angle
Definition VectorTools.hh:866
PoseLine(Point p1, Point p2, Point p)
Definition VectorTools.hh:850
Definition VectorTools.hh:749
void OrthoNormalize()
Definition VectorTools.cc:1300
Vector u_x
Definition VectorTools.hh:752
void Scale(float x)
Definition VectorTools.cc:1312
Vector u_y
Definition VectorTools.hh:752
Vector u_z
Definition VectorTools.hh:752
Definition VectorTools.hh:972
void operator/=(float x)
Definition VectorTools.hh:980
float Dist() const
Definition VectorTools.hh:986
void operator*=(float x)
Definition VectorTools.hh:975
float dy
Definition VectorTools.hh:973
static float DotProduct(const Vector2d &v, const Vector2d &v2)
Definition VectorTools.hh:987
friend Vector2d operator*(const Vector2d &p, float x)
Definition VectorTools.hh:1013
float dx
Definition VectorTools.hh:973
friend Vector2d operator+(const Vector2d &p1, const Vector2d &p2)
Definition VectorTools.hh:999
static Vector2d FromPoint(const Point2d &p)
Definition VectorTools.hh:991
friend Vector2d operator*(float x, const Vector2d &p)
Definition VectorTools.hh:1006
float Length() const
Definition VectorTools.cc:1390
Vector2d operator-()
Definition VectorTools.hh:998