| 232 | } |
| 233 | |
| 234 | void PhysicsJoint::setMaxForce(float force) |
| 235 | { |
| 236 | if (_initDirty) |
| 237 | { |
| 238 | delay([this, force]() { |
| 239 | _maxForce = force; |
| 240 | for (auto&& joint : _cpConstraints) |
| 241 | { |
| 242 | cpConstraintSetMaxForce(joint, force); |
| 243 | } |
| 244 | }); |
| 245 | } |
| 246 | else |
| 247 | { |
| 248 | _maxForce = force; |
| 249 | for (auto&& joint : _cpConstraints) |
| 250 | { |
| 251 | cpConstraintSetMaxForce(joint, force); |
| 252 | } |
| 253 | } |
| 254 | } |
| 255 | |
| 256 | PhysicsJointFixed* PhysicsJointFixed::construct(PhysicsBody* a, PhysicsBody* b, const Vec2& anchr) |
| 257 | { |