.. | .. |
---|
177 | 177 | |
---|
178 | 178 | public void spawnRagdoll(boolean walk) // random) |
---|
179 | 179 | { |
---|
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; |
---|
181 | 183 | ragdolls.add(ragDoll); |
---|
182 | 184 | |
---|
183 | 185 | bRep = null; |
---|
.. | .. |
---|
277 | 279 | // |
---|
278 | 280 | ObjectArrayList<Transform> initialmatrices; |
---|
279 | 281 | |
---|
| 282 | + float myzoffset; |
---|
| 283 | + |
---|
280 | 284 | void Reset() |
---|
281 | 285 | { |
---|
282 | 286 | // int numObjects = dynamicsWorld.getNumCollisionObjects(); |
---|
.. | .. |
---|
309 | 313 | walkdefined = true; |
---|
310 | 314 | } |
---|
311 | 315 | |
---|
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); |
---|
313 | 317 | |
---|
314 | 318 | bRep = null; |
---|
315 | 319 | } |
---|
316 | 320 | |
---|
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) // ?? |
---|
318 | 324 | { |
---|
319 | 325 | // super.DrawNode(display,root,selected); |
---|
320 | 326 | |
---|
.. | .. |
---|
330 | 336 | e.printStackTrace(); |
---|
331 | 337 | } |
---|
332 | 338 | |
---|
333 | | - display.GetGL().glPushMatrix(); |
---|
| 339 | + //display.GetGL().glPushMatrix(); |
---|
| 340 | + display.PushMatrix(LA.Identity, 1); |
---|
334 | 341 | Vector3f v = ragdolls.get(0).bodies[0].worldTransform.origin; |
---|
335 | 342 | // display.GetGL().glTranslatef(-v.x,0,-v.z); |
---|
336 | 343 | |
---|
337 | 344 | super.DrawNode(display, root, selected); |
---|
338 | | - display.GetGL().glPopMatrix(); |
---|
| 345 | + //display.GetGL().glPopMatrix(); |
---|
| 346 | + display.PopMatrix(LA.Identity); |
---|
339 | 347 | |
---|
340 | 348 | // assert(bRep != null); |
---|
341 | 349 | |
---|
342 | | - if (display.isLIVE() && live && display.drawMode == display.SHADOW) // FUCK |
---|
| 350 | + if (Globals.isLIVE() && live && display.DrawMode() == display.SHADOW) // SHADOW |
---|
343 | 351 | { |
---|
344 | 352 | // float ms = getDeltaTimeMicroseconds(); |
---|
345 | 353 | // float minFPS = 1000000f / 60f; |
---|
.. | .. |
---|
379 | 387 | try |
---|
380 | 388 | { |
---|
381 | 389 | //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")); |
---|
383 | 391 | } catch (java.io.IOException e) |
---|
384 | 392 | { |
---|
385 | 393 | e.printStackTrace(); |
---|
.. | .. |
---|
451 | 459 | int startvertex; |
---|
452 | 460 | int currentobject; |
---|
453 | 461 | |
---|
454 | | - public void renderme(CameraPane display) |
---|
| 462 | + public void renderme(iCameraPane display) |
---|
455 | 463 | { |
---|
456 | | - GL gl = display!=null?display.getGL():null; |
---|
| 464 | + GL gl = display!=null?display.GetGL0():null; |
---|
457 | 465 | |
---|
458 | 466 | // gl0 = gl; |
---|
459 | 467 | if (GetDynamicsWorld() != null) |
---|
.. | .. |
---|
484 | 492 | |
---|
485 | 493 | tc.getFrameOffsetB(trans); |
---|
486 | 494 | |
---|
487 | | - if (false) // c == 2) // DEBUG |
---|
| 495 | + if (false) //c == 8) // DEBUG |
---|
488 | 496 | { |
---|
489 | 497 | gl.glDisable(gl.GL_LIGHTING); |
---|
490 | 498 | |
---|
.. | .. |
---|
513 | 521 | |
---|
514 | 522 | gl.glPopMatrix(); |
---|
515 | 523 | |
---|
516 | | - tc.getFrameOffsetB(trans); |
---|
| 524 | + //tc.getFrameOffsetB(trans); |
---|
517 | 525 | |
---|
518 | 526 | gl.glColor3f(0, 1, 0); |
---|
519 | 527 | |
---|
.. | .. |
---|
555 | 563 | bRep.startvertices = new int[numObjects]; |
---|
556 | 564 | bRep.averagepoints = new float[(bRep.startvertices.length-1) * 3]; |
---|
557 | 565 | 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)]; |
---|
559 | 568 | buildrep = true; |
---|
560 | 569 | |
---|
561 | 570 | initialmatrices = new ObjectArrayList<Transform>(); |
---|
.. | .. |
---|
796 | 805 | } |
---|
797 | 806 | } |
---|
798 | 807 | |
---|
799 | | - public void drawCube(CameraPane display, float extent) |
---|
| 808 | + public void drawCube(iCameraPane display, float extent) |
---|
800 | 809 | { |
---|
801 | | - GL gl = display.getGL(); |
---|
| 810 | + GL gl = display.GetGL0(); |
---|
802 | 811 | |
---|
803 | 812 | extent = extent * 0.5f; |
---|
804 | 813 | |
---|
.. | .. |
---|
838 | 847 | |
---|
839 | 848 | private /*static*/ float[] glMat = new float[16]; |
---|
840 | 849 | |
---|
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) |
---|
842 | 851 | { |
---|
843 | 852 | GL gl = null; // display.getGL(); |
---|
844 | 853 | |
---|
.. | .. |
---|
871 | 880 | |
---|
872 | 881 | if (shape.getShapeType() == BroadphaseNativeType.COMPOUND_SHAPE_PROXYTYPE) |
---|
873 | 882 | { |
---|
| 883 | + new Exception().printStackTrace(); |
---|
874 | 884 | System.exit(0); |
---|
875 | 885 | CompoundShape compoundShape = (CompoundShape) shape; |
---|
876 | 886 | Transform childTrans = transformsPool.get(); |
---|
.. | .. |
---|
901 | 911 | { |
---|
902 | 912 | case BOX_SHAPE_PROXYTYPE: |
---|
903 | 913 | { |
---|
| 914 | + new Exception().printStackTrace(); |
---|
904 | 915 | System.exit(0); |
---|
905 | 916 | BoxShape boxShape = (BoxShape) shape; |
---|
906 | 917 | Vector3f halfExtent = boxShape.getHalfExtentsWithMargin(vectorsPool.get()); |
---|
.. | .. |
---|
912 | 923 | } |
---|
913 | 924 | case SPHERE_SHAPE_PROXYTYPE: |
---|
914 | 925 | { |
---|
| 926 | + new Exception().printStackTrace(); |
---|
915 | 927 | System.exit(0); |
---|
916 | 928 | SphereShape sphereShape = (SphereShape) shape; |
---|
917 | 929 | float radius = sphereShape.getMargin(); // radius doesn't include the margin, so draw with margin |
---|
.. | .. |
---|
958 | 970 | |
---|
959 | 971 | case STATIC_PLANE_PROXYTYPE: |
---|
960 | 972 | { |
---|
| 973 | + new Exception().printStackTrace(); |
---|
961 | 974 | System.exit(0); |
---|
962 | 975 | StaticPlaneShape staticPlaneShape = (StaticPlaneShape) shape; |
---|
963 | 976 | float planeConst = staticPlaneShape.getPlaneConstant(); |
---|
.. | .. |
---|
1004 | 1017 | |
---|
1005 | 1018 | case CYLINDER_SHAPE_PROXYTYPE: |
---|
1006 | 1019 | { |
---|
| 1020 | + new Exception().printStackTrace(); |
---|
1007 | 1021 | System.exit(0); |
---|
1008 | 1022 | CylinderShape cylinder = (CylinderShape) shape; |
---|
1009 | 1023 | int upAxis = cylinder.getUpAxis(); |
---|
.. | .. |
---|
1218 | 1232 | } |
---|
1219 | 1233 | else |
---|
1220 | 1234 | { |
---|
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) |
---|
1222 | 1236 | { |
---|
1223 | 1237 | bRep.averagepoints = new float[(bRep.startvertices.length-1) * 3]; |
---|
1224 | 1238 | 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)]; |
---|
1226 | 1241 | } |
---|
1227 | 1242 | |
---|
1228 | 1243 | float averagex = 0; |
---|
.. | .. |
---|
1292 | 1307 | } |
---|
1293 | 1308 | } |
---|
1294 | 1309 | |
---|
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); |
---|
1296 | 1312 | } |
---|
1297 | 1313 | |
---|
1298 | 1314 | // if (hull.numTriangles() > 0) |
---|
.. | .. |
---|
1356 | 1372 | // for polyhedral shapes |
---|
1357 | 1373 | if (shape.isPolyhedral()) |
---|
1358 | 1374 | { |
---|
| 1375 | + new Exception().printStackTrace(); |
---|
1359 | 1376 | System.exit(0); |
---|
1360 | 1377 | PolyhedralConvexShape polyshape = (PolyhedralConvexShape) shape; |
---|
1361 | 1378 | |
---|
.. | .. |
---|
1425 | 1442 | if (shape.isConcave())//>getShapeType() == TRIANGLE_MESH_SHAPE_PROXYTYPE||shape->getShapeType() == GIMPACT_SHAPE_PROXYTYPE) |
---|
1426 | 1443 | // if (shape->getShapeType() == TRIANGLE_MESH_SHAPE_PROXYTYPE) |
---|
1427 | 1444 | { |
---|
| 1445 | + new Exception().printStackTrace(); |
---|
1428 | 1446 | System.exit(0); |
---|
1429 | 1447 | ConcaveShape concaveMesh = (ConcaveShape) shape; |
---|
1430 | 1448 | //btVector3 aabbMax(btScalar(1e30),btScalar(1e30),btScalar(1e30)); |
---|
.. | .. |
---|
1522 | 1540 | private static Map<SphereKey, Integer> sphereDisplayLists = new HashMap<SphereKey, Integer>(); |
---|
1523 | 1541 | private static SphereKey sphereKey = new SphereKey(); |
---|
1524 | 1542 | |
---|
1525 | | - public void drawSphere(CameraPane display, float radius, int slices, int stacks) |
---|
| 1543 | + public void drawSphere(iCameraPane display, float radius, int slices, int stacks) |
---|
1526 | 1544 | { |
---|
1527 | | - GL gl = display.getGL(); |
---|
| 1545 | + GL gl = display.GetGL0(); |
---|
1528 | 1546 | |
---|
1529 | 1547 | sphereKey.radius = radius; |
---|
1530 | 1548 | Integer glList = sphereDisplayLists.get(sphereKey); |
---|
.. | .. |
---|
1594 | 1612 | private static Map<CylinderKey, Integer> cylinderDisplayLists = new HashMap<CylinderKey, Integer>(); |
---|
1595 | 1613 | private static CylinderKey cylinderKey = new CylinderKey(); |
---|
1596 | 1614 | |
---|
1597 | | - public void drawCylinder(CameraPane display, float radius, float halfHeight, int upAxis) |
---|
| 1615 | + public void drawCylinder(iCameraPane display, float radius, float halfHeight, int upAxis) |
---|
1598 | 1616 | { |
---|
1599 | | - GL gl = display.getGL(); |
---|
| 1617 | + GL gl = display.GetGL0(); |
---|
1600 | 1618 | |
---|
1601 | 1619 | gl.glPushMatrix(); |
---|
1602 | 1620 | switch (upAxis) |
---|