Normand Briere
2019-08-06 b3ae4e889872ca0b9ca76f1d17b2f0b961226729
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
....@@ -330,16 +330,18 @@
330330 e.printStackTrace();
331331 }
332332
333
- display.GetGL().glPushMatrix();
333
+ //display.GetGL().glPushMatrix();
334
+ display.PushMatrix(LA.Identity, 1);
334335 Vector3f v = ragdolls.get(0).bodies[0].worldTransform.origin;
335336 // display.GetGL().glTranslatef(-v.x,0,-v.z);
336337
337338 super.DrawNode(display, root, selected);
338
- display.GetGL().glPopMatrix();
339
+ //display.GetGL().glPopMatrix();
340
+ display.PopMatrix(LA.Identity);
339341
340342 // assert(bRep != null);
341343
342
- if (display.isLIVE() && live && display.drawMode == display.SHADOW) // FUCK
344
+ if (Globals.isLIVE() && live && display.DrawMode() == display.SHADOW) // FUCK
343345 {
344346 // float ms = getDeltaTimeMicroseconds();
345347 // float minFPS = 1000000f / 60f;
....@@ -379,7 +381,7 @@
379381 try
380382 {
381383 //font = FontRender.createFont("Dialog", 11, false, true);
382
- font = new FontRender.GLFont(gl, GraphreeD.class.getResourceAsStream("DejaVu_Sans_11.fnt"));
384
+ font = new FontRender.GLFont(gl, Grafreed.class.getResourceAsStream("DejaVu_Sans_11.fnt"));
383385 } catch (java.io.IOException e)
384386 {
385387 e.printStackTrace();
....@@ -451,9 +453,9 @@
451453 int startvertex;
452454 int currentobject;
453455
454
- public void renderme(CameraPane display)
456
+ public void renderme(iCameraPane display)
455457 {
456
- GL gl = display!=null?display.getGL():null;
458
+ GL gl = display!=null?display.GetGL0():null;
457459
458460 // gl0 = gl;
459461 if (GetDynamicsWorld() != null)
....@@ -555,7 +557,8 @@
555557 bRep.startvertices = new int[numObjects];
556558 bRep.averagepoints = new float[(bRep.startvertices.length-1) * 3];
557559 bRep.extremepoints = new float[(bRep.startvertices.length-1) * 3];
558
- bRep.supportsizes = new float[(bRep.startvertices.length-1)];
560
+ bRep.supportminsize = new float[(bRep.startvertices.length-1)];
561
+ bRep.supportmaxsize = new float[(bRep.startvertices.length-1)];
559562 buildrep = true;
560563
561564 initialmatrices = new ObjectArrayList<Transform>();
....@@ -796,9 +799,9 @@
796799 }
797800 }
798801
799
- public void drawCube(CameraPane display, float extent)
802
+ public void drawCube(iCameraPane display, float extent)
800803 {
801
- GL gl = display.getGL();
804
+ GL gl = display.GetGL0();
802805
803806 extent = extent * 0.5f;
804807
....@@ -838,7 +841,7 @@
838841
839842 private /*static*/ float[] glMat = new float[16];
840843
841
- public void drawOpenGL(CameraPane display, Transform trans, CollisionShape shape, Vector3f color, int debugMode)
844
+ public void drawOpenGL(iCameraPane display, Transform trans, CollisionShape shape, Vector3f color, int debugMode)
842845 {
843846 GL gl = null; // display.getGL();
844847
....@@ -871,6 +874,7 @@
871874
872875 if (shape.getShapeType() == BroadphaseNativeType.COMPOUND_SHAPE_PROXYTYPE)
873876 {
877
+ new Exception().printStackTrace();
874878 System.exit(0);
875879 CompoundShape compoundShape = (CompoundShape) shape;
876880 Transform childTrans = transformsPool.get();
....@@ -901,6 +905,7 @@
901905 {
902906 case BOX_SHAPE_PROXYTYPE:
903907 {
908
+ new Exception().printStackTrace();
904909 System.exit(0);
905910 BoxShape boxShape = (BoxShape) shape;
906911 Vector3f halfExtent = boxShape.getHalfExtentsWithMargin(vectorsPool.get());
....@@ -912,6 +917,7 @@
912917 }
913918 case SPHERE_SHAPE_PROXYTYPE:
914919 {
920
+ new Exception().printStackTrace();
915921 System.exit(0);
916922 SphereShape sphereShape = (SphereShape) shape;
917923 float radius = sphereShape.getMargin(); // radius doesn't include the margin, so draw with margin
....@@ -958,6 +964,7 @@
958964
959965 case STATIC_PLANE_PROXYTYPE:
960966 {
967
+ new Exception().printStackTrace();
961968 System.exit(0);
962969 StaticPlaneShape staticPlaneShape = (StaticPlaneShape) shape;
963970 float planeConst = staticPlaneShape.getPlaneConstant();
....@@ -1004,6 +1011,7 @@
10041011
10051012 case CYLINDER_SHAPE_PROXYTYPE:
10061013 {
1014
+ new Exception().printStackTrace();
10071015 System.exit(0);
10081016 CylinderShape cylinder = (CylinderShape) shape;
10091017 int upAxis = cylinder.getUpAxis();
....@@ -1218,11 +1226,12 @@
12181226 }
12191227 else
12201228 {
1221
- if (bRep.averagepoints == null || bRep.extremepoints == null || bRep.supportsizes == null)
1229
+ if (bRep.averagepoints == null || bRep.extremepoints == null || bRep.supportminsize == null || bRep.supportmaxsize == null)
12221230 {
12231231 bRep.averagepoints = new float[(bRep.startvertices.length-1) * 3];
12241232 bRep.extremepoints = new float[(bRep.startvertices.length-1) * 3];
1225
- bRep.supportsizes = new float[(bRep.startvertices.length-1)];
1233
+ bRep.supportminsize = new float[(bRep.startvertices.length-1)];
1234
+ bRep.supportmaxsize = new float[(bRep.startvertices.length-1)];
12261235 }
12271236
12281237 float averagex = 0;
....@@ -1292,7 +1301,8 @@
12921301 }
12931302 }
12941303
1295
- bRep.supportsizes[currentobject-1] = (float)Math.sqrt(mindist2);
1304
+ bRep.supportminsize[currentobject-1] = (float)Math.sqrt(mindist2);
1305
+ bRep.supportmaxsize[currentobject-1] = (float)Math.sqrt(maxdist2);
12961306 }
12971307
12981308 // if (hull.numTriangles() > 0)
....@@ -1356,6 +1366,7 @@
13561366 // for polyhedral shapes
13571367 if (shape.isPolyhedral())
13581368 {
1369
+ new Exception().printStackTrace();
13591370 System.exit(0);
13601371 PolyhedralConvexShape polyshape = (PolyhedralConvexShape) shape;
13611372
....@@ -1425,6 +1436,7 @@
14251436 if (shape.isConcave())//>getShapeType() == TRIANGLE_MESH_SHAPE_PROXYTYPE||shape->getShapeType() == GIMPACT_SHAPE_PROXYTYPE)
14261437 // if (shape->getShapeType() == TRIANGLE_MESH_SHAPE_PROXYTYPE)
14271438 {
1439
+ new Exception().printStackTrace();
14281440 System.exit(0);
14291441 ConcaveShape concaveMesh = (ConcaveShape) shape;
14301442 //btVector3 aabbMax(btScalar(1e30),btScalar(1e30),btScalar(1e30));
....@@ -1522,9 +1534,9 @@
15221534 private static Map<SphereKey, Integer> sphereDisplayLists = new HashMap<SphereKey, Integer>();
15231535 private static SphereKey sphereKey = new SphereKey();
15241536
1525
- public void drawSphere(CameraPane display, float radius, int slices, int stacks)
1537
+ public void drawSphere(iCameraPane display, float radius, int slices, int stacks)
15261538 {
1527
- GL gl = display.getGL();
1539
+ GL gl = display.GetGL0();
15281540
15291541 sphereKey.radius = radius;
15301542 Integer glList = sphereDisplayLists.get(sphereKey);
....@@ -1594,9 +1606,9 @@
15941606 private static Map<CylinderKey, Integer> cylinderDisplayLists = new HashMap<CylinderKey, Integer>();
15951607 private static CylinderKey cylinderKey = new CylinderKey();
15961608
1597
- public void drawCylinder(CameraPane display, float radius, float halfHeight, int upAxis)
1609
+ public void drawCylinder(iCameraPane display, float radius, float halfHeight, int upAxis)
15981610 {
1599
- GL gl = display.getGL();
1611
+ GL gl = display.GetGL0();
16001612
16011613 gl.glPushMatrix();
16021614 switch (upAxis)