public void setScale(float x, float y, float z) {

        float length = m00 * m00 + m10 * m10 + m20 * m20;
        if (length != 0f) {
            length = length == 1 ? x : (x / FastMath.sqrt(length));
            m00 *= length;
            m10 *= length;
            m20 *= length;
        }

        length = m01 * m01 + m11 * m11 + m21 * m21;
        if (length != 0f) {
            length = length == 1 ? y : (y / FastMath.sqrt(length));
            m01 *= length;
            m11 *= length;
            m21 *= length;
        }

        length = m02 * m02 + m12 * m12 + m22 * m22;
        if (length != 0f) {
            length = length == 1 ? z : (z / FastMath.sqrt(length));
            m02 *= length;
            m12 *= length;
            m22 *= length;
        }
    }
Alters the scale component of the coordinate transform.

@param x the desired scale factor for the X axis
@param y the desired scale factor for the Y axis
@param z the desired scale factor for the Z axis
jme3-core/src/main/java/com/jme3/math/Matrix4f.java