CameraPane.java | ●●●●● patch | view | raw | blame | history | |
GenericJoint.java | ●●●●● patch | view | raw | blame | history | |
Merge.java | ●●●●● patch | view | raw | blame | history | |
Object3D.java | ●●●●● patch | view | raw | blame | history | |
PhysicsEditor.java | ●●●●● patch | view | raw | blame | history | |
PhysicsNode.java | ●●●●● patch | view | raw | blame | history | |
RagDoll.java | ●●●●● patch | view | raw | blame | history | |
com/bulletphysics/dynamics/RigidBody.java | ●●●●● patch | view | raw | blame | history |
CameraPane.java
.. .. @@ -6962,30 +6962,30 @@ 6962 6962 short residu = 0; 6963 6963 6964 6964 // wraparound workarounds 6965 - short fuck = (short) (buffer[i] & 0xFF);6965 + short ww = (short) (buffer[i] & 0xFF);6966 6966 /* 6967 - residu += (fuck%2);6968 - if(fuck/2 < 256-residu/2)6967 + residu += (ww%2);6968 + if(ww/2 < 256-residu/2)6969 6969 { 6970 - fuck = (short)((fuck/2) + residu/2);6970 + ww = (short)((ww/2) + residu/2);6971 6971 if(residu == 2) 6972 6972 residu = 0; 6973 6973 } 6974 6974 else 6975 6975 { 6976 6976 residu = 0; 6977 - fuck /= 2;6977 + ww /= 2;6978 6978 } 6979 6979 */ 6980 - if (i < imglength / 3 || rnd.nextFloat() < 0.5 || fuck >= 254)6980 + if (i < imglength / 3 || rnd.nextFloat() < 0.5 || ww >= 254)6981 6981 { 6982 - fuck /= 2;6982 + ww /= 2;6983 6983 } else 6984 6984 { 6985 - fuck = (short) ((fuck / 2) + fuck % 2);6985 + ww = (short) ((ww / 2) + ww % 2);6986 6986 } 6987 6987 6988 - buffer[i] = (byte) fuck;6988 + buffer[i] = (byte) ww;6989 6989 } 6990 6990 //System.out.print(bytes[i] + " "); 6991 6991 //if(buffer[i] >= 0 && buffer[i]<=eps-1) buffer[i] = eps; .. .. @@ -14341,10 +14341,13 @@ 14341 14341 public void mouseClicked(MouseEvent e) 14342 14342 { 14343 14343 System.out.println("mouseClicked: " + e); 14344 + System.exit(0);14344 14345 } 14345 14346 14346 14347 public void mousePressed(MouseEvent e) 14347 14348 { 14349 + RigidBody.justclicked = true;14350 + System.out.println("justclicked: " + e);14348 14351 //System.out.println("mousePressed: " + e); 14349 14352 clickStart(e.getX(), e.getY(), e.getModifiers(), e.getModifiersEx()); 14350 14353 } .. .. @@ -14668,13 +14671,20 @@ 14668 14671 // only one thread!? synchronized 14669 14672 void StepToTarget(boolean jump) 14670 14673 { 14671 - RigidBody.pos.x = (float)manipCamera.lookAt.x;14672 - RigidBody.pos.y = (float)manipCamera.lookAt.y;14673 - RigidBody.pos.z = (float)manipCamera.lookAt.z;14674 -// RigidBody.wind.x = (float)manipCamera.right.x;14675 -// RigidBody.wind.y = (float)manipCamera.right.y;14676 -// RigidBody.wind.z = (float)manipCamera.right.z;14677 - //RigidBody.wind.normalize();14674 + RigidBody.pos.x = 0;14675 + RigidBody.pos.y = 0;14676 + RigidBody.pos.z = 0;14677 + if (RigidBody.justclicked)14678 + {14679 + RigidBody.pos.x = (float)manipCamera.lookAt.x;14680 + RigidBody.pos.y = (float)manipCamera.lookAt.y;14681 + RigidBody.pos.z = (float)manipCamera.lookAt.z;14682 + RigidBody.wind.set(RigidBody.pos);14683 + RigidBody.wind.x -= (float)manipCamera.location.x;14684 + RigidBody.wind.y -= (float)manipCamera.location.y;14685 + RigidBody.wind.z -= (float)manipCamera.location.z;14686 + RigidBody.wind.normalize();14687 + }14678 14688 14679 14689 if (mute) 14680 14690 return; .. .. @@ -15022,6 +15032,8 @@ 15022 15032 15023 15033 void GoUp(int mod) 15024 15034 { 15035 + RigidBody.justclicked = true;15036 +15025 15037 MODIFIERS |= COMMAND; 15026 15038 /**/ 15027 15039 boolean isVR = (mouseMode&VR)!=0; .. .. @@ -16752,7 +16764,8 @@ 16752 16764 16753 16765 public boolean mouseDrag(Event evt, int x, int y) 16754 16766 { 16755 - //System.out.println("mouseDrag: " + evt);16767 + System.out.println("mouseDrag: " + evt);16768 + System.exit(0);16756 16769 /* 16757 16770 drag = true; 16758 16771 //System.out.println("Mouse DRAG"); .. .. @@ -16871,6 +16884,7 @@ 16871 16884 public boolean mouseUp(Event evt, int x, int y) 16872 16885 { 16873 16886 System.out.println("mouseUp: " + evt); 16887 + System.exit(0);16874 16888 /* 16875 16889 locked = false; 16876 16890 if (isRenderer) GenericJoint.java
.. .. @@ -342,7 +342,7 @@ 342 342 343 343 // assert(bRep != null); 344 344 345 - if (Globals.isLIVE() && live && display.DrawMode() == display.SHADOW) // FUCK345 + if (Globals.isLIVE() && live && display.DrawMode() == display.SHADOW) // SHADOW346 346 { 347 347 // float ms = getDeltaTimeMicroseconds(); 348 348 // float minFPS = 1000000f / 60f; Merge.java
.. .. @@ -144,7 +144,7 @@ 144 144 if (bRep == null && GetObject() != null) 145 145 renderme(); // display); // only once 146 146 147 - if (/*display.LIVE && live &&*/link2master) // && display.drawMode == display.SHADOW) // FUCK!!!147 + if (/*display.LIVE && live &&*/link2master) // && display.drawMode == display.SHADOW) // SHADOW!!!148 148 { 149 149 try 150 150 { Object3D.java
.. .. @@ -8349,7 +8349,7 @@ 8349 8349 8350 8350 public int hashCode() 8351 8351 { 8352 - // Fuck Vector...8352 + // Do not use Vector...8353 8353 return System.identityHashCode(this); 8354 8354 } 8355 8355 PhysicsEditor.java
.. .. @@ -70,7 +70,7 @@ 70 70 */ 71 71 super.SetupUI2(oe); 72 72 73 - gravityPanel = AddSlider(oe.ctrlPanel, "Gravity:", 0, 100.0, physicsnode.gravity, 1);73 + gravityPanel = AddSlider(oe.ctrlPanel, "Gravity:", 0, 10.0, physicsnode.gravity, 1);74 74 gravityField = (cNumberSlider)gravityPanel.getComponent(1); 75 75 76 76 // oe.ctrlPanel.add(gravityLabel = new JLabel("Gravity: ")); //, oe.aConstraints, oe.ctrlPanel.getComponentCount()-2); .. .. @@ -79,7 +79,7 @@ 79 79 80 80 oe.ctrlPanel.Return(); 81 81 82 - windPanel = AddSlider(oe.ctrlPanel, "Wind:", 0, 100.0, physicsnode.wind, 1);82 + windPanel = AddSlider(oe.ctrlPanel, "Wind:", 0, 10.0, physicsnode.wind, 1);83 83 windField = (cNumberSlider)windPanel.getComponent(1); 84 84 85 85 // oe.ctrlPanel.add(windLabel = new JLabel("Wind: ")); //, oe.aConstraints, oe.ctrlPanel.getComponentCount()-2); PhysicsNode.java
.. .. @@ -112,7 +112,7 @@ 112 112 113 113 void drawSelf(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked) 114 114 { 115 - if (Globals.isLIVE() && live && display.DrawMode() == display.SHADOW) // FUCK115 + if (Globals.isLIVE() && live && display.DrawMode() == display.SHADOW) // SHADOW116 116 { 117 117 float ms = getDeltaTimeMicroseconds(); 118 118 float minFPS = 1000000f / 60f; RagDoll.java
.. .. @@ -89,11 +89,11 @@ 89 89 90 90 BODYPART_LEFT_UPPER_ARM, 91 91 BODYPART_LEFT_LOWER_ARM, 92 - BODYPART_LEFT_HAND,92 + //BODYPART_LEFT_HAND,93 93 94 94 BODYPART_RIGHT_UPPER_ARM, 95 95 BODYPART_RIGHT_LOWER_ARM, 96 - BODYPART_RIGHT_HAND,96 + //BODYPART_RIGHT_HAND,97 97 98 98 //BODYPART_GROUND, 99 99 .. .. @@ -114,11 +114,11 @@ 114 114 115 115 JOINT_LEFT_SHOULDER, 116 116 JOINT_LEFT_ELBOW, 117 - JOINT_LEFT_WRIST,117 + //JOINT_LEFT_WRIST,118 118 119 119 JOINT_RIGHT_SHOULDER, 120 120 JOINT_RIGHT_ELBOW, 121 - JOINT_RIGHT_WRIST,121 + //JOINT_RIGHT_WRIST,122 122 123 123 JOINT_COUNT 124 124 } .. .. @@ -174,19 +174,19 @@ 174 174 175 175 shapes[BodyPart.BODYPART_LEFT_UPPER_LEG.ordinal()] = new CapsuleShape(scale_ragdoll * 0.4f * thin, scale_ragdoll * 0.4f, node); 176 176 shapes[BodyPart.BODYPART_LEFT_LOWER_LEG.ordinal()] = new CapsuleShape(scale_ragdoll * 0.37f * thin, scale_ragdoll * 0.37f, node); 177 - shapes[BodyPart.BODYPART_LEFT_FOOT.ordinal()] = new CapsuleShape(scale_ragdoll * 0.1f * thin, scale_ragdoll * 0.1f, node);177 + shapes[BodyPart.BODYPART_LEFT_FOOT.ordinal()] = new CapsuleShape(scale_ragdoll * 0.2f * thin, scale_ragdoll * 0.2f, node);178 178 179 179 shapes[BodyPart.BODYPART_RIGHT_UPPER_LEG.ordinal()] = new CapsuleShape(scale_ragdoll * 0.4f * thin, scale_ragdoll * 0.4f, node); 180 180 shapes[BodyPart.BODYPART_RIGHT_LOWER_LEG.ordinal()] = new CapsuleShape(scale_ragdoll * 0.37f * thin, scale_ragdoll * 0.37f, node); 181 - shapes[BodyPart.BODYPART_RIGHT_FOOT.ordinal()] = new CapsuleShape(scale_ragdoll * 0.1f * thin, scale_ragdoll * 0.1f, node);181 + shapes[BodyPart.BODYPART_RIGHT_FOOT.ordinal()] = new CapsuleShape(scale_ragdoll * 0.2f * thin, scale_ragdoll * 0.2f, node);182 182 183 183 shapes[BodyPart.BODYPART_LEFT_UPPER_ARM.ordinal()] = new CapsuleShape(scale_ragdoll * upperarmlength * thin, scale_ragdoll * upperarmlength, node); 184 184 shapes[BodyPart.BODYPART_LEFT_LOWER_ARM.ordinal()] = new CapsuleShape(scale_ragdoll * lowerarmlength * thin, scale_ragdoll * lowerarmlength, node); 185 - shapes[BodyPart.BODYPART_LEFT_HAND.ordinal()] = new CapsuleShape(scale_ragdoll * handlength * thin, scale_ragdoll * handlength, node);185 + //shapes[BodyPart.BODYPART_LEFT_HAND.ordinal()] = new CapsuleShape(scale_ragdoll * handlength * thin, scale_ragdoll * handlength, node);186 186 187 187 shapes[BodyPart.BODYPART_RIGHT_UPPER_ARM.ordinal()] = new CapsuleShape(scale_ragdoll * upperarmlength * thin, scale_ragdoll * upperarmlength, node); 188 188 shapes[BodyPart.BODYPART_RIGHT_LOWER_ARM.ordinal()] = new CapsuleShape(scale_ragdoll * lowerarmlength * thin, scale_ragdoll * lowerarmlength, node); 189 - shapes[BodyPart.BODYPART_RIGHT_HAND.ordinal()] = new CapsuleShape(scale_ragdoll * handlength * thin, scale_ragdoll * handlength, node);189 + //shapes[BodyPart.BODYPART_RIGHT_HAND.ordinal()] = new CapsuleShape(scale_ragdoll * handlength * thin, scale_ragdoll * handlength, node);190 190 } 191 191 //scale_ragdoll *= 1.25; 192 192 .. .. @@ -329,15 +329,15 @@ 329 329 body.getMotionState().setWorldTransform(tmpTrans); 330 330 ((cRigidBody)body).anchor.set(tmpTrans.origin); 331 331 332 - transform.setIdentity();333 - if ((body = bodies[BodyPart.BODYPART_LEFT_HAND.ordinal()]) == null)334 - body = bodies[BodyPart.BODYPART_LEFT_HAND.ordinal()] = localCreateRigidBody(1f, 0, transform, shapes[BodyPart.BODYPART_LEFT_HAND.ordinal()]);335 - transform.origin.set(-(handlength/2 + lowerarmlength + upperarmlength + upperarmdist) * scale_ragdoll, 1.325f * scale_ragdoll, depth);336 - MatrixUtil.setEulerZYX(transform.basis, 0, 0, BulletGlobals.SIMD_HALF_PI);337 - tmpTrans.mul(offset, transform);338 - body.worldTransform.set(tmpTrans);339 - body.getMotionState().setWorldTransform(tmpTrans);340 - ((cRigidBody)body).anchor.set(tmpTrans.origin);332 +// transform.setIdentity();333 +// if ((body = bodies[BodyPart.BODYPART_LEFT_HAND.ordinal()]) == null)334 +// body = bodies[BodyPart.BODYPART_LEFT_HAND.ordinal()] = localCreateRigidBody(1f, 0, transform, shapes[BodyPart.BODYPART_LEFT_HAND.ordinal()]);335 +// transform.origin.set(-(handlength/2 + lowerarmlength + upperarmlength + upperarmdist) * scale_ragdoll, 1.325f * scale_ragdoll, depth);336 +// MatrixUtil.setEulerZYX(transform.basis, 0, 0, BulletGlobals.SIMD_HALF_PI);337 +// tmpTrans.mul(offset, transform);338 +// body.worldTransform.set(tmpTrans);339 +// body.getMotionState().setWorldTransform(tmpTrans);340 +// ((cRigidBody)body).anchor.set(tmpTrans.origin);341 341 342 342 transform.setIdentity(); 343 343 if ((body = bodies[BodyPart.BODYPART_RIGHT_UPPER_ARM.ordinal()]) == null) .. .. @@ -359,15 +359,15 @@ 359 359 body.getMotionState().setWorldTransform(tmpTrans); 360 360 ((cRigidBody)body).anchor.set(tmpTrans.origin); 361 361 362 - transform.setIdentity();363 - if ((body = bodies[BodyPart.BODYPART_RIGHT_HAND.ordinal()]) == null)364 - body = bodies[BodyPart.BODYPART_RIGHT_HAND.ordinal()] = localCreateRigidBody(1f, 0, transform, shapes[BodyPart.BODYPART_RIGHT_HAND.ordinal()]);365 - transform.origin.set((handlength/2 + lowerarmlength + upperarmlength + upperarmdist) * scale_ragdoll, 1.325f * scale_ragdoll, depth);366 - MatrixUtil.setEulerZYX(transform.basis, 0, 0, -BulletGlobals.SIMD_HALF_PI);367 - tmpTrans.mul(offset, transform);368 - body.worldTransform.set(tmpTrans);369 - body.getMotionState().setWorldTransform(tmpTrans);370 - ((cRigidBody)body).anchor.set(tmpTrans.origin);362 +// transform.setIdentity();363 +// if ((body = bodies[BodyPart.BODYPART_RIGHT_HAND.ordinal()]) == null)364 +// body = bodies[BodyPart.BODYPART_RIGHT_HAND.ordinal()] = localCreateRigidBody(1f, 0, transform, shapes[BodyPart.BODYPART_RIGHT_HAND.ordinal()]);365 +// transform.origin.set((handlength/2 + lowerarmlength + upperarmlength + upperarmdist) * scale_ragdoll, 1.325f * scale_ragdoll, depth);366 +// MatrixUtil.setEulerZYX(transform.basis, 0, 0, -BulletGlobals.SIMD_HALF_PI);367 +// tmpTrans.mul(offset, transform);368 +// body.worldTransform.set(tmpTrans);369 +// body.getMotionState().setWorldTransform(tmpTrans);370 +// ((cRigidBody)body).anchor.set(tmpTrans.origin);371 371 372 372 // Setup some damping on the m_bodies 373 373 for (int i = 0; i < BodyPart.BODYPART_COUNT.ordinal(); ++i) .. .. @@ -533,6 +533,7 @@ 533 533 /// *************************** /// 534 534 535 535 /// ******* LEFT WRIST ******** /// 536 + /**536 537 if (links) 537 538 { 538 539 localA.setIdentity(); .. .. @@ -556,9 +557,11 @@ 556 557 joints[JointType.JOINT_LEFT_WRIST.ordinal()] = joint6DOF; 557 558 // ownerWorld.addConstraint(joints[JointType.JOINT_LEFT_WRIST.ordinal()], !selfcollision); 558 559 } 560 + /**/559 561 /// *************************** /// 560 562 561 563 /// ******* RIGHT WRIST ******** /// 564 + /**562 565 if (links) 563 566 { 564 567 localA.setIdentity(); .. .. @@ -582,6 +585,7 @@ 582 585 joints[JointType.JOINT_RIGHT_WRIST.ordinal()] = joint6DOF; 583 586 // ownerWorld.addConstraint(joints[JointType.JOINT_RIGHT_WRIST.ordinal()], !selfcollision); 584 587 } 588 + /**/585 589 586 590 /// ******* PELVIS ******** /// 587 591 if (links) .. .. @@ -723,6 +727,7 @@ 723 727 /// *************************** /// 724 728 725 729 /// ******* LEFT ANKLE ******** /// 730 + /**/726 731 if (links) 727 732 { 728 733 localA.setIdentity(); .. .. @@ -746,9 +751,11 @@ 746 751 joints[JointType.JOINT_LEFT_ANKLE.ordinal()] = joint6DOF; 747 752 // ownerWorld.addConstraint(joints[JointType.JOINT_LEFT_KNEE.ordinal()], !selfcollision); 748 753 } 754 + /**/749 755 /// *************************** /// 750 756 751 757 /// ******* RIGHT ANKLE ******** /// 758 + /**/752 759 if (links) 753 760 { 754 761 localA.setIdentity(); .. .. @@ -772,6 +779,7 @@ 772 779 joints[JointType.JOINT_RIGHT_ANKLE.ordinal()] = joint6DOF; 773 780 // ownerWorld.addConstraint(joints[JointType.JOINT_RIGHT_KNEE.ordinal()], !selfcollision); 774 781 } 782 + /**/775 783 /// *************************** /// 776 784 777 785 com/bulletphysics/dynamics/RigidBody.java
.. .. @@ -216,9 +216,15 @@ 216 216 217 217 static Vector3f g = new Vector3f(); 218 218 static Vector3f w = new Vector3f(); 219 +219 220 static public Vector3f wind = new Vector3f(); 220 221 static public Vector3f pos = new Vector3f(); 221 222 223 + static public Vector3f min = new Vector3f();224 + static public Vector3f max = new Vector3f();225 +226 + static public boolean justclicked;227 +222 228 public void applyGravity() { 223 229 if (isStaticOrKinematicObject()) 224 230 return; .. .. @@ -226,11 +232,25 @@ 226 232 g.y = gravity.y; 227 233 applyCentralForce(g); 228 234 229 - wind.set(pos);230 - wind.x -= worldTransform.origin.x;231 - wind.y -= worldTransform.origin.y;232 - wind.z -= worldTransform.origin.z;235 + if (pos.x == 0 && pos.y == 0 && pos.z == 0)236 + return;233 237 238 + justclicked = false;239 +240 +// wind.set(pos);241 +// wind.x -= worldTransform.origin.x;242 +// wind.y -= worldTransform.origin.y;243 +// wind.z -= worldTransform.origin.z;244 +245 +// this.collisionShape.getAabb(worldTransform, min, max);246 +//247 +// if (pos.x < min.x || pos.x > max.x)248 +// return;249 +// if (pos.y < min.y || pos.y > max.y)250 +// return;251 +// if (pos.z < min.z || pos.z > max.z)252 +// return;253 +234 254 float dot = pos.x * wind.x + pos.y * wind.y + pos.z * wind.z; 235 255 236 256 dot = 10; .. .. @@ -238,6 +258,7 @@ 238 258 w.x = wind.x * gravity.z * dot; 239 259 w.y = wind.y * gravity.z * dot; 240 260 w.z = wind.z * gravity.z * dot; 261 +241 262 applyCentralForce(w); 242 263 } 243 264