Normand Briere
2019-09-30 3966454055db8e04700e881a091c2d33dcfda232
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,10 +313,12 @@
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 }
320
+
321
+ static float zoffset = 0;
316322
317323 void DrawNode(iCameraPane display, Object3D /*Composite*/ root, boolean selected) // ??
318324 {
....@@ -341,7 +347,7 @@
341347
342348 // assert(bRep != null);
343349
344
- if (Globals.isLIVE() && live && display.DrawMode() == display.SHADOW) // FUCK
350
+ if (Globals.isLIVE() && live && display.DrawMode() == display.SHADOW) // SHADOW
345351 {
346352 // float ms = getDeltaTimeMicroseconds();
347353 // float minFPS = 1000000f / 60f;
....@@ -381,7 +387,7 @@
381387 try
382388 {
383389 //font = FontRender.createFont("Dialog", 11, false, true);
384
- 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"));
385391 } catch (java.io.IOException e)
386392 {
387393 e.printStackTrace();
....@@ -486,7 +492,7 @@
486492
487493 tc.getFrameOffsetB(trans);
488494
489
- if (false) // c == 2) // DEBUG
495
+ if (false) //c == 8) // DEBUG
490496 {
491497 gl.glDisable(gl.GL_LIGHTING);
492498
....@@ -515,7 +521,7 @@
515521
516522 gl.glPopMatrix();
517523
518
- tc.getFrameOffsetB(trans);
524
+ //tc.getFrameOffsetB(trans);
519525
520526 gl.glColor3f(0, 1, 0);
521527
....@@ -557,7 +563,8 @@
557563 bRep.startvertices = new int[numObjects];
558564 bRep.averagepoints = new float[(bRep.startvertices.length-1) * 3];
559565 bRep.extremepoints = new float[(bRep.startvertices.length-1) * 3];
560
- 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)];
561568 buildrep = true;
562569
563570 initialmatrices = new ObjectArrayList<Transform>();
....@@ -873,6 +880,7 @@
873880
874881 if (shape.getShapeType() == BroadphaseNativeType.COMPOUND_SHAPE_PROXYTYPE)
875882 {
883
+ new Exception().printStackTrace();
876884 System.exit(0);
877885 CompoundShape compoundShape = (CompoundShape) shape;
878886 Transform childTrans = transformsPool.get();
....@@ -903,6 +911,7 @@
903911 {
904912 case BOX_SHAPE_PROXYTYPE:
905913 {
914
+ new Exception().printStackTrace();
906915 System.exit(0);
907916 BoxShape boxShape = (BoxShape) shape;
908917 Vector3f halfExtent = boxShape.getHalfExtentsWithMargin(vectorsPool.get());
....@@ -914,6 +923,7 @@
914923 }
915924 case SPHERE_SHAPE_PROXYTYPE:
916925 {
926
+ new Exception().printStackTrace();
917927 System.exit(0);
918928 SphereShape sphereShape = (SphereShape) shape;
919929 float radius = sphereShape.getMargin(); // radius doesn't include the margin, so draw with margin
....@@ -960,6 +970,7 @@
960970
961971 case STATIC_PLANE_PROXYTYPE:
962972 {
973
+ new Exception().printStackTrace();
963974 System.exit(0);
964975 StaticPlaneShape staticPlaneShape = (StaticPlaneShape) shape;
965976 float planeConst = staticPlaneShape.getPlaneConstant();
....@@ -1006,6 +1017,7 @@
10061017
10071018 case CYLINDER_SHAPE_PROXYTYPE:
10081019 {
1020
+ new Exception().printStackTrace();
10091021 System.exit(0);
10101022 CylinderShape cylinder = (CylinderShape) shape;
10111023 int upAxis = cylinder.getUpAxis();
....@@ -1220,11 +1232,12 @@
12201232 }
12211233 else
12221234 {
1223
- if (bRep.averagepoints == null || bRep.extremepoints == null || bRep.supportsizes == null)
1235
+ if (bRep.averagepoints == null || bRep.extremepoints == null || bRep.supportminsize == null || bRep.supportmaxsize == null)
12241236 {
12251237 bRep.averagepoints = new float[(bRep.startvertices.length-1) * 3];
12261238 bRep.extremepoints = new float[(bRep.startvertices.length-1) * 3];
1227
- 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)];
12281241 }
12291242
12301243 float averagex = 0;
....@@ -1294,7 +1307,8 @@
12941307 }
12951308 }
12961309
1297
- 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);
12981312 }
12991313
13001314 // if (hull.numTriangles() > 0)
....@@ -1358,6 +1372,7 @@
13581372 // for polyhedral shapes
13591373 if (shape.isPolyhedral())
13601374 {
1375
+ new Exception().printStackTrace();
13611376 System.exit(0);
13621377 PolyhedralConvexShape polyshape = (PolyhedralConvexShape) shape;
13631378
....@@ -1427,6 +1442,7 @@
14271442 if (shape.isConcave())//>getShapeType() == TRIANGLE_MESH_SHAPE_PROXYTYPE||shape->getShapeType() == GIMPACT_SHAPE_PROXYTYPE)
14281443 // if (shape->getShapeType() == TRIANGLE_MESH_SHAPE_PROXYTYPE)
14291444 {
1445
+ new Exception().printStackTrace();
14301446 System.exit(0);
14311447 ConcaveShape concaveMesh = (ConcaveShape) shape;
14321448 //btVector3 aabbMax(btScalar(1e30),btScalar(1e30),btScalar(1e30));