Skip to content

Commit 36e9b3b

Browse files
committed
PhysicsRigidBody: bypass an unhelpful warning during read()
1 parent 2769f55 commit 36e9b3b

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

MinieLibrary/src/main/java/com/jme3/bullet/objects/PhysicsRigidBody.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1324,8 +1324,12 @@ public void read(JmeImporter importer) throws IOException {
13241324
tagInverseInertia, scaleIdentity));
13251325
setAngularFactor((Vector3f) capsule.readSavable(
13261326
tagAngularFactor, scaleIdentity));
1327-
setGravity((Vector3f) capsule.readSavable(
1327+
1328+
// Set gravity but bypass the "adding it to a PhysicsSpace" warning:
1329+
long objectId = nativeId();
1330+
setGravity(objectId, (Vector3f) capsule.readSavable(
13281331
tagGravity, translateIdentity));
1332+
13291333
setLinearFactor((Vector3f) capsule.readSavable(
13301334
tagLinearFactor, scaleIdentity));
13311335
setDamping(capsule.readFloat(tagLinearDamping, 0f),

0 commit comments

Comments
 (0)