From 476ac0f40b3e78e1276c7165f8e9880472a0ad9d Mon Sep 17 00:00:00 2001 From: Stephen Gold Date: Tue, 21 Nov 2023 09:18:34 -0800 Subject: [PATCH] PhysicsSpace: deprecate the countCollisionListeners() method --- src/main/java/com/jme3/bullet/PhysicsSpace.java | 2 ++ src/main/java/jme3utilities/minie/PhysicsDumper.java | 3 +-- src/test/java/TestLibbulletjme.java | 1 - 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/jme3/bullet/PhysicsSpace.java b/src/main/java/com/jme3/bullet/PhysicsSpace.java index 7b18ca1b..d4d1ff07 100644 --- a/src/main/java/com/jme3/bullet/PhysicsSpace.java +++ b/src/main/java/com/jme3/bullet/PhysicsSpace.java @@ -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(); diff --git a/src/main/java/jme3utilities/minie/PhysicsDumper.java b/src/main/java/jme3utilities/minie/PhysicsDumper.java index e58649da..d48636a7 100644 --- a/src/main/java/jme3utilities/minie/PhysicsDumper.java +++ b/src/main/java/jme3utilities/minie/PhysicsDumper.java @@ -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); diff --git a/src/test/java/TestLibbulletjme.java b/src/test/java/TestLibbulletjme.java index 86ebc987..2fa92ff2 100644 --- a/src/test/java/TestLibbulletjme.java +++ b/src/test/java/TestLibbulletjme.java @@ -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());