【发布时间】:2013-07-04 06:17:08
【问题描述】:
我正在研究绳索物理。我已经使用旋转关节实现了一根绳子..
我正在制作连接动态体的绳索(通过 b2RevoluteJoints)。我成功创建了它。现在我还在绳索的末端附加了一个动态体。 &我正在释放我的绳索,身体向下,现在不知何故我的动态绳索体之间的关节被拉伸然后断裂,我希望我的绳索看起来更平滑。
我的关节是这样的
b2RevoluteJointDef revoluteJointDef;
revoluteJointDef.bodyA = referenceBody;//provided by testbed
revoluteJointDef.bodyB = lastLink;
revoluteJointDef.localAnchorA = startPos;//world coords, because m_groundBody is at (0,0)
revoluteJointDef.localAnchorB.Set(0,0);//center of circle
world->CreateJoint( &revoluteJointDef );
revoluteJointDef.bodyA = lastLink;//the last added link of the chain
revoluteJointDef.bodyB = chainBase;
revoluteJointDef.localAnchorA.Set(0,linkWidth);//the regular position for chain link joints
revoluteJointDef.localAnchorB.Set(0,linkWidth);//a little in from the edge of the circle
world->CreateJoint( &revoluteJointDef );
有什么方法可以让关节变得结实吗??
我们可以通过研究物体的密度和世界的重力来实现这一点吗??
请帮忙.....
【问题讨论】:
-
大概有多少个旋转关节?
-
hmmmm 大约 30 个旋转接头在一根绳索和 2 根绳索 r 那里.. 两条绳索的一端在地体(地的上边缘),另一端连接着一个悬挂在世界上的动态 b2body。
-
绳索末端的尸体有多大?
标签: iphone cocos2d-iphone box2d-iphone