@@ -525,7 +525,7 @@ private void onDrawFrame(float[] viewMatrix, float[] projectionMatrix, float[] v
525525 lightPosInWorldSpace [2 ] = tempVector4 [2 ];
526526
527527 // Draw a point that represents the light bulb
528- basicShader .draw (scene .getLightBulb (), projectionMatrix , viewMatrix , -1 , lightPosInWorldSpace , colorMask , cameraPosInWorldSpace );
528+ basicShader .draw (scene .getLightBulb (), projectionMatrix , viewMatrix , -1 , lightPosInWorldSpace , colorMask , cameraPosInWorldSpace , scene . getLightBulb (). getDrawMode (), scene . getLightBulb (). getDrawSize () );
529529 //basicShader.draw(Point.build(lightPosInWorldSpace), projectionMatrix, viewMatrix, -1, lightPosInWorldSpace, colorMask, cameraPosInWorldSpace);
530530 } else {
531531 lightPosInWorldSpace [0 ] = cameraPosInWorldSpace [0 ];
@@ -535,11 +535,12 @@ private void onDrawFrame(float[] viewMatrix, float[] projectionMatrix, float[] v
535535
536536 // FIXME: memory leak
537537 if (scene .isDrawNormals ()) {
538- basicShader .draw (Line .build (new float []{lightPosInWorldSpace [0 ],
539- lightPosInWorldSpace [1 ], lightPosInWorldSpace [2 ], 0 , 0 , 0 }).setId ("light_line" ), projectionMatrix ,
538+ Object3DData light_line = Line .build (new float []{lightPosInWorldSpace [0 ],
539+ lightPosInWorldSpace [1 ], lightPosInWorldSpace [2 ], 0 , 0 , 0 }).setId ("light_line" );
540+ basicShader .draw (light_line , projectionMatrix ,
540541 viewMatrix , -1 ,
541542 lightPosInWorldSpace ,
542- colorMask , cameraPosInWorldSpace );
543+ colorMask , cameraPosInWorldSpace , light_line . getDrawMode (), light_line . getDrawSize () );
543544 }
544545 }
545546
@@ -604,7 +605,7 @@ else if (isDrawSkyBox && skyBoxId >= 0 && skyBoxId < skyBoxes3D.length) {
604605 }
605606 Renderer basicShader = drawer .getSkyBoxDrawer ();
606607 skyBoxes3D [skyBoxId ].setColor (Constants .COLOR_BIT_TRANSPARENT );
607- basicShader .draw (skyBoxes3D [skyBoxId ], projectionMatrixSkyBox , viewMatrix , skyBoxes3D [skyBoxId ].getMaterial ().getTextureId (), null , cameraPosInWorldSpace );
608+ basicShader .draw (skyBoxes3D [skyBoxId ], projectionMatrixSkyBox , viewMatrix , skyBoxes3D [skyBoxId ].getMaterial ().getTextureId (), null , null , cameraPosInWorldSpace , skyBoxes3D [ skyBoxId ]. getDrawMode (), skyBoxes3D [ skyBoxId ]. getDrawSize () );
608609
609610 // sensor stuff
610611 /*this.orientation.toRotationMatrix(viewMatrixSkyBox);
@@ -649,7 +650,7 @@ private void drawObject(float[] viewMatrix, float[] projectionMatrix, float[] li
649650 objData .setChanged (false );
650651
651652 // load textures
652- Integer textureId = null ;
653+ /* Integer textureId = null;
653654 if (drawTextures) {
654655
655656 // TODO: move texture loading to Renderer
@@ -736,15 +737,13 @@ else if (element.getMaterial().getTextureData() != null){
736737 Log.i("ModelRenderer", "Loaded texture OK. id: " + textureId);
737738 }
738739 }
739- }
740- if (textureId == null ) {
741- textureId = -1 ;
742- }
740+ }*/
741+ Integer textureId = -1 ;
743742
744743 // draw points
745744 if (objData .getDrawMode () == GLES20 .GL_POINTS ) {
746745 Renderer basicDrawer = drawer .getBasicShader ();
747- basicDrawer .draw (objData , projectionMatrix , viewMatrix , GLES20 .GL_POINTS , lightPosInWorldSpace , cameraPosInWorldSpace );
746+ basicDrawer .draw (objData , projectionMatrix , viewMatrix , GLES20 .GL_POINTS , lightPosInWorldSpace , null , cameraPosInWorldSpace , objData . getDrawMode (), objData . getDrawSize () );
748747 } else {
749748
750749 // draw wireframe
@@ -763,7 +762,7 @@ else if (element.getMaterial().getTextureData() != null){
763762 Log .i ("ModelRenderer" , "Wireframe build: " + wireframe );
764763 }
765764 animator .update (wireframe , scene .isShowBindPose ());
766- drawerObject .draw (wireframe , projectionMatrix , viewMatrix , wireframe .getDrawMode (), wireframe .getDrawSize (), textureId , lightPosInWorldSpace , colorMask , cameraPosInWorldSpace );
765+ drawerObject .draw (wireframe , projectionMatrix , viewMatrix , textureId , lightPosInWorldSpace , colorMask , cameraPosInWorldSpace , wireframe .getDrawMode (), wireframe .getDrawSize ());
767766 //objData.render(drawer, lightPosInWorldSpace, colorMask);
768767 } catch (Error e ) {
769768 Log .e ("ModelRenderer" , e .getMessage (), e );
@@ -773,8 +772,7 @@ else if (element.getMaterial().getTextureData() != null){
773772 // draw points
774773 else if (scene .isDrawPoints ()) {
775774 drawerObject .draw (objData , projectionMatrix , viewMatrix
776- , GLES20 .GL_POINTS , objData .getDrawSize (),
777- textureId , lightPosInWorldSpace , colorMask , cameraPosInWorldSpace );
775+ , textureId , lightPosInWorldSpace , colorMask , cameraPosInWorldSpace , GLES20 .GL_POINTS , objData .getDrawSize ());
778776 objData .render (drawer , scene .getCamera (), lightPosInWorldSpace , colorMask );
779777 }
780778
@@ -792,23 +790,24 @@ else if (scene.isDrawSkeleton() && objData instanceof AnimatedModel && ((Animate
792790 this .skeleton .put (objData , skeleton );
793791 }
794792 final Renderer skeletonDrawer = drawer .getDrawer (skeleton , false , false , drawLighting , doAnimation , drawColors );
795- skeletonDrawer .draw (skeleton , projectionMatrix , viewMatrix , -1 , lightPosInWorldSpace , colorMask , cameraPosInWorldSpace );
793+ skeletonDrawer .draw (skeleton , projectionMatrix , viewMatrix , -1 , lightPosInWorldSpace , colorMask , cameraPosInWorldSpace , skeleton . getDrawMode (), skeleton . getDrawSize () );
796794 //GLES20.glEnable(GLES20.GL_DEPTH_TEST);
797795
798796 // draw the original object a bit transparent
799- drawerObject .draw (objData , projectionMatrix , viewMatrix , textureId , lightPosInWorldSpace , Constants .COLOR_HALF_TRANSPARENT , cameraPosInWorldSpace );
797+ drawerObject .draw (objData , projectionMatrix , viewMatrix , textureId , lightPosInWorldSpace , Constants .COLOR_HALF_TRANSPARENT , cameraPosInWorldSpace , objData . getDrawMode (), objData . getDrawSize () );
800798 }
801799
802800 // draw solids
803801 else {
804802 if (!infoLogged .containsKey (objData .getId () + "render" )) {
805803 Log .i ("ModelRenderer" , "Rendering object... " + objData .getId ());
806- Log .d ("ModelRenderer" , objData .getId ()+ ": " + objData );
807- Log .d ("ModelRenderer" ,objData . getId ()+ ": " + drawerObject );
804+ Log .d ("ModelRenderer" , objData .toString () );
805+ Log .d ("ModelRenderer" , drawerObject . toString () );
808806 infoLogged .put (objData .getId () + "render" , true );
809807 }
810808 drawerObject .draw (objData , projectionMatrix , viewMatrix ,
811- textureId , lightPosInWorldSpace , colorMask , cameraPosInWorldSpace );
809+ textureId , lightPosInWorldSpace , colorMask , cameraPosInWorldSpace ,
810+ objData .getDrawMode (), objData .getDrawSize ());
812811 objData .render (drawer , scene .getCamera (), lightPosInWorldSpace , colorMask );
813812 }
814813 }
@@ -834,7 +833,7 @@ else if (scene.isDrawSkeleton() && objData instanceof AnimatedModel && ((Animate
834833 false );
835834 animator .update (normalData , scene .isShowBindPose ());
836835 normalsDrawer .draw (normalData , projectionMatrix , viewMatrix , -1 , lightPosInWorldSpace , colorMask
837- , cameraPosInWorldSpace );
836+ , cameraPosInWorldSpace , normalData . getDrawMode (), normalData . getDrawSize () );
838837 }
839838 }
840839
@@ -864,7 +863,8 @@ private void drawBoundingBox(float[] viewMatrix, float[] projectionMatrix, float
864863 }
865864 Renderer boundingBoxDrawer = drawer .getBoundingBoxDrawer ();
866865 boundingBoxDrawer .draw (boundingBoxData , projectionMatrix , viewMatrix , -1 ,
867- lightPosInWorldSpace , colorMask , cameraPosInWorldSpace );
866+ lightPosInWorldSpace , colorMask , cameraPosInWorldSpace ,
867+ boundingBoxData .getDrawMode (), boundingBoxData .getDrawSize ());
868868 }
869869
870870 public int getWidth () {
0 commit comments