33/*
44 Part of the Processing project - http://processing.org
55
6- Copyright (c) 2005-08 Ben Fry and Casey Reas
6+ Copyright (c) 2005-12 Ben Fry and Casey Reas
77
88 This library is free software; you can redistribute it and/or
99 modify it under the terms of the GNU Lesser General Public
10- License as published by the Free Software Foundation; either
11- version 2.1 of the License, or (at your option) any later version.
10+ License version 2.1 as published by the Free Software Foundation.
1211
1312 This library is distributed in the hope that it will be useful,
1413 but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -426,9 +425,9 @@ public PVector mult(PVector source, PVector target) {
426425 if (target == null ) {
427426 target = new PVector ();
428427 }
429- target .x = m00 *source .x + m01 *source .y + m02 *source .z + m03 ;
430- target . y = m10 *source .x + m11 *source .y + m12 *source .z + m13 ;
431- target . z = m20 *source .x + m21 *source .y + m22 *source .z + m23 ;
428+ target .set ( m00 *source .x + m01 *source .y + m02 *source .z + m03 ,
429+ m10 *source .x + m11 *source .y + m12 *source .z + m13 ,
430+ m20 *source .x + m21 *source .y + m22 *source .z + m23 ) ;
432431// float tw = m30*source.x + m31*source.y + m32*source.z + m33;
433432// if (tw != 0 && tw != 1) {
434433// target.div(tw);
@@ -656,36 +655,36 @@ public float determinant() {
656655 // These functions should not be used, as they will be removed in the future.
657656
658657
659- public void invTranslate (float tx , float ty , float tz ) {
658+ protected void invTranslate (float tx , float ty , float tz ) {
660659 preApply (1 , 0 , 0 , -tx ,
661660 0 , 1 , 0 , -ty ,
662661 0 , 0 , 1 , -tz ,
663662 0 , 0 , 0 , 1 );
664663 }
665664
666665
667- public void invRotateX (float angle ) {
666+ protected void invRotateX (float angle ) {
668667 float c = cos (-angle );
669668 float s = sin (-angle );
670669 preApply (1 , 0 , 0 , 0 , 0 , c , -s , 0 , 0 , s , c , 0 , 0 , 0 , 0 , 1 );
671670 }
672671
673672
674- public void invRotateY (float angle ) {
673+ protected void invRotateY (float angle ) {
675674 float c = cos (-angle );
676675 float s = sin (-angle );
677676 preApply (c , 0 , s , 0 , 0 , 1 , 0 , 0 , -s , 0 , c , 0 , 0 , 0 , 0 , 1 );
678677 }
679678
680679
681- public void invRotateZ (float angle ) {
680+ protected void invRotateZ (float angle ) {
682681 float c = cos (-angle );
683682 float s = sin (-angle );
684683 preApply (c , -s , 0 , 0 , s , c , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 );
685684 }
686685
687686
688- public void invRotate (float angle , float v0 , float v1 , float v2 ) {
687+ protected void invRotate (float angle , float v0 , float v1 , float v2 ) {
689688 //TODO should make sure this vector is normalized
690689
691690 float c = cos (-angle );
@@ -699,15 +698,15 @@ public void invRotate(float angle, float v0, float v1, float v2) {
699698 }
700699
701700
702- public void invScale (float x , float y , float z ) {
701+ protected void invScale (float x , float y , float z ) {
703702 preApply (1 /x , 0 , 0 , 0 , 0 , 1 /y , 0 , 0 , 0 , 0 , 1 /z , 0 , 0 , 0 , 0 , 1 );
704703 }
705704
706705
707- public boolean invApply (float n00 , float n01 , float n02 , float n03 ,
708- float n10 , float n11 , float n12 , float n13 ,
709- float n20 , float n21 , float n22 , float n23 ,
710- float n30 , float n31 , float n32 , float n33 ) {
706+ protected boolean invApply (float n00 , float n01 , float n02 , float n03 ,
707+ float n10 , float n11 , float n12 , float n13 ,
708+ float n20 , float n21 , float n22 , float n23 ,
709+ float n30 , float n31 , float n32 , float n33 ) {
711710 if (inverseCopy == null ) {
712711 inverseCopy = new PMatrix3D ();
713712 }
0 commit comments