Normand Briere
2019-11-21 ddb10cb84dddfeef1ef9946f2e13cef3c93e6cc4
GenericJoint.java
....@@ -177,7 +177,9 @@
177177
178178 public void spawnRagdoll(boolean walk) // random)
179179 {
180
- RagDoll ragDoll = new RagDoll(null, new Vector3f(0f, 0f, 0f), 0.45f, walk); // Math.random() > 0.5/*true*/); // true);
180
+ // KIDS4
181
+ RagDoll ragDoll = new RagDoll(null, new Vector3f(0f, 0f, 0f), 0.45f/2, walk, myzoffset = zoffset); // Math.random() > 0.5/*true*/); // true);
182
+ zoffset += 0.1f;
181183 ragdolls.add(ragDoll);
182184
183185 bRep = null;
....@@ -277,6 +279,8 @@
277279 //
278280 ObjectArrayList<Transform> initialmatrices;
279281
282
+ float myzoffset;
283
+
280284 void Reset()
281285 {
282286 // int numObjects = dynamicsWorld.getNumCollisionObjects();
....@@ -309,12 +313,14 @@
309313 walkdefined = true;
310314 }
311315
312
- ragdolls.get(0).init(/*staticdynamicsWorld,*/ new Vector3f(0f, 0f, 0f), 0.45f, walk);
316
+ ragdolls.get(0).init(/*staticdynamicsWorld,*/ new Vector3f(0f, 0f, 0f), ragdolls.get(0).scale, walk, myzoffset);
313317
314318 bRep = null;
315319 }
316320
317
- void DrawNode(CameraPane display, Object3D /*Composite*/ root, boolean selected) // ??
321
+ static float zoffset = 0;
322
+
323
+ void DrawNode(iCameraPane display, Object3D /*Composite*/ root, boolean selected) // ??
318324 {
319325 // super.DrawNode(display,root,selected);
320326
....@@ -330,16 +336,18 @@
330336 e.printStackTrace();
331337 }
332338
333
- display.GetGL().glPushMatrix();
339
+ //display.GetGL().glPushMatrix();
340
+ display.PushMatrix(LA.Identity, 1);
334341 Vector3f v = ragdolls.get(0).bodies[0].worldTransform.origin;
335342 // display.GetGL().glTranslatef(-v.x,0,-v.z);
336343
337344 super.DrawNode(display, root, selected);
338
- display.GetGL().glPopMatrix();
345
+ //display.GetGL().glPopMatrix();
346
+ display.PopMatrix(LA.Identity);
339347
340348 // assert(bRep != null);
341349
342
- if (display.isLIVE() && live && display.drawMode == display.SHADOW) // FUCK
350
+ if (Globals.isLIVE() && live && display.DrawMode() == display.SHADOW) // SHADOW
343351 {
344352 // float ms = getDeltaTimeMicroseconds();
345353 // float minFPS = 1000000f / 60f;
....@@ -379,7 +387,7 @@
379387 try
380388 {
381389 //font = FontRender.createFont("Dialog", 11, false, true);
382
- font = new FontRender.GLFont(gl, GrafreeD.class.getResourceAsStream("DejaVu_Sans_11.fnt"));
390
+ font = new FontRender.GLFont(gl, Grafreed.class.getResourceAsStream("DejaVu_Sans_11.fnt"));
383391 } catch (java.io.IOException e)
384392 {
385393 e.printStackTrace();
....@@ -451,9 +459,9 @@
451459 int startvertex;
452460 int currentobject;
453461
454
- public void renderme(CameraPane display)
462
+ public void renderme(iCameraPane display)
455463 {
456
- GL gl = display!=null?display.getGL():null;
464
+ GL gl = display!=null?display.GetGL0():null;
457465
458466 // gl0 = gl;
459467 if (GetDynamicsWorld() != null)
....@@ -484,7 +492,7 @@
484492
485493 tc.getFrameOffsetB(trans);
486494
487
- if (false) // c == 2) // DEBUG
495
+ if (false) //c == 8) // DEBUG
488496 {
489497 gl.glDisable(gl.GL_LIGHTING);
490498
....@@ -513,7 +521,7 @@
513521
514522 gl.glPopMatrix();
515523
516
- tc.getFrameOffsetB(trans);
524
+ //tc.getFrameOffsetB(trans);
517525
518526 gl.glColor3f(0, 1, 0);
519527
....@@ -555,7 +563,8 @@
555563 bRep.startvertices = new int[numObjects];
556564 bRep.averagepoints = new float[(bRep.startvertices.length-1) * 3];
557565 bRep.extremepoints = new float[(bRep.startvertices.length-1) * 3];
558
- bRep.supportsizes = new float[(bRep.startvertices.length-1)];
566
+ bRep.supportminsize = new float[(bRep.startvertices.length-1)];
567
+ bRep.supportmaxsize = new float[(bRep.startvertices.length-1)];
559568 buildrep = true;
560569
561570 initialmatrices = new ObjectArrayList<Transform>();
....@@ -796,9 +805,9 @@
796805 }
797806 }
798807
799
- public void drawCube(CameraPane display, float extent)
808
+ public void drawCube(iCameraPane display, float extent)
800809 {
801
- GL gl = display.getGL();
810
+ GL gl = display.GetGL0();
802811
803812 extent = extent * 0.5f;
804813
....@@ -838,7 +847,7 @@
838847
839848 private /*static*/ float[] glMat = new float[16];
840849
841
- public void drawOpenGL(CameraPane display, Transform trans, CollisionShape shape, Vector3f color, int debugMode)
850
+ public void drawOpenGL(iCameraPane display, Transform trans, CollisionShape shape, Vector3f color, int debugMode)
842851 {
843852 GL gl = null; // display.getGL();
844853
....@@ -871,6 +880,7 @@
871880
872881 if (shape.getShapeType() == BroadphaseNativeType.COMPOUND_SHAPE_PROXYTYPE)
873882 {
883
+ new Exception().printStackTrace();
874884 System.exit(0);
875885 CompoundShape compoundShape = (CompoundShape) shape;
876886 Transform childTrans = transformsPool.get();
....@@ -901,6 +911,7 @@
901911 {
902912 case BOX_SHAPE_PROXYTYPE:
903913 {
914
+ new Exception().printStackTrace();
904915 System.exit(0);
905916 BoxShape boxShape = (BoxShape) shape;
906917 Vector3f halfExtent = boxShape.getHalfExtentsWithMargin(vectorsPool.get());
....@@ -912,6 +923,7 @@
912923 }
913924 case SPHERE_SHAPE_PROXYTYPE:
914925 {
926
+ new Exception().printStackTrace();
915927 System.exit(0);
916928 SphereShape sphereShape = (SphereShape) shape;
917929 float radius = sphereShape.getMargin(); // radius doesn't include the margin, so draw with margin
....@@ -958,6 +970,7 @@
958970
959971 case STATIC_PLANE_PROXYTYPE:
960972 {
973
+ new Exception().printStackTrace();
961974 System.exit(0);
962975 StaticPlaneShape staticPlaneShape = (StaticPlaneShape) shape;
963976 float planeConst = staticPlaneShape.getPlaneConstant();
....@@ -1004,6 +1017,7 @@
10041017
10051018 case CYLINDER_SHAPE_PROXYTYPE:
10061019 {
1020
+ new Exception().printStackTrace();
10071021 System.exit(0);
10081022 CylinderShape cylinder = (CylinderShape) shape;
10091023 int upAxis = cylinder.getUpAxis();
....@@ -1218,11 +1232,12 @@
12181232 }
12191233 else
12201234 {
1221
- if (bRep.averagepoints == null || bRep.extremepoints == null || bRep.supportsizes == null)
1235
+ if (bRep.averagepoints == null || bRep.extremepoints == null || bRep.supportminsize == null || bRep.supportmaxsize == null)
12221236 {
12231237 bRep.averagepoints = new float[(bRep.startvertices.length-1) * 3];
12241238 bRep.extremepoints = new float[(bRep.startvertices.length-1) * 3];
1225
- bRep.supportsizes = new float[(bRep.startvertices.length-1)];
1239
+ bRep.supportminsize = new float[(bRep.startvertices.length-1)];
1240
+ bRep.supportmaxsize = new float[(bRep.startvertices.length-1)];
12261241 }
12271242
12281243 float averagex = 0;
....@@ -1292,7 +1307,8 @@
12921307 }
12931308 }
12941309
1295
- bRep.supportsizes[currentobject-1] = (float)Math.sqrt(mindist2);
1310
+ bRep.supportminsize[currentobject-1] = (float)Math.sqrt(mindist2);
1311
+ bRep.supportmaxsize[currentobject-1] = (float)Math.sqrt(maxdist2);
12961312 }
12971313
12981314 // if (hull.numTriangles() > 0)
....@@ -1356,6 +1372,7 @@
13561372 // for polyhedral shapes
13571373 if (shape.isPolyhedral())
13581374 {
1375
+ new Exception().printStackTrace();
13591376 System.exit(0);
13601377 PolyhedralConvexShape polyshape = (PolyhedralConvexShape) shape;
13611378
....@@ -1425,6 +1442,7 @@
14251442 if (shape.isConcave())//>getShapeType() == TRIANGLE_MESH_SHAPE_PROXYTYPE||shape->getShapeType() == GIMPACT_SHAPE_PROXYTYPE)
14261443 // if (shape->getShapeType() == TRIANGLE_MESH_SHAPE_PROXYTYPE)
14271444 {
1445
+ new Exception().printStackTrace();
14281446 System.exit(0);
14291447 ConcaveShape concaveMesh = (ConcaveShape) shape;
14301448 //btVector3 aabbMax(btScalar(1e30),btScalar(1e30),btScalar(1e30));
....@@ -1522,9 +1540,9 @@
15221540 private static Map<SphereKey, Integer> sphereDisplayLists = new HashMap<SphereKey, Integer>();
15231541 private static SphereKey sphereKey = new SphereKey();
15241542
1525
- public void drawSphere(CameraPane display, float radius, int slices, int stacks)
1543
+ public void drawSphere(iCameraPane display, float radius, int slices, int stacks)
15261544 {
1527
- GL gl = display.getGL();
1545
+ GL gl = display.GetGL0();
15281546
15291547 sphereKey.radius = radius;
15301548 Integer glList = sphereDisplayLists.get(sphereKey);
....@@ -1594,9 +1612,9 @@
15941612 private static Map<CylinderKey, Integer> cylinderDisplayLists = new HashMap<CylinderKey, Integer>();
15951613 private static CylinderKey cylinderKey = new CylinderKey();
15961614
1597
- public void drawCylinder(CameraPane display, float radius, float halfHeight, int upAxis)
1615
+ public void drawCylinder(iCameraPane display, float radius, float halfHeight, int upAxis)
15981616 {
1599
- GL gl = display.getGL();
1617
+ GL gl = display.GetGL0();
16001618
16011619 gl.glPushMatrix();
16021620 switch (upAxis)