491331AD1372653600DFB46D /* iPhoneTestEntries.mm in Sources */ = {isa = PBXBuildFile; fileRef = 491331A21372653600DFB46D /* iPhoneTestEntries.mm */; };
491331AE1372653600DFB46D /* TestEntriesViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 491331A41372653600DFB46D /* TestEntriesViewController.mm */; };
491331AF1372653600DFB46D /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 491331A51372653600DFB46D /* Icon.png */; };
- 491331B01372653600DFB46D /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 491331A61372653600DFB46D /* Info.plist */; };
491331B11372653600DFB46D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 491331A71372653600DFB46D /* main.m */; };
- 491331B21372653600DFB46D /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 491331A81372653600DFB46D /* MainWindow.xib */; };
4913323813726B1F00DFB46D /* ApplyForce.h in Headers */ = {isa = PBXBuildFile; fileRef = 4913320D13726B1F00DFB46D /* ApplyForce.h */; };
4913323913726B1F00DFB46D /* BodyTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 4913320E13726B1F00DFB46D /* BodyTypes.h */; };
4913323A13726B1F00DFB46D /* Breakable.h in Headers */ = {isa = PBXBuildFile; fileRef = 4913320F13726B1F00DFB46D /* Breakable.h */; };
buildActionMask = 2147483647;
files = (
491331AF1372653600DFB46D /* Icon.png in Resources */,
- 491331B01372653600DFB46D /* Info.plist in Resources */,
- 491331B21372653600DFB46D /* MainWindow.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/*\r
-* Copyright (c) 2006-2009 Erin Catto http://www.gphysics.com\r
+* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org\r
*\r
* This software is provided 'as-is', without any express or implied\r
* warranty. In no event will the authors be held liable for any damages\r
// These include files constitute the main Box2D API\r
\r
#include <Box2D/Common/b2Settings.h>\r
+#include <Box2D/Common/b2Draw.h>\r
+#include <Box2D/Common/b2Timer.h>\r
\r
#include <Box2D/Collision/Shapes/b2CircleShape.h>\r
+#include <Box2D/Collision/Shapes/b2EdgeShape.h>\r
+#include <Box2D/Collision/Shapes/b2LoopShape.h>\r
#include <Box2D/Collision/Shapes/b2PolygonShape.h>\r
\r
#include <Box2D/Collision/b2BroadPhase.h>\r
#include <Box2D/Dynamics/Joints/b2DistanceJoint.h>\r
#include <Box2D/Dynamics/Joints/b2FrictionJoint.h>\r
#include <Box2D/Dynamics/Joints/b2GearJoint.h>\r
-#include <Box2D/Dynamics/Joints/b2LineJoint.h>\r
+#include <Box2D/Dynamics/Joints/b2WheelJoint.h>\r
#include <Box2D/Dynamics/Joints/b2MouseJoint.h>\r
#include <Box2D/Dynamics/Joints/b2PrismaticJoint.h>\r
#include <Box2D/Dynamics/Joints/b2PulleyJoint.h>\r
#include <Box2D/Dynamics/Joints/b2RevoluteJoint.h>\r
+#include <Box2D/Dynamics/Joints/b2RopeJoint.h>\r
#include <Box2D/Dynamics/Joints/b2WeldJoint.h>\r
\r
+#include <Box2D/Rope/b2Rope.h>\r
+\r
#endif\r
/*\r
-* Copyright (c) 2006-2009 Erin Catto http://www.gphysics.com\r
+* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org\r
*\r
* This software is provided 'as-is', without any express or implied\r
* warranty. In no event will the authors be held liable for any damages\r
\r
#include <Box2D/Collision/Shapes/b2CircleShape.h>\r
#include <new>\r
+using namespace std;\r
\r
b2Shape* b2CircleShape::Clone(b2BlockAllocator* allocator) const\r
{\r
return clone;\r
}\r
\r
+int32 b2CircleShape::GetChildCount() const\r
+{\r
+ return 1;\r
+}\r
+\r
bool b2CircleShape::TestPoint(const b2Transform& transform, const b2Vec2& p) const\r
{\r
b2Vec2 center = transform.position + b2Mul(transform.R, m_p);\r
// From Section 3.1.2\r
// x = s + a * r\r
// norm(x) = radius\r
-bool b2CircleShape::RayCast(b2RayCastOutput* output, const b2RayCastInput& input, const b2Transform& transform) const\r
+bool b2CircleShape::RayCast(b2RayCastOutput* output, const b2RayCastInput& input,\r
+ const b2Transform& transform, int32 childIndex) const\r
{\r
+ B2_NOT_USED(childIndex);\r
+\r
b2Vec2 position = transform.position + b2Mul(transform.R, m_p);\r
b2Vec2 s = input.p1 - position;\r
float32 b = b2Dot(s, s) - m_radius * m_radius;\r
return false;\r
}\r
\r
-void b2CircleShape::ComputeAABB(b2AABB* aabb, const b2Transform& transform) const\r
+void b2CircleShape::ComputeAABB(b2AABB* aabb, const b2Transform& transform, int32 childIndex) const\r
{\r
+ B2_NOT_USED(childIndex);\r
+\r
b2Vec2 p = transform.position + b2Mul(transform.R, m_p);\r
aabb->lowerBound.Set(p.x - m_radius, p.y - m_radius);\r
aabb->upperBound.Set(p.x + m_radius, p.y + m_radius);\r
/*\r
-* Copyright (c) 2006-2009 Erin Catto http://www.gphysics.com\r
+* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org\r
*\r
* This software is provided 'as-is', without any express or implied\r
* warranty. In no event will the authors be held liable for any damages\r
/// Implement b2Shape.\r
b2Shape* Clone(b2BlockAllocator* allocator) const;\r
\r
+ /// @see b2Shape::GetChildCount\r
+ int32 GetChildCount() const;\r
+\r
/// Implement b2Shape.\r
bool TestPoint(const b2Transform& transform, const b2Vec2& p) const;\r
\r
/// Implement b2Shape.\r
- bool RayCast(b2RayCastOutput* output, const b2RayCastInput& input, const b2Transform& transform) const;\r
+ bool RayCast(b2RayCastOutput* output, const b2RayCastInput& input,\r
+ const b2Transform& transform, int32 childIndex) const;\r
\r
/// @see b2Shape::ComputeAABB\r
- void ComputeAABB(b2AABB* aabb, const b2Transform& transform) const;\r
+ void ComputeAABB(b2AABB* aabb, const b2Transform& transform, int32 childIndex) const;\r
\r
/// @see b2Shape::ComputeMass\r
void ComputeMass(b2MassData* massData, float32 density) const;\r
--- /dev/null
+/*\r
+* Copyright (c) 2006-2010 Erin Catto http://www.box2d.org\r
+*\r
+* This software is provided 'as-is', without any express or implied\r
+* warranty. In no event will the authors be held liable for any damages\r
+* arising from the use of this software.\r
+* Permission is granted to anyone to use this software for any purpose,\r
+* including commercial applications, and to alter it and redistribute it\r
+* freely, subject to the following restrictions:\r
+* 1. The origin of this software must not be misrepresented; you must not\r
+* claim that you wrote the original software. If you use this software\r
+* in a product, an acknowledgment in the product documentation would be\r
+* appreciated but is not required.\r
+* 2. Altered source versions must be plainly marked as such, and must not be\r
+* misrepresented as being the original software.\r
+* 3. This notice may not be removed or altered from any source distribution.\r
+*/\r
+\r
+#include <Box2D/Collision/Shapes/b2EdgeShape.h>\r
+#include <new>\r
+using namespace std;\r
+\r
+void b2EdgeShape::Set(const b2Vec2& v1, const b2Vec2& v2)\r
+{\r
+ m_vertex1 = v1;\r
+ m_vertex2 = v2;\r
+ m_hasVertex0 = false;\r
+ m_hasVertex3 = false;\r
+}\r
+\r
+b2Shape* b2EdgeShape::Clone(b2BlockAllocator* allocator) const\r
+{\r
+ void* mem = allocator->Allocate(sizeof(b2EdgeShape));\r
+ b2EdgeShape* clone = new (mem) b2EdgeShape;\r
+ *clone = *this;\r
+ return clone;\r
+}\r
+\r
+int32 b2EdgeShape::GetChildCount() const\r
+{\r
+ return 1;\r
+}\r
+\r
+bool b2EdgeShape::TestPoint(const b2Transform& xf, const b2Vec2& p) const\r
+{\r
+ B2_NOT_USED(xf);\r
+ B2_NOT_USED(p);\r
+ return false;\r
+}\r
+\r
+// p = p1 + t * d\r
+// v = v1 + s * e\r
+// p1 + t * d = v1 + s * e\r
+// s * e - t * d = p1 - v1\