@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2009-2012 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -143,6 +143,12 @@ public class AndroidKeyMapping {
0x0,//mute
};
+ /**
+ * A private constructor to inhibit instantiation of this class.
+ */
+ private AndroidKeyMapping() {
+ }
+
public static int getJmeKey(int androidKey) {
if (androidKey > ANDROID_TO_JME.length) {
return androidKey;
@@ -51,6 +51,12 @@ public class RendererUtil {
*/
public static boolean ENABLE_ERROR_CHECKING = true;
+ private RendererUtil() {
/**
* Checks for an OpenGL error and throws a {@link RendererException} if
* there is one. Ignores the value of
@@ -8,6 +8,12 @@ public final class AndroidScreenshots {
private static final Logger logger = Logger.getLogger(AndroidScreenshots.class.getName());
+ private AndroidScreenshots() {
* Convert OpenGL GLES20.GL_RGBA to Bitmap.Config.ARGB_8888 and store result
* in a Bitmap
- * Copyright (c) 2009-2020 jMonkeyEngine
@@ -51,6 +51,11 @@ import java.util.LinkedList;
* @author normenhansen, tim8dev
public class CollisionShapeFactory {
+ private CollisionShapeFactory() {
* Calculate the correct transform for a collision shape relative to the
@@ -176,5 +176,9 @@ public class AnimInterpolators {
public static final TimeInterpolator constant = new TimeInterpolator(Easing.constant);
-
+ private AnimInterpolators() {
}
@@ -52,6 +52,12 @@ public class Tweens {
private static final CurveFunction SMOOTH = new SmoothStep();
private static final CurveFunction SINE = new Sine();
+ private Tweens() {
* Creates a tween that will interpolate over an entire sequence
* of tweens in order.
@@ -13,6 +13,11 @@ public class AnimMigrationUtils {
final private static AnimControlVisitor animControlVisitor = new AnimControlVisitor();
final private static SkeletonControlVisitor skeletonControlVisitor = new SkeletonControlVisitor();
+ private AnimMigrationUtils() {
public static Spatial migrate(Spatial source) {
Map<Skeleton, Armature> skeletonArmatureMap = new HashMap<>();
@@ -33,6 +33,12 @@ public class Primitives {
PRIMITIVE_TO_WRAPPER_TYPE = Collections.unmodifiableMap(primToWrap);
+ private Primitives() {
* Returns the corresponding wrapper type of {@code type} if it is a primitive type; otherwise
* returns {@code type} itself. Idempotent.
@@ -40,6 +40,12 @@ public class AudioContext {
final private static ThreadLocal<AudioRenderer> audioRenderer = new ThreadLocal<AudioRenderer>();
+ private AudioContext() {
public static void setAudioRenderer( AudioRenderer ar ) {
audioRenderer.set(ar);
@@ -72,6 +72,12 @@ import java.util.concurrent.ScheduledThreadPoolExecutor;
public class LightProbeFactory {
+ private LightProbeFactory() {
* Creates a LightProbe with the giver EnvironmentCamera in the given scene.
@@ -90,6 +90,12 @@ public class EnvMapUtils {
HighQuality
+ private EnvMapUtils() {
* Creates a cube map from 6 images
@@ -80,6 +80,12 @@ public class SavableClassUtil {
addRemapping("com.jme3.scene.plugins.blender.objects.Properties", NullSavable.class);
+ private SavableClassUtil() {
private static String remapClass(String className) throws ClassNotFoundException {
String result = CLASS_REMAPPINGS.get(className);
if (result == null) {
@@ -140,4 +140,10 @@ public class CameraInput {
public final static String FLYCAM_LOWER = "FLYCAM_Lower";
public final static String FLYCAM_INVERTY = "FLYCAM_InvertY";
+ private CameraInput() {
@@ -73,6 +73,12 @@ public class JoystickCompatibilityMappings {
loadDefaultMappings();
+ private JoystickCompatibilityMappings() {
protected static Map<String,String> getMappings( String joystickName, boolean create ) {
Map<String,String> result = joystickMappings.get(joystickName.trim());
if( result == null && create ) {
@@ -180,6 +180,12 @@ public class KeyNames {
KEY_NAMES[KEY_UNLABELED] = "Unlabeled";
+ private KeyNames() {
public static String getName(int keyId) {
return KEY_NAMES[keyId];
- * Copyright (c) 2009-2018 jMonkeyEngine
@@ -42,4 +42,9 @@ public class Materials {
public static final String LIGHTING = "Common/MatDefs/Light/Lighting.j3md";
public static final String PBR = "Common/MatDefs/Light/PBRLighting.j3md";
+ private Materials() {
@@ -167,6 +167,12 @@ public class Easing {
+ private Easing() {
* An Ease function composed of 2 sb function for custom in and out easing
@@ -38,6 +38,12 @@ import com.jme3.util.TempVars;
* Created by Nehon on 23/04/2017.
public class MathUtils {
+ private MathUtils() {
* Calculate the natural logarithm of a unit quaternion.
@@ -44,6 +44,11 @@ import com.jme3.math.FastMath;
public class AreaUtils {
+ private AreaUtils() {
* Estimate the screen area of a bounding volume. If the volume isn't a
@@ -33,6 +33,12 @@ package com.jme3.shader;
public class ShaderUtils {
+ private ShaderUtils() {
public static String convertToGLSL130(String input, boolean isFrag) {
StringBuilder sb = new StringBuilder();
sb.append("#version 130\n");
- * Copyright (c) 2009-2019 jMonkeyEngine
@@ -51,6 +51,12 @@ import static java.lang.Math.min;
public final class PssmShadowUtil {
+ private PssmShadowUtil() {
* Updates the frustum splits stores in <code>splits</code> using PSSM.
@@ -61,6 +61,12 @@ import java.util.List;
public class ShadowUtil {
+ private ShadowUtil() {
* Updates a points arrays with the frustum corners of the provided camera.
@@ -53,6 +53,12 @@ public class JmeSystem {
private static JmeSystemDelegate systemDelegate;
+ private JmeSystem() {
public static void setSystemDelegate(JmeSystemDelegate systemDelegate) {
JmeSystem.systemDelegate = systemDelegate;
@@ -63,4 +63,10 @@ public class JmeVersion {
public static final String VERSION_TAG = props.getProperty("version.tag", "");
public static final String VERSION_FULL = props.getProperty("version.full", "");
public static final String FULL_NAME = props.getProperty("name.full", "jMonkeyEngine (unknown version)");
+ private JmeVersion() {
@@ -214,6 +214,7 @@ public class FrameBuffer extends NativeObject {
public static class FrameBufferTarget {
+ private FrameBufferTarget(){}
public static FrameBufferTextureTarget newTarget(Texture tx){
FrameBufferTextureTarget t=new FrameBufferTextureTarget();
t.setTexture(tx);
@@ -227,6 +228,11 @@ public class FrameBuffer extends NativeObject {
+ private FrameBuffer() {
public void addColorTarget(FrameBufferBufferTarget colorBuf){
colorBuf.slot=colorBufs.size();
@@ -17,6 +17,12 @@ public class BufferAllocatorFactory {
private static final Logger LOGGER = Logger.getLogger(BufferAllocatorFactory.class.getName());
+ private BufferAllocatorFactory() {
@Internal
protected static BufferAllocator create() {
@@ -69,6 +69,12 @@ public final class BufferUtils {
final private static ConcurrentHashMap<BufferInfo, BufferInfo> trackedBuffers = new ConcurrentHashMap<BufferInfo, BufferInfo>();
static ClearReferences cleanupthread;
+ private BufferUtils() {
* Set it to true if you want to enable direct memory tracking for debugging
* purpose. Default is false. To print direct memory usage use
@@ -55,6 +55,12 @@ public class MemoryUtils {
+ private MemoryUtils() {
* @return the direct memory used in byte.
@@ -71,6 +71,12 @@ public class PlaceholderAssets {
(byte)0xFF, (byte)0xFF, (byte)0xFF,
+ private PlaceholderAssets() {
@Deprecated
public static Image getPlaceholderImage(){
ByteBuffer tempData = BufferUtils.createByteBuffer(3 * 4 * 4);
@@ -80,6 +80,12 @@ public class SkyFactory {
EquirectMap
+ private SkyFactory() {
* Create a sky with radius=10 using the given cubemap or spheremap texture.
@@ -117,6 +117,12 @@ public class TangentBinormalGenerator {
+ private TangentBinormalGenerator() {
private static List<VertexData> initVertexData(int size) {
List<VertexData> vertices = new ArrayList<>(size);
for (int i = 0; i < size; i++) {
@@ -38,6 +38,12 @@ import com.jme3.scene.*;
public class TangentUtils {
+ private TangentUtils() {
public static void generateBindPoseTangentsIfNecessary(Mesh mesh){
if (mesh.getBuffer(VertexBuffer.Type.BindPosePosition) != null) {
@@ -68,6 +68,12 @@ public class MikktspaceTangentGenerator {
private final static long INTERNAL_RND_SORT_SEED = 39871946 & 0xffffffffL;
static final int CELLS = 2048;
+ private MikktspaceTangentGenerator() {
static int makeIndex(final int face, final int vert) {
assert (vert >= 0 && vert < 4 && face >= 0);
return (face << 2) | (vert & 0x3);
@@ -41,6 +41,12 @@ import org.xml.sax.SAXException;
public final class SAXUtil {
+ private SAXUtil() {
* Parses an integer from a string, if the string is null returns
* def.
@@ -44,6 +44,12 @@ import java.io.OutputStream;
public class ByteUtils {
+ private ByteUtils() {
* Takes an InputStream and returns the complete byte content of it
@@ -50,6 +50,12 @@ public class DXTFlipper {
bb.order(ByteOrder.LITTLE_ENDIAN);
+ private DXTFlipper() {
private static long readCode5(long data, int x, int y){
long shift = (4 * y + x) * 3;
long mask = 0x7;
@@ -44,6 +44,12 @@ import java.nio.ByteBuffer;
public class ImageFlipper {
+ private ImageFlipper() {
public static void flipImage(Image img, int index){
if (img.getFormat().isCompressed())
throw new UnsupportedOperationException("Flipping compressed " +
- * Copyright (c) 2009-2015 jMonkeyEngine
@@ -40,6 +40,12 @@ import com.jme3.bounding.BoundingVolume;
final class CollisionUtil {
+ private CollisionUtil() {
private static void checkCollisionBase(Collidable a, Collidable b, int expected) {
// Test bounding volume methods
if (a instanceof BoundingVolume && b instanceof BoundingVolume) {
@@ -52,6 +52,12 @@ public class MPOTestUtils {
+ private MPOTestUtils() {
private static void validateSubScene(Spatial scene) {
scene.checkCulling(DUMMY_CAM);
@@ -44,6 +44,12 @@ public class TestUtil {
JmeSystem.setSystemDelegate(new MockJmeSystemDelegate());
+ private TestUtil() {
public static AssetManager createAssetManager() {
Logger.getLogger(AssetConfig.class.getName()).setLevel(Level.OFF);
return new DesktopAssetManager(true);
@@ -38,6 +38,12 @@ package jme3tools.converters;
public class RGB565 {
+ private RGB565() {
public static short ARGB8_to_RGB565(int argb){
int a = (argb & 0xFF000000) >> 24;
int r = (argb & 0x00FF0000) >> 16;
@@ -55,6 +55,12 @@ import java.util.zip.GZIPOutputStream;
public class SaveGame {
+ private SaveGame() {
* Saves a savable in a system-dependent way.
* @param gamePath A unique path for this game, e.g. com/mycompany/mygame
@@ -37,6 +37,12 @@ package jme3tools.shader;
public class ShaderDebug {
+ private ShaderDebug() {
* Append the line numbers to the source code of a shader to output it
* @param source the source
@@ -40,6 +40,12 @@ import java.nio.IntBuffer;
public final class Screenshots {
+ private Screenshots() {
public static void convertScreenShot2(IntBuffer bgraBuf, BufferedImage out){
WritableRaster wr = out.getRaster();
DataBufferInt db = (DataBufferInt) wr.getDataBuffer();
@@ -177,6 +177,12 @@ public class ImageToAwt {
+ private ImageToAwt() {
private static int Ix(int x, int y, int w){
return y * w + x;
@@ -44,6 +44,12 @@ import java.util.ArrayList;
public class MipMapGenerator {
+ private MipMapGenerator() {
private static BufferedImage scaleDown(BufferedImage sourceImage, int targetWidth, int targetHeight) {
int sourceWidth = sourceImage.getWidth();
int sourceHeight = sourceImage.getHeight();
@@ -40,8 +40,13 @@ import com.jme3.util.TempVars;
* @author Nehon
-public class WaterUtils {
+public class WaterUtils {
+ private WaterUtils() {
public static void updateReflectionCam(Camera reflectionCam, Plane plane, Camera sceneCam){
TempVars vars = TempVars.get();
@@ -63,6 +63,11 @@ import com.jme3.util.BufferUtils;
* @author normenhansen
public class PhysicsTestHelper {
+ private PhysicsTestHelper() {
* creates a simple physics test world with a floor, an obstacle and some test boxes
@@ -135,6 +135,12 @@ public class JmeIosGLES {
public static final int GL_VERTEX_SHADER = 0x00008b31;
public static final int GL_ZERO = 0x00000000;
+ private JmeIosGLES() {
public static native void glActiveTexture(int texture);
public static native void glAttachShader(int program, int shader);
public static native void glBindBuffer(int target, int buffer);
@@ -64,6 +64,12 @@ public class DebugShapeFactory {
/** The minimum corner for the aabb used for triangles to include in ConcaveShape processing.*/
private static final Vector3f aabbMin = new Vector3f(-1e30f, -1e30f, -1e30f);
+ private DebugShapeFactory() {
* Creates a debug shape from the given collision shape. This is mostly used internally.<br>
* To attach a debug shape to a physics object, call <code>attachDebugShape(AssetManager manager);</code> on it.
@@ -38,6 +38,12 @@ public class GlfwKeyMap {
private static final int[] GLFW_TO_JME_KEY_MAP = new int[GLFW_KEY_LAST + 1];
+ private GlfwKeyMap() {
private static void reg(final int jmeKey, final int glfwKey) {
GLFW_TO_JME_KEY_MAP[glfwKey] = jmeKey;
@@ -43,6 +43,12 @@ import java.util.HashSet;
public class Filters
{
+ private Filters() {
* Creates a filter that returns true for any value in the specified
* list of values and false for all other cases.
@@ -53,6 +53,12 @@ public class Network
public static final String DEFAULT_GAME_NAME = "Unnamed jME3 Game";
public static final int DEFAULT_VERSION = 42;
+ private Network() {
* Creates a Server that will utilize both reliable and fast
* transports to communicate with clients. The specified port
- * Copyright (c) 2015 jMonkeyEngine
+ * Copyright (c) 2015-2021 jMonkeyEngine
@@ -46,6 +46,12 @@ import com.jme3.network.HostedConnection;
public class RmiContext {
private static final ThreadLocal<HostedConnection> connection = new ThreadLocal<HostedConnection>();
+ private RmiContext() {
* Returns the HostedConnection that is responsible for any
* RMI-related calls on this thread.
@@ -41,4 +41,10 @@ public class FbxAnimUtil {
public static final String CURVE_NODE_PROPERTY_Y = "d|Y";
public static final String CURVE_NODE_PROPERTY_Z = "d|Z";
public static final String CURVE_NODE_PROPERTY_VISIBILITY = "d|Visibility";
+ private FbxAnimUtil() {
- * Copyright (c) 2009-2014 jMonkeyEngine
@@ -50,6 +50,12 @@ public class FbxReader {
public static final byte[] HEAD_MAGIC = new byte[]{0x4b, 0x61, 0x79, 0x64, 0x61, 0x72, 0x61, 0x20, 0x46, 0x42, 0x58, 0x20, 0x42, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x20, 0x20, 0x00, 0x1a, 0x00};
+ private FbxReader() {
public static FbxFile readFBX(InputStream stream) throws IOException {
FbxFile fbxFile = new FbxFile();
// Read file to byte buffer so we can know current position in file
@@ -34,6 +34,11 @@ package com.jme3.scene.plugins.fbx.mesh;
import com.jme3.scene.plugins.fbx.file.FbxElement;
public class FbxMeshUtil {
+ private FbxMeshUtil() {
public static double[] getDoubleArray(FbxElement el) {
if (el.propertiesTypes[0] == 'd') {
@@ -35,6 +35,12 @@ import com.jme3.math.FastMath;
import com.jme3.math.Quaternion;
public class FbxNodeUtil {
+ private FbxNodeUtil() {
public static Quaternion quatFromBoneAngles(float xAngle, float yAngle, float zAngle) {
float angle;
float sinY, sinZ, sinX, cosY, cosZ, cosX;
@@ -59,6 +59,12 @@ public final class FbxObjectFactory {
private static final Logger logger = Logger.getLogger(FbxObjectFactory.class.getName());
+ private FbxObjectFactory() {
private static Class<? extends FbxObject> getImplementingClass(String elementName, String subclassName) {
if (elementName.equals("NodeAttribute")) {
if (subclassName.equals("Root")) {
@@ -52,6 +52,12 @@ public class GltfUtils {
private static final Logger logger = Logger.getLogger(GltfUtils.class.getName());
+ private GltfUtils() {
public static Mesh.Mode getMeshMode(Integer mode) {
if (mode == null) {
return Mesh.Mode.Triangles;
@@ -55,6 +55,11 @@ import java.nio.ShortBuffer;
* @author Kirill Vainer
public class EntropyComputeUtil {
+ private EntropyComputeUtil() {
public static float computeLodEntropy(Mesh terrainBlock, Buffer lodIndices){
// Bounding box for the terrain block
@@ -46,6 +46,11 @@ import java.nio.ByteOrder;
public static final float[] i2c(final int color) {
return new float[] { (color & 0x00ff0000) / 256f, (color & 0x0000ff00) / 256f, (color & 0x000000ff) / 256f,
@@ -156,5 +156,10 @@ public class VRConstants {
* @see #SETTING_VRAPI_OPENVR_LWJGL_VALUE
public static final int SETTING_VRAPI_OCULUSVR_VALUE = 4;
+ private VRConstants() {
@@ -10,7 +10,12 @@ import com.jme3.shadow.DirectionalLightShadowFilter;
* @author Rickard
public class FilterUtil {
+ private FilterUtil() {
public static FogFilter cloneFogFilter(FogFilter fogFilter){
FogFilter filterClone = new FogFilter();
filterClone.setFogColor(fogFilter.getFogColor());
@@ -17,6 +17,12 @@ public class PreNormalCaching {
private static FrameBuffer cachedPreNormals;
private static int lastNormalPassesCount, curCount;
+ private PreNormalCaching() {
* Get pre-normals from the given rendering.
* @param renderManager the render manager.
@@ -16,6 +16,11 @@ import com.sun.jna.ptr.IntByReference;
* @author Julien Seinturier - 2017 - <a href="http://www.seinturier.fr">http://www.seinturier.fr</a>
public class OpenVRUtil {
+ private OpenVRUtil() {
* Get the value of the given string {@link JOpenVRLibrary.ETrackedDeviceProperty property} attached to the given device.
@@ -17,6 +17,12 @@ public class VRUtil {
private static final long SLEEP_PRECISION = TimeUnit.MILLISECONDS.toNanos(4);
private static final long SPIN_YIELD_PRECISION = TimeUnit.MILLISECONDS.toNanos(2);
+ private VRUtil() {
public static void sleepNanos(long nanoDuration) {
final long end = System.nanoTime() + nanoDuration;
long timeLeft = nanoDuration;