Normand Briere
2019-04-22 c60a1ad4f6aa4904e80280586b440a584b5ff061
Refactoring phase 2
16 files modified
463 ■■■■ changed files
CameraPane.java 194 ●●●●● patch | view | raw | blame | history
FrameSelector.java 2 ●●● patch | view | raw | blame | history
GLShapeDrawer.java 12 ●●●● patch | view | raw | blame | history
GenericJoint.java 20 ●●●● patch | view | raw | blame | history
Geometry.java 2 ●●● patch | view | raw | blame | history
Merge.java 2 ●●● patch | view | raw | blame | history
MorphNode.java 2 ●●● patch | view | raw | blame | history
ParticleNode.java 4 ●●●● patch | view | raw | blame | history
PhysicsNode.java 2 ●●● patch | view | raw | blame | history
ScriptNode.java 2 ●●● patch | view | raw | blame | history
SwitchNode.java 2 ●●● patch | view | raw | blame | history
TriMesh.java 199 ●●●●● patch | view | raw | blame | history
VehicleDemo.java 8 ●●●● patch | view | raw | blame | history
cMesh.java 2 ●●● patch | view | raw | blame | history
cSpring.java 4 ●●●● patch | view | raw | blame | history
iCameraPane.java 6 ●●●● patch | view | raw | blame | history
CameraPane.java
....@@ -192,6 +192,11 @@
192192
193193 /// INTERFACE
194194
195
+ public boolean IsBoxMode()
196
+ {
197
+ return BOXMODE;
198
+ }
199
+
195200 public void ClearDepth()
196201 {
197202 GetGL().glClear(GetGL().GL_DEPTH_BUFFER_BIT);
....@@ -566,6 +571,195 @@
566571 }
567572 }
568573
574
+ /**
575
+ * <code>draw</code> renders a <code>TriMesh</code> object including
576
+ * it's normals, colors, textures and vertices.
577
+ *
578
+ * @see Renderer#draw(TriMesh)
579
+ * @param tris
580
+ * the mesh to render.
581
+ */
582
+ public void DrawParticles(TriMesh geo, Object3D shape, boolean selected, boolean rotate) // TriMesh tris)
583
+ {
584
+ CameraPane display = this;
585
+
586
+ float r = display.modelParams0[0];
587
+ float g = display.modelParams0[1];
588
+ float b = display.modelParams0[2];
589
+ float opacity = display.modelParams5[1];
590
+
591
+ //final GL gl = GLU.getCurrentGL();
592
+ GL gl = display.GetGL(); // getGL();
593
+
594
+ FloatBuffer vertBuf = geo.vertBuf;
595
+
596
+ int v = vertBuf.capacity();
597
+
598
+ int count = 0;
599
+
600
+ boolean cf = gl.glIsEnabled(gl.GL_CULL_FACE);
601
+ gl.glEnable(gl.GL_CULL_FACE);
602
+ // gl.glScalef(1.0f/1024,1.0f/1024,1.0f/1024);
603
+ for (int i=0; i<v/3; i++)
604
+ {
605
+ int index3 = i*3;
606
+
607
+ if (geo.sizeBuf.get(index3+1) == 0)
608
+ continue;
609
+
610
+ count++;
611
+
612
+ int index4 = i*4;
613
+
614
+ float tx = vertBuf.get(index3);
615
+ float ty = vertBuf.get(index3+1);
616
+ float tz = vertBuf.get(index3+2);
617
+
618
+ // if (tx == 0 && ty == 0 && tz == 0)
619
+ // continue;
620
+
621
+ gl.glMatrixMode(gl.GL_TEXTURE);
622
+ gl.glPushMatrix();
623
+
624
+ float[] texmat = geo.texmat;
625
+ texmat[12] = texmat[13] = texmat[14] = i;
626
+
627
+ gl.glMultMatrixf(texmat, 0);
628
+
629
+ gl.glMatrixMode(gl.GL_MODELVIEW);
630
+ gl.glPushMatrix();
631
+
632
+ gl.glTranslatef(tx,ty,tz);
633
+
634
+ if (rotate)
635
+ gl.glRotatef(i, 0, 1, 0);
636
+
637
+ float size = geo.sizeBuf.get(index3) / 100;
638
+ gl.glScalef(size,size,size);
639
+
640
+ float cr = geo.colorBuf.get(index4);
641
+ float cg = geo.colorBuf.get(index4+1);
642
+ float cb = geo.colorBuf.get(index4+2);
643
+ float ca = geo.colorBuf.get(index4+3);
644
+
645
+ display.modelParams0[0] = r * cr;
646
+ display.modelParams0[1] = g * cg;
647
+ display.modelParams0[2] = b * cb;
648
+
649
+ display.modelParams5[1] = opacity * ca;
650
+
651
+ gl.glProgramEnvParameter4fvARB(gl.GL_FRAGMENT_PROGRAM_ARB, 0, display.modelParams0, 0);
652
+ gl.glProgramEnvParameter4fvARB(gl.GL_FRAGMENT_PROGRAM_ARB, 5, display.modelParams5, 0);
653
+
654
+ RandomNode.globalseed = (int)geo.sizeBuf.get(index3+2); // i;
655
+ RandomNode.globalseed2 = RandomNode.globalseed;
656
+
657
+// gl.glColor4f(cr,cg,cb,ca);
658
+ // gl.glScalef(1024/16,1024/16,1024/16);
659
+ shape.Draw/*Node*/(display,null,selected,false); // blocked
660
+ // gl.glScalef(16.0f/1024,16.0f/1024,16.0f/1024);
661
+ //gl.glTranslatef(-tx,-ty,-tz);
662
+ gl.glPopMatrix();
663
+
664
+ gl.glMatrixMode(gl.GL_TEXTURE);
665
+ gl.glPopMatrix();
666
+ }
667
+ // gl.glScalef(1024,1024,1024);
668
+ if (!cf)
669
+ gl.glDisable(gl.GL_CULL_FACE);
670
+
671
+ display.modelParams0[0] = r;
672
+ display.modelParams0[1] = g;
673
+ display.modelParams0[2] = b;
674
+
675
+ display.modelParams5[1] = opacity;
676
+
677
+ gl.glProgramEnvParameter4fvARB(gl.GL_FRAGMENT_PROGRAM_ARB, 0, display.modelParams0, 0);
678
+ gl.glProgramEnvParameter4fvARB(gl.GL_FRAGMENT_PROGRAM_ARB, 5, display.modelParams5, 0);
679
+
680
+ gl.glMatrixMode(gl.GL_MODELVIEW);
681
+
682
+// System.err.println("total = " + v/3 + "; displayed = " + count);
683
+ if (true)
684
+ return;
685
+
686
+//// if (!tris.predraw(this))
687
+//// {
688
+//// return;
689
+//// }
690
+//// if (Debug.stats)
691
+//// {
692
+//// StatCollector.addStat(StatType.STAT_TRIANGLE_COUNT, tris.getTriangleCount());
693
+//// StatCollector.addStat(StatType.STAT_VERTEX_COUNT, tris.getVertexCount());
694
+//// StatCollector.addStat(StatType.STAT_GEOM_COUNT, 1);
695
+//// }
696
+////
697
+//// if (tris.getDisplayListID() != -1)
698
+//// {
699
+//// renderDisplayList(tris);
700
+//// return;
701
+//// }
702
+////
703
+//// if (!generatingDisplayList)
704
+//// {
705
+//// applyStates(tris.states, tris);
706
+//// }
707
+//// if (Debug.stats)
708
+//// {
709
+//// StatCollector.startStat(StatType.STAT_RENDER_TIMER);
710
+//// }
711
+//// boolean transformed = doTransforms(tris);
712
+//
713
+// int glMode = GL.GL_TRIANGLES;
714
+// switch (getMode())
715
+// {
716
+// case Triangles:
717
+// glMode = GL.GL_TRIANGLES;
718
+// break;
719
+// case Strip:
720
+// glMode = GL.GL_TRIANGLE_STRIP;
721
+// break;
722
+// case Fan:
723
+// glMode = GL.GL_TRIANGLE_FAN;
724
+// break;
725
+// }
726
+//
727
+// if (!predrawGeometry(gl))
728
+// {
729
+// // make sure only the necessary indices are sent through on old
730
+// // cards.
731
+// IntBuffer indices = this.getIndexBuffer();
732
+// if (indices == null)
733
+// {
734
+// logger.severe("missing indices on geometry object: " + this.toString());
735
+// } else
736
+// {
737
+// indices.rewind();
738
+// indices.limit(this.getMaxIndex());
739
+//
740
+// gl.glDrawElements(glMode, indices.limit(), GL.GL_UNSIGNED_INT, indices); // TODO Check <count> and assumed <type> of GL_UNSIGNED_INT
741
+//
742
+// indices.clear();
743
+// }
744
+// } else
745
+// {
746
+// gl.glDrawElements(glMode, this.getIndexBuffer().limit(),
747
+// GL.GL_UNSIGNED_INT, 0);
748
+// }
749
+//
750
+//// postdrawGeometry(tris);
751
+//// if (transformed)
752
+//// {
753
+//// undoTransforms(tris);
754
+//// }
755
+////
756
+//// if (Debug.stats)
757
+//// {
758
+//// StatCollector.endStat(StatType.STAT_RENDER_TIMER);
759
+//// }
760
+//// tris.postdraw(this);
761
+ }
762
+
569763 /// INTERFACE
570764
571765 void SetColor(Object3D obj, Vertex p0)
FrameSelector.java
....@@ -16,7 +16,7 @@
1616 frame = 0;
1717 }
1818
19
- void DrawNode(CameraPane display, Object3D /*Composite*/ root, boolean selected)
19
+ void DrawNode(iCameraPane display, Object3D /*Composite*/ root, boolean selected)
2020 {
2121 while (realframe == 0)
2222 {
GLShapeDrawer.java
....@@ -136,13 +136,13 @@
136136 }
137137 private static float[] glMat = new float[16];
138138
139
- static public void drawOpenGL(CameraPane display, Transform trans, CollisionShape shape, Vector3f color, int debugMode) {
139
+ static public void drawOpenGL(iCameraPane display, Transform trans, CollisionShape shape, Vector3f color, int debugMode) {
140140 ObjectPool<Transform> transformsPool = ObjectPool.get(Transform.class);
141141 ObjectPool<Vector3f> vectorsPool = ObjectPool.get(Vector3f.class);
142142
143143 //System.out.println("shape="+shape+" type="+BroadphaseNativeTypes.forValue(shape.getShapeType()));
144144
145
- GL gl = display.getGL();
145
+ GL gl = display.GetGL();
146146
147147 gl.glPushMatrix();
148148 trans.getOpenGLMatrix(glMat);
....@@ -550,9 +550,9 @@
550550 private static Map<SphereKey, Integer> sphereDisplayLists = new HashMap<SphereKey, Integer>();
551551 private static SphereKey sphereKey = new SphereKey();
552552
553
- static public void drawSphere(CameraPane display, float radius, int slices, int stacks)
553
+ static public void drawSphere(iCameraPane display, float radius, int slices, int stacks)
554554 {
555
- GL gl = display.getGL();
555
+ GL gl = display.GetGL();
556556
557557 sphereKey.radius = radius;
558558 Integer glList = sphereDisplayLists.get(sphereKey);
....@@ -622,9 +622,9 @@
622622 private static Map<CylinderKey, Integer> cylinderDisplayLists = new HashMap<CylinderKey, Integer>();
623623 private static CylinderKey cylinderKey = new CylinderKey();
624624
625
- static public void drawCylinder(CameraPane display, float radius, float halfHeight, int upAxis)
625
+ static public void drawCylinder(iCameraPane display, float radius, float halfHeight, int upAxis)
626626 {
627
- GL gl = display.getGL();
627
+ GL gl = display.GetGL();
628628
629629 gl.glPushMatrix();
630630 switch (upAxis)
GenericJoint.java
....@@ -314,7 +314,7 @@
314314 bRep = null;
315315 }
316316
317
- void DrawNode(CameraPane display, Object3D /*Composite*/ root, boolean selected) // ??
317
+ void DrawNode(iCameraPane display, Object3D /*Composite*/ root, boolean selected) // ??
318318 {
319319 // super.DrawNode(display,root,selected);
320320
....@@ -451,9 +451,9 @@
451451 int startvertex;
452452 int currentobject;
453453
454
- public void renderme(CameraPane display)
454
+ public void renderme(iCameraPane display)
455455 {
456
- GL gl = display!=null?display.getGL():null;
456
+ GL gl = display!=null?display.GetGL():null;
457457
458458 // gl0 = gl;
459459 if (GetDynamicsWorld() != null)
....@@ -796,9 +796,9 @@
796796 }
797797 }
798798
799
- public void drawCube(CameraPane display, float extent)
799
+ public void drawCube(iCameraPane display, float extent)
800800 {
801
- GL gl = display.getGL();
801
+ GL gl = display.GetGL();
802802
803803 extent = extent * 0.5f;
804804
....@@ -838,7 +838,7 @@
838838
839839 private /*static*/ float[] glMat = new float[16];
840840
841
- public void drawOpenGL(CameraPane display, Transform trans, CollisionShape shape, Vector3f color, int debugMode)
841
+ public void drawOpenGL(iCameraPane display, Transform trans, CollisionShape shape, Vector3f color, int debugMode)
842842 {
843843 GL gl = null; // display.getGL();
844844
....@@ -1522,9 +1522,9 @@
15221522 private static Map<SphereKey, Integer> sphereDisplayLists = new HashMap<SphereKey, Integer>();
15231523 private static SphereKey sphereKey = new SphereKey();
15241524
1525
- public void drawSphere(CameraPane display, float radius, int slices, int stacks)
1525
+ public void drawSphere(iCameraPane display, float radius, int slices, int stacks)
15261526 {
1527
- GL gl = display.getGL();
1527
+ GL gl = display.GetGL();
15281528
15291529 sphereKey.radius = radius;
15301530 Integer glList = sphereDisplayLists.get(sphereKey);
....@@ -1594,9 +1594,9 @@
15941594 private static Map<CylinderKey, Integer> cylinderDisplayLists = new HashMap<CylinderKey, Integer>();
15951595 private static CylinderKey cylinderKey = new CylinderKey();
15961596
1597
- public void drawCylinder(CameraPane display, float radius, float halfHeight, int upAxis)
1597
+ public void drawCylinder(iCameraPane display, float radius, float halfHeight, int upAxis)
15981598 {
1599
- GL gl = display.getGL();
1599
+ GL gl = display.GetGL();
16001600
16011601 gl.glPushMatrix();
16021602 switch (upAxis)
Geometry.java
....@@ -75,7 +75,7 @@
7575 {
7676 static final long serialVersionUID = 0;
7777
78
- abstract void DrawParticles(CameraPane display, Object3D geo, boolean selected, boolean rotate);
78
+ abstract void DrawParticles(iCameraPane display, Object3D geo, boolean selected, boolean rotate);
7979
8080 private static final Logger logger = Logger.getLogger(Geometry.class.getName());
8181 // private static final long serialVersionUID = 1;
Merge.java
....@@ -135,7 +135,7 @@
135135
136136 // ObjectArrayList<Transform> initialmatrices;
137137
138
- void DrawNode(CameraPane display, Object3D /*Composite*/ root, boolean selected) // ??
138
+ void DrawNode(iCameraPane display, Object3D /*Composite*/ root, boolean selected) // ??
139139 {
140140 //if (support == null)
141141 // System.err.println("DrawNode Merge # " + ((Mocap)object).frame);
MorphNode.java
....@@ -42,7 +42,7 @@
4242 morphobject.count = 1; // hide
4343 }
4444
45
- void DrawNode(CameraPane display, Object3D /*Composite*/ root, boolean selected)
45
+ void DrawNode(iCameraPane display, Object3D /*Composite*/ root, boolean selected)
4646 {
4747 //System.err.println("Frame # " + frame);
4848
ParticleNode.java
....@@ -344,9 +344,9 @@
344344 }
345345 }
346346
347
- void DrawNode(CameraPane display, Object3D /*Composite*/ root, boolean selected) // ??
347
+ void DrawNode(iCameraPane display, Object3D /*Composite*/ root, boolean selected) // ??
348348 {
349
- if (display.DrawMode() == display.SELECTION || display.BOXMODE)
349
+ if (display.DrawMode() == display.SELECTION || display.IsBoxMode())
350350 return; // hum...
351351
352352 Object3D geo = test;
PhysicsNode.java
....@@ -108,7 +108,7 @@
108108
109109 float totalms = 0;
110110
111
- void drawSelf(CameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked)
111
+ void drawSelf(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked)
112112 {
113113 if (Globals.isLIVE() && live && display.DrawMode() == display.SHADOW) // FUCK
114114 {
ScriptNode.java
....@@ -1785,7 +1785,7 @@
17851785 return live;
17861786 }
17871787
1788
- void DrawNode(CameraPane display, Object3D /*Composite*/ root, boolean selected)
1788
+ void DrawNode(iCameraPane display, Object3D /*Composite*/ root, boolean selected)
17891789 {
17901790 if (CameraPane.ABORTED)
17911791 {
SwitchNode.java
....@@ -46,7 +46,7 @@
4646
4747 transient boolean toggleneutral;
4848
49
- void DrawNode(CameraPane display, Object3D /*Composite*/ root, boolean selected)
49
+ void DrawNode(iCameraPane display, Object3D /*Composite*/ root, boolean selected)
5050 {
5151 //System.err.println("Frame # " + frame);
5252
TriMesh.java
....@@ -70,13 +70,28 @@
7070 */
7171 public class TriMesh extends Geometry implements Serializable
7272 {
73
+ /**
74
+ * <code>draw</code> renders a <code>TriMesh</code> object including
75
+ * it's normals, colors, textures and vertices.
76
+ *
77
+ * @see Renderer#draw(TriMesh)
78
+ * @param tris
79
+ * the mesh to render.
80
+ */
81
+ void DrawParticles(iCameraPane display, Object3D geo, boolean selected, boolean rotate) // TriMesh tris)
82
+ {
83
+ display.DrawParticles(this, geo, selected, rotate);
84
+ }
85
+
7386 static final long serialVersionUID = 0;
7487
7588 boolean IsStatic()
7689 {
7790 return false;
7891 }
92
+
7993 private static final Logger logger = Logger.getLogger(TriMesh.class.getName());
94
+
8095 // private static final long serialVersionUID = 2L;
8196 public enum Mode
8297 {
....@@ -270,190 +285,6 @@
270285
271286 float[] texmat = { 1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1 };
272287
273
- // super.DrawNode(...);
274
- /**
275
- * <code>draw</code> renders a <code>TriMesh</code> object including
276
- * it's normals, colors, textures and vertices.
277
- *
278
- * @see Renderer#draw(TriMesh)
279
- * @param tris
280
- * the mesh to render.
281
- */
282
- void DrawParticles(CameraPane display, Object3D geo, boolean selected, boolean rotate) // TriMesh tris)
283
- {
284
- float r = display.modelParams0[0];
285
- float g = display.modelParams0[1];
286
- float b = display.modelParams0[2];
287
- float opacity = display.modelParams5[1];
288
-
289
- //final GL gl = GLU.getCurrentGL();
290
- GL gl = display.GetGL(); // getGL();
291
-
292
- int v = vertBuf.capacity();
293
-
294
- int count = 0;
295
-
296
- boolean cf = gl.glIsEnabled(gl.GL_CULL_FACE);
297
- gl.glEnable(gl.GL_CULL_FACE);
298
- // gl.glScalef(1.0f/1024,1.0f/1024,1.0f/1024);
299
- for (int i=0; i<v/3; i++)
300
- {
301
- int index3 = i*3;
302
-
303
- if (sizeBuf.get(index3+1) == 0)
304
- continue;
305
-
306
- count++;
307
-
308
- int index4 = i*4;
309
-
310
- float tx = vertBuf.get(index3);
311
- float ty = vertBuf.get(index3+1);
312
- float tz = vertBuf.get(index3+2);
313
-
314
- // if (tx == 0 && ty == 0 && tz == 0)
315
- // continue;
316
-
317
- gl.glMatrixMode(gl.GL_TEXTURE);
318
- gl.glPushMatrix();
319
- texmat[12] = texmat[13] = texmat[14] = i;
320
-
321
- gl.glMultMatrixf(texmat, 0);
322
-
323
- gl.glMatrixMode(gl.GL_MODELVIEW);
324
- gl.glPushMatrix();
325
-
326
- gl.glTranslatef(tx,ty,tz);
327
-
328
- if (rotate)
329
- gl.glRotatef(i, 0, 1, 0);
330
-
331
- float size = sizeBuf.get(index3) / 100;
332
- gl.glScalef(size,size,size);
333
-
334
- float cr = colorBuf.get(index4);
335
- float cg = colorBuf.get(index4+1);
336
- float cb = colorBuf.get(index4+2);
337
- float ca = colorBuf.get(index4+3);
338
-
339
- display.modelParams0[0] = r * cr;
340
- display.modelParams0[1] = g * cg;
341
- display.modelParams0[2] = b * cb;
342
-
343
- display.modelParams5[1] = opacity * ca;
344
-
345
- gl.glProgramEnvParameter4fvARB(gl.GL_FRAGMENT_PROGRAM_ARB, 0, display.modelParams0, 0);
346
- gl.glProgramEnvParameter4fvARB(gl.GL_FRAGMENT_PROGRAM_ARB, 5, display.modelParams5, 0);
347
-
348
- RandomNode.globalseed = (int)sizeBuf.get(index3+2); // i;
349
- RandomNode.globalseed2 = RandomNode.globalseed;
350
-
351
-// gl.glColor4f(cr,cg,cb,ca);
352
- // gl.glScalef(1024/16,1024/16,1024/16);
353
- geo.Draw/*Node*/(display,null,selected,false); // blocked
354
- // gl.glScalef(16.0f/1024,16.0f/1024,16.0f/1024);
355
- //gl.glTranslatef(-tx,-ty,-tz);
356
- gl.glPopMatrix();
357
-
358
- gl.glMatrixMode(gl.GL_TEXTURE);
359
- gl.glPopMatrix();
360
- }
361
- // gl.glScalef(1024,1024,1024);
362
- if (!cf)
363
- gl.glDisable(gl.GL_CULL_FACE);
364
-
365
- display.modelParams0[0] = r;
366
- display.modelParams0[1] = g;
367
- display.modelParams0[2] = b;
368
-
369
- display.modelParams5[1] = opacity;
370
-
371
- gl.glProgramEnvParameter4fvARB(gl.GL_FRAGMENT_PROGRAM_ARB, 0, display.modelParams0, 0);
372
- gl.glProgramEnvParameter4fvARB(gl.GL_FRAGMENT_PROGRAM_ARB, 5, display.modelParams5, 0);
373
-
374
- gl.glMatrixMode(gl.GL_MODELVIEW);
375
-
376
-// System.err.println("total = " + v/3 + "; displayed = " + count);
377
- if (true)
378
- return;
379
-
380
-//// if (!tris.predraw(this))
381
-//// {
382
-//// return;
383
-//// }
384
-//// if (Debug.stats)
385
-//// {
386
-//// StatCollector.addStat(StatType.STAT_TRIANGLE_COUNT, tris.getTriangleCount());
387
-//// StatCollector.addStat(StatType.STAT_VERTEX_COUNT, tris.getVertexCount());
388
-//// StatCollector.addStat(StatType.STAT_GEOM_COUNT, 1);
389
-//// }
390
-////
391
-//// if (tris.getDisplayListID() != -1)
392
-//// {
393
-//// renderDisplayList(tris);
394
-//// return;
395
-//// }
396
-////
397
-//// if (!generatingDisplayList)
398
-//// {
399
-//// applyStates(tris.states, tris);
400
-//// }
401
-//// if (Debug.stats)
402
-//// {
403
-//// StatCollector.startStat(StatType.STAT_RENDER_TIMER);
404
-//// }
405
-//// boolean transformed = doTransforms(tris);
406
-//
407
-// int glMode = GL.GL_TRIANGLES;
408
-// switch (getMode())
409
-// {
410
-// case Triangles:
411
-// glMode = GL.GL_TRIANGLES;
412
-// break;
413
-// case Strip:
414
-// glMode = GL.GL_TRIANGLE_STRIP;
415
-// break;
416
-// case Fan:
417
-// glMode = GL.GL_TRIANGLE_FAN;
418
-// break;
419
-// }
420
-//
421
-// if (!predrawGeometry(gl))
422
-// {
423
-// // make sure only the necessary indices are sent through on old
424
-// // cards.
425
-// IntBuffer indices = this.getIndexBuffer();
426
-// if (indices == null)
427
-// {
428
-// logger.severe("missing indices on geometry object: " + this.toString());
429
-// } else
430
-// {
431
-// indices.rewind();
432
-// indices.limit(this.getMaxIndex());
433
-//
434
-// gl.glDrawElements(glMode, indices.limit(), GL.GL_UNSIGNED_INT, indices); // TODO Check <count> and assumed <type> of GL_UNSIGNED_INT
435
-//
436
-// indices.clear();
437
-// }
438
-// } else
439
-// {
440
-// gl.glDrawElements(glMode, this.getIndexBuffer().limit(),
441
-// GL.GL_UNSIGNED_INT, 0);
442
-// }
443
-//
444
-//// postdrawGeometry(tris);
445
-//// if (transformed)
446
-//// {
447
-//// undoTransforms(tris);
448
-//// }
449
-////
450
-//// if (Debug.stats)
451
-//// {
452
-//// StatCollector.endStat(StatType.STAT_RENDER_TIMER);
453
-//// }
454
-//// tris.postdraw(this);
455
- }
456
-
457288 final boolean supportsVBO = false;
458289 private FloatBuffer prevVerts;
459290
VehicleDemo.java
....@@ -484,7 +484,7 @@
484484
485485 }
486486
487
- void DrawNode(CameraPane display, Object3D /*Composite*/ root, boolean selected) // ??
487
+ void DrawNode(iCameraPane display, Object3D /*Composite*/ root, boolean selected) // ??
488488 {
489489 // super.DrawNode(display,root,selected);
490490
....@@ -526,10 +526,10 @@
526526 return debugMode;
527527 }
528528
529
- public void renderme0(CameraPane display)
529
+ public void renderme0(iCameraPane display)
530530 {
531531 //updateCamera();
532
- GL gl = display.getGL();
532
+ GL gl = display.GetGL();
533533
534534 if (dynamicsWorld != null) {
535535 int numObjects = dynamicsWorld.getNumCollisionObjects();
....@@ -755,7 +755,7 @@
755755
756756 // // to be implemented by the demo
757757 // @Override
758
- public void renderme(CameraPane display)
758
+ public void renderme(iCameraPane display)
759759 {
760760 // updateCamera();
761761
cMesh.java
....@@ -484,7 +484,7 @@
484484 }
485485
486486
487
- void DrawNode(CameraPane display, Object3D /*Composite*/ root, boolean selected) // ??
487
+ void DrawNode(iCameraPane display, Object3D /*Composite*/ root, boolean selected) // ??
488488 {
489489 // ?????? if (size() > 0)
490490 // {
cSpring.java
....@@ -543,13 +543,13 @@
543543 }
544544
545545 // serial lost
546
- void DrawNode0(CameraPane display)
546
+ void DrawNode0(iCameraPane display)
547547 {
548548 super.DrawNode(display, null, false);
549549 }
550550
551551
552
- void DrawNode/*notused*/(CameraPane display, Object3D /*Composite*/ root, boolean selected)
552
+ void DrawNode/*notused*/(iCameraPane display, Object3D /*Composite*/ root, boolean selected)
553553 {
554554 // assert displaylist == -1;
555555
iCameraPane.java
....@@ -5,7 +5,9 @@
55 static final public int SELECTION = 1;
66 static final public int SHADOW = 2;
77 static final public int OCCLUSION = 3;
8
-
8
+
9
+ boolean IsBoxMode();
10
+
911 void ClearDepth();
1012
1113 void DepthTest(boolean depthtest);
....@@ -50,4 +52,6 @@
5052 void ReleaseTextures(cTexture tex);
5153
5254 void DrawFace(Object3D obj, Vertex pv, Vertex qv, Vertex rv, Face face);
55
+
56
+ void DrawParticles(TriMesh geo, Object3D shape, boolean selected, boolean rotate);
5357 }