Skip to content

Commit

Permalink
PhysicsSpace: deprecate the countCollisionListeners() method
Browse files Browse the repository at this point in the history
  • Loading branch information
stephengold committed Nov 21, 2023
1 parent 3a25e79 commit 476ac0f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/main/java/com/jme3/bullet/PhysicsSpace.java
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,9 @@ public boolean contains(PhysicsJoint joint) {
* Count how many collision listeners are registered with this space.
*
* @return the count (≥0)
* @deprecated Override the ContactListener methods instead.
*/
@Deprecated
public int countCollisionListeners() {
int result = contactProcessedListeners.size()
+ contactStartedListeners.size();
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/jme3utilities/minie/PhysicsDumper.java
Original file line number Diff line number Diff line change
Expand Up @@ -783,9 +783,8 @@ public void dump(PhysicsSpace space, String indent) {
stream.printf("%s maxSS=%d", accuDesc, maxSS);
}

int cCount = space.countCollisionListeners();
int tCount = space.countTickListeners();
stream.printf("] listeners[c=%d t=%d]", cCount, tCount);
stream.printf("] listeners=%d", tCount);

// 3rd line: solver type and info
addLine(indent);
Expand Down
1 change: 0 additions & 1 deletion src/test/java/TestLibbulletjme.java
Original file line number Diff line number Diff line change
Expand Up @@ -2075,7 +2075,6 @@ private static void verifyCollisionSpaceDefaults(CollisionSpace space) {
private static void verifyPhysicsSpaceDefaults(PhysicsSpace space) {
verifyCollisionSpaceDefaults(space);

Assert.assertEquals(0, space.countCollisionListeners());
Assert.assertEquals(0, space.countJoints());
Assert.assertEquals(0, space.countManifolds());
Assert.assertEquals(0, space.countRigidBodies());
Expand Down

0 comments on commit 476ac0f

Please sign in to comment.