@@ -2111,7 +2111,7 @@ public void setColor(int idx, float[] c) {
21112111
21122112
21132113 protected void setColorImpl (float [] c ) {
2114- PShape3D p = ( PShape3D ) root ;
2114+ PShape3D p = root ;
21152115 p .loadColors ();
21162116 for (int i = firstVertex ; i <= lastVertex ; i ++) {
21172117 p .set (i , c );
@@ -2150,7 +2150,7 @@ public void setNormal(int idx, float[] n) {
21502150
21512151
21522152 protected void setNormalImpl (float [] n ) {
2153- PShape3D p = ( PShape3D ) root ;
2153+ PShape3D p = root ;
21542154 p .loadNormals ();
21552155 for (int i = firstVertex ; i <= lastVertex ; i ++) {
21562156 p .set (i , n );
@@ -2166,9 +2166,9 @@ protected void optimizeChildren(ArrayList<PShape3D> childList) {
21662166 // Expanding identical, contiguous shapes. Names are taken into account (two
21672167 // shapes with different names are considered to be different, even though the
21682168 // rest of their parameters are identical).
2169- child0 = ( PShape3D ) childList .get (0 );
2169+ child0 = childList .get (0 );
21702170 for (int i = 1 ; i < childList .size (); i ++) {
2171- child1 = ( PShape3D ) childList .get (i );
2171+ child1 = childList .get (i );
21722172 if (child0 .equalTo (child1 , false )) {
21732173 child0 .lastVertex = child1 .lastVertex ; // Extending child0.
21742174 child0 .lastIndex = child1 .lastIndex ;
@@ -2184,16 +2184,16 @@ protected void optimizeChildren(ArrayList<PShape3D> childList) {
21842184
21852185 // Deleting superfluous shapes.
21862186 for (int i = childList .size () - 1 ; i >= 0 ; i --) {
2187- if ((( PShape3D ) childList .get (i ) ).lastVertex == -1 ) {
2187+ if (childList .get (i ).lastVertex == -1 ) {
21882188 childList .remove (i );
21892189 }
21902190 }
21912191
21922192 // Making sure the names are unique.
21932193 for (int i = 1 ; i < childList .size (); i ++) {
2194- child1 = ( PShape3D ) childList .get (i );
2194+ child1 = childList .get (i );
21952195 for (int j = i - 1 ; j >= 0 ; j --) {
2196- child0 = ( PShape3D ) childList .get (j );
2196+ child0 = childList .get (j );
21972197 if (child1 .name .equals (child0 .name )) {
21982198 int pos = child0 .name .indexOf (':' );
21992199 if (-1 < pos ) {
@@ -2288,7 +2288,7 @@ public void setVertices(ArrayList<PVector> vertexList) {
22882288 public void setVertices (ArrayList <PVector > vertexList , int offset ) {
22892289 loadVertices ();
22902290 for (int i = firstVertex ; i <= lastVertex ; i ++) {
2291- PVector v = ( PVector ) vertexList .get (i - firstVertex + offset );
2291+ PVector v = vertexList .get (i - firstVertex + offset );
22922292 set (i , v .x , v .y , v .z );
22932293 }
22942294 updateVertices ();
@@ -2301,7 +2301,7 @@ public void setColors(ArrayList<float[]> colorList) {
23012301 public void setColors (ArrayList <float []> colorList , int offset ) {
23022302 loadColors ();
23032303 for (int i = firstVertex ; i <= lastVertex ; i ++) {
2304- float [] c = ( float []) colorList .get (i - firstVertex + offset );
2304+ float [] c = colorList .get (i - firstVertex + offset );
23052305 set (i , c );
23062306 }
23072307 updateColors ();
@@ -2315,7 +2315,7 @@ public void setNormals(ArrayList<PVector> normalList) {
23152315 public void setNormals (ArrayList <PVector > normalList , int offset ) {
23162316 loadNormals ();
23172317 for (int i = firstVertex ; i <= lastVertex ; i ++) {
2318- PVector n = ( PVector ) normalList .get (i - firstVertex + offset );
2318+ PVector n = normalList .get (i - firstVertex + offset );
23192319 set (i , n .x , n .y , n .z );
23202320 }
23212321 updateNormals ();
@@ -2337,7 +2337,7 @@ public void setTexcoords(int unit, ArrayList<PVector> tcoordList) {
23372337 public void setTexcoords (int unit , ArrayList <PVector > tcoordList , int offset ) {
23382338 loadTexcoords (unit );
23392339 for (int i = firstVertex ; i <= lastVertex ; i ++) {
2340- PVector tc = ( PVector ) tcoordList .get (i - firstVertex + offset );
2340+ PVector tc = tcoordList .get (i - firstVertex + offset );
23412341 set (i , tc .x , tc .y );
23422342 }
23432343 updateTexcoords ();
@@ -2349,7 +2349,7 @@ public void setChildren(ArrayList<PShape3D> who) {
23492349
23502350 childCount = 0 ;
23512351 for (int i = 0 ; i < who .size (); i ++) {
2352- PShape child = ( PShape ) who .get (i );
2352+ PShape child = who .get (i );
23532353 addChild (child );
23542354 }
23552355 }
@@ -2599,7 +2599,7 @@ public void setIndices(ArrayList<Integer> recordedIndices) {
25992599 indexBuffer = getGl ().glMapBuffer (GL .GL_ELEMENT_ARRAY_BUFFER , GL .GL_WRITE_ONLY ).asIntBuffer ();
26002600
26012601 for (int i = 0 ; i < indexCount ; i ++) {
2602- indices [i ] = ( Integer ) recordedIndices .get (i );
2602+ indices [i ] = recordedIndices .get (i );
26032603 }
26042604 indexBuffer .put (indices );
26052605
@@ -3521,13 +3521,13 @@ protected void recordOBJ(ArrayList<PVector> vertices, ArrayList<PVector> normals
35213521
35223522 ogl .beginShapeRecorderImpl ();
35233523 for (int i = 0 ; i < faces .size (); i ++) {
3524- OBJFace face = ( OBJFace ) faces .get (i );
3524+ OBJFace face = faces .get (i );
35253525
35263526 // Getting current material.
35273527 if (mtlIdxCur != face .matIdx ) {
35283528 mtlIdxCur = PApplet .max (0 , face .matIdx ); // To make sure that at least we get the default material.
35293529
3530- mtl = ( OBJMaterial ) materials .get (mtlIdxCur );
3530+ mtl = materials .get (mtlIdxCur );
35313531
35323532 // Setting colors.
35333533 ogl .specular (mtl .ks .x * 255.0f , mtl .ks .y * 255.0f , mtl .ks .z * 255.0f );
@@ -3561,12 +3561,12 @@ protected void recordOBJ(ArrayList<PVector> vertices, ArrayList<PVector> normals
35613561 vert = norms = null ;
35623562
35633563 vertIdx = face .vertIdx .get (j ).intValue () - 1 ;
3564- vert = ( PVector ) vertices .get (vertIdx );
3564+ vert = vertices .get (vertIdx );
35653565
35663566 if (j < face .normIdx .size ()) {
35673567 normIdx = face .normIdx .get (j ).intValue () - 1 ;
35683568 if (-1 < normIdx ) {
3569- norms = ( PVector ) normals .get (normIdx );
3569+ norms = normals .get (normIdx );
35703570 }
35713571 }
35723572
@@ -3578,7 +3578,7 @@ protected void recordOBJ(ArrayList<PVector> vertices, ArrayList<PVector> normals
35783578 if (j < face .texIdx .size ()) {
35793579 texIdx = face .texIdx .get (j ).intValue () - 1 ;
35803580 if (-1 < texIdx ) {
3581- tex = ( PVector ) textures .get (texIdx );
3581+ tex = textures .get (texIdx );
35823582 }
35833583 }
35843584
0 commit comments