Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions cocos/physics-2d/box2d-wasm/physics-contact.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,11 @@
}

init (b2contact: number): void {
const ab = B2.ContactGetFixture(b2contact) as Vec2;
this.colliderA = (getTSObjectFromWASMObjectPtr<B2Shape2D>(B2ObjectType.Fixture, ab.x)).collider;
this.colliderB = (getTSObjectFromWASMObjectPtr<B2Shape2D>(B2ObjectType.Fixture, ab.y)).collider;
// const ab = B2.ContactGetFixture(b2contact) as Vec2;
const fixtureA = B2.ContactGetFixtureA(b2contact);
const fixtureB = B2.ContactGetFixtureB(b2contact);
this.colliderA = (getTSObjectFromWASMObjectPtr<B2Shape2D>(B2ObjectType.Fixture, fixtureA)).collider;

Check failure on line 103 in cocos/physics-2d/box2d-wasm/physics-contact.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unsafe argument of type `any` assigned to a parameter of type `number`
this.colliderB = (getTSObjectFromWASMObjectPtr<B2Shape2D>(B2ObjectType.Fixture, fixtureB)).collider;

Check failure on line 104 in cocos/physics-2d/box2d-wasm/physics-contact.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unsafe argument of type `any` assigned to a parameter of type `number`
this.disabled = false;
this.disabledOnce = false;
this._impulsePtr = 0;
Expand Down
7 changes: 7 additions & 0 deletions cocos/physics-2d/box2d-wasm/shapes/box-shape-2d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,11 @@
B2.PolygonShapeSetAsBoxWithCenterAndAngle(shape, width, height, offsetX, offsetY, 0);
return [shape];
}

destroy(): void {

Check warning on line 74 in cocos/physics-2d/box2d-wasm/shapes/box-shape-2d.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Missing space before function parentheses
for (let i = 0; i < this._shapes.length; i++) {
B2.PolygonShapeDelete(this._shapes[i])

Check failure on line 76 in cocos/physics-2d/box2d-wasm/shapes/box-shape-2d.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Missing semicolon
}
super.destroy();
}
}
7 changes: 7 additions & 0 deletions cocos/physics-2d/box2d-wasm/shapes/circle-shape-2d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,11 @@

return [shape];
}

destroy(): void {

Check warning on line 60 in cocos/physics-2d/box2d-wasm/shapes/circle-shape-2d.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Missing space before function parentheses
for (let i = 0; i < this._shapes.length; i++) {
B2.CircleShapeDelete(this._shapes[i])

Check failure on line 62 in cocos/physics-2d/box2d-wasm/shapes/circle-shape-2d.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Missing semicolon
}
super.destroy();
}
}
7 changes: 7 additions & 0 deletions cocos/physics-2d/box2d-wasm/shapes/polygon-shape-2d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,11 @@

return shapes;
}

destroy(): void {

Check warning on line 116 in cocos/physics-2d/box2d-wasm/shapes/polygon-shape-2d.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Missing space before function parentheses
for (let i = 0; i < this._shapes.length; i++) {
B2.PolygonShapeDelete(this._shapes[i]);
}
super.destroy();
}
}
Loading