Permalink
Browse files

Initial commit

  • Loading branch information...
0 parents commit cc9570e968013932316fb211f94fe90dc9705d71 Jonas Wagner committed Jul 31, 2010
Showing with 29,881 additions and 0 deletions.
  1. +1 −0 README
  2. +347 −0 box2d.js
  3. +2 −0 build.sh
  4. +195 −0 changes.patch
  5. +232 −0 convert.py
  6. +217 −0 engine.js
  7. +5 −0 extend.js
  8. +33 −0 flash/Box2D/Collision/ClipVertex.as
  9. +69 −0 flash/Box2D/Collision/Features.as
  10. +40 −0 flash/Box2D/Collision/Shapes/b2CircleDef.as
  11. +190 −0 flash/Box2D/Collision/Shapes/b2CircleShape.as
  12. +50 −0 flash/Box2D/Collision/Shapes/b2FilterData.as
  13. +37 −0 flash/Box2D/Collision/Shapes/b2MassData.as
  14. +94 −0 flash/Box2D/Collision/Shapes/b2PolygonDef.as
  15. +700 −0 flash/Box2D/Collision/Shapes/b2PolygonShape.as
  16. +329 −0 flash/Box2D/Collision/Shapes/b2Shape.as
  17. +56 −0 flash/Box2D/Collision/Shapes/b2ShapeDef.as
  18. +42 −0 flash/Box2D/Collision/b2AABB.as
  19. +45 −0 flash/Box2D/Collision/b2Bound.as
  20. +28 −0 flash/Box2D/Collision/b2BoundValues.as
  21. +987 −0 flash/Box2D/Collision/b2BroadPhase.as
  22. +28 −0 flash/Box2D/Collision/b2BufferedPair.as
  23. +756 −0 flash/Box2D/Collision/b2Collision.as
  24. +53 −0 flash/Box2D/Collision/b2ContactID.as
  25. +40 −0 flash/Box2D/Collision/b2ContactPoint.as
  26. +548 −0 flash/Box2D/Collision/b2Distance.as
  27. +55 −0 flash/Box2D/Collision/b2Manifold.as
  28. +56 −0 flash/Box2D/Collision/b2ManifoldPoint.as
  29. +32 −0 flash/Box2D/Collision/b2OBB.as
  30. +64 −0 flash/Box2D/Collision/b2Pair.as
  31. +35 −0 flash/Box2D/Collision/b2PairCallback.as
  32. +406 −0 flash/Box2D/Collision/b2PairManager.as
  33. +41 −0 flash/Box2D/Collision/b2Point.as
  34. +37 −0 flash/Box2D/Collision/b2Proxy.as
  35. +103 −0 flash/Box2D/Collision/b2Segment.as
  36. +155 −0 flash/Box2D/Collision/b2TimeOfImpact.as
  37. +134 −0 flash/Box2D/Common/Math/b2Mat22.as
  38. +265 −0 flash/Box2D/Common/Math/b2Math.as
  39. +79 −0 flash/Box2D/Common/Math/b2Sweep.as
  40. +140 −0 flash/Box2D/Common/Math/b2Vec2.as
  41. +67 −0 flash/Box2D/Common/Math/b2XForm.as
  42. +67 −0 flash/Box2D/Common/b2Color.as
  43. +107 −0 flash/Box2D/Common/b2Settings.as
  44. +141 −0 flash/Box2D/Dynamics/Contacts/b2CircleContact.as
  45. +259 −0 flash/Box2D/Dynamics/Contacts/b2Contact.as
  46. +49 −0 flash/Box2D/Dynamics/Contacts/b2ContactConstraint.as
  47. +42 −0 flash/Box2D/Dynamics/Contacts/b2ContactConstraintPoint.as
  48. +40 −0 flash/Box2D/Dynamics/Contacts/b2ContactEdge.as
  49. +31 −0 flash/Box2D/Dynamics/Contacts/b2ContactRegister.as
  50. +38 −0 flash/Box2D/Dynamics/Contacts/b2ContactResult.as
  51. +483 −0 flash/Box2D/Dynamics/Contacts/b2ContactSolver.as
  52. +33 −0 flash/Box2D/Dynamics/Contacts/b2NullContact.as
  53. +182 −0 flash/Box2D/Dynamics/Contacts/b2PolyAndCircleContact.as
  54. +181 −0 flash/Box2D/Dynamics/Contacts/b2PolygonContact.as
  55. +313 −0 flash/Box2D/Dynamics/Joints/b2DistanceJoint.as
  56. +77 −0 flash/Box2D/Dynamics/Joints/b2DistanceJointDef.as
  57. +330 −0 flash/Box2D/Dynamics/Joints/b2GearJoint.as
  58. +49 −0 flash/Box2D/Dynamics/Joints/b2GearJointDef.as
  59. +48 −0 flash/Box2D/Dynamics/Joints/b2Jacobian.as
  60. +220 −0 flash/Box2D/Dynamics/Joints/b2Joint.as
  61. +52 −0 flash/Box2D/Dynamics/Joints/b2JointDef.as
  62. +42 −0 flash/Box2D/Dynamics/Joints/b2JointEdge.as
  63. +227 −0 flash/Box2D/Dynamics/Joints/b2MouseJoint.as
  64. +53 −0 flash/Box2D/Dynamics/Joints/b2MouseJointDef.as
  65. +701 −0 flash/Box2D/Dynamics/Joints/b2PrismaticJoint.as
  66. +84 −0 flash/Box2D/Dynamics/Joints/b2PrismaticJointDef.as
  67. +655 −0 flash/Box2D/Dynamics/Joints/b2PulleyJoint.as
  68. +107 −0 flash/Box2D/Dynamics/Joints/b2PulleyJointDef.as
  69. +534 −0 flash/Box2D/Dynamics/Joints/b2RevoluteJoint.as
  70. +95 −0 flash/Box2D/Dynamics/Joints/b2RevoluteJointDef.as
  71. +857 −0 flash/Box2D/Dynamics/b2Body.as
  72. +95 −0 flash/Box2D/Dynamics/b2BodyDef.as
  73. +40 −0 flash/Box2D/Dynamics/b2BoundaryListener.as
  74. +54 −0 flash/Box2D/Dynamics/b2ContactFilter.as
  75. +59 −0 flash/Box2D/Dynamics/b2ContactListener.as
  76. +267 −0 flash/Box2D/Dynamics/b2ContactManager.as
  77. +158 −0 flash/Box2D/Dynamics/b2DebugDraw.as
  78. +46 −0 flash/Box2D/Dynamics/b2DestructionListener.as
  79. +477 −0 flash/Box2D/Dynamics/b2Island.as
  80. +33 −0 flash/Box2D/Dynamics/b2TimeStep.as
  81. +1,274 −0 flash/Box2D/Dynamics/b2World.as
  82. BIN flash/Box2DFlashAS3_2.0.2_.zip
  83. +49 −0 flash/General/FRateLimiter.as
  84. +132 −0 flash/General/FpsCounter.as
  85. +392 −0 flash/General/Input.as
  86. +140 −0 flash/HelloWorld.as
  87. BIN flash/HelloWorld.fla
  88. BIN flash/HelloWorld.swf
  89. +17 −0 flash/License.txt
  90. +167 −0 flash/Main.as
  91. BIN flash/PhysTest.fla
  92. BIN flash/PhysTest.swf
  93. +65 −0 flash/ReadMe.txt
  94. +459 −0 flash/TestBed/Test.as
  95. +166 −0 flash/TestBed/TestBridge.as
  96. +93 −0 flash/TestBed/TestCCD.as
  97. +161 −0 flash/TestBed/TestCompound.as
  98. +252 −0 flash/TestBed/TestCrankGearsPulley.as
  99. +273 −0 flash/TestBed/TestRagdoll.as
  100. +106 −0 flash/TestBed/TestStack.as
  101. +254 −0 flash/TestBed/TestTheoJansen.as
  102. +15 −0 javascript/Box2D/Collision/ClipVertex.js
  103. +45 −0 javascript/Box2D/Collision/Features.js
  104. +45 −0 javascript/Box2D/Collision/Features_edited.js
  105. +20 −0 javascript/Box2D/Collision/Shapes/b2CircleDef.js
  106. +147 −0 javascript/Box2D/Collision/Shapes/b2CircleShape.js
  107. +23 −0 javascript/Box2D/Collision/Shapes/b2FilterData.js
  108. +15 −0 javascript/Box2D/Collision/Shapes/b2MassData.js
  109. +61 −0 javascript/Box2D/Collision/Shapes/b2PolygonDef.js
  110. +576 −0 javascript/Box2D/Collision/Shapes/b2PolygonShape.js
  111. +191 −0 javascript/Box2D/Collision/Shapes/b2Shape.js
  112. +20 −0 javascript/Box2D/Collision/Shapes/b2ShapeDef.js
  113. +23 −0 javascript/Box2D/Collision/b2AABB.js
  114. +29 −0 javascript/Box2D/Collision/b2Bound.js
  115. +15 −0 javascript/Box2D/Collision/b2BoundValues.js
  116. +909 −0 javascript/Box2D/Collision/b2BroadPhase.js
  117. +13 −0 javascript/Box2D/Collision/b2BufferedPair.js
  118. +689 −0 javascript/Box2D/Collision/b2Collision.js
  119. +36 −0 javascript/Box2D/Collision/b2ContactID.js
  120. +24 −0 javascript/Box2D/Collision/b2ContactPoint.js
  121. +36 −0 javascript/Box2D/Collision/b2Contact_modified.js
  122. +488 −0 javascript/Box2D/Collision/b2Distance.js
  123. +34 −0 javascript/Box2D/Collision/b2Manifold.js
  124. +36 −0 javascript/Box2D/Collision/b2ManifoldPoint.js
  125. +17 −0 javascript/Box2D/Collision/b2OBB.js
  126. +31 −0 javascript/Box2D/Collision/b2Pair.js
  127. +13 −0 javascript/Box2D/Collision/b2PairCallback.js
  128. +334 −0 javascript/Box2D/Collision/b2PairManager.js
  129. +19 −0 javascript/Box2D/Collision/b2Point.js
  130. +21 −0 javascript/Box2D/Collision/b2Proxy.js
  131. +68 −0 javascript/Box2D/Collision/b2Segment.js
  132. +126 −0 javascript/Box2D/Collision/b2TimeOfImpact.js
  133. +92 −0 javascript/Box2D/Common/Math/b2Mat22.js
  134. +150 −0 javascript/Box2D/Common/Math/b2Math.js
  135. +55 −0 javascript/Box2D/Common/Math/b2Sweep.js
  136. +83 −0 javascript/Box2D/Common/Math/b2Vec2.js
  137. +89 −0 javascript/Box2D/Common/Math/b2Vec2_edited.js
  138. +36 −0 javascript/Box2D/Common/Math/b2XForm.js
  139. +35 −0 javascript/Box2D/Common/b2Color.js
  140. +38 −0 javascript/Box2D/Common/b2Settings.js
  141. +118 −0 javascript/Box2D/Dynamics/Contacts/b2CircleContact.js
  142. +192 −0 javascript/Box2D/Dynamics/Contacts/b2Contact.js
  143. +27 −0 javascript/Box2D/Dynamics/Contacts/b2ContactConstraint.js
  144. +27 −0 javascript/Box2D/Dynamics/Contacts/b2ContactConstraintPoint.js
  145. +15 −0 javascript/Box2D/Dynamics/Contacts/b2ContactEdge.js
  146. +14 −0 javascript/Box2D/Dynamics/Contacts/b2ContactRegister.js
  147. +21 −0 javascript/Box2D/Dynamics/Contacts/b2ContactResult.js
  148. +454 −0 javascript/Box2D/Dynamics/Contacts/b2ContactSolver.js
  149. +16 −0 javascript/Box2D/Dynamics/Contacts/b2NullContact.js
  150. +155 −0 javascript/Box2D/Dynamics/Contacts/b2PolyAndCircleContact.js
  151. +155 −0 javascript/Box2D/Dynamics/Contacts/b2PolygonContact.js
  152. +268 −0 javascript/Box2D/Dynamics/Joints/b2DistanceJoint.js
  153. +40 −0 javascript/Box2D/Dynamics/Joints/b2DistanceJointDef.js
  154. +281 −0 javascript/Box2D/Dynamics/Joints/b2GearJoint.js
  155. +22 −0 javascript/Box2D/Dynamics/Joints/b2GearJointDef.js
  156. +30 −0 javascript/Box2D/Dynamics/Joints/b2Jacobian.js
  157. +127 −0 javascript/Box2D/Dynamics/Joints/b2Joint.js
  158. +22 −0 javascript/Box2D/Dynamics/Joints/b2JointDef.js
  159. +15 −0 javascript/Box2D/Dynamics/Joints/b2JointEdge.js
  160. +188 −0 javascript/Box2D/Dynamics/Joints/b2MouseJoint.js
  161. +26 −0 javascript/Box2D/Dynamics/Joints/b2MouseJointDef.js
  162. +625 −0 javascript/Box2D/Dynamics/Joints/b2PrismaticJoint.js
  163. +47 −0 javascript/Box2D/Dynamics/Joints/b2PrismaticJointDef.js
  164. +598 −0 javascript/Box2D/Dynamics/Joints/b2PulleyJoint.js
  165. +67 −0 javascript/Box2D/Dynamics/Joints/b2PulleyJointDef.js
  166. +465 −0 javascript/Box2D/Dynamics/Joints/b2RevoluteJoint.js
  167. +43 −0 javascript/Box2D/Dynamics/Joints/b2RevoluteJointDef.js
  168. +663 −0 javascript/Box2D/Dynamics/b2Body.js
  169. +36 −0 javascript/Box2D/Dynamics/b2BodyDef.js
  170. +12 −0 javascript/Box2D/Dynamics/b2BoundaryListener.js
  171. +24 −0 javascript/Box2D/Dynamics/b2ContactFilter.js
  172. +15 −0 javascript/Box2D/Dynamics/b2ContactListener.js
  173. +227 −0 javascript/Box2D/Dynamics/b2ContactManager.js
  174. +96 −0 javascript/Box2D/Dynamics/b2DebugDraw.js
  175. +13 −0 javascript/Box2D/Dynamics/b2DestructionListener.js
  176. +350 −0 javascript/Box2D/Dynamics/b2Island.js
  177. +17 −0 javascript/Box2D/Dynamics/b2TimeStep.js
  178. +1,126 −0 javascript/Box2D/Dynamics/b2World.js
  179. +217 −0 javascript/Box2D/engine.js
  180. +74 −0 load.html
  181. +9 −0 test.html
  182. +128 −0 test.js
1 README
@@ -0,0 +1 @@
+See http://29a.ch/2010/4/17/box2d-2-flash-ported-javascript
347 box2d.js

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -0,0 +1,2 @@
+#!/bin/sh
+java -jar compiler.jar --js extend.js --js javascript/Box2D/Common/b2Settings.js --js javascript/Box2D/Common/Math/b2Vec2.js --js javascript/Box2D/Collision/b2BufferedPair.js --js javascript/Box2D/Collision/b2AABB.js --js javascript/Box2D/Collision/b2Pair.js --js javascript/Box2D/Dynamics/b2TimeStep.js --js javascript/Box2D/Collision/b2Manifold.js --js javascript/Box2D/Collision/b2Point.js --js javascript/Box2D/Collision/b2Bound.js --js javascript/Box2D/Common/Math/b2Mat22.js --js javascript/Box2D/Dynamics/b2BoundaryListener.js --js javascript/Box2D/Collision/Shapes/b2MassData.js --js javascript/Box2D/Dynamics/Joints/b2JointEdge.js --js javascript/Box2D/Collision/b2Collision.js --js javascript/Box2D/Dynamics/b2ContactListener.js --js javascript/Box2D/Collision/b2PairCallback.js --js javascript/Box2D/Dynamics/Joints/b2JointDef.js --js javascript/Box2D/Collision/b2Proxy.js --js javascript/Box2D/Common/b2Color.js --js javascript/Box2D/Collision/Shapes/b2FilterData.js --js javascript/Box2D/Collision/b2PairManager.js --js javascript/Box2D/Dynamics/Contacts/b2ContactSolver.js --js javascript/Box2D/Collision/b2BoundValues.js --js javascript/Box2D/Collision/b2Segment.js --js javascript/Box2D/Collision/Features.js --js javascript/Box2D/Dynamics/Joints/b2MouseJointDef.js --js javascript/Box2D/Dynamics/Contacts/b2ContactConstraintPoint.js --js javascript/Box2D/Dynamics/Contacts/b2ContactRegister.js --js javascript/Box2D/Dynamics/b2DestructionListener.js --js javascript/Box2D/Dynamics/Joints/b2PulleyJointDef.js --js javascript/Box2D/Dynamics/Joints/b2Jacobian.js --js javascript/Box2D/Dynamics/b2DebugDraw.js --js javascript/Box2D/Dynamics/Contacts/b2ContactEdge.js --js javascript/Box2D/Common/Math/b2Sweep.js --js javascript/Box2D/Dynamics/Contacts/b2ContactConstraint.js --js javascript/Box2D/Collision/b2Distance.js --js javascript/Box2D/Collision/Shapes/b2Shape.js --js javascript/Box2D/Common/Math/b2XForm.js --js javascript/Box2D/Dynamics/Joints/b2DistanceJointDef.js --js javascript/Box2D/Collision/b2OBB.js --js javascript/Box2D/Dynamics/b2BodyDef.js --js javascript/Box2D/Dynamics/Joints/b2PrismaticJointDef.js --js javascript/Box2D/Collision/b2ContactID.js --js javascript/Box2D/Dynamics/Joints/b2RevoluteJointDef.js --js javascript/Box2D/Collision/Shapes/b2CircleShape.js --js javascript/Box2D/Dynamics/Joints/b2Joint.js --js javascript/Box2D/Dynamics/Joints/b2GearJoint.js --js javascript/Box2D/Dynamics/Joints/b2GearJointDef.js --js javascript/Box2D/Collision/b2BroadPhase.js --js javascript/Box2D/Collision/b2TimeOfImpact.js --js javascript/Box2D/Collision/Shapes/b2ShapeDef.js --js javascript/Box2D/Collision/Shapes/b2PolygonDef.js --js javascript/Box2D/Dynamics/Contacts/b2Contact.js --js javascript/Box2D/Dynamics/Joints/b2DistanceJoint.js --js javascript/Box2D/Dynamics/b2Body.js --js javascript/Box2D/Dynamics/b2ContactFilter.js --js javascript/Box2D/Collision/Shapes/b2PolygonShape.js --js javascript/Box2D/Dynamics/Contacts/b2ContactResult.js --js javascript/Box2D/Dynamics/b2Island.js --js javascript/Box2D/Collision/b2ManifoldPoint.js --js javascript/Box2D/Common/Math/b2Math.js --js javascript/Box2D/Collision/Shapes/b2CircleDef.js --js javascript/Box2D/Collision/b2ContactPoint.js --js javascript/Box2D/Dynamics/Contacts/b2PolygonContact.js --js javascript/Box2D/Dynamics/Joints/b2MouseJoint.js --js javascript/Box2D/Dynamics/Contacts/b2CircleContact.js --js javascript/Box2D/Dynamics/Joints/b2PulleyJoint.js --js javascript/Box2D/Dynamics/Joints/b2RevoluteJoint.js --js javascript/Box2D/Dynamics/Joints/b2PrismaticJoint.js --js javascript/Box2D/Collision/ClipVertex.js --js javascript/Box2D/Dynamics/Contacts/b2NullContact.js --js javascript/Box2D/Dynamics/Contacts/b2PolyAndCircleContact.js --js javascript/Box2D/Dynamics/b2ContactManager.js --js javascript/Box2D/Dynamics/b2World.js --js_output_file box2d.js
@@ -0,0 +1,195 @@
+diff -r 91f57f867c94 Box2D/Collision/Features.js
+--- a/Box2D/Collision/Features.js Sun Apr 18 20:55:05 2010 +0200
++++ b/Box2D/Collision/Features.js Sun Apr 18 21:00:19 2010 +0200
+@@ -2,6 +2,36 @@
+ this.__varz();
+ this.__constructor.apply(this, arguments);
+ }
++Features.prototype = {
++ get referenceEdge() {
++ return this._referenceEdge;
++ },
++ set referenceEdge(value) {
++ this._referenceEdge = value;
++ this._m_id._key = (this._m_id._key & 0xffffff00) | (this._referenceEdge & 0x000000ff);
++ },
++ get incidentEdge() {
++ return this._incidentEdge;
++ },
++ set incidentEdge(value) {
++ this._incidentEdge = value;
++ this._m_id._key = (this._m_id._key & 0xffff00ff) | ((this._incidentEdge << 8) & 0x0000ff00);
++ },
++ set incidentVertex(value) {
++ this._incidentVertex = value;
++ this._m_id._key = (this._m_id._key & 0xff00ffff) | ((this._incidentVertex << 16) & 0x00ff0000);
++ },
++ get incidentVertex() {
++ return this._incidentVertex;
++ },
++ set flip(value) {
++ this._flip = value;
++ this._m_id._key = (this._m_id._key & 0x00ffffff) | ((this._flip << 24) & 0xff000000);
++ },
++ get flip() {
++ return this._flip;
++ }
++}
+ Features.prototype.__constructor = function(){}
+ Features.prototype.__varz = function(){
+ }
+@@ -13,32 +43,3 @@
+ Features.prototype._incidentVertex = 0;
+ Features.prototype._flip = 0;
+ Features.prototype._m_id = null;
+-// methods
+-Features.prototype.set = function (value) {
+- this._referenceEdge = value;
+- this._m_id._key = (this._m_id._key & 0xffffff00) | (this._referenceEdge & 0x000000ff);
+- }
+-Features.prototype.get = function () {
+- return this._referenceEdge;
+- }
+-Features.prototype.set = function (value) {
+- this._incidentEdge = value;
+- this._m_id._key = (this._m_id._key & 0xffff00ff) | ((this._incidentEdge << 8) & 0x0000ff00);
+- }
+-Features.prototype.get = function () {
+- return this._incidentEdge;
+- }
+-Features.prototype.set = function (value) {
+- this._incidentVertex = value;
+- this._m_id._key = (this._m_id._key & 0xff00ffff) | ((this._incidentVertex << 16) & 0x00ff0000);
+- }
+-Features.prototype.get = function () {
+- return this._incidentVertex;
+- }
+-Features.prototype.set = function (value) {
+- this._flip = value;
+- this._m_id._key = (this._m_id._key & 0x00ffffff) | ((this._flip << 24) & 0xff000000);
+- }
+-Features.prototype.get = function () {
+- return this._flip;
+- }
+\ No newline at end of file
+diff -r 91f57f867c94 Box2D/Collision/Shapes/b2PolygonShape.js
+--- a/Box2D/Collision/Shapes/b2PolygonShape.js Sun Apr 18 20:55:05 2010 +0200
++++ b/Box2D/Collision/Shapes/b2PolygonShape.js Sun Apr 18 21:00:19 2010 +0200
+@@ -102,7 +102,6 @@
+ b2PolygonShape.ComputeCentroid = function (vs, count) {
+
+
+-
+ var c = new b2Vec2();
+ var area = 0.0;
+
+@@ -574,4 +573,4 @@
+
+ if (dX > this.m_sweepRadius) this.m_sweepRadius = dX;
+ }
+- }
+\ No newline at end of file
++ }
+diff -r 91f57f867c94 Box2D/Collision/b2ContactID.js
+--- a/Box2D/Collision/b2ContactID.js Sun Apr 18 20:55:05 2010 +0200
++++ b/Box2D/Collision/b2ContactID.js Sun Apr 18 21:00:19 2010 +0200
+@@ -2,12 +2,23 @@
+ this.__varz();
+ this.__constructor.apply(this, arguments);
+ }
++b2ContactID.prototype = {
++ get key() {
++ return this._key;
++ },
++ set key(value) {
++ this._key = value;
++ this.features._referenceEdge = this._key & 0x000000ff;
++ this.features._incidentEdge = ((this._key & 0x0000ff00) >> 8) & 0x000000ff;
++ this.features._incidentVertex = ((this._key & 0x00ff0000) >> 16) & 0x000000ff;
++ this.features._flip = ((this._key & 0xff000000) >> 24) & 0x000000ff;
++ }
++}
+ b2ContactID.prototype.__constructor = function () {
+ this.features._m_id = this;
+-
+- }
++}
+ b2ContactID.prototype.__varz = function(){
+-this.features = new Features();
++ this.features = new Features();
+ }
+ // static attributes
+ // static methods
+@@ -16,20 +27,10 @@
+ b2ContactID.prototype._key = 0;
+ // methods
+ b2ContactID.prototype.Set = function (id) {
+- key = id._key;
+- }
++ this.key = id._key;
++}
+ b2ContactID.prototype.Copy = function () {
+- var id = new b2ContactID();
+- id.key = key;
+- return id;
+- }
+-b2ContactID.prototype.get = function () {
+- return this._key;
+- }
+-b2ContactID.prototype.set = function (value) {
+- this._key = value;
+- this.features._referenceEdge = this._key & 0x000000ff;
+- this.features._incidentEdge = ((this._key & 0x0000ff00) >> 8) & 0x000000ff;
+- this.features._incidentVertex = ((this._key & 0x00ff0000) >> 16) & 0x000000ff;
+- this.features._flip = ((this._key & 0xff000000) >> 24) & 0x000000ff;
+- }
+\ No newline at end of file
++ var id = new b2ContactID();
++ id.key = this._key;
++ return id;
++}
+diff -r 91f57f867c94 Box2D/Common/Math/b2Vec2.js
+--- a/Box2D/Common/Math/b2Vec2.js Sun Apr 18 20:55:05 2010 +0200
++++ b/Box2D/Common/Math/b2Vec2.js Sun Apr 18 21:00:19 2010 +0200
+@@ -1,9 +1,7 @@
+-var b2Vec2 = function() {
+-this.__varz();
+-this.__constructor.apply(this, arguments);
+-}
+-b2Vec2.prototype.__constructor = function (x_, y_) {this.x=x_; this.y=y_;}
+-b2Vec2.prototype.__varz = function(){
++var b2Vec2 = function(x_, y_) {
++ if(arguments.length == 2) {
++ this.x=x_; this.y=y_;
++ }
+ }
+ // static attributes
+ // static methods
+@@ -11,8 +9,8 @@
+ return new b2Vec2(x_, y_);
+ }
+ // attributes
+-b2Vec2.prototype.x = null;
+-b2Vec2.prototype.y = null;
++b2Vec2.prototype.x = 0;
++b2Vec2.prototype.y = 0;
+ // methods
+ b2Vec2.prototype.SetZero = function () { this.x = 0.0; this.y = 0.0; }
+ b2Vec2.prototype.Set = function (x_, y_) {this.x=x_; this.y=y_;}
+@@ -82,4 +80,4 @@
+ }
+ b2Vec2.prototype.IsValid = function () {
+ return b2Math.b2IsValid(this.x) && b2Math.b2IsValid(this.y);
+- }
+\ No newline at end of file
++ }
+diff -r 91f57f867c94 Box2D/Common/b2Settings.js
+--- a/Box2D/Common/b2Settings.js Sun Apr 18 20:55:05 2010 +0200
++++ b/Box2D/Common/b2Settings.js Sun Apr 18 21:00:19 2010 +0200
+@@ -35,4 +35,4 @@
+ }
+ }
+ // attributes
+-// methods
+\ No newline at end of file
++// methods
Oops, something went wrong.

0 comments on commit cc9570e

Please sign in to comment.