Skip to content

Commit 1f47719

Browse files
authored
Merge pull request #134 from pmndrs/remove-numobjects
Remove deprecated `world.numObjects`
2 parents e888dfd + 42cdf14 commit 1f47719

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

src/collision/GridBroadphase.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export class GridBroadphase extends Broadphase {
7777
* Get all the collision pairs in the physics world
7878
*/
7979
collisionPairs(world: World, pairs1: Body[], pairs2: Body[]): void {
80-
const N = world.numObjects()
80+
const N = world.bodies.length
8181
const bodies = world.bodies
8282
const max = this.aabbMax
8383
const min = this.aabbMin

src/world/World.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -265,14 +265,6 @@ export class World extends EventTarget {
265265
return this.contactMaterialTable.get(m1.id, m2.id)
266266
}
267267

268-
/**
269-
* Get number of objects in the world.
270-
* @deprecated
271-
*/
272-
numObjects(): number {
273-
return this.bodies.length
274-
}
275-
276268
/**
277269
* Store old collision state info
278270
*/
@@ -527,7 +519,7 @@ export class World extends EventTarget {
527519
const contacts = this.contacts
528520
const p1 = World_step_p1
529521
const p2 = World_step_p2
530-
const N = this.numObjects()
522+
const N = this.bodies.length
531523
const bodies = this.bodies
532524
const solver = this.solver
533525
const gravity = this.gravity

0 commit comments

Comments
 (0)