src/main/java/com/jme3/bullet/objects/PhysicsRigidBody.java
/**
     * Build/rebuild this body after parameters have changed.
     */
Build/rebuild this body after parameters have changed.
Build / rebuild this body after parameters have changed .
protected void rebuildRigidBody() {
        PhysicsSpace removedFrom = null;
        if (hasAssignedNativeObject()) {
            removedFrom = (PhysicsSpace) getCollisionSpace();
            if (removedFrom != null) {
                removedFrom.removeCollisionObject(this);
            }
            logger2.log(Level.FINE, "Clearing {0}.", this);
            unassignNativeObject();
        }
        preRebuild();
        CollisionShape shape = getCollisionShape();
        long objectId = createRigidBody(mass, motionState.nativeId(),
                shape.nativeId());
        setNativeId(objectId);
        assert getInternalType(objectId) == PcoType.rigid :
                getInternalType(objectId);
        logger2.log(Level.FINE, "Created {0}.", this);
        postRebuild();
        if (removedFrom != null) {
            removedFrom.addCollisionObject(this);
        }
    }
protected void rebuildRigidBody ( ) { PhysicsSpace removedFrom = null ; if ( hasAssignedNativeObject ( ) ) { removedFrom = ( PhysicsSpace ) getCollisionSpace ( ) ; if ( removedFrom != null ) { removedFrom . removeCollisionObject ( this ) ; } logger2 . log ( Level . FINE , "Clearing {0}." , this ) ; unassignNativeObject ( ) ; } preRebuild ( ) ; CollisionShape shape = getCollisionShape ( ) ; long objectId = createRigidBody ( mass , motionState . nativeId ( ) , shape . nativeId ( ) ) ; setNativeId ( objectId ) ; assert getInternalType ( objectId ) == PcoType . rigid : getInternalType ( objectId ) ; logger2 . log ( Level . FINE , "Created {0}." , this ) ; postRebuild ( ) ; if ( removedFrom != null ) { removedFrom . addCollisionObject ( this ) ; } }
Build/rebuild this body after parameters have changed.
Build / rebuild this body after parameters have changed .