MCPcopy
hub / github.com/piqnt/planck.js / createFixture

Method createFixture

src/dynamics/Body.ts:1082–1093  ·  view source on GitHub ↗
(shape, fixdef?)

Source from the content-addressed store, hash-verified

1080 createFixture(shape: Shape, density?: number): Fixture;
1081 // tslint:disable-next-line:typedef
1082 createFixture(shape, fixdef?) {
1083 if (_ASSERT) console.assert(this.isWorldLocked() == false);
1084
1085 if (this.isWorldLocked() == true) {
1086 return null;
1087 }
1088
1089 const fixture = new Fixture(this, shape, fixdef);
1090 this._addFixture(fixture);
1091 this.m_world.publish("add-fixture", fixture);
1092 return fixture;
1093 }
1094
1095 /**
1096 * Destroy a fixture. This removes the fixture from the broad-phase and destroys

Callers 15

HelloWorld.tsFile · 0.80
Chain.tsFile · 0.80
Breakable.tsFile · 0.80
breakItFunction · 0.80
HeavyOnLight.tsFile · 0.80
TheoJansen.tsFile · 0.80
createLegFunction · 0.80
createBodyFunction · 0.80
Revolute.tsFile · 0.80
MotorJoint.tsFile · 0.80
Boxes.tsFile · 0.80
HeavyOnLightTwo.tsFile · 0.80

Calls 4

isWorldLockedMethod · 0.95
_addFixtureMethod · 0.95
publishMethod · 0.80
assertMethod · 0.45

Tested by

no test coverage detected