Permalink
Browse files

git-svn-id: http://hotruby.googlecode.com/svn/trunk@26 4fb8041d-b042-…

…0410-9571-f50be27af959
  • Loading branch information...
yukoba@accelart.jp
yukoba@accelart.jp committed Jan 16, 2008
1 parent b9e5afa commit b7b93737c43c9bdef57a4a28719510e566b83bc8
Showing with 4,920 additions and 13,297 deletions.
  1. +0 −33 test/Box2DFlashAS3/Box2D/Collision/ClipVertex.as
  2. +0 −64 test/Box2DFlashAS3/Box2D/Collision/Features.as
  3. +0 −39 test/Box2DFlashAS3/Box2D/Collision/Shapes/b2BoxDef.as
  4. +0 −39 test/Box2DFlashAS3/Box2D/Collision/Shapes/b2CircleDef.as
  5. +0 −180 test/Box2DFlashAS3/Box2D/Collision/Shapes/b2CircleShape.as
  6. +0 −34 test/Box2DFlashAS3/Box2D/Collision/Shapes/b2MassData.as
  7. +0 −45 test/Box2DFlashAS3/Box2D/Collision/Shapes/b2PolyDef.as
  8. +0 −471 test/Box2DFlashAS3/Box2D/Collision/Shapes/b2PolyShape.as
  9. +0 −340 test/Box2DFlashAS3/Box2D/Collision/Shapes/b2Shape.as
  10. +0 −115 test/Box2DFlashAS3/Box2D/Collision/Shapes/b2ShapeDef.as
  11. +0 −45 test/Box2DFlashAS3/Box2D/Collision/b2AABB.as
  12. +0 −45 test/Box2DFlashAS3/Box2D/Collision/b2Bound.as
  13. +0 −28 test/Box2DFlashAS3/Box2D/Collision/b2BoundValues.as
  14. +0 −901 test/Box2DFlashAS3/Box2D/Collision/b2BroadPhase.as
  15. +0 −28 test/Box2DFlashAS3/Box2D/Collision/b2BufferedPair.as
  16. +0 −743 test/Box2DFlashAS3/Box2D/Collision/b2Collision.as
  17. +0 −53 test/Box2DFlashAS3/Box2D/Collision/b2ContactID.as
  18. +0 −35 test/Box2DFlashAS3/Box2D/Collision/b2ContactPoint.as
  19. +0 −339 test/Box2DFlashAS3/Box2D/Collision/b2Distance.as
  20. +0 −41 test/Box2DFlashAS3/Box2D/Collision/b2Manifold.as
  21. +0 −32 test/Box2DFlashAS3/Box2D/Collision/b2OBB.as
  22. +0 −64 test/Box2DFlashAS3/Box2D/Collision/b2Pair.as
  23. +0 −35 test/Box2DFlashAS3/Box2D/Collision/b2PairCallback.as
  24. +0 −391 test/Box2DFlashAS3/Box2D/Collision/b2PairManager.as
  25. +0 −37 test/Box2DFlashAS3/Box2D/Collision/b2Proxy.as
  26. +0 −128 test/Box2DFlashAS3/Box2D/Common/Math/b2Mat22.as
  27. +0 −220 test/Box2DFlashAS3/Box2D/Common/Math/b2Math.as
  28. +0 −135 test/Box2DFlashAS3/Box2D/Common/Math/b2Vec2.as
  29. +0 −74 test/Box2DFlashAS3/Box2D/Common/b2Settings.as
  30. +0 −69 test/Box2DFlashAS3/Box2D/Dynamics/Contacts/b2CircleContact.as
  31. +0 −234 test/Box2DFlashAS3/Box2D/Dynamics/Contacts/b2Conservative.as
  32. +0 −207 test/Box2DFlashAS3/Box2D/Dynamics/Contacts/b2Contact.as
  33. +0 −49 test/Box2DFlashAS3/Box2D/Dynamics/Contacts/b2ContactConstraint.as
  34. +0 −39 test/Box2DFlashAS3/Box2D/Dynamics/Contacts/b2ContactConstraintPoint.as
  35. +0 −36 test/Box2DFlashAS3/Box2D/Dynamics/Contacts/b2ContactNode.as
  36. +0 −31 test/Box2DFlashAS3/Box2D/Dynamics/Contacts/b2ContactRegister.as
  37. +0 −541 test/Box2DFlashAS3/Box2D/Dynamics/Contacts/b2ContactSolver.as
  38. +0 −32 test/Box2DFlashAS3/Box2D/Dynamics/Contacts/b2NullContact.as
  39. +0 −71 test/Box2DFlashAS3/Box2D/Dynamics/Contacts/b2PolyAndCircleContact.as
  40. +0 −129 test/Box2DFlashAS3/Box2D/Dynamics/Contacts/b2PolyContact.as
  41. +0 −247 test/Box2DFlashAS3/Box2D/Dynamics/Joints/b2DistanceJoint.as
  42. +0 −39 test/Box2DFlashAS3/Box2D/Dynamics/Joints/b2DistanceJointDef.as
  43. +0 −289 test/Box2DFlashAS3/Box2D/Dynamics/Joints/b2GearJoint.as
  44. +0 −52 test/Box2DFlashAS3/Box2D/Dynamics/Joints/b2GearJointDef.as
  45. +0 −48 test/Box2DFlashAS3/Box2D/Dynamics/Joints/b2Jacobian.as
  46. +0 −202 test/Box2DFlashAS3/Box2D/Dynamics/Joints/b2Joint.as
  47. +0 −46 test/Box2DFlashAS3/Box2D/Dynamics/Joints/b2JointDef.as
  48. +0 −36 test/Box2DFlashAS3/Box2D/Dynamics/Joints/b2JointNode.as
  49. +0 −212 test/Box2DFlashAS3/Box2D/Dynamics/Joints/b2MouseJoint.as
  50. +0 −43 test/Box2DFlashAS3/Box2D/Dynamics/Joints/b2MouseJointDef.as
  51. +0 −656 test/Box2DFlashAS3/Box2D/Dynamics/Joints/b2PrismaticJoint.as
  52. +0 −50 test/Box2DFlashAS3/Box2D/Dynamics/Joints/b2PrismaticJointDef.as
  53. +0 −596 test/Box2DFlashAS3/Box2D/Dynamics/Joints/b2PulleyJoint.as
  54. +0 −57 test/Box2DFlashAS3/Box2D/Dynamics/Joints/b2PulleyJointDef.as
  55. +0 −469 test/Box2DFlashAS3/Box2D/Dynamics/Joints/b2RevoluteJoint.as
  56. +0 −49 test/Box2DFlashAS3/Box2D/Dynamics/Joints/b2RevoluteJointDef.as
  57. +0 −474 test/Box2DFlashAS3/Box2D/Dynamics/b2Body.as
  58. +0 −76 test/Box2DFlashAS3/Box2D/Dynamics/b2BodyDef.as
  59. +0 −46 test/Box2DFlashAS3/Box2D/Dynamics/b2CollisionFilter.as
  60. +0 −338 test/Box2DFlashAS3/Box2D/Dynamics/b2ContactManager.as
  61. +0 −338 test/Box2DFlashAS3/Box2D/Dynamics/b2Island.as
  62. +0 −30 test/Box2DFlashAS3/Box2D/Dynamics/b2TimeStep.as
  63. +0 −530 test/Box2DFlashAS3/Box2D/Dynamics/b2World.as
  64. +0 −55 test/Box2DFlashAS3/Box2D/Dynamics/b2WorldListener.as
  65. +0 −49 test/Box2DFlashAS3/General/FRateLimiter.as
  66. +0 −131 test/Box2DFlashAS3/General/FpsCounter.as
  67. +0 −352 test/Box2DFlashAS3/General/Input.as
  68. +0 −379 test/Box2DFlashAS3/TestBed/Test.as
  69. +0 −156 test/Box2DFlashAS3/TestBed/TestBridge.as
  70. +0 −135 test/Box2DFlashAS3/TestBed/TestCompound.as
  71. +0 −118 test/Box2DFlashAS3/TestBed/TestCrank.as
  72. +0 −268 test/Box2DFlashAS3/TestBed/TestExample.as
  73. +0 −123 test/Box2DFlashAS3/TestBed/TestGears.as
  74. +0 −110 test/Box2DFlashAS3/TestBed/TestPulley.as
  75. +0 −252 test/Box2DFlashAS3/TestBed/TestRagdoll.as
  76. +0 −74 test/Box2DFlashAS3/TestBed/TestStack.as
  77. BIN test/pinball/Box2DFlashAS3.swc
  78. +13 −0 test/pinball/HotRubyFlash-config.xml
  79. +1 −0 test/pinball/ImportAS.as
  80. +17 −0 test/pinball/LicenseOfBox2DFlashAS3.txt
  81. +9 −0 test/pinball/build.bat
  82. +9 −0 test/pinball/buildDebug.bat
  83. +1 −0 test/pinball/pinball.js
  84. +221 −0 test/pinball/pinball.rb
  85. +4,649 −0 test/pinball/pinball_pretty.json
@@ -1,33 +0,0 @@
-/*
-* Copyright (c) 2006-2007 Erin Catto http://www.gphysics.com
-*
-* This software is provided 'as-is', without any express or implied
-* warranty. In no event will the authors be held liable for any damages
-* arising from the use of this software.
-* Permission is granted to anyone to use this software for any purpose,
-* including commercial applications, and to alter it and redistribute it
-* freely, subject to the following restrictions:
-* 1. The origin of this software must not be misrepresented; you must not
-* claim that you wrote the original software. If you use this software
-* in a product, an acknowledgment in the product documentation would be
-* appreciated but is not required.
-* 2. Altered source versions must be plainly marked as such, and must not be
-* misrepresented as being the original software.
-* 3. This notice may not be removed or altered from any source distribution.
-*/
-
-package Box2D.Collision{
-
-
-import Box2D.Common.Math.*
-import Box2D.Collision.*
-
-
-public class ClipVertex
-{
- public var v:b2Vec2 = new b2Vec2();
- public var id:b2ContactID = new b2ContactID();
-};
-
-
-}
@@ -1,64 +0,0 @@
-/*
-* Copyright (c) 2006-2007 Erin Catto http://www.gphysics.com
-*
-* This software is provided 'as-is', without any express or implied
-* warranty. In no event will the authors be held liable for any damages
-* arising from the use of this software.
-* Permission is granted to anyone to use this software for any purpose,
-* including commercial applications, and to alter it and redistribute it
-* freely, subject to the following restrictions:
-* 1. The origin of this software must not be misrepresented; you must not
-* claim that you wrote the original software. If you use this software
-* in a product, an acknowledgment in the product documentation would be
-* appreciated but is not required.
-* 2. Altered source versions must be plainly marked as such, and must not be
-* misrepresented as being the original software.
-* 3. This notice may not be removed or altered from any source distribution.
-*/
-
-package Box2D.Collision{
-
-// We use contact ids to facilitate warm starting.
-public class Features
-{
- //
- public function set referenceFace(value:int) : void{
- _referenceFace = value;
- _m_id._key = (_m_id._key & 0xffffff00) | (_referenceFace & 0x000000ff)
- }
- public function get referenceFace():int{
- return _referenceFace;
- }
- public var _referenceFace:int;
- //
- public function set incidentEdge(value:int) : void{
- _incidentEdge = value;
- _m_id._key = (_m_id._key & 0xffff00ff) | ((_incidentEdge << 8) & 0x0000ff00)
- }
- public function get incidentEdge():int{
- return _incidentEdge;
- }
- public var _incidentEdge:int;
- //
- public function set incidentVertex(value:int) : void{
- _incidentVertex = value;
- _m_id._key = (_m_id._key & 0xff00ffff) | ((_incidentVertex << 16) & 0x00ff0000)
- }
- public function get incidentVertex():int{
- return _incidentVertex;
- }
- public var _incidentVertex:int;
- //
- public function set flip(value:int) : void{
- _flip = value;
- _m_id._key = (_m_id._key & 0x00ffffff) | ((_flip << 24) & 0xff000000)
- }
- public function get flip():int{
- return _flip;
- }
- public var _flip:int;
- public var _m_id:b2ContactID;
-};
-
-
-}
@@ -1,39 +0,0 @@
-/*
-* Copyright (c) 2006-2007 Erin Catto http://www.gphysics.com
-*
-* This software is provided 'as-is', without any express or implied
-* warranty. In no event will the authors be held liable for any damages
-* arising from the use of this software.
-* Permission is granted to anyone to use this software for any purpose,
-* including commercial applications, and to alter it and redistribute it
-* freely, subject to the following restrictions:
-* 1. The origin of this software must not be misrepresented; you must not
-* claim that you wrote the original software. If you use this software
-* in a product, an acknowledgment in the product documentation would be
-* appreciated but is not required.
-* 2. Altered source versions must be plainly marked as such, and must not be
-* misrepresented as being the original software.
-* 3. This notice may not be removed or altered from any source distribution.
-*/
-
-package Box2D.Collision.Shapes{
-
-
-
-import Box2D.Common.Math.*;
-import Box2D.Collision.Shapes.*;
-
-
-
-public class b2BoxDef extends b2ShapeDef
-{
- public function b2BoxDef()
- {
- type = b2Shape.e_boxShape;
- extents = new b2Vec2(1.0, 1.0);
- }
-
- public var extents:b2Vec2;
-};
-
-}
@@ -1,39 +0,0 @@
-/*
-* Copyright (c) 2006-2007 Erin Catto http://www.gphysics.com
-*
-* This software is provided 'as-is', without any express or implied
-* warranty. In no event will the authors be held liable for any damages
-* arising from the use of this software.
-* Permission is granted to anyone to use this software for any purpose,
-* including commercial applications, and to alter it and redistribute it
-* freely, subject to the following restrictions:
-* 1. The origin of this software must not be misrepresented; you must not
-* claim that you wrote the original software. If you use this software
-* in a product, an acknowledgment in the product documentation would be
-* appreciated but is not required.
-* 2. Altered source versions must be plainly marked as such, and must not be
-* misrepresented as being the original software.
-* 3. This notice may not be removed or altered from any source distribution.
-*/
-
-package Box2D.Collision.Shapes{
-
-
-
-import Box2D.Common.Math.*;
-import Box2D.Collision.Shapes.*;
-
-
-
-public class b2CircleDef extends b2ShapeDef
-{
- public function b2CircleDef()
- {
- type = b2Shape.e_circleShape;
- radius = 1.0;
- }
-
- public var radius:Number;
-};
-
-}
@@ -1,180 +0,0 @@
-/*
-* Copyright (c) 2006-2007 Erin Catto http://www.gphysics.com
-*
-* This software is provided 'as-is', without any express or implied
-* warranty. In no event will the authors be held liable for any damages
-* arising from the use of this software.
-* Permission is granted to anyone to use this software for any purpose,
-* including commercial applications, and to alter it and redistribute it
-* freely, subject to the following restrictions:
-* 1. The origin of this software must not be misrepresented; you must not
-* claim that you wrote the original software. If you use this software
-* in a product, an acknowledgment in the product documentation would be
-* appreciated but is not required.
-* 2. Altered source versions must be plainly marked as such, and must not be
-* misrepresented as being the original software.
-* 3. This notice may not be removed or altered from any source distribution.
-*/
-
-package Box2D.Collision.Shapes{
-
-
-
-import Box2D.Common.Math.*;
-import Box2D.Common.*
-import Box2D.Collision.Shapes.*;
-import Box2D.Dynamics.*
-import Box2D.Collision.*
-
-
-
-public class b2CircleShape extends b2Shape
-{
- public override function TestPoint(p:b2Vec2):Boolean{
- //var d:b2Vec2 = b2Math.SubtractVV(p, m_position);
- var d:b2Vec2 = new b2Vec2();
- d.SetV(p);
- d.Subtract(m_position);
- return b2Math.b2Dot(d, d) <= m_radius * m_radius;
- }
-
- //--------------- Internals Below -------------------
-
- public function b2CircleShape(def:b2ShapeDef, body:b2Body, localCenter:b2Vec2){
- super(def, body);
-
- //b2Settings.b2Assert(def.type == b2Shape.e_circleShape);
- var circle:b2CircleDef = def as b2CircleDef;
-
- //m_localPosition = def.localPosition - localCenter;
- m_localPosition.Set(def.localPosition.x - localCenter.x, def.localPosition.y - localCenter.y);
- m_type = b2Shape.e_circleShape;
- m_radius = circle.radius;
-
- m_R.SetM(m_body.m_R);
- //b2Vec2 r = b2Mul(m_body->m_R, m_localPosition);
- var rX:Number = m_R.col1.x * m_localPosition.x + m_R.col2.x * m_localPosition.y;
- var rY:Number = m_R.col1.y * m_localPosition.x + m_R.col2.y * m_localPosition.y;
- //m_position = m_body->m_position + r;
- m_position.x = m_body.m_position.x + rX;
- m_position.y = m_body.m_position.y + rY;
- //m_maxRadius = r.Length() + m_radius;
- m_maxRadius = Math.sqrt(rX*rX+rY*rY) + m_radius;
-
- var aabb:b2AABB = new b2AABB();
- aabb.minVertex.Set(m_position.x - m_radius, m_position.y - m_radius);
- aabb.maxVertex.Set(m_position.x + m_radius, m_position.y + m_radius);
-
- var broadPhase:b2BroadPhase = m_body.m_world.m_broadPhase;
- if (broadPhase.InRange(aabb))
- {
- m_proxyId = broadPhase.CreateProxy(aabb, this);
- }
- else
- {
- m_proxyId = b2Pair.b2_nullProxy;
- }
-
- if (m_proxyId == b2Pair.b2_nullProxy)
- {
- m_body.Freeze();
- }
- }
-
- public override function Synchronize(position1:b2Vec2, R1:b2Mat22,
- position2:b2Vec2, R2:b2Mat22) : void{
- m_R.SetM(R2);
- //m_position = position2 + b2Mul(R2, m_localPosition);
- m_position.x = (R2.col1.x * m_localPosition.x + R2.col2.x * m_localPosition.y) + position2.x;
- m_position.y = (R2.col1.y * m_localPosition.x + R2.col2.y * m_localPosition.y) + position2.y;
-
- if (m_proxyId == b2Pair.b2_nullProxy)
- {
- return;
- }
-
- // Compute an AABB that covers the swept shape (may miss some rotation effect).
- //b2Vec2 p1 = position1 + b2Mul(R1, m_localPosition);
- var p1X:Number = position1.x + (R1.col1.x * m_localPosition.x + R1.col2.x * m_localPosition.y);
- var p1Y:Number = position1.y + (R1.col1.y * m_localPosition.x + R1.col2.y * m_localPosition.y);
- //b2Vec2 lower = b2Min(p1, m_position);
- var lowerX:Number = Math.min(p1X, m_position.x);
- var lowerY:Number = Math.min(p1Y, m_position.y);
- //b2Vec2 upper = b2Max(p1, m_position);
- var upperX:Number = Math.max(p1X, m_position.x);
- var upperY:Number = Math.max(p1Y, m_position.y);
-
- var aabb:b2AABB = new b2AABB();
- aabb.minVertex.Set(lowerX - m_radius, lowerY - m_radius);
- aabb.maxVertex.Set(upperX + m_radius, upperY + m_radius);
-
- var broadPhase:b2BroadPhase = m_body.m_world.m_broadPhase;
- if (broadPhase.InRange(aabb))
- {
- broadPhase.MoveProxy(m_proxyId, aabb);
- }
- else
- {
- m_body.Freeze();
- }
- }
-
- public override function QuickSync(position:b2Vec2, R:b2Mat22) : void{
- m_R.SetM(R);
- //m_position = position + b2Mul(R, m_localPosition);
- m_position.x = (R.col1.x * m_localPosition.x + R.col2.x * m_localPosition.y) + position.x;
- m_position.y = (R.col1.y * m_localPosition.x + R.col2.y * m_localPosition.y) + position.y;
- }
-
-
- public override function ResetProxy(broadPhase:b2BroadPhase) : void
- {
- if (m_proxyId == b2Pair.b2_nullProxy)
- {
- return;
- }
-
- var proxy:b2Proxy = broadPhase.GetProxy(m_proxyId);
-
- broadPhase.DestroyProxy(m_proxyId);
- proxy = null;
-
- var aabb:b2AABB = new b2AABB();
- aabb.minVertex.Set(m_position.x - m_radius, m_position.y - m_radius);
- aabb.maxVertex.Set(m_position.x + m_radius, m_position.y + m_radius);
-
- if (broadPhase.InRange(aabb))
- {
- m_proxyId = broadPhase.CreateProxy(aabb, this);
- }
- else
- {
- m_proxyId = b2Pair.b2_nullProxy;
- }
-
- if (m_proxyId == b2Pair.b2_nullProxy)
- {
- m_body.Freeze();
- }
- }
-
-
- public override function Support(dX:Number, dY:Number, out:b2Vec2): void
- {
- //b2Vec2 u = d;
- //u.Normalize();
- var len:Number = Math.sqrt(dX*dX + dY*dY);
- dX /= len;
- dY /= len;
- //return m_position + m_radius * u;
- out.Set( m_position.x + m_radius*dX,
- m_position.y + m_radius*dY);
- }
-
-
- // Local position in parent body
- public var m_localPosition:b2Vec2 = new b2Vec2();
- public var m_radius:Number;
-};
-
-}
Oops, something went wrong.

0 comments on commit b7b9373

Please sign in to comment.