You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -825,12 +814,11 @@ public PVector normalize(PVector target) {
825
814
* @param max the maximum magnitude for the vector
826
815
* @brief Limit the magnitude of the vector
827
816
*/
828
-
publicPVectorlimit(floatmax) {
817
+
publicvoidlimit(floatmax) {
829
818
if (magSq() > max*max) {
830
819
normalize();
831
820
mult(max);
832
821
}
833
-
returnthis;
834
822
}
835
823
836
824
@@ -846,10 +834,9 @@ public PVector limit(float max) {
846
834
* @param len the new length for this vector
847
835
* @brief Set the magnitude of the vector
848
836
*/
849
-
publicPVectorsetMag(floatlen) {
837
+
publicvoidsetMag(floatlen) {
850
838
normalize();
851
839
mult(len);
852
-
returnthis;
853
840
}
854
841
855
842
@@ -902,12 +889,11 @@ public float heading2D() {
902
889
* @brief Rotate the vector by an angle (2D only)
903
890
* @param theta the angle of rotation
904
891
*/
905
-
publicPVectorrotate(floattheta) {
892
+
publicvoidrotate(floattheta) {
906
893
floattemp = x;
907
894
// Might need to check for rounding errors like with angleBetween function?
908
895
x = x*PApplet.cos(theta) - y*PApplet.sin(theta);
909
896
y = temp*PApplet.sin(theta) + y*PApplet.cos(theta);
910
-
returnthis;
911
897
}
912
898
913
899
@@ -925,11 +911,10 @@ public PVector rotate(float theta) {
925
911
* @param amt The amount of interpolation; some value between 0.0 (old vector) and 1.0 (new vector). 0.1 is very near the new vector. 0.5 is halfway in between.
0 commit comments