1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 | #ifndef _OFX_VEC3f #define _OFX_VEC3f #include "ofConstants.h" #include "ofTypes.h" class ofxVec3f : public ofPoint { public: ofxVec3f( float _x=0.0f, float _y=0.0f, float _z=0.0f ); ofxVec3f( const ofPoint& pnt ); // Getters and Setters. // void set( float _x, float _y, float _z ); void set( const ofPoint& vec ); float &operator[]( const int& i ); // Check similarity/equality. // bool operator==( const ofPoint& vec ); bool operator!=( const ofPoint& vec ); bool match( const ofPoint& vec, float tollerance=0.0001 ); /** * Checks if vectors look in the same direction. */ bool align( const ofxVec3f& vec, float tollerance=0.0001 ) const; bool alignRad( const ofxVec3f& vec, float tollerance=0.0001 ) const; // Operator overloading for ofPoint // void operator=( const ofPoint& vec ); ofxVec3f operator+( const ofPoint& pnt ) const; ofxVec3f& operator+=( const ofPoint& pnt ); ofxVec3f operator-( const ofPoint& vec ) const; ofxVec3f& operator-=( const ofPoint& vec ); ofxVec3f operator*( const ofPoint& vec ) const; ofxVec3f& operator*=( const ofPoint& vec ); ofxVec3f operator/( const ofPoint& vec ) const; ofxVec3f& operator/=( const ofPoint& vec ); ofxVec3f operator-() const; //operator overloading for float // void operator=( const float f); ofxVec3f operator+( const float f ) const; ofxVec3f& operator+=( const float f ); ofxVec3f operator-( const float f ) const; ofxVec3f& operator-=( const float f ); ofxVec3f operator*( const float f ) const; ofxVec3f& operator*=( const float f ); ofxVec3f operator/( const float f ) const; ofxVec3f& operator/=( const float f ); //Scale // ofxVec3f getScaled( const float length ) const; ofxVec3f& scale( const float length ); // Rotation // ofxVec3f getRotated( float angle, const ofxVec3f& axis ) const; ofxVec3f getRotatedRad( float angle, const ofxVec3f& axis ) const; ofxVec3f& rotate( float angle, const ofxVec3f& axis ); ofxVec3f& rotateRad( float angle, const ofxVec3f& axis ); ofxVec3f getRotated(float ax, float ay, float az) const; ofxVec3f getRotatedRad(float ax, float ay, float az) const; ofxVec3f& rotate(float ax, float ay, float az); ofxVec3f& rotateRad(float ax, float ay, float az); // Rotation - point around pivot // ofxVec3f getRotated( float angle, const ofPoint& pivot, const ofxVec3f& axis ) const; ofxVec3f& rotate( float angle, const ofPoint& pivot, const ofxVec3f& axis ); ofxVec3f getRotatedRad( float angle, const ofPoint& pivot, const ofxVec3f& axis ) const; ofxVec3f& rotateRad( float angle, const ofPoint& pivot, const ofxVec3f& axis ); // Map point to coordinate system defined by origin, vx, vy, and vz. // ofxVec3f getMapped( const ofPoint& origin, const ofxVec3f& vx, const ofxVec3f& vy, const ofxVec3f& vz ) const; ofxVec3f& map( const ofPoint& origin, const ofxVec3f& vx, const ofxVec3f& vy, const ofxVec3f& vz ); // Distance between two points. // float distance( const ofPoint& pnt) const; float squareDistance( const ofPoint& pnt ) const; // Linear interpolation. // /** * p==0.0 results in this point, p==0.5 results in the * midpoint, and p==1.0 results in pnt being returned. */ ofxVec3f getInterpolated( const ofPoint& pnt, float p ) const; ofxVec3f& interpolate( const ofPoint& pnt, float p ); ofxVec3f getMiddle( const ofPoint& pnt ) const; ofxVec3f& middle( const ofPoint& pnt ); ofxVec3f& average( const ofPoint* points, int num ); // Normalization // ofxVec3f getNormalized() const; ofxVec3f& normalize(); // Limit length. // ofxVec3f getLimited(float max) const; ofxVec3f& limit(float max); // Perpendicular vector. // ofxVec3f getCrossed( const ofxVec3f& vec ) const; ofxVec3f& cross( const ofxVec3f& vec ); /** * Normalized perpendicular. */ ofxVec3f getPerpendicular( const ofxVec3f& vec ) const; ofxVec3f& perpendicular( const ofxVec3f& vec ); // Length // float length() const; float squareLength() const; /** * Angle (deg) between two vectors. * This is an unsigned relative angle from 0 to 180. * http://www.euclideanspace.com/maths/algebra/vectors/angleBetween/index.htm */ float angle( const ofxVec3f& vec ) const; float angleRad( const ofxVec3f& vec ) const; // Dot Product // float dot( const ofxVec3f& vec ) const; //----------------------------------------------- // this methods are deprecated in 006 please use: // getScaled ofxVec3f rescaled( const float length ) const; // scale ofxVec3f& rescale( const float length ); // getRotated ofxVec3f rotated( float angle, const ofxVec3f& axis ) const; // getRotated should this be const??? ofxVec3f rotated(float ax, float ay, float az); // getNormalized ofxVec3f normalized() const; // getLimited ofxVec3f limited(float max) const; // getCrossed ofxVec3f crossed( const ofxVec3f& vec ) const; // getPerpendicular ofxVec3f perpendiculared( const ofxVec3f& vec ) const; // squareLength float lengthSquared() const; // use getMapped ofxVec3f mapped( const ofPoint& origin, const ofxVec3f& vx, const ofxVec3f& vy, const ofxVec3f& vz ) const; // use squareDistance float distanceSquared( const ofPoint& pnt ) const; // use getInterpolated ofxVec3f interpolated( const ofPoint& pnt, float p ) const; // use getMiddle ofxVec3f middled( const ofPoint& pnt ) const; // use getRotated ofxVec3f rotated( float angle, const ofPoint& pivot, const ofxVec3f& axis ) const; }; // Non-Member operators // // ofxVec3f operator+( float f, const ofxVec3f& vec ); ofxVec3f operator-( float f, const ofxVec3f& vec ); ofxVec3f operator*( float f, const ofxVec3f& vec ); ofxVec3f operator/( float f, const ofxVec3f& vec ); ///////////////// // Implementation ///////////////// inline ofxVec3f::ofxVec3f( float _x, float _y, float _z ) { x = _x; y = _y; z = _z; } inline ofxVec3f::ofxVec3f( const ofPoint& pnt ) { x = pnt.x; y = pnt.y; z = pnt.z; } // Getters and Setters. // // inline void ofxVec3f::set( float _x, float _y, float _z ) { x = _x; y = _y; z = _z; } inline void ofxVec3f::set( const ofPoint& vec ) { x = vec.x; y = vec.y; z = vec.z; } inline float& ofxVec3f::operator[]( const int& i ) { switch(i) { case 0: return x; case 1: return y; case 2: return z; default: return x; } } // Check similarity/equality. // // inline bool ofxVec3f::operator==( const ofPoint& vec ) { return (x == vec.x) && (y == vec.y) && (z == vec.z); } inline bool ofxVec3f::operator!=( const ofPoint& vec ) { return (x != vec.x) || (y != vec.y) || (z != vec.z); } inline bool ofxVec3f::match( const ofPoint& vec, float tollerance ) { return (fabs(x - vec.x) < tollerance) && (fabs(y - vec.y) < tollerance) && (fabs(z - vec.z) < tollerance); } /** * Checks if vectors look in the same direction. */ inline bool ofxVec3f::align( const ofxVec3f& vec, float tollerance ) const { float angle = this->angle( vec ); return angle < tollerance; } inline bool ofxVec3f::alignRad( const ofxVec3f& vec, float tollerance ) const { float angle = this->angleRad( vec ); return angle < tollerance; } // Operator overloading for ofPoint // // inline void ofxVec3f::operator=( const ofPoint& vec ){ x = vec.x; y = vec.y; z = vec.z; } inline ofxVec3f ofxVec3f::operator+( const ofPoint& pnt ) const { return ofxVec3f( x+pnt.x, y+pnt.y, z+pnt.z ); } inline ofxVec3f& ofxVec3f::operator+=( const ofPoint& pnt ) { x+=pnt.x; y+=pnt.y; z+=pnt.z; return *this; } inline ofxVec3f ofxVec3f::operator-( const ofPoint& vec ) const { return ofxVec3f( x-vec.x, y-vec.y, z-vec.z ); } inline ofxVec3f& ofxVec3f::operator-=( const ofPoint& vec ) { x -= vec.x; y -= vec.y; z -= vec.z; return *this; } inline ofxVec3f ofxVec3f::operator*( const ofPoint& vec ) const { return ofxVec3f( x*vec.x, y*vec.y, z*vec.z ); } inline ofxVec3f& ofxVec3f::operator*=( const ofPoint& vec ) { x*=vec.x; y*=vec.y; z*=vec.z; return *this; } inline ofxVec3f ofxVec3f::operator/( const ofPoint& vec ) const { return ofxVec3f( vec.x!=0 ? x/vec.x : x , vec.y!=0 ? y/vec.y : y, vec.z!=0 ? z/vec.z : z ); } inline ofxVec3f& ofxVec3f::operator/=( const ofPoint& vec ) { vec.x!=0 ? x/=vec.x : x; vec.y!=0 ? y/=vec.y : y; vec.z!=0 ? z/=vec.z : z; return *this; } inline ofxVec3f ofxVec3f::operator-() const { return ofxVec3f( -x, -y, -z ); } //operator overloading for float // // inline void ofxVec3f::operator=( const float f){ x = f; y = f; z = f; } inline ofxVec3f ofxVec3f::operator+( const float f ) const { return ofxVec3f( x+f, y+f, z+f); } inline ofxVec3f& ofxVec3f::operator+=( const float f ) { x += f; y += f; z += f; return *this; } inline ofxVec3f ofxVec3f::operator-( const float f ) const { return ofxVec3f( x-f, y-f, z-f); } inline ofxVec3f& ofxVec3f::operator-=( const float f ) { x -= f; y -= f; z -= f; return *this; } inline ofxVec3f ofxVec3f::operator*( const float f ) const { return ofxVec3f( x*f, y*f, z*f ); } inline ofxVec3f& ofxVec3f::operator*=( const float f ) { x*=f; y*=f; z*=f; return *this; } inline ofxVec3f ofxVec3f::operator/( const float f ) const { if(f == 0) return ofxVec3f( x, y, z); return ofxVec3f( x/f, y/f, z/f ); } inline ofxVec3f& ofxVec3f::operator/=( const float f ) { if(f == 0) return *this; x/=f; y/=f; z/=f; return *this; } //Scale // // inline ofxVec3f ofxVec3f::rescaled( const float length ) const { return getScaled(length); } inline ofxVec3f ofxVec3f::getScaled( const float length ) const { float l = (float)sqrt(x*x + y*y + z*z); if( l > 0 ) return ofxVec3f( (x/l)*length, (y/l)*length, (z/l)*length ); else return ofxVec3f(); } inline ofxVec3f& ofxVec3f::rescale( const float length ) { return scale(length); } inline ofxVec3f& ofxVec3f::scale( const float length ) { float l = (float)sqrt(x*x + y*y + z*z); if (l > 0) { x = (x/l)*length; y = (y/l)*length; z = (z/l)*length; } return *this; } // Rotation // // inline ofxVec3f ofxVec3f::rotated( float angle, const ofxVec3f& axis ) const { return getRotated(angle, axis); } inline ofxVec3f ofxVec3f::getRotated( float angle, const ofxVec3f& axis ) const { ofxVec3f ax = axis.normalized(); float a = (float)(angle*DEG_TO_RAD); float sina = sin( a ); float cosa = cos( a ); float cosb = 1.0f - cosa; return ofxVec3f( x*(ax.x*ax.x*cosb + cosa) + y*(ax.x*ax.y*cosb - ax.z*sina) + z*(ax.x*ax.z*cosb + ax.y*sina), x*(ax.y*ax.x*cosb + ax.z*sina) + y*(ax.y*ax.y*cosb + cosa) + z*(ax.y*ax.z*cosb - ax.x*sina), x*(ax.z*ax.x*cosb - ax.y*sina) + y*(ax.z*ax.y*cosb + ax.x*sina) + z*(ax.z*ax.z*cosb + cosa) ); } inline ofxVec3f ofxVec3f::getRotatedRad( float angle, const ofxVec3f& axis ) const { ofxVec3f ax = axis.normalized(); float a = angle; float sina = sin( a ); float cosa = cos( a ); float cosb = 1.0f - cosa; return ofxVec3f( x*(ax.x*ax.x*cosb + cosa) + y*(ax.x*ax.y*cosb - ax.z*sina) + z*(ax.x*ax.z*cosb + ax.y*sina), x*(ax.y*ax.x*cosb + ax.z*sina) + y*(ax.y*ax.y*cosb + cosa) + z*(ax.y*ax.z*cosb - ax.x*sina), x*(ax.z*ax.x*cosb - ax.y*sina) + y*(ax.z*ax.y*cosb + ax.x*sina) + z*(ax.z*ax.z*cosb + cosa) ); } inline ofxVec3f& ofxVec3f::rotate( float angle, const ofxVec3f& axis ) { ofxVec3f ax = axis.normalized(); float a = (float)(angle*DEG_TO_RAD); float sina = sin( a ); float cosa = cos( a ); float cosb = 1.0f - cosa; float nx = x*(ax.x*ax.x*cosb + cosa) + y*(ax.x*ax.y*cosb - ax.z*sina) + z*(ax.x*ax.z*cosb + ax.y*sina); float ny = x*(ax.y*ax.x*cosb + ax.z*sina) + y*(ax.y*ax.y*cosb + cosa) + z*(ax.y*ax.z*cosb - ax.x*sina); float nz = x*(ax.z*ax.x*cosb - ax.y*sina) + y*(ax.z*ax.y*cosb + ax.x*sina) + z*(ax.z*ax.z*cosb + cosa); x = nx; y = ny; z = nz; return *this; } inline ofxVec3f& ofxVec3f::rotateRad(float angle, const ofxVec3f& axis ) { ofxVec3f ax = axis.normalized(); float a = angle; float sina = sin( a ); float cosa = cos( a ); float cosb = 1.0f - cosa; float nx = x*(ax.x*ax.x*cosb + cosa) + y*(ax.x*ax.y*cosb - ax.z*sina) + z*(ax.x*ax.z*cosb + ax.y*sina); float ny = x*(ax.y*ax.x*cosb + ax.z*sina) + y*(ax.y*ax.y*cosb + cosa) + z*(ax.y*ax.z*cosb - ax.x*sina); float nz = x*(ax.z*ax.x*cosb - ax.y*sina) + y*(ax.z*ax.y*cosb + ax.x*sina) + z*(ax.z*ax.z*cosb + cosa); x = nx; y = ny; z = nz; return *this; } // const??? inline ofxVec3f ofxVec3f::rotated(float ax, float ay, float az) { return getRotated(ax,ay,az); } inline ofxVec3f ofxVec3f::getRotated(float ax, float ay, float az) const { float a = (float)cos(DEG_TO_RAD*(ax)); float b = (float)sin(DEG_TO_RAD*(ax)); float c = (float)cos(DEG_TO_RAD*(ay)); float d = (float)sin(DEG_TO_RAD*(ay)); float e = (float)cos(DEG_TO_RAD*(az)); float f = (float)sin(DEG_TO_RAD*(az)); float nx = c * e * x - c * f * y + d * z; float ny = (a * f + b * d * e) * x + (a * e - b * d * f) * y - b * c * z; float nz = (b * f - a * d * e) * x + (a * d * f + b * e) * y + a * c * z; return ofxVec3f( nx, ny, nz ); } inline ofxVec3f ofxVec3f::getRotatedRad(float ax, float ay, float az) const { float a = cos(ax); float b = sin(ax); float c = cos(ay); float d = sin(ay); float e = cos(az); float f = sin(az); float nx = c * e * x - c * f * y + d * z; float ny = (a * f + b * d * e) * x + (a * e - b * d * f) * y - b * c * z; float nz = (b * f - a * d * e) * x + (a * d * f + b * e) * y + a * c * z; return ofxVec3f( nx, ny, nz ); } inline ofxVec3f& ofxVec3f::rotate(float ax, float ay, float az) { float a = (float)cos(DEG_TO_RAD*(ax)); float b = (float)sin(DEG_TO_RAD*(ax)); float c = (float)cos(DEG_TO_RAD*(ay)); float d = (float)sin(DEG_TO_RAD*(ay)); float e = (float)cos(DEG_TO_RAD*(az)); float f = (float)sin(DEG_TO_RAD*(az)); float nx = c * e * x - c * f * y + d * z; float ny = (a * f + b * d * e) * x + (a * e - b * d * f) * y - b * c * z; float nz = (b * f - a * d * e) * x + (a * d * f + b * e) * y + a * c * z; x = nx; y = ny; z = nz; return *this; } inline ofxVec3f& ofxVec3f::rotateRad(float ax, float ay, float az) { float a = cos(ax); float b = sin(ax); float c = cos(ay); float d = sin(ay); float e = cos(az); float f = sin(az); float nx = c * e * x - c * f * y + d * z; float ny = (a * f + b * d * e) * x + (a * e - b * d * f) * y - b * c * z; float nz = (b * f - a * d * e) * x + (a * d * f + b * e) * y + a * c * z; x = nx; y = ny; z = nz; return *this; } // Rotate point by angle (deg) around line defined by pivot and axis. // // inline ofxVec3f ofxVec3f::rotated( float angle, const ofPoint& pivot, const ofxVec3f& axis ) const{ return getRotated(angle, pivot, axis); } inline ofxVec3f ofxVec3f::getRotated( float angle, const ofPoint& pivot, const ofxVec3f& axis ) const { ofxVec3f ax = axis.normalized(); float tx = x - pivot.x; float ty = y - pivot.y; float tz = z - pivot.z; float a = (float)(angle*DEG_TO_RAD); float sina = sin( a ); float cosa = cos( a ); float cosb = 1.0f - cosa; float xrot = tx*(ax.x*ax.x*cosb + cosa) + ty*(ax.x*ax.y*cosb - ax.z*sina) + tz*(ax.x*ax.z*cosb + ax.y*sina); float yrot = tx*(ax.y*ax.x*cosb + ax.z*sina) + ty*(ax.y*ax.y*cosb + cosa) + tz*(ax.y*ax.z*cosb - ax.x*sina); float zrot = tx*(ax.z*ax.x*cosb - ax.y*sina) + ty*(ax.z*ax.y*cosb + ax.x*sina) + tz*(ax.z*ax.z*cosb + cosa); return ofxVec3f( xrot+pivot.x, yrot+pivot.y, zrot+pivot.z ); } inline ofxVec3f ofxVec3f::getRotatedRad( float angle, const ofPoint& pivot, const ofxVec3f& axis ) const { ofxVec3f ax = axis.normalized(); float tx = x - pivot.x; float ty = y - pivot.y; float tz = z - pivot.z; float a = angle; float sina = sin( a ); float cosa = cos( a ); float cosb = 1.0f - cosa; float xrot = tx*(ax.x*ax.x*cosb + cosa) + ty*(ax.x*ax.y*cosb - ax.z*sina) + tz*(ax.x*ax.z*cosb + ax.y*sina); float yrot = tx*(ax.y*ax.x*cosb + ax.z*sina) + ty*(ax.y*ax.y*cosb + cosa) + tz*(ax.y*ax.z*cosb - ax.x*sina); float zrot = tx*(ax.z*ax.x*cosb - ax.y*sina) + ty*(ax.z*ax.y*cosb + ax.x*sina) + tz*(ax.z*ax.z*cosb + cosa); return ofxVec3f( xrot+pivot.x, yrot+pivot.y, zrot+pivot.z ); } inline ofxVec3f& ofxVec3f::rotate( float angle, const ofPoint& pivot, const ofxVec3f& axis ) { ofxVec3f ax = axis.normalized(); x -= pivot.x; y -= pivot.y; z -= pivot.z; float a = (float)(angle*DEG_TO_RAD); float sina = sin( a ); float cosa = cos( a ); float cosb = 1.0f - cosa; float xrot = x*(ax.x*ax.x*cosb + cosa) + y*(ax.x*ax.y*cosb - ax.z*sina) + z*(ax.x*ax.z*cosb + ax.y*sina); float yrot = x*(ax.y*ax.x*cosb + ax.z*sina) + y*(ax.y*ax.y*cosb + cosa) + z*(ax.y*ax.z*cosb - ax.x*sina); float zrot = x*(ax.z*ax.x*cosb - ax.y*sina) + y*(ax.z*ax.y*cosb + ax.x*sina) + z*(ax.z*ax.z*cosb + cosa); x = xrot + pivot.x; y = yrot + pivot.y; z = zrot + pivot.z; return *this; } inline ofxVec3f& ofxVec3f::rotateRad( float angle, const ofPoint& pivot, const ofxVec3f& axis ) { ofxVec3f ax = axis.normalized(); x -= pivot.x; y -= pivot.y; z -= pivot.z; float a = angle; float sina = sin( a ); float cosa = cos( a ); float cosb = 1.0f - cosa; float xrot = x*(ax.x*ax.x*cosb + cosa) + y*(ax.x*ax.y*cosb - ax.z*sina) + z*(ax.x*ax.z*cosb + ax.y*sina); float yrot = x*(ax.y*ax.x*cosb + ax.z*sina) + y*(ax.y*ax.y*cosb + cosa) + z*(ax.y*ax.z*cosb - ax.x*sina); float zrot = x*(ax.z*ax.x*cosb - ax.y*sina) + y*(ax.z*ax.y*cosb + ax.x*sina) + z*(ax.z*ax.z*cosb + cosa); x = xrot + pivot.x; y = yrot + pivot.y; z = zrot + pivot.z; return *this; } // Map point to coordinate system defined by origin, vx, vy, and vz. // // inline ofxVec3f ofxVec3f::mapped( const ofPoint& origin, const ofxVec3f& vx, const ofxVec3f& vy, const ofxVec3f& vz ) const{ return getMapped(origin, vx, vy, vz); } inline ofxVec3f ofxVec3f::getMapped( const ofPoint& origin, const ofxVec3f& vx, const ofxVec3f& vy, const ofxVec3f& vz ) const { return ofxVec3f( origin.x + x*vx.x + y*vy.x + z*vz.x, origin.y + x*vx.y + y*vy.y + z*vz.y, origin.z + x*vx.z + y*vy.z + z*vz.z ); } inline ofxVec3f& ofxVec3f::map( const ofPoint& origin, const ofxVec3f& vx, const ofxVec3f& vy, const ofxVec3f& vz ) { float xmap = origin.x + x*vx.x + y*vy.x + z*vz.x; float ymap = origin.y + x*vx.y + y*vy.y + z*vz.y; z = origin.z + x*vx.z + y*vy.z + z*vz.z; x = xmap; y = ymap; return *this; } // Distance between two points. // // inline float ofxVec3f::distance( const ofPoint& pnt) const { float vx = x-pnt.x; float vy = y-pnt.y; float vz = z-pnt.z; return (float)sqrt(vx*vx + vy*vy + vz*vz); } inline float ofxVec3f::distanceSquared( const ofPoint& pnt ) const{ return squareDistance(pnt); } inline float ofxVec3f::squareDistance( const ofPoint& pnt ) const { float vx = x-pnt.x; float vy = y-pnt.y; float vz = z-pnt.z; return vx*vx + vy*vy + vz*vz; } // Linear interpolation. // // /** * p==0.0 results in this point, p==0.5 results in the * midpoint, and p==1.0 results in pnt being returned. */ inline ofxVec3f ofxVec3f::interpolated( const ofPoint& pnt, float p ) const { return getInterpolated(pnt,p); } inline ofxVec3f ofxVec3f::getInterpolated( const ofPoint& pnt, float p ) const { return ofxVec3f( x*(1-p) + pnt.x*p, y*(1-p) + pnt.y*p, z*(1-p) + pnt.z*p ); } inline ofxVec3f& ofxVec3f::interpolate( const ofPoint& pnt, float p ) { x = x*(1-p) + pnt.x*p; y = y*(1-p) + pnt.y*p; z = z*(1-p) + pnt.z*p; return *this; } inline ofxVec3f ofxVec3f::middled( const ofPoint& pnt ) const { return getMiddle(pnt); } inline ofxVec3f ofxVec3f::getMiddle( const ofPoint& pnt ) const { return ofxVec3f( (x+pnt.x)/2.0f, (y+pnt.y)/2.0f, (z+pnt.z)/2.0f ); } inline ofxVec3f& ofxVec3f::middle( const ofPoint& pnt ) { x = (x+pnt.x)/2.0f; y = (y+pnt.y)/2.0f; z = (z+pnt.z)/2.0f; return *this; } // Average (centroid) among points. // Addition is sometimes useful for calculating averages too. // // inline ofxVec3f& ofxVec3f::average( const ofPoint* points, int num ) { x = 0.f; y = 0.f; z = 0.f; for( int i=0; i<num; i++) { x += points[i].x; y += points[i].y; z += points[i].z; } x /= num; y /= num; z /= num; return *this; } // Normalization // // inline ofxVec3f ofxVec3f::normalized() const { return getNormalized(); } inline ofxVec3f ofxVec3f::getNormalized() const { float length = (float)sqrt(x*x + y*y + z*z); if( length > 0 ) { return ofxVec3f( x/length, y/length, z/length ); } else { return ofxVec3f(); } } inline ofxVec3f& ofxVec3f::normalize() { float length = (float)sqrt(x*x + y*y + z*z); if( length > 0 ) { x /= length; y /= length; z /= length; } return *this; } // Limit length. // // inline ofxVec3f ofxVec3f::limited(float max) const { return getLimited(max); } inline ofxVec3f ofxVec3f::getLimited(float max) const { ofxVec3f limited; float lengthSquared = (x*x + y*y + z*z); if( lengthSquared > max*max && lengthSquared > 0 ) { float ratio = max/(float)sqrt(lengthSquared); limited.set( x*ratio, y*ratio, z*ratio); } else { limited.set(x,y,z); } return limited; } inline ofxVec3f& ofxVec3f::limit(float max) { float lengthSquared = (x*x + y*y + z*z); if( lengthSquared > max*max && lengthSquared > 0 ) { float ratio = max/(float)sqrt(lengthSquared); x *= ratio; y *= ratio; z *= ratio; } return *this; } // Perpendicular vector. // // inline ofxVec3f ofxVec3f::crossed( const ofxVec3f& vec ) const { return getCrossed(vec); } inline ofxVec3f ofxVec3f::getCrossed( const ofxVec3f& vec ) const { return ofxVec3f( y*vec.z - z*vec.y, z*vec.x - x*vec.z, x*vec.y - y*vec.x ); } inline ofxVec3f& ofxVec3f::cross( const ofxVec3f& vec ) { float _x = y*vec.z - z*vec.y; float _y = z*vec.x - x*vec.z; z = x*vec.y - y*vec.x; x = _x; y = _y; return *this; } /** * Normalized perpendicular. */ inline ofxVec3f ofxVec3f::perpendiculared( const ofxVec3f& vec ) const { return getPerpendicular(vec); } inline ofxVec3f ofxVec3f::getPerpendicular( const ofxVec3f& vec ) const { float crossX = y*vec.z - z*vec.y; float crossY = z*vec.x - x*vec.z; float crossZ = x*vec.y - y*vec.x; float length = (float)sqrt(crossX*crossX + crossY*crossY + crossZ*crossZ); if( length > 0 ) return ofxVec3f( crossX/length, crossY/length, crossZ/length ); else return ofxVec3f(); } inline ofxVec3f& ofxVec3f::perpendicular( const ofxVec3f& vec ) { float crossX = y*vec.z - z*vec.y; float crossY = z*vec.x - x*vec.z; float crossZ = x*vec.y - y*vec.x; float length = (float)sqrt(crossX*crossX + crossY*crossY + crossZ*crossZ); if( length > 0 ) { x = crossX/length; y = crossY/length; z = crossZ/length; } else { x = 0.f; y = 0.f; z = 0.f; } return *this; } // Length // // inline float ofxVec3f::length() const { return (float)sqrt( x*x + y*y + z*z ); } inline float ofxVec3f::lengthSquared() const { return squareLength(); } inline float ofxVec3f::squareLength() const { return (float)(x*x + y*y + z*z); } /** * Angle (deg) between two vectors. * This is an unsigned relative angle from 0 to 180. * http://www.euclideanspace.com/maths/algebra/vectors/angleBetween/index.htm */ inline float ofxVec3f::angle( const ofxVec3f& vec ) const { ofxVec3f n1 = this->normalized(); ofxVec3f n2 = vec.normalized(); return (float)(acos( n1.dot(n2) )*RAD_TO_DEG); } inline float ofxVec3f::angleRad( const ofxVec3f& vec ) const { ofxVec3f n1 = this->normalized(); ofxVec3f n2 = vec.normalized(); return (float)acos( n1.dot(n2) ); } /** * Dot Product. */ inline float ofxVec3f::dot( const ofxVec3f& vec ) const { return x*vec.x + y*vec.y + z*vec.z; } // Non-Member operators // // inline ofxVec3f operator+( float f, const ofxVec3f& vec ) { return ofxVec3f( f+vec.x, f+vec.y, f+vec.z ); } inline ofxVec3f operator-( float f, const ofxVec3f& vec ) { return ofxVec3f( f-vec.x, f-vec.y, f-vec.z ); } inline ofxVec3f operator*( float f, const ofxVec3f& vec ) { return ofxVec3f( f*vec.x, f*vec.y, f*vec.z ); } inline ofxVec3f operator/( float f, const ofxVec3f& vec ) { return ofxVec3f( f/vec.x, f/vec.y, f/vec.z); } #endif |
I2lmbmRlZiBfT0ZYX1ZFQzNmCiNkZWZpbmUgX09GWF9WRUMzZgoKI2luY2x1ZGUgIm9mQ29uc3RhbnRzLmgiCiNpbmNsdWRlICJvZlR5cGVzLmgiCgoKCmNsYXNzIG9meFZlYzNmIDogcHVibGljIG9mUG9pbnQgewoKCiAgcHVibGljOgoKICAgIG9meFZlYzNmKCBmbG9hdCBfeD0wLjBmLAogICAgICAgICAgICAgIGZsb2F0IF95PTAuMGYsCiAgICAgICAgICAgICAgZmxvYXQgX3o9MC4wZiApOwogICAgICAgICAgICAgIAogICAgb2Z4VmVjM2YoIGNvbnN0IG9mUG9pbnQmIHBudCApOwoKCiAgICAvLyBHZXR0ZXJzIGFuZCBTZXR0ZXJzLgogICAgLy8KICAgIHZvaWQgc2V0KCBmbG9hdCBfeCwgZmxvYXQgX3ksIGZsb2F0IF96ICk7CiAgICB2b2lkIHNldCggY29uc3Qgb2ZQb2ludCYgdmVjICk7CiAgICBmbG9hdCAmb3BlcmF0b3JbXSggY29uc3QgaW50JiBpICk7CgoKICAgIC8vIENoZWNrIHNpbWlsYXJpdHkvZXF1YWxpdHkuCiAgICAvLwogICAgYm9vbCBvcGVyYXRvcj09KCBjb25zdCBvZlBvaW50JiB2ZWMgKTsKICAgIGJvb2wgb3BlcmF0b3IhPSggY29uc3Qgb2ZQb2ludCYgdmVjICk7CiAgICBib29sIG1hdGNoKCBjb25zdCBvZlBvaW50JiB2ZWMsIGZsb2F0IHRvbGxlcmFuY2U9MC4wMDAxICk7CiAgICAvKioKICAgICogQ2hlY2tzIGlmIHZlY3RvcnMgbG9vayBpbiB0aGUgc2FtZSBkaXJlY3Rpb24uCiAgICAqLwogICAgYm9vbCBhbGlnbiggY29uc3Qgb2Z4VmVjM2YmIHZlYywgZmxvYXQgdG9sbGVyYW5jZT0wLjAwMDEgKSBj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SAxLjBmIC0gY29zYTsKCglmbG9hdCBueCA9IHgqKGF4LngqYXgueCpjb3NiICsgY29zYSkKCSAgKyB5KihheC54KmF4LnkqY29zYiAtIGF4Lnoqc2luYSkKCSAgKyB6KihheC54KmF4LnoqY29zYiArIGF4Lnkqc2luYSk7CglmbG9hdCBueSA9IHgqKGF4LnkqYXgueCpjb3NiICsgYXgueipzaW5hKQoJICArIHkqKGF4LnkqYXgueSpjb3NiICsgY29zYSkKCSAgKyB6KihheC55KmF4LnoqY29zYiAtIGF4Lngqc2luYSk7CglmbG9hdCBueiA9IHgqKGF4LnoqYXgueCpjb3NiIC0gYXgueSpzaW5hKQoJICArIHkqKGF4LnoqYXgueSpjb3NiICsgYXgueCpzaW5hKQoJICArIHoqKGF4LnoqYXgueipjb3NiICsgY29zYSk7Cgl4ID0gbng7IHkgPSBueTsgeiA9IG56OwoJcmV0dXJuICp0aGlzOwp9CgoKaW5saW5lIG9meFZlYzNmJiBvZnhWZWMzZjo6cm90YXRlUmFkKGZsb2F0IGFuZ2xlLCBjb25zdCBvZnhWZWMzZiYgYXhpcyApIHsKCW9meFZlYzNmIGF4ID0gYXhpcy5ub3JtYWxpemVkKCk7CglmbG9hdCBhID0gYW5nbGU7CglmbG9hdCBzaW5hID0gc2luKCBhICk7CglmbG9hdCBjb3NhID0gY29zKCBhICk7CglmbG9hdCBjb3NiID0gMS4wZiAtIGNvc2E7CgoJZmxvYXQgbnggPSB4KihheC54KmF4LngqY29zYiArIGNvc2EpCgkgICsgeSooYXgueCpheC55KmNvc2IgLSBheC56KnNpbmEpCgkgICsgeiooYXgueCpheC56KmNvc2IgKyBheC55KnNpbmEpOwoJZmxvYXQgbnkgPSB4KihheC55KmF4LngqY29zYiArIGF4Lnoqc2luYSkKCSAgKyB5KihheC55KmF4LnkqY29zYiArIGNvc2EpCgkgICsgeiooYXgueSpheC56KmNvc2IgLSBheC54KnNpbmEpOwoJZmxvYXQgbnogPSB4KihheC56KmF4LngqY29zYiAtIGF4L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Zsb2F0IGFuZ2xlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IG9mUG9pbnQmIHBpdm90LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IG9meFZlYzNmJiBheGlzICkgY29uc3QKewoJb2Z4VmVjM2YgYXggPSBheGlzLm5vcm1hbGl6ZWQoKTsKCWZsb2F0IHR4ID0geCAtIHBpdm90Lng7CglmbG9hdCB0eSA9IHkgLSBwaXZvdC55OwoJZmxvYXQgdHogPSB6IC0gcGl2b3QuejsKCglmbG9hdCBhID0gYW5nbGU7CglmbG9hdCBzaW5hID0gc2luKCBhICk7CglmbG9hdCBjb3NhID0gY29zKCBhICk7CglmbG9hdCBjb3NiID0gMS4wZiAtIGNvc2E7CgoJZmxvYXQgeHJvdCA9IHR4KihheC54KmF4LngqY29zYiArIGNvc2EpCgkJCSAgICsgdHkqKGF4LngqYXgueSpjb3NiIC0gYXgueipzaW5hKQoJCQkgICArIHR6KihheC54KmF4LnoqY29zYiArIGF4Lnkqc2luYSk7CglmbG9hdCB5cm90ID0gdHgqKGF4LnkqYXgueCpjb3NiICsgYXgueipzaW5hKQoJCQkgICArIHR5KihheC55KmF4LnkqY29zYiArIGNvc2EpCgkJCSAgICsgdHoqKGF4LnkqYXgueipjb3NiIC0gYXgueCpzaW5hKTsKCWZsb2F0IHpyb3QgPSB0eCooYXgueipheC54KmNvc2IgLSBheC55KnNpbmEpCgkJCSAgICsgdHkqKGF4LnoqYXgueSpjb3NiICsgYXgueCpzaW5hKQoJCQkgICArIHR6KihheC56KmF4LnoqY29zYiArIGNvc2EpOwoKCglyZXR1cm4gb2Z4VmVjM2YoIHhyb3QrcGl2b3QueCwgeXJvdCtwaXZvdC55LCB6cm90K3Bpdm90LnogKTsKfQoKCmlubGluZSBvZnhWZWMzZiYgb2Z4VmVjM2Y6OnJvdGF0ZSggZmxvYXQgYW5nbGUsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgb2ZQb2ludCYgcGl2b3QsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgb2Z4VmVjM2YmIGF4aXMgKQp7CglvZnhWZWMzZiBheCA9IGF4aXMubm9ybWFsaXplZCgpOwoJeCAtPSBwaXZvdC54OwoJeSAtPSBwaXZvdC55OwoJeiAtPSBwaXZvdC56OwoKCWZsb2F0IGEgPSAoZmxvYXQpKGFuZ2xlKkRFR19UT19SQUQpOwoJZmxvYXQgc2luYSA9IHNpbiggYSApOwoJZmxvYXQgY29zYSA9IGNvcyggYSApOwoJZmxvYXQgY29zYiA9IDEuMGYgLSBjb3NhOwoKCWZsb2F0IHhyb3QgPSB4KihheC54KmF4LngqY29zYiArIGNvc2EpCgkJCSAgICsgeSooYXgueCpheC55KmNvc2IgLSBheC56KnNpbmEpCgkJCSAgICsgeiooYXgueCpheC56KmNvc2IgKyBheC55KnNpbmEpOwoJZmxvYXQgeXJvdCA9IHgqKGF4LnkqYXgueCpjb3NiICsgYXgueipzaW5hKQoJCQkgICArIHkqKGF4LnkqYXgueSpjb3NiICsgY29zYSkKCQkJICAgKyB6KihheC55KmF4LnoqY29zYiAtIGF4Lngqc2luYSk7CglmbG9hdCB6cm90ID0geCooYXgueipheC54KmNvc2IgLSBheC55KnNpbmEpCgkJCSAgICsgeSooYXgueipheC55KmNvc2IgKyBheC54KnNpbmEpCgkJCSAgICsgeiooYXgueipheC56KmNvc2IgKyBjb3NhKTsKCgl4ID0geHJvdCArIHBpdm90Lng7Cgl5ID0geXJvdCArIHBpdm90Lnk7Cgl6ID0genJvdCArIHBpdm90Lno7CgoJcmV0dXJuICp0aGlzOwp9CgoKaW5saW5lIG9meFZlYzNmJiBvZnhWZWMzZjo6cm90YXRlUmFkKCBmbG9hdCBhbmdsZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBvZlBvaW50JiBwaXZvdCwKICAgICAgICAgICAgICAg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mVjM2YmIHZ4LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgb2Z4VmVjM2YmIHZ5LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgb2Z4VmVjM2YmIHZ6ICkgY29uc3R7CglyZXR1cm4gZ2V0TWFwcGVkKG9yaWdpbiwgdngsIHZ5LCB2eik7Cn0KCmlubGluZSBvZnhWZWMzZiBvZnhWZWMzZjo6Z2V0TWFwcGVkKCBjb25zdCBvZlBvaW50JiBvcmlnaW4sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBvZnhWZWMzZiYgdngsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBvZnhWZWMzZiYgdnksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBvZnhWZWMzZiYgdnogKSBjb25zdAp7CglyZXR1cm4gb2Z4VmVjM2YoIG9yaWdpbi54ICsgeCp2eC54ICsgeSp2eS54ICsgeip2ei54LAogICAgICAgICAgICAgICAgICAgICBvcmlnaW4ueSArIHgqdngueSArIHkqdnkueSArIHoqdnoueSwKICAgICAgICAgICAgICAgICAgICAgb3JpZ2luLnogKyB4KnZ4LnogKyB5KnZ5LnogKyB6KnZ6LnogKTsKfQoKaW5saW5lIG9meFZlYzNmJiBvZnhWZWMzZjo6bWFwKCBjb25zdCBvZlBvaW50JiBvcmlnaW4sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgb2Z4VmVjM2YmIHZ4LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IG9meFZlYzNmJiB2eSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBvZnhWZWMzZiYgdnogKQp7CglmbG9hdCB4bWFwID0gb3JpZ2luLnggKyB4KnZ4LnggKyB5KnZ5LnggKyB6KnZ6Lng7CglmbG9hdCB5bWFwID0gIG9yaWdp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XRvci0oIGZsb2F0IGYsIGNvbnN0IG9meFZlYzNmJiB2ZWMgKSB7CiAgICByZXR1cm4gb2Z4VmVjM2YoIGYtdmVjLngsIGYtdmVjLnksIGYtdmVjLnogKTsKfQoKaW5saW5lIG9meFZlYzNmIG9wZXJhdG9yKiggZmxvYXQgZiwgY29uc3Qgb2Z4VmVjM2YmIHZlYyApIHsKICAgIHJldHVybiBvZnhWZWMzZiggZip2ZWMueCwgZip2ZWMueSwgZip2ZWMueiApOwp9CgppbmxpbmUgb2Z4VmVjM2Ygb3BlcmF0b3IvKCBmbG9hdCBmLCBjb25zdCBvZnhWZWMzZiYgdmVjICkgewogICAgcmV0dXJuIG9meFZlYzNmKCBmL3ZlYy54LCBmL3ZlYy55LCBmL3ZlYy56KTsKfQoKCgoKI2VuZGlmCg==
prog.cpp:4:25: error: ofConstants.h: No such file or directory
prog.cpp:5:21: error: ofTypes.h: No such file or directory
prog.cpp:9: error: expected class-name before ‘{’ token
prog.cpp:18: error: expected ‘,’ or ‘...’ before ‘&’ token
prog.cpp:18: error: ISO C++ forbids declaration of ‘ofPoint’ with no type
prog.cpp:24: error: expected ‘,’ or ‘...’ before ‘&’ token
prog.cpp:24: error: ISO C++ forbids declaration of ‘ofPoint’ with no type
prog.cpp:30: error: expected ‘,’ or ‘...’ before ‘&’ token
prog.cpp:30: error: ISO C++ forbids declaration of ‘ofPoint’ with no type
prog.cpp:31: error: expected ‘,’ or ‘...’ before ‘&’ token
prog.cpp:31: error: ISO C++ forbids declaration of ‘ofPoint’ with no type
prog.cpp:32: error: expected ‘,’ or ‘...’ before ‘&’ token
prog.cpp:32: error: ISO C++ forbids declaration of ‘ofPoint’ with no type
prog.cpp:42: error: expected ‘,’ or ‘...’ before ‘&’ token
prog.cpp:42: error: ISO C++ forbids declaration of ‘ofPoint’ with no type
prog.cpp:43: error: expected ‘,’ or ‘...’ before ‘&’ token
prog.cpp:43: error: ISO C++ forbids declaration of ‘ofPoint’ with no type
prog.cpp:44: error: expected ‘,’ or ‘...’ before ‘&’ token
prog.cpp:44: error: ISO C++ forbids declaration of ‘ofPoint’ with no type
prog.cpp:45: error: expected ‘,’ or ‘...’ before ‘&’ token
prog.cpp:45: error: ISO C++ forbids declaration of ‘ofPoint’ with no type
prog.cpp:46: error: expected ‘,’ or ‘...’ before ‘&’ token
prog.cpp:46: error: ISO C++ forbids declaration of ‘ofPoint’ with no type
prog.cpp:47: error: expected ‘,’ or ‘...’ before ‘&’ token
prog.cpp:47: error: ISO C++ forbids declaration of ‘ofPoint’ with no type
prog.cpp:48: error: expected ‘,’ or ‘...’ before ‘&’ token
prog.cpp:48: error: ISO C++ forbids declaration of ‘ofPoint’ with no type
prog.cpp:49: error: expected ‘,’ or ‘...’ before ‘&’ token
prog.cpp:49: error: ISO C++ forbids declaration of ‘ofPoint’ with no type
prog.cpp:50: error: expected ‘,’ or ‘...’ before ‘&’ token
prog.cpp:50: error: ISO C++ forbids declaration of ‘ofPoint’ with no type
prog.cpp:87: error: expected ‘,’ or ‘...’ before ‘&’ token
prog.cpp:87: error: ISO C++ forbids declaration of ‘ofPoint’ with no type
prog.cpp:88: error: expected ‘,’ or ‘...’ before ‘&’ token
prog.cpp:88: error: ISO C++ forbids declaration of ‘ofPoint’ with no type
prog.cpp:89: error: expected ‘,’ or ‘...’ before ‘&’ token
prog.cpp:89: error: ISO C++ forbids declaration of ‘ofPoint’ with no type
prog.cpp:90: error: expected ‘,’ or ‘...’ before ‘&’ token
prog.cpp:90: error: ISO C++ forbids declaration of ‘ofPoint’ with no type
prog.cpp:95: error: expected ‘,’ or ‘...’ before ‘&’ token
prog.cpp:98: error: ISO C++ forbids declaration of ‘ofPoint’ with no type
prog.cpp:99: error: expected ‘,’ or ‘...’ before ‘&’ token
prog.cpp:102: error: ISO C++ forbids declaration of ‘ofPoint’ with no type
prog.cpp:107: error: expected ‘,’ or ‘...’ before ‘&’ token
prog.cpp:107: error: ISO C++ forbids declaration of ‘ofPoint’ with no type
prog.cpp:108: error: expected ‘,’ or ‘...’ before ‘&’ token
prog.cpp:108: error: ISO C++ forbids declaration of ‘ofPoint’ with no type
prog.cpp:117: error: expected ‘,’ or ‘...’ before ‘&’ token
prog.cpp:117: error: ISO C++ forbids declaration of ‘ofPoint’ with no type
prog.cpp:118: error: expected ‘,’ or ‘...’ before ‘&’ token
prog.cpp:118: error: ISO C++ forbids declaration of ‘ofPoint’ with no type
prog.cpp:119: error: expected ‘,’ or ‘...’ before ‘&’ token
prog.cpp:119: error: ISO C++ forbids declaration of ‘ofPoint’ with no type
prog.cpp:120: error: expected ‘,’ or ‘...’ before ‘&’ token
prog.cpp:120: error: ISO C++ forbids declaration of ‘ofPoint’ with no type
prog.cpp:121: error: expected ‘,’ or ‘...’ before ‘*’ token
prog.cpp:121: error: ISO C++ forbids declaration of ‘ofPoint’ with no type
prog.cpp:197: error: expected ‘,’ or ‘...’ before ‘&’ token
prog.cpp:200: error: ISO C++ forbids declaration of ‘ofPoint’ with no type
prog.cpp:203: error: expected ‘,’ or ‘...’ before ‘&’ token
prog.cpp:203: error: ISO C++ forbids declaration of ‘ofPoint’ with no type
prog.cpp:206: error: expected ‘,’ or ‘...’ before ‘&’ token
prog.cpp:206: error: ISO C++ forbids declaration of ‘ofPoint’ with no type
prog.cpp:209: error: expected ‘,’ or ‘...’ before ‘&’ token
prog.cpp:209: error: ISO C++ forbids declaration of ‘ofPoint’ with no type
prog.cpp:213: error: expected ‘,’ or ‘...’ before ‘&’ token
prog.cpp:214: error: ISO C++ forbids declaration of ‘ofPoint’ with no type
prog.cpp: In constructor ‘ofxVec3f::ofxVec3f(float, float, float)’:
prog.cpp:241: error: ‘x’ was not declared in this scope
prog.cpp:242: error: ‘y’ was not declared in this scope
prog.cpp:243: error: ‘z’ was not declared in this scope
prog.cpp: At global scope:
prog.cpp:246: error: expected ‘,’ or ‘...’ before ‘&’ token
prog.cpp:246: error: ISO C++ forbids declaration of ‘ofPoint’ with no type
prog.cpp: In constructor ‘ofxVec3f::ofxVec3f(int)’:
prog.cpp:247: error: ‘x’ was not declared in this scope
prog.cpp:247: error: ‘pnt’ was not declared in this scope
prog.cpp:248: error: ‘y’ was not declared in this scope
prog.cpp:249: error: ‘z’ was not declared in this scope
prog.cpp: In member function ‘void ofxVec3f::set(float, float, float)’:
prog.cpp:258: error: ‘x’ was not declared in this scope
prog.cpp:259: error: ‘y’ was not declared in this scope
prog.cpp:260: error: ‘z’ was not declared in this scope
prog.cpp: At global scope:
prog.cpp:263: error: expected ‘,’ or ‘...’ before ‘&’ token
prog.cpp:263: error: ISO C++ forbids declaration of ‘ofPoint’ with no type
prog.cpp: In member function ‘void ofxVec3f::set(int)’:
prog.cpp:264: error: ‘x’ was not declared in this scope
prog.cpp:264: error: ‘vec’ was not declared in this scope
prog.cpp:265: error: ‘y’ was not declared in this scope
prog.cpp:266: error: ‘z’ was not declared in this scope
prog.cpp: In member function ‘float& ofxVec3f::operator[](const int&)’:
prog.cpp:271: error: ‘x’ was not declared in this scope
prog.cpp:272: error: ‘y’ was not declared in this scope
prog.cpp:273: error: ‘z’ was not declared in this scope
prog.cpp: At global scope:
prog.cpp:283: error: expected ‘,’ or ‘...’ before ‘&’ token
prog.cpp:283: error: ISO C++ forbids declaration of ‘ofPoint’ with no type
prog.cpp: In member function ‘bool ofxVec3f::operator==(int)’:
prog.cpp:284: error: ‘x’ was not declared in this scope
prog.cpp:284: error: ‘vec’ was not declared in this scope
prog.cpp:284: error: ‘y’ was not declared in this scope
prog.cpp:284: error: ‘z’ was not declared in this scope
prog.cpp: At global scope:
prog.cpp:287: error: expected ‘,’ or ‘...’ before ‘&’ token
prog.cpp:287: error: ISO C++ forbids declaration of ‘ofPoint’ with no type
prog.cpp: In member function ‘bool ofxVec3f::operator!=(int)’:
prog.cpp:288: error: ‘x’ was not declared in this scope
prog.cpp:288: error: ‘vec’ was not declared in this scope
prog.cpp:288: error: ‘y’ was not declared in this scope
prog.cpp:288: error: ‘z’ was not declared in this scope
prog.cpp: At global scope:
prog.cpp:291: error: expected ‘,’ or ‘...’ before ‘&’ token
prog.cpp:291: error: ISO C++ forbids declaration of ‘ofPoint’ with no type
prog.cpp: In member function ‘bool ofxVec3f::match(int)’:
prog.cpp:292: error: ‘x’ was not declared in this scope
prog.cpp:292: error: ‘vec’ was not declared in this scope
prog.cpp:292: error: ‘fabs’ was not declared in this scope
prog.cpp:292: error: ‘tollerance’ was not declared in this scope
prog.cpp:293: error: ‘y’ was not declared in this scope
prog.cpp:294: error: ‘z’ was not declared in this scope
prog.cpp: At global scope:
prog.cpp:315: error: expected ‘,’ or ‘...’ before ‘&’ token
prog.cpp:315: error: ISO C++ forbids declaration of ‘ofPoint’ with no type
prog.cpp: In member function ‘void ofxVec3f::operator=(int)’:
prog.cpp:316: error: ‘x’ was not declared in this scope
prog.cpp:316: error: ‘vec’ was not declared in this scope
prog.cpp:317: error: ‘y’ was not declared in this scope
prog.cpp:318: error: ‘z’ was not declared in this scope
prog.cpp: At global scope:
prog.cpp:321: error: expected ‘,’ or ‘...’ before ‘&’ token
prog.cpp:321: error: ISO C++ forbids declaration of ‘ofPoint’ with no type
prog.cpp: In member function ‘ofxVec3f ofxVec3f::operator+(int) const’:
prog.cpp:322: error: ‘x’ was not declared in this scope
prog.cpp:322: error: ‘pnt’ was not declared in this scope
prog.cpp:322: error: ‘y’ was not declared in this scope
prog.cpp:322: error: ‘z’ was not declared in this scope
prog.cpp: At global scope:
prog.cpp:325: error: expected ‘,’ or ‘...’ before ‘&’ token
prog.cpp:325: error: ISO C++ forbids declaration of ‘ofPoint’ with no type
prog.cpp: In member function ‘ofxVec3f& ofxVec3f::operator+=(int)’:
prog.cpp:326: error: ‘x’ was not declared in this scope
prog.cpp:326: error: ‘pnt’ was not declared in this scope
prog.cpp:327: error: ‘y’ was not declared in this scope
prog.cpp:328: error: ‘z’ was not declared in this scope
prog.cpp: At global scope:
prog.cpp:332: error: expected ‘,’ or ‘...’ before ‘&’ token
prog.cpp:332: error: ISO C++ forbids declaration of ‘ofPoint’ with no type
prog.cpp: In member function ‘ofxVec3f ofxVec3f::operator-(int) const’:
prog.cpp:333: error: ‘x’ was not declared in this scope
prog.cpp:333: error: ‘vec’ was not declared in this scope
prog.cpp:333: error: ‘y’ was not declared in this scope
prog.cpp:333: error: ‘z’ was not declared in this scope
prog.cpp: At global scope:
prog.cpp:336: error: expected ‘,’ or ‘...’ before ‘&’ token
prog.cpp:336: error: ISO C++ forbids declaration of ‘ofPoint’ with no type
prog.cpp: In member function ‘ofxVec3f& ofxVec3f::operator-=(int)’:
prog.cpp:337: error: ‘x’ was not declared in this scope
prog.cpp:337: error: ‘vec’ was not declared in this scope
prog.cpp:338: error: ‘y’ was not declared in this scope
prog.cpp:339: error: ‘z’ was not declared in this scope
prog.cpp: At global scope:
prog.cpp:343: error: expected ‘,’ or ‘...’ before ‘&’ token
prog.cpp:343: error: ISO C++ forbids declaration of ‘ofPoint’ with no type
prog.cpp: In member function ‘ofxVec3f ofxVec3f::operator*(int) const’:
prog.cpp:344: error: ‘x’ was not declared in this scope
prog.cpp:344: error: ‘vec’ was not declared in this scope
prog.cpp:344: error: ‘y’ was not declared in this scope
prog.cpp:344: error: ‘z’ was not declared in this scope
prog.cpp: At global scope:
prog.cpp:347: error: expected ‘,’ or ‘...’ before ‘&’ token
prog.cpp:347: error: ISO C++ forbids declaration of ‘ofPoint’ with no type
prog.cpp: In member function ‘ofxVec3f& ofxVec3f::operator*=(int)’:
prog.cpp:348: error: ‘x’ was not declared in this scope
prog.cpp:348: error: ‘vec’ was not declared in this scope
prog.cpp:349: error: ‘y’ was not declared in this scope
prog.cpp:350: error: ‘z’ was not declared in this scope
prog.cpp: At global scope:
prog.cpp:354: error: expected ‘,’ or ‘...’ before ‘&’ token
prog.cpp:354: error: ISO C++ forbids declaration of ‘ofPoint’ with no type
prog.cpp: In member function ‘ofxVec3f ofxVec3f::operator/(int) const’:
prog.cpp:355: error: ‘vec’ was not declared in this scope
prog.cpp:355: error: ‘x’ was not declared in this scope
prog.cpp:355: error: ‘y’ was not declared in this scope
prog.cpp:355: error: ‘z’ was not declared in this scope
prog.cpp: At global scope:
prog.cpp:358: error: expected ‘,’ or ‘...’ before ‘&’ token
prog.cpp:358: error: ISO C++ forbids declaration of ‘ofPoint’ with no type
prog.cpp: In member function ‘ofxVec3f& ofxVec3f::operator/=(int)’:
prog.cpp:359: error: ‘vec’ was not declared in this scope
prog.cpp:359: error: ‘x’ was not declared in this scope
prog.cpp:360: error: ‘y’ was not declared in this scope
prog.cpp:361: error: ‘z’ was not declared in this scope
prog.cpp: In member function ‘ofxVec3f ofxVec3f::operator-() const’:
prog.cpp:366: error: ‘x’ was not declared in this scope
prog.cpp:366: error: ‘y’ was not declared in this scope
prog.cpp:366: error: ‘z’ was not declared in this scope
prog.cpp: In member function ‘void ofxVec3f::operator=(float)’:
prog.cpp:374: error: ‘x’ was not declared in this scope
prog.cpp:375: error: ‘y’ was not declared in this scope
prog.cpp:376: error: ‘z’ was not declared in this scope
prog.cpp: In member function ‘ofxVec3f ofxVec3f::operator+(float) const’:
prog.cpp:380: error: ‘x’ was not declared in this scope
prog.cpp:380: error: ‘y’ was not declared in this scope
prog.cpp:380: error: ‘z’ was not declared in this scope
prog.cpp: In member function ‘ofxVec3f& ofxVec3f::operator+=(float)’:
prog.cpp:384: error: ‘x’ was not declared in this scope
prog.cpp:385: error: ‘y’ was not declared in this scope
prog.cpp:386: error: ‘z’ was not declared in this scope
prog.cpp: In member function ‘ofxVec3f ofxVec3f::operator-(float) const’:
prog.cpp:391: error: ‘x’ was not declared in this scope
prog.cpp:391: error: ‘y’ was not declared in this scope
prog.cpp:391: error: ‘z’ was not declared in this scope
prog.cpp: In member function ‘ofxVec3f& ofxVec3f::operator-=(float)’:
prog.cpp:395: error: ‘x’ was not declared in this scope
prog.cpp:396: error: ‘y’ was not declared in this scope
prog.cpp:397: error: ‘z’ was not declared in this scope
prog.cpp: In member function ‘ofxVec3f ofxVec3f::operator*(float) const’:
prog.cpp:402: error: ‘x’ was not declared in this scope
prog.cpp:402: error: ‘y’ was not declared in this scope
prog.cpp:402: error: ‘z’ was not declared in this scope
prog.cpp: In member function ‘ofxVec3f& ofxVec3f::operator*=(float)’:
prog.cpp:406: error: ‘x’ was not declared in this scope
prog.cpp:407: error: ‘y’ was not declared in this scope
prog.cpp:408: error: ‘z’ was not declared in this scope
prog.cpp: In member function ‘ofxVec3f ofxVec3f::operator/(float) const’:
prog.cpp:413: error: ‘x’ was not declared in this scope
prog.cpp:413: error: ‘y’ was not declared in this scope
prog.cpp:413: error: ‘z’ was not declared in this scope
prog.cpp:415: error: ‘x’ was not declared in this scope
prog.cpp:415: error: ‘y’ was not declared in this scope
prog.cpp:415: error: ‘z’ was not declared in this scope
prog.cpp: In member function ‘ofxVec3f& ofxVec3f::operator/=(float)’:
prog.cpp:421: error: ‘x’ was not declared in this scope
prog.cpp:422: error: ‘y’ was not declared in this scope
prog.cpp:423: error: ‘z’ was not declared in this scope
prog.cpp: In member function ‘ofxVec3f ofxVec3f::getScaled(float) const’:
prog.cpp:435: error: ‘x’ was not declared in this scope
prog.cpp:435: error: ‘y’ was not declared in this scope
prog.cpp:435: error: ‘z’ was not declared in this scope
prog.cpp:435: error: ‘sqrt’ was not declared in this scope
prog.cpp: In member function ‘ofxVec3f& ofxVec3f::scale(float)’:
prog.cpp:445: error: ‘x’ was not declared in this scope
prog.cpp:445: error: ‘y’ was not declared in this scope
prog.cpp:445: error: ‘z’ was not declared in this scope
prog.cpp:445: error: ‘sqrt’ was not declared in this scope
prog.cpp: In member function ‘ofxVec3f ofxVec3f::getRotated(float, const ofxVec3f&) const’:
prog.cpp:464: error: ‘DEG_TO_RAD’ was not declared in this scope
prog.cpp:465: error: ‘sin’ was not declared in this scope
prog.cpp:466: error: ‘cos’ was not declared in this scope
prog.cpp:469: error: ‘x’ was not declared in this scope
prog.cpp:469: error: ‘class ofxVec3f’ has no member named ‘x’
prog.cpp:469: error: ‘class ofxVec3f’ has no member named ‘x’
prog.cpp:470: error: ‘y’ was not declared in this scope
prog.cpp:470: error: ‘class ofxVec3f’ has no member named ‘x’
prog.cpp:470: error: ‘class ofxVec3f’ has no member named ‘y’
prog.cpp:470: error: ‘class ofxVec3f’ has no member named ‘z’
prog.cpp:471: error: ‘z’ was not declared in this scope
prog.cpp:471: error: ‘class ofxVec3f’ has no member named ‘x’
prog.cpp:471: error: ‘class ofxVec3f’ has no member named ‘z’
prog.cpp:471: error: ‘class ofxVec3f’ has no member named ‘y’
prog.cpp:472: error: ‘class ofxVec3f’ has no member named ‘y’
prog.cpp:472: error: ‘class ofxVec3f’ has no member named ‘x’
prog.cpp:472: error: ‘class ofxVec3f’ has no member named ‘z’
prog.cpp:473: error: ‘class ofxVec3f’ has no member named ‘y’
prog.cpp:473: error: ‘class ofxVec3f’ has no member named ‘y’
prog.cpp:474: error: ‘class ofxVec3f’ has no member named ‘y’
prog.cpp:474: error: ‘class ofxVec3f’ has no member named ‘z’
prog.cpp:474: error: ‘class ofxVec3f’ has no member named ‘x’
prog.cpp:475: error: ‘class ofxVec3f’ has no member named ‘z’
prog.cpp:475: error: ‘class ofxVec3f’ has no member named ‘x’
prog.cpp:475: error: ‘class ofxVec3f’ has no member named ‘y’
prog.cpp:476: error: ‘class ofxVec3f’ has no member named ‘z’
prog.cpp:476: error: ‘class ofxVec3f’ has no member named ‘y’
prog.cpp:476: error: ‘class ofxVec3f’ has no member named ‘x’
prog.cpp:477: error: ‘class ofxVec3f’ has no member named ‘z’
prog.cpp:477: error: ‘class ofxVec3f’ has no member named ‘z’
prog.cpp: In member function ‘ofxVec3f ofxVec3f::getRotatedRad(float, const ofxVec3f&) const’:
prog.cpp:483: error: ‘sin’ was not declared in this scope
prog.cpp:484: error: ‘cos’ was not declared in this scope
prog.cpp:487: error: ‘x’ was not declared in this scope
prog.cpp:487: error: ‘class ofxVec3f’ has no member named ‘x’
prog.cpp:487: error: ‘class ofxVec3f’ has no member named ‘x’
prog.cpp:488: error: ‘y’ was not declared in this scope
prog.cpp:488: error: ‘class ofxVec3f’ has no member named ‘x’
prog.cpp:488: error: ‘class ofxVec3f’ has no member named ‘y’
prog.cpp:488: error: ‘class ofxVec3f’ has no member named ‘z’
prog.cpp:489: error: ‘z’ was not declared in this scope
prog.cpp:489: error: ‘class ofxVec3f’ has no member named ‘x’
prog.cpp:489: error: ‘class ofxVec3f’ has no member named ‘z’
prog.cpp:489: error: ‘class ofxVec3f’ has no member named ‘y’
prog.cpp:490: error: ‘class ofxVec3f’ has no member named ‘y’
prog.cpp:490: error: ‘class ofxVec3f’ has no member named ‘x’
prog.cpp:490: error: ‘class ofxVec3f’ has no member named ‘z’
prog.cpp:491: error: ‘class ofxVec3f’ has no member named ‘y’
prog.cpp:491: error: ‘class ofxVec3f’ has no member named ‘y’
prog.cpp:492: error: ‘class ofxVec3f’ has no member named ‘y’
prog.cpp:492: error: ‘class ofxVec3f’ has no member named ‘z’
prog.cpp:492: error: ‘class ofxVec3f’ has no member named ‘x’
prog.cpp:493: error: ‘class ofxVec3f’ has no member named ‘z’
prog.cpp:493: error: ‘class ofxVec3f’ has no member named ‘x’
prog.cpp:493: error: ‘class ofxVec3f’ has no member named ‘y’
prog.cpp:494: error: ‘class ofxVec3f’ has no member named ‘z’
prog.cpp:494: error: ‘class ofxVec3f’ has no member named ‘y’
prog.cpp:494: error: ‘class ofxVec3f’ has no member named ‘x’
prog.cpp:495: error: ‘class ofxVec3f’ has no member named ‘z’
prog.cpp:495: error: ‘class ofxVec3f’ has no member named ‘z’
prog.cpp: In member function ‘ofxVec3f& ofxVec3f::rotate(float, const ofxVec3f&)’:
prog.cpp:500: error: ‘DEG_TO_RAD’ was not declared in this scope
prog.cpp:501: error: ‘sin’ was not declared in this scope
prog.cpp:502: error: ‘cos’ was not declared in this scope
prog.cpp:505: error: ‘x’ was not declared in this scope
prog.cpp:505: error: ‘class ofxVec3f’ has no member named ‘x’
prog.cpp:505: error: ‘class ofxVec3f’ has no member named ‘x’
prog.cpp:506: error: ‘y’ was not declared in this scope
prog.cpp:506: error: ‘class ofxVec3f’ has no member named ‘x’
prog.cpp:506: error: ‘class ofxVec3f’ has no member named ‘y’
prog.cpp:506: error: ‘class ofxVec3f’ has no member named ‘z’
prog.cpp:507: error: ‘z’ was not declared in this scope
prog.cpp:507: error: ‘class ofxVec3f’ has no member named ‘x’
prog.cpp:507: error: ‘class ofxVec3f’ has no member named ‘z’
prog.cpp:507: error: ‘class ofxVec3f’ has no member named ‘y’
prog.cpp:508: error: ‘class ofxVec3f’ has no member named ‘y’
prog.cpp:508: error: ‘class ofxVec3f’ has no member named ‘x’
prog.cpp:508: error: ‘class ofxVec3f’ has no member named ‘z’
prog.cpp:509: error: ‘class ofxVec3f’ has no member named ‘y’
prog.cpp:509: error: ‘class ofxVec3f’ has no member named ‘y’
prog.cpp:510: error: ‘class ofxVec3f’ has no member named ‘y’
prog.cpp:510: error: ‘class ofxVec3f’ has no member named ‘z’
prog.cpp:510: error: ‘class ofxVec3f’ has no member named ‘x’
prog.cpp:511: error: ‘class ofxVec3f’ has no member named ‘z’
prog.cpp:511: error: ‘class ofxVec3f’ has no member named ‘x’
prog.cpp:511: error: ‘class ofxVec3f’ has no member named ‘y’
prog.cpp:512: error: ‘class ofxVec3f’ has no member named ‘z’
prog.cpp:512: error: ‘class ofxVec3f’ has no member named ‘y’
prog.cpp:512: error: ‘class ofxVec3f’ has no member named ‘x’
prog.cpp:513: error: ‘class ofxVec3f’ has no member named ‘z’
prog.cpp:513: error: ‘class ofxVec3f’ has no member named ‘z’
prog.cpp: In member function ‘ofxVec3f& ofxVec3f::rotateRad(float, const ofxVec3f&)’:
prog.cpp:522: error: ‘sin’ was not declared in this scope
prog.cpp:523: error: ‘cos’ was not declared in this scope
prog.cpp:526: error: ‘x’ was not declared in this scope
prog.cpp:526: error: ‘class ofxVec3f’ has no member named ‘x’
prog.cpp:526: error: ‘class ofxVec3f’ has no member named ‘x’
prog.cpp:527: error: ‘y’ was not declared in this scope
prog.cpp:527: error: ‘class ofxVec3f’ has no member named ‘x’
prog.cpp:527: error: ‘class ofxVec3f’ has no member named ‘y’
prog.cpp:527: error: ‘class ofxVec3f’ has no member named ‘z’
prog.cpp:528: error: ‘z’ was not declared in this scope
prog.cpp:528: error: ‘class ofxVec3f’ has no member named ‘x’
prog.cpp:528: error: ‘class ofxVec3f’ has no member named ‘z’
prog.cpp:528: error: ‘class ofxVec3f’ has no member named ‘y’
prog.cpp:529: error: ‘class ofxVec3f’ has no member named ‘y’
prog.cpp:529: error: ‘class ofxVec3f’ has no member named ‘x’
prog.cpp:529: error: ‘class ofxVec3f’ has no member named ‘z’
prog.cpp:530: error: ‘class ofxVec3f’ has no member named ‘y’
prog.cpp:530: error: ‘class ofxVec3f’ has no member named ‘y’
prog.cpp:531: error: ‘class ofxVec3f’ has no member named ‘y’
prog.cpp:531: error: ‘class ofxVec3f’ has no member named ‘z’
prog.cpp:531: error: ‘class ofxVec3f’ has no member named ‘x’
prog.cpp:532: error: ‘class ofxVec3f’ has no member named ‘z’
prog.cpp:532: error: ‘class ofxVec3f’ has no member named ‘x’
prog.cpp:532: error: ‘class ofxVec3f’ has no member named ‘y’
prog.cpp:533: error: ‘class ofxVec3f’ has no member named ‘z’
prog.cpp:533: error: ‘class ofxVec3f’ has no member named ‘y’
prog.cpp:533: error: ‘class ofxVec3f’ has no member named ‘x’
prog.cpp:534: error: ‘class ofxVec3f’ has no member named ‘z’
prog.cpp:534: error: ‘class ofxVec3f’ has no member named ‘z’
prog.cpp: In member function ‘ofxVec3f ofxVec3f::getRotated(float, float, float) const’:
prog.cpp:545: error: ‘DEG_TO_RAD’ was not declared in this scope
prog.cpp:545: error: ‘cos’ was not declared in this scope
prog.cpp:546: error: ‘sin’ was not declared in this scope
prog.cpp:552: error: ‘x’ was not declared in this scope
prog.cpp:552: error: ‘y’ was not declared in this scope
prog.cpp:552: error: ‘z’ was not declared in this scope
prog.cpp: In member function ‘ofxVec3f ofxVec3f::getRotatedRad(float, float, float) const’:
prog.cpp:560: error: ‘cos’ was not declared in this scope
prog.cpp:561: error: ‘sin’ was not declared in this scope
prog.cpp:567: error: ‘x’ was not declared in this scope
prog.cpp:567: error: ‘y’ was not declared in this scope
prog.cpp:567: error: ‘z’ was not declared in this scope
prog.cpp: In member function ‘ofxVec3f& ofxVec3f::rotate(float, float, float)’:
prog.cpp:576: error: ‘DEG_TO_RAD’ was not declared in this scope
prog.cpp:576: error: ‘cos’ was not declared in this scope
prog.cpp:577: error: ‘sin’ was not declared in this scope
prog.cpp:583: error: ‘x’ was not declared in this scope
prog.cpp:583: error: ‘y’ was not declared in this scope
prog.cpp:583: error: ‘z’ was not declared in this scope
prog.cpp: In member function ‘ofxVec3f& ofxVec3f::rotateRad(float, float, float)’:
prog.cpp:593: error: ‘cos’ was not declared in this scope
prog.cpp:594: error: ‘sin’ was not declared in this scope
prog.cpp:600: error: ‘x’ was not declared in this scope
prog.cpp:600: error: ‘y’ was not declared in this scope
prog.cpp:600: error: ‘z’ was not declared in this scope
prog.cpp: At global scope:
prog.cpp:613: error: expected ‘,’ or ‘...’ before ‘&’ token
prog.cpp:614: error: ISO C++ forbids declaration of ‘ofPoint’ with no type
prog.cpp: In member function ‘ofxVec3f ofxVec3f::rotated(float, int) const’:
prog.cpp:615: error: ‘pivot’ was not declared in this scope
prog.cpp:615: error: ‘axis’ was not declared in this scope
prog.cpp: At global scope:
prog.cpp:619: error: expected ‘,’ or ‘...’ before ‘&’ token
prog.cpp:620: error: ISO C++ forbids declaration of ‘ofPoint’ with no type
prog.cpp: In member function ‘ofxVec3f ofxVec3f::getRotated(float, int) const’:
prog.cpp:622: error: ‘axis’ was not declared in this scope
prog.cpp:623: error: ‘x’ was not declared in this scope
prog.cpp:623: error: ‘pivot’ was not declared in this scope
prog.cpp:624: error: ‘y’ was not declared in this scope
prog.cpp:625: error: ‘z’ was not declared in this scope
prog.cpp:627: error: ‘DEG_TO_RAD’ was not declared in this scope
prog.cpp:628: error: ‘sin’ was not declared in this scope
prog.cpp:629: error: ‘cos’ was not declared in this scope
prog.cpp:632: error: ‘class ofxVec3f’ has no member named ‘x’
prog.cpp:632: error: ‘class ofxVec3f’ has no member named ‘x’
prog.cpp:633: error: ‘class ofxVec3f’ has no member named ‘x’
prog.cpp:633: error: ‘class ofxVec3f’ has no member named ‘y’
prog.cpp:633: error: ‘class ofxVec3f’ has no member named ‘z’
prog.cpp:634: error: ‘class ofxVec3f’ has no member named ‘x’
prog.cpp:634: error: ‘class ofxVec3f’ has no member named ‘z’
prog.cpp:634: error: ‘class ofxVec3f’ has no member named ‘y’
prog.cpp:635: error: ‘class ofxVec3f’ has no member named ‘y’
prog.cpp:635: error: ‘class ofxVec3f’ has no member named ‘x’
prog.cpp:635: error: ‘class ofxVec3f’ has no member named ‘z’
prog.cpp:636: error: ‘class ofxVec3f’ has no member named ‘y’
prog.cpp:636: error: ‘class ofxVec3f’ has no member named ‘y’
prog.cpp:637: error: ‘class ofxVec3f’ has no member named ‘y’
prog.cpp:637: error: ‘class ofxVec3f’ has no member named ‘z’
prog.cpp:637: error: ‘class ofxVec3f’ has no member named ‘x’
prog.cpp:638: error: ‘class ofxVec3f’ has no member named ‘z’
prog.cpp:638: error: ‘class ofxVec3f’ has no member named ‘x’
prog.cpp:638: error: ‘class ofxVec3f’ has no member named ‘y’
prog.cpp:639: error: ‘class ofxVec3f’ has no member named ‘z’
prog.cpp:639: error: ‘class ofxVec3f’ has no member named ‘y’
prog.cpp:639: error: ‘class ofxVec3f’ has no member named ‘x’
prog.cpp:640: error: ‘class ofxVec3f’ has no member named ‘z’
prog.cpp:640: error: ‘class ofxVec3f’ has no member named ‘z’
prog.cpp: At global scope:
prog.cpp:648: error: expected ‘,’ or ‘...’ before ‘&’ token
prog.cpp:649: error: ISO C++ forbids declaration of ‘ofPoint’ with no type
prog.cpp: In member function ‘ofxVec3f ofxVec3f::getRotatedRad(float, int) const’:
prog.cpp:651: error: ‘axis’ was not declared in this scope
prog.cpp:652: error: ‘x’ was not declared in this scope
prog.cpp:652: error: ‘pivot’ was not declared in this scope
prog.cpp:653: error: ‘y’ was not declared in this scope
prog.cpp:654: error: ‘z’ was not declared in this scope
prog.cpp:657: error: ‘sin’ was not declared in this scope
prog.cpp:658: error: ‘cos’ was not declared in this scope
prog.cpp:661: error: ‘class ofxVec3f’ has no member named ‘x’
prog.cpp:661: error: ‘class ofxVec3f’ has no member named ‘x’
prog.cpp:662: error: ‘class ofxVec3f’ has no member named ‘x’
prog.cpp:662: error: ‘class ofxVec3f’ has no member named ‘y’
prog.cpp:662: error: ‘class ofxVec3f’ has no member named ‘z’
prog.cpp:663: error: ‘class ofxVec3f’ has no member named ‘x’
prog.cpp:663: error: ‘class ofxVec3f’ has no member named ‘z’
prog.cpp:663: error: ‘class ofxVec3f’ has no member named ‘y’
prog.cpp:664: error: ‘class ofxVec3f’ has no member named ‘y’
prog.cpp:664: error: ‘class ofxVec3f’ has no member named ‘x’
prog.cpp:664: error: ‘class ofxVec3f’ has no member named ‘z’
prog.cpp:665: error: ‘class ofxVec3f’ has no member named ‘y’
prog.cpp:665: error: ‘class ofxVec3f’ has no member named ‘y’
prog.cpp:666: error: ‘class ofxVec3f’ has no member named ‘y’
prog.cpp:666: error: ‘class ofxVec3f’ has no member named ‘z’
prog.cpp:666: error: ‘class ofxVec3f’ has no member named ‘x’
prog.cpp:667: error: ‘class ofxVec3f’ has no member named ‘z’
prog.cpp:667: error: ‘class ofxVec3f’ has no member named ‘x’
prog.cpp:667: error: ‘class ofxVec3f’ has no member named ‘y’
prog.cpp:668: error: ‘class ofxVec3f’ has no member named ‘z’
prog.cpp:668: error: ‘class ofxVec3f’ has no member named ‘y’
prog.cpp:668: error: ‘class ofxVec3f’ has no member named ‘x’
prog.cpp:669: error: ‘class ofxVec3f’ has no member named ‘z’
prog.cpp:669: error: ‘class ofxVec3f’ has no member named ‘z’
prog.cpp: At global scope:
prog.cpp:677: error: expected ‘,’ or ‘...’ before ‘&’ token
prog.cpp:678: error: ISO C++ forbids declaration of ‘ofPoint’ with no type
prog.cpp: In member function ‘ofxVec3f& ofxVec3f::rotate(float, int)’:
prog.cpp:680: error: ‘axis’ was not declared in this scope
prog.cpp:681: error: ‘x’ was not declared in this scope
prog.cpp:681: error: ‘pivot’ was not declared in this scope
prog.cpp:682: error: ‘y’ was not declared in this scope
prog.cpp:683: error: ‘z’ was not declared in this scope
prog.cpp:685: error: ‘DEG_TO_RAD’ was not declared in this scope
prog.cpp:686: error: ‘sin’ was not declared in this scope
prog.cpp:687: error: ‘cos’ was not declared in this scope
prog.cpp:690: error: ‘class ofxVec3f’ has no member named ‘x’
prog.cpp:690: error: ‘class ofxVec3f’ has no member named ‘x’
prog.cpp:691: error: ‘class ofxVec3f’ has no member named ‘x’
prog.cpp:691: error: ‘class ofxVec3f’ has no member named ‘y’
prog.cpp:691: error: ‘class ofxVec3f’ has no member named ‘z’
prog.cpp:692: error: ‘class ofxVec3f’ has no member named ‘x’
prog.cpp:692: error: ‘class ofxVec3f’ has no member named ‘z’
prog.cpp:692: error: ‘class ofxVec3f’ has no member named ‘y’
prog.cpp:693: error: ‘class ofxVec3f’ has no member named ‘y’
prog.cpp:693: error: ‘class ofxVec3f’ has no member named ‘x’
prog.cpp:693: error: ‘class ofxVec3f’ has no member named ‘z’
prog.cpp:694: error: ‘class ofxVec3f’ has no member named ‘y’
prog.cpp:694: error: ‘class ofxVec3f’ has no member named ‘y’
prog.cpp:695: error: ‘class ofxVec3f’ has no member named ‘y’
prog.cpp:695: error: ‘class ofxVec3f’ has no member named ‘z’
prog.cpp:695: error: ‘class ofxVec3f’ has no member named ‘x’
prog.cpp:696: error: ‘class ofxVec3f’ has no member named ‘z’
prog.cpp:696: error: ‘class ofxVec3f’ has no member named ‘x’
prog.cpp:696: error: ‘class ofxVec3f’ has no member named ‘y’
prog.cpp:697: error: ‘class ofxVec3f’ has no member named ‘z’
prog.cpp:697: error: ‘class ofxVec3f’ has no member named ‘y’
prog.cpp:697: error: ‘class ofxVec3f’ has no member named ‘x’
prog.cpp:698: error: ‘class ofxVec3f’ has no member named ‘z’
prog.cpp:698: error: ‘class ofxVec3f’ has no member named ‘z’
prog.cpp: At global scope:
prog.cpp:709: error: expected ‘,’ or ‘...’ before ‘&’ token
prog.cpp:710: error: ISO C++ forbids declaration of ‘ofPoint’ with no type
prog.cpp: In member function ‘ofxVec3f& ofxVec3f::rotateRad(float, int)’:
prog.cpp:712: error: ‘axis’ was not declared in this scope
prog.cpp:713: error: ‘x’ was not declared in this scope
prog.cpp:713: error: ‘pivot’ was not declared in this scope
prog.cpp:714: error: ‘y’ was not declared in this scope
prog.cpp:715: error: ‘z’ was not declared in this scope
prog.cpp:718: error: ‘sin’ was not declared in this scope
prog.cpp:719: error: ‘cos’ was not declared in this scope
prog.cpp:722: error: ‘class ofxVec3f’ has no member named ‘x’
prog.cpp:722: error: ‘class ofxVec3f’ has no member named ‘x’
prog.cpp:723: error: ‘class ofxVec3f’ has no member named ‘x’
prog.cpp:723: error: ‘class ofxVec3f’ has no member named ‘y’
prog.cpp:723: error: ‘class ofxVec3f’ has no member named ‘z’
prog.cpp:724: error: ‘class ofxVec3f’ has no member named ‘x’
prog.cpp:724: error: ‘class ofxVec3f’ has no member named ‘z’
prog.cpp:724: error: ‘class ofxVec3f’ has no member named ‘y’
prog.cpp:725: error: ‘class ofxVec3f’ has no member named ‘y’
prog.cpp:725: error: ‘class ofxVec3f’ has no member named ‘x’
prog.cpp:725: error: ‘class ofxVec3f’ has no member named ‘z’
prog.cpp:726: error: ‘class ofxVec3f’ has no member named ‘y’
prog.cpp:726: error: ‘class ofxVec3f’ has no member named ‘y’
prog.cpp:727: error: ‘class ofxVec3f’ has no member named ‘y’
prog.cpp:727: error: ‘class ofxVec3f’ has no member named ‘z’
prog.cpp:727: error: ‘class ofxVec3f’ has no member named ‘x’
prog.cpp:728: error: ‘class ofxVec3f’ has no member named ‘z’
prog.cpp:728: error: ‘class ofxVec3f’ has no member named ‘x’
prog.cpp:728: error: ‘class ofxVec3f’ has no member named ‘y’
prog.cpp:729: error: ‘class ofxVec3f’ has no member named ‘z’
prog.cpp:729: error: ‘class ofxVec3f’ has no member named ‘y’
prog.cpp:729: error: ‘class ofxVec3f’ has no member named ‘x’
prog.cpp:730: error: ‘class ofxVec3f’ has no member named ‘z’
prog.cpp:730: error: ‘class ofxVec3f’ has no member named ‘z’
prog.cpp: At global scope:
prog.cpp:745: error: expected ‘,’ or ‘...’ before ‘&’ token
prog.cpp:748: error: ISO C++ forbids declaration of ‘ofPoint’ with no type
prog.cpp: In member function ‘ofxVec3f ofxVec3f::mapped(int) const’:
prog.cpp:749: error: ‘origin’ was not declared in this scope
prog.cpp:749: error: ‘vx’ was not declared in this scope
prog.cpp:749: error: ‘vy’ was not declared in this scope
prog.cpp:749: error: ‘vz’ was not declared in this scope
prog.cpp: At global scope:
prog.cpp:752: error: expected ‘,’ or ‘...’ before ‘&’ token
prog.cpp:755: error: ISO C++ forbids declaration of ‘ofPoint’ with no type
prog.cpp: In member function ‘ofxVec3f ofxVec3f::getMapped(int) const’:
prog.cpp:757: error: ‘origin’ was not declared in this scope
prog.cpp:757: error: ‘x’ was not declared in this scope
prog.cpp:757: error: ‘vx’ was not declared in this scope
prog.cpp:757: error: ‘y’ was not declared in this scope
prog.cpp:757: error: ‘vy’ was not declared in this scope
prog.cpp:757: error: ‘z’ was not declared in this scope
prog.cpp:757: error: ‘vz’ was not declared in this scope
prog.cpp: At global scope:
prog.cpp:762: error: expected ‘,’ or ‘...’ before ‘&’ token
prog.cpp:765: error: ISO C++ forbids declaration of ‘ofPoint’ with no type
prog.cpp: In member function ‘ofxVec3f& ofxVec3f::map(int)’:
prog.cpp:767: error: ‘origin’ was not declared in this scope
prog.cpp:767: error: ‘x’ was not declared in this scope
prog.cpp:767: error: ‘vx’ was not declared in this scope
prog.cpp:767: error: ‘y’ was not declared in this scope
prog.cpp:767: error: ‘vy’ was not declared in this scope
prog.cpp:767: error: ‘z’ was not declared in this scope
prog.cpp:767: error: ‘vz’ was not declared in this scope
prog.cpp: At global scope:
prog.cpp:779: error: expected ‘,’ or ‘...’ before ‘&’ token
prog.cpp:779: error: ISO C++ forbids declaration of ‘ofPoint’ with no type
prog.cpp: In member function ‘float ofxVec3f::distance(int) const’:
prog.cpp:780: error: ‘x’ was not declared in this scope
prog.cpp:780: error: ‘pnt’ was not declared in this scope
prog.cpp:781: error: ‘y’ was not declared in this scope
prog.cpp:782: error: ‘z’ was not declared in this scope
prog.cpp:783: error: ‘sqrt’ was not declared in this scope
prog.cpp: At global scope:
prog.cpp:786: error: expected ‘,’ or ‘...’ before ‘&’ token
prog.cpp:786: error: ISO C++ forbids declaration of ‘ofPoint’ with no type
prog.cpp: In member function ‘float ofxVec3f::distanceSquared(int) const’:
prog.cpp:787: error: ‘pnt’ was not declared in this scope
prog.cpp: At global scope:
prog.cpp:790: error: expected ‘,’ or ‘...’ before ‘&’ token
prog.cpp:790: error: ISO C++ forbids declaration of ‘ofPoint’ with no type
prog.cpp: In member function ‘float ofxVec3f::squareDistance(int) const’:
prog.cpp:791: error: ‘x’ was not declared in this scope
prog.cpp:791: error: ‘pnt’ was not declared in this scope
prog.cpp:792: error: ‘y’ was not declared in this scope
prog.cpp:793: error: ‘z’ was not declared in this scope
prog.cpp: At global scope:
prog.cpp:807: error: expected ‘,’ or ‘...’ before ‘&’ token
prog.cpp:807: error: ISO C++ forbids declaration of ‘ofPoint’ with no type
prog.cpp: In member function ‘ofxVec3f ofxVec3f::interpolated(int) const’:
prog.cpp:808: error: ‘pnt’ was not declared in this scope
prog.cpp:808: error: ‘p’ was not declared in this scope
prog.cpp: At global scope:
prog.cpp:811: error: expected ‘,’ or ‘...’ before ‘&’ token
prog.cpp:811: error: ISO C++ forbids declaration of ‘ofPoint’ with no type
prog.cpp: In member function ‘ofxVec3f ofxVec3f::getInterpolated(int) const’:
prog.cpp:812: error: ‘x’ was not declared in this scope
prog.cpp:812: error: ‘p’ was not declared in this scope
prog.cpp:812: error: ‘pnt’ was not declared in this scope
prog.cpp:813: error: ‘y’ was not declared in this scope
prog.cpp:814: error: ‘z’ was not declared in this scope
prog.cpp: At global scope:
prog.cpp:817: error: expected ‘,’ or ‘...’ before ‘&’ token
prog.cpp:817: error: ISO C++ forbids declaration of ‘ofPoint’ with no type
prog.cpp: In member function ‘ofxVec3f& ofxVec3f::interpolate(int)’:
prog.cpp:818: error: ‘x’ was not declared in this scope
prog.cpp:818: error: ‘p’ was not declared in this scope
prog.cpp:818: error: ‘pnt’ was not declared in this scope
prog.cpp:819: error: ‘y’ was not declared in this scope
prog.cpp:820: error: ‘z’ was not declared in this scope
prog.cpp: At global scope:
prog.cpp:825: error: expected ‘,’ or ‘...’ before ‘&’ token
prog.cpp:825: error: ISO C++ forbids declaration of ‘ofPoint’ with no type
prog.cpp: In member function ‘ofxVec3f ofxVec3f::middled(int) const’:
prog.cpp:826: error: ‘pnt’ was not declared in this scope
prog.cpp: At global scope:
prog.cpp:829: error: expected ‘,’ or ‘...’ before ‘&’ token
prog.cpp:829: error: ISO C++ forbids declaration of ‘ofPoint’ with no type
prog.cpp: In member function ‘ofxVec3f ofxVec3f::getMiddle(int) const’:
prog.cpp:830: error: ‘x’ was not declared in this scope
prog.cpp:830: error: ‘pnt’ was not declared in this scope
prog.cpp:830: error: ‘y’ was not declared in this scope
prog.cpp:830: error: ‘z’ was not declared in this scope
prog.cpp: At global scope:
prog.cpp:833: error: expected ‘,’ or ‘...’ before ‘&’ token
prog.cpp:833: error: ISO C++ forbids declaration of ‘ofPoint’ with no type
prog.cpp: In member function ‘ofxVec3f& ofxVec3f::middle(int)’:
prog.cpp:834: error: ‘x’ was not declared in this scope
prog.cpp:834: error: ‘pnt’ was not declared in this scope
prog.cpp:835: error: ‘y’ was not declared in this scope
prog.cpp:836: error: ‘z’ was not declared in this scope
prog.cpp: At global scope:
prog.cpp:845: error: expected ‘,’ or ‘...’ before ‘*’ token
prog.cpp:845: error: ISO C++ forbids declaration of ‘ofPoint’ with no type
prog.cpp: In member function ‘ofxVec3f& ofxVec3f::average(int)’:
prog.cpp:846: error: ‘x’ was not declared in this scope
prog.cpp:847: error: ‘y’ was not declared in this scope
prog.cpp:848: error: ‘z’ was not declared in this scope
prog.cpp:849: error: ‘num’ was not declared in this scope
prog.cpp:850: error: ‘points’ was not declared in this scope
prog.cpp:854: error: ‘num’ was not declared in this scope
prog.cpp: In member function ‘ofxVec3f ofxVec3f::getNormalized() const’:
prog.cpp:870: error: ‘x’ was not declared in this scope
prog.cpp:870: error: ‘y’ was not declared in this scope
prog.cpp:870: error: ‘z’ was not declared in this scope
prog.cpp:870: error: ‘sqrt’ was not declared in this scope
prog.cpp: In member function ‘ofxVec3f& ofxVec3f::normalize()’:
prog.cpp:879: error: ‘x’ was not declared in this scope
prog.cpp:879: error: ‘y’ was not declared in this scope
prog.cpp:879: error: ‘z’ was not declared in this scope
prog.cpp:879: error: ‘sqrt’ was not declared in this scope
prog.cpp: In member function ‘ofxVec3f ofxVec3f::getLimited(float) const’:
prog.cpp:900: error: ‘x’ was not declared in this scope
prog.cpp:900: error: ‘y’ was not declared in this scope
prog.cpp:900: error: ‘z’ was not declared in this scope
prog.cpp:902: error: ‘sqrt’ was not declared in this scope
prog.cpp: In member function ‘ofxVec3f& ofxVec3f::limit(float)’:
prog.cpp:911: error: ‘x’ was not declared in this scope
prog.cpp:911: error: ‘y’ was not declared in this scope
prog.cpp:911: error: ‘z’ was not declared in this scope
prog.cpp:913: error: ‘sqrt’ was not declared in this scope
prog.cpp: In member function ‘ofxVec3f ofxVec3f::getCrossed(const ofxVec3f&) const’:
prog.cpp:929: error: ‘y’ was not declared in this scope
prog.cpp:929: error: ‘const class ofxVec3f’ has no member named ‘z’
prog.cpp:929: error: ‘z’ was not declared in this scope
prog.cpp:929: error: ‘const class ofxVec3f’ has no member named ‘y’
prog.cpp:930: error: ‘const class ofxVec3f’ has no member named ‘x’
prog.cpp:930: error: ‘x’ was not declared in this scope
prog.cpp:930: error: ‘const class ofxVec3f’ has no member named ‘z’
prog.cpp:931: error: ‘const class ofxVec3f’ has no member named ‘y’
prog.cpp:931: error: ‘const class ofxVec3f’ has no member named ‘x’
prog.cpp: In member function ‘ofxVec3f& ofxVec3f::cross(const ofxVec3f&)’:
prog.cpp:935: error: ‘y’ was not declared in this scope
prog.cpp:935: error: ‘const class ofxVec3f’ has no member named ‘z’
prog.cpp:935: error: ‘z’ was not declared in this scope
prog.cpp:935: error: ‘const class ofxVec3f’ has no member named ‘y’
prog.cpp:936: error: ‘const class ofxVec3f’ has no member named ‘x’
prog.cpp:936: error: ‘x’ was not declared in this scope
prog.cpp:936: error: ‘const class ofxVec3f’ has no member named ‘z’
prog.cpp:937: error: ‘const class ofxVec3f’ has no member named ‘y’
prog.cpp:937: error: ‘const class ofxVec3f’ has no member named ‘x’
prog.cpp: In member function ‘ofxVec3f ofxVec3f::getPerpendicular(const ofxVec3f&) const’:
prog.cpp:951: error: ‘y’ was not declared in this scope
prog.cpp:951: error: ‘const class ofxVec3f’ has no member named ‘z’
prog.cpp:951: error: ‘z’ was not declared in this scope
prog.cpp:951: error: ‘const class ofxVec3f’ has no member named ‘y’
prog.cpp:952: error: ‘const class ofxVec3f’ has no member named ‘x’
prog.cpp:952: error: ‘x’ was not declared in this scope
prog.cpp:952: error: ‘const class ofxVec3f’ has no member named ‘z’
prog.cpp:953: error: ‘const class ofxVec3f’ has no member named ‘y’
prog.cpp:953: error: ‘const class ofxVec3f’ has no member named ‘x’
prog.cpp:957: error: ‘sqrt’ was not declared in this scope
prog.cpp: In member function ‘ofxVec3f& ofxVec3f::perpendicular(const ofxVec3f&)’:
prog.cpp:966: error: ‘y’ was not declared in this scope
prog.cpp:966: error: ‘const class ofxVec3f’ has no member named ‘z’
prog.cpp:966: error: ‘z’ was not declared in this scope
prog.cpp:966: error: ‘const class ofxVec3f’ has no member named ‘y’
prog.cpp:967: error: ‘const class ofxVec3f’ has no member named ‘x’
prog.cpp:967: error: ‘x’ was not declared in this scope
prog.cpp:967: error: ‘const class ofxVec3f’ has no member named ‘z’
prog.cpp:968: error: ‘const class ofxVec3f’ has no member named ‘y’
prog.cpp:968: error: ‘const class ofxVec3f’ has no member named ‘x’
prog.cpp:972: error: ‘sqrt’ was not declared in this scope
prog.cpp: In member function ‘float ofxVec3f::length() const’:
prog.cpp:992: error: ‘x’ was not declared in this scope
prog.cpp:992: error: ‘y’ was not declared in this scope
prog.cpp:992: error: ‘z’ was not declared in this scope
prog.cpp:992: error: ‘sqrt’ was not declared in this scope
prog.cpp: In member function ‘float ofxVec3f::squareLength() const’:
prog.cpp:1000: error: ‘x’ was not declared in this scope
prog.cpp:1000: error: ‘y’ was not declared in this scope
prog.cpp:1000: error: ‘z’ was not declared in this scope
prog.cpp: In member function ‘float ofxVec3f::angle(const ofxVec3f&) const’:
prog.cpp:1013: error: ‘acos’ was not declared in this scope
prog.cpp:1013: error: ‘RAD_TO_DEG’ was not declared in this scope
prog.cpp: In member function ‘float ofxVec3f::angleRad(const ofxVec3f&) const’:
prog.cpp:1019: error: ‘acos’ was not declared in this scope
prog.cpp: In member function ‘float ofxVec3f::dot(const ofxVec3f&) const’:
prog.cpp:1028: error: ‘x’ was not declared in this scope
prog.cpp:1028: error: ‘const class ofxVec3f’ has no member named ‘x’
prog.cpp:1028: error: ‘y’ was not declared in this scope
prog.cpp:1028: error: ‘const class ofxVec3f’ has no member named ‘y’
prog.cpp:1028: error: ‘z’ was not declared in this scope
prog.cpp:1028: error: ‘const class ofxVec3f’ has no member named ‘z’
prog.cpp: In function ‘ofxVec3f operator+(float, const ofxVec3f&)’:
prog.cpp:1039: error: ‘const class ofxVec3f’ has no member named ‘x’
prog.cpp:1039: error: ‘const class ofxVec3f’ has no member named ‘y’
prog.cpp:1039: error: ‘const class ofxVec3f’ has no member named ‘z’
prog.cpp: In function ‘ofxVec3f operator-(float, const ofxVec3f&)’:
prog.cpp:1043: error: ‘const class ofxVec3f’ has no member named ‘x’
prog.cpp:1043: error: ‘const class ofxVec3f’ has no member named ‘y’
prog.cpp:1043: error: ‘const class ofxVec3f’ has no member named ‘z’
prog.cpp: In function ‘ofxVec3f operator*(float, const ofxVec3f&)’:
prog.cpp:1047: error: ‘const class ofxVec3f’ has no member named ‘x’
prog.cpp:1047: error: ‘const class ofxVec3f’ has no member named ‘y’
prog.cpp:1047: error: ‘const class ofxVec3f’ has no member named ‘z’
prog.cpp: In function ‘ofxVec3f operator/(float, const ofxVec3f&)’:
prog.cpp:1051: error: ‘const class ofxVec3f’ has no member named ‘x’
prog.cpp:1051: error: ‘const class ofxVec3f’ has no member named ‘y’
prog.cpp:1051: error: ‘const class ofxVec3f’ has no member named ‘z’
-
result: Compilation error (maybe you wish to see an example for C++ 4.7.2)


