MCPcopy Create free account
hub / github.com/axmolengine/axmol / setMaxForce

Method setMaxForce

core/physics/PhysicsJoint.cpp:234–254  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

232}
233
234void 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
256PhysicsJointFixed* PhysicsJointFixed::construct(PhysicsBody* a, PhysicsBody* b, const Vec2& anchr)
257{

Callers 2

onTouchBeganMethod · 0.80

Calls 2

delayFunction · 0.85
cpConstraintSetMaxForceFunction · 0.85

Tested by 1

onTouchBeganMethod · 0.64