diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8782a24e63..b879bf07b4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -69,13 +69,14 @@ jobs: uses: actions/checkout@v1 with: fetch-depth: 1 - - - name: Build + - name: Validate the Gradle wrapper + uses: gradle/wrapper-validation-action@v1 + - name: Build run: | # Build # Note: since this is crossbuild we use the buildForPlatforms filter to tell # the buildscript wich platforms it should build for. - gradle -PuseCommitHashAsVersionName=true --no-daemon -PbuildForPlatforms=LinuxArm,LinuxArmHF,LinuxArm64 -PbuildNativeProjects=true \ + ./gradlew -PuseCommitHashAsVersionName=true --no-daemon -PbuildForPlatforms=LinuxArm,LinuxArmHF,LinuxArm64 -PbuildNativeProjects=true \ :jme3-bullet-native:assemble - name: Upload natives @@ -96,10 +97,11 @@ jobs: uses: actions/checkout@v1 with: fetch-depth: 1 - - - name: Build - run: | - gradle -PuseCommitHashAsVersionName=true --no-daemon -PbuildNativeProjects=true \ + - name: Validate the Gradle wrapper + uses: gradle/wrapper-validation-action@v1 + - name: Build + run: | + ./gradlew -PuseCommitHashAsVersionName=true --no-daemon -PbuildNativeProjects=true \ :jme3-android-native:assemble \ :jme3-bullet-native-android:assemble @@ -137,8 +139,9 @@ jobs: uses: actions/setup-java@v1 with: java-version: ${{ matrix.jdk }} - architecture: x64 - + architecture: x64 + - name: Validate the Gradle wrapper + uses: gradle/wrapper-validation-action@v1 - name: Build Natives shell: bash env: @@ -159,7 +162,7 @@ jobs: fi # Build - gradle -PuseCommitHashAsVersionName=true --no-daemon -PbuildNativeProjects=true -Dmaven.repo.local="$PWD/dist/maven" \ + ./gradlew -PuseCommitHashAsVersionName=true --no-daemon -PbuildNativeProjects=true -Dmaven.repo.local="$PWD/dist/maven" \ build \ :jme3-bullet-native:build @@ -233,12 +236,13 @@ jobs: with: name: linuxarm-natives path: build/native - + - name: Validate the Gradle wrapper + uses: gradle/wrapper-validation-action@v1 - name: Build Engine shell: bash run: | # Build - gradle -PuseCommitHashAsVersionName=true -PskipPrebuildLibraries=true build + ./gradlew -PuseCommitHashAsVersionName=true -PskipPrebuildLibraries=true build if [ "${{ matrix.deploy }}" = "true" ]; then @@ -247,7 +251,7 @@ jobs: sudo apt-get install -y zip # Create the zip release and the javadoc - gradle -PuseCommitHashAsVersionName=true -PskipPrebuildLibraries=true mergedJavadoc createZipDistribution + ./gradlew -PuseCommitHashAsVersionName=true -PskipPrebuildLibraries=true mergedJavadoc createZipDistribution # We prepare the release for deploy mkdir -p ./dist/release/ @@ -255,7 +259,7 @@ jobs: # Create the maven artifacts mkdir -p ./dist/maven/ - gradle -PuseCommitHashAsVersionName=true -PskipPrebuildLibraries=true install -Dmaven.repo.local="$PWD/dist/maven" + ./gradlew -PuseCommitHashAsVersionName=true -PskipPrebuildLibraries=true install -Dmaven.repo.local="$PWD/dist/maven" # Zip the natives into a single archive (we are going to use this to deploy native snapshots) echo "Create native zip" diff --git a/README.md b/README.md index bc63883568..5112b5efad 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,9 @@ The engine is used by several commercial game studios and computer-science cours - [Lightspeed Frontier (on Steam)](https://store.steampowered.com/app/548650/Lightspeed_Frontier/) - [Skullstone](http://www.skullstonegame.com/) - [Spoxel (on Steam)](https://store.steampowered.com/app/746880/Spoxel/) + - [Nine Circles of Hell (on Steam)](https://store.steampowered.com/app/1200600/Nine_Circles_of_Hell/) + - [Leap](https://gamejolt.com/games/leap/313308) + - [Jumping Jack Flag](http://timealias.bplaced.net/jack/) ## Getting started diff --git a/build.gradle b/build.gradle index db97fb4756..dd72639df7 100644 --- a/build.gradle +++ b/build.gradle @@ -158,29 +158,29 @@ task configureAndroidNDK { gradle.rootProject.ext.set("usePrebuildNatives", buildNativeProjects!="true"); -if(skipPrebuildLibraries!="true"&&buildNativeProjects!="true"){ +if (skipPrebuildLibraries != "true" && buildNativeProjects != "true") { String rootPath = rootProject.projectDir.absolutePath Properties nativesSnasphotProp = new Properties() - File nativesSnasphotPropF=new File("${rootPath}/natives-snapshot.properties"); - - if(nativesSnasphotPropF.exists()){ + File nativesSnasphotPropF = new File("${rootPath}/natives-snapshot.properties"); + + if (nativesSnasphotPropF.exists()) { nativesSnasphotPropF.withInputStream { nativesSnasphotProp.load(it) } - String nativesSnasphot=nativesSnasphotProp.getProperty("natives.snapshot"); - String nativesUrl=PREBUILD_NATIVES_URL.replace('${natives.snapshot}',nativesSnasphot) - println "Use natives snapshot: "+nativesUrl + String nativesSnasphot = nativesSnasphotProp.getProperty("natives.snapshot"); + String nativesUrl = PREBUILD_NATIVES_URL.replace('${natives.snapshot}', nativesSnasphot) + println "Use natives snapshot: " + nativesUrl - String nativesZipFile="${rootPath}" + File.separator + "build"+ File.separator +nativesSnasphot+"-natives.zip" - String nativesPath="${rootPath}" + File.separator + "build"+ File.separator +"native" + String nativesZipFile = "${rootPath}" + File.separator + "build" + File.separator + nativesSnasphot + "-natives.zip" + String nativesPath = "${rootPath}" + File.separator + "build" + File.separator + "native" task getNativesZipFile { outputs.file nativesZipFile doFirst { File target = file(nativesZipFile); - println("Download natives from "+nativesUrl+" to "+nativesZipFile); + println("Download natives from " + nativesUrl + " to " + nativesZipFile); target.getParentFile().mkdirs(); ant.get(src: nativesUrl, dest: target); } @@ -192,28 +192,26 @@ if(skipPrebuildLibraries!="true"&&buildNativeProjects!="true"){ dependsOn getNativesZipFile doFirst { - for(File src : zipTree(nativesZipFile)){ - String srcRel=src.getAbsolutePath().substring((int)(nativesZipFile.length()+1)); - srcRel=srcRel.substring(srcRel.indexOf( File.separator)+1); + for (File src : zipTree(nativesZipFile)) { + String srcRel = src.getAbsolutePath().substring((int) (nativesZipFile.length() + 1)); + srcRel = srcRel.substring(srcRel.indexOf(File.separator) + 1); - File dest=new File(nativesPath+File.separator+srcRel); + File dest = new File(nativesPath + File.separator + srcRel); boolean doCopy = !(dest.exists() && dest.lastModified() > src.lastModified()) if (doCopy) { - println("Copy "+src+" "+dest); + println("Copy " + src + " " + dest); dest.getParentFile().mkdirs(); Files.copy(src.toPath(), dest.toPath(), StandardCopyOption.REPLACE_EXISTING); } } } } - build.dependsOn extractPrebuiltNatives + + assemble.dependsOn extractPrebuiltNatives } } - - - //class IncrementalReverseTask extends DefaultTask { // @InputDirectory // def File inputDir @@ -249,3 +247,7 @@ if(skipPrebuildLibraries!="true"&&buildNativeProjects!="true"){ // enableAssertions = true // true by default // } //} + +wrapper { + gradleVersion = '5.6.4' +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 82c99b55ac..035c547130 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,13 +1,17 @@ -# Version number: Major.Minor (e.g. 3.3) -jmeVersion = 3.3 +# Version number: Major.Minor.SubMinor (e.g. 3.3.0) +jmeVersion = 3.4.0 # Leave empty to autogenerate # (use -PjmeVersionName="myVersion" from commandline to specify a custom version name ) -jmeVersionName = +jmeVersionName = # If true, the version name will contain the commit hash useCommitHashAsVersionName = false +# Set to true if a non-master branch name should be included in the automatically +# generated version. +includeBranchInVersion = false + # specify if JavaDoc should be built buildJavaDoc = true diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 7a3265ee94..5c2d1cf016 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 76e4690af0..5028f28f8e 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.10-bin.zip +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index cccdd3d517..83f2acfdc3 100755 --- a/gradlew +++ b/gradlew @@ -1,5 +1,21 @@ #!/usr/bin/env sh +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + ############################################################################## ## ## Gradle start up script for UN*X @@ -28,7 +44,7 @@ APP_NAME="Gradle" APP_BASE_NAME=`basename "$0"` # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD="maximum" @@ -109,8 +125,8 @@ if $darwin; then GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" fi -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then APP_HOME=`cygpath --path --mixed "$APP_HOME"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` JAVACMD=`cygpath --unix "$JAVACMD"` diff --git a/gradlew.bat b/gradlew.bat index e95643d6a2..24467a141f 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,3 +1,19 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + @if "%DEBUG%" == "" @echo off @rem ########################################################################## @rem @@ -14,7 +30,7 @@ set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome diff --git a/jme3-android-examples/src/main/java/org/jmonkeyengine/jme3androidexamples/MainActivity.java b/jme3-android-examples/src/main/java/org/jmonkeyengine/jme3androidexamples/MainActivity.java index 81cb3f8568..fcebf70f8e 100644 --- a/jme3-android-examples/src/main/java/org/jmonkeyengine/jme3androidexamples/MainActivity.java +++ b/jme3-android-examples/src/main/java/org/jmonkeyengine/jme3androidexamples/MainActivity.java @@ -286,7 +286,7 @@ private boolean checkClassName(String className) { private boolean checkClassType(String className) { boolean include = true; try { - Class clazz = (Class) Class.forName(className); + Class clazz = Class.forName(className); if (Application.class.isAssignableFrom(clazz)) { Log.d(TAG, "Class " + className + " is a jME Application"); } else { diff --git a/jme3-android-native/decode.gradle b/jme3-android-native/decode.gradle index 07d93a04af..5acd27c8c5 100644 --- a/jme3-android-native/decode.gradle +++ b/jme3-android-native/decode.gradle @@ -1,5 +1,5 @@ String tremorZipFile = "TremorAndroid.zip" -String stbiUrl = 'https://raw.githubusercontent.com/nothings/stb/master/stb_image.h' +String stbiUrl = 'https://raw.githubusercontent.com/jMonkeyEngine/stb/0224a44a10564a214595797b4c88323f79a5f934/stb_image.h' // Working directories for the ndk build. String decodeBuildDir = "${buildDir}" + File.separator + 'decode' diff --git a/jme3-android-native/openalsoft.gradle b/jme3-android-native/openalsoft.gradle index d8e5e836e2..3c47011ae1 100644 --- a/jme3-android-native/openalsoft.gradle +++ b/jme3-android-native/openalsoft.gradle @@ -1,11 +1,11 @@ // OpenAL Soft r1.16 -String openALSoftUrl = 'http://repo.or.cz/w/openal-soft.git/snapshot/e5016f814a265ed592a88acea95cf912c4bfdf12.zip' +String openALSoftUrl = 'https://github.com/jMonkeyEngine/openal-soft/archive/e5016f814a265ed592a88acea95cf912c4bfdf12.zip' String openALSoftZipFile = 'OpenALSoft.zip' // OpenAL Soft directory the download is extracted into // Typically, the downloaded OpenAL Soft zip file will extract to a directory // called "openal-soft" -String openALSoftFolder = 'openal-soft-e5016f8' +String openALSoftFolder = 'openal-soft-e5016f814a265ed592a88acea95cf912c4bfdf12' //Working directories for the ndk build. String openalsoftBuildDir = "${buildDir}" + File.separator + 'openalsoft' diff --git a/jme3-android/src/main/java/com/jme3/app/AndroidHarness.java b/jme3-android/src/main/java/com/jme3/app/AndroidHarness.java index b6d0913d16..5700f01cc7 100644 --- a/jme3-android/src/main/java/com/jme3/app/AndroidHarness.java +++ b/jme3-android/src/main/java/com/jme3/app/AndroidHarness.java @@ -362,6 +362,7 @@ public void run() { * @param dialog * @param whichButton */ + @Override public void onClick(DialogInterface dialog, int whichButton) { if (whichButton != -2) { if (app != null) { @@ -473,6 +474,7 @@ protected void initializeLogHandler() { handler.setLevel(Level.ALL); } + @Override public void initialize() { app.initialize(); if (handleExitHook) { @@ -488,10 +490,12 @@ public void initialize() { } } + @Override public void reshape(int width, int height) { app.reshape(width, height); } + @Override public void update() { app.update(); // call to remove the splash screen, if present. @@ -503,10 +507,12 @@ public void update() { } } + @Override public void requestClose(boolean esc) { app.requestClose(esc); } + @Override public void destroy() { if (app != null) { app.destroy(); @@ -516,6 +522,7 @@ public void destroy() { } } + @Override public void gainFocus() { logger.fine("gainFocus"); if (view != null) { @@ -547,6 +554,7 @@ public void gainFocus() { } } + @Override public void loseFocus() { logger.fine("loseFocus"); if (app != null) { diff --git a/jme3-android/src/main/java/com/jme3/app/AndroidHarnessFragment.java b/jme3-android/src/main/java/com/jme3/app/AndroidHarnessFragment.java index ed8976955f..073feb3fe4 100644 --- a/jme3-android/src/main/java/com/jme3/app/AndroidHarnessFragment.java +++ b/jme3-android/src/main/java/com/jme3/app/AndroidHarnessFragment.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -684,10 +684,10 @@ public void onLayoutChange(View v, if (viewWidth > viewHeight && viewWidth > maxResolutionDimension) { // landscape fixedSizeWidth = maxResolutionDimension; - fixedSizeHeight = (int)(maxResolutionDimension * ((float)viewHeight / (float)viewWidth)); + fixedSizeHeight = (int)(maxResolutionDimension * (viewHeight / (float)viewWidth)); } else if (viewHeight > viewWidth && viewHeight > maxResolutionDimension) { // portrait - fixedSizeWidth = (int)(maxResolutionDimension * ((float)viewWidth / (float)viewHeight)); + fixedSizeWidth = (int)(maxResolutionDimension * (viewWidth / (float)viewHeight)); fixedSizeHeight = maxResolutionDimension; } else if (viewWidth == viewHeight && viewWidth > maxResolutionDimension) { fixedSizeWidth = maxResolutionDimension; diff --git a/jme3-android/src/main/java/com/jme3/app/DefaultAndroidProfiler.java b/jme3-android/src/main/java/com/jme3/app/DefaultAndroidProfiler.java index 4faa8aa898..3c4e95bf68 100644 --- a/jme3-android/src/main/java/com/jme3/app/DefaultAndroidProfiler.java +++ b/jme3-android/src/main/java/com/jme3/app/DefaultAndroidProfiler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 jMonkeyEngine + * Copyright (c) 2014-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -82,6 +82,7 @@ public class DefaultAndroidProfiler implements AppProfiler { private int androidApiLevel = Build.VERSION.SDK_INT; + @Override public void appStep(AppStep appStep) { if (androidApiLevel >= 18) { switch(appStep) { @@ -140,6 +141,7 @@ public void appSubStep(String... additionalInfo) { } + @Override public void vpStep(VpStep vpStep, ViewPort vp, RenderQueue.Bucket bucket) { if (androidApiLevel >= 18) { switch (vpStep) { diff --git a/jme3-android/src/main/java/com/jme3/app/state/MjpegFileWriter.java b/jme3-android/src/main/java/com/jme3/app/state/MjpegFileWriter.java index 9a8361f440..61a1a5a399 100644 --- a/jme3-android/src/main/java/com/jme3/app/state/MjpegFileWriter.java +++ b/jme3-android/src/main/java/com/jme3/app/state/MjpegFileWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -478,7 +478,7 @@ public byte[] toBytes() throws Exception { baos.write(fcc); baos.write(intBytes(swapInt(cb))); for (int i = 0; i < ind.size(); i++) { - AVIIndex in = (AVIIndex) ind.get(i); + AVIIndex in = ind.get(i); baos.write(in.toBytes()); } diff --git a/jme3-android/src/main/java/com/jme3/app/state/VideoRecorderAppState.java b/jme3-android/src/main/java/com/jme3/app/state/VideoRecorderAppState.java index f89a49879d..22e15c9611 100644 --- a/jme3-android/src/main/java/com/jme3/app/state/VideoRecorderAppState.java +++ b/jme3-android/src/main/java/com/jme3/app/state/VideoRecorderAppState.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -73,6 +73,7 @@ public class VideoRecorderAppState extends AbstractAppState { private Application app; private ExecutorService executor = Executors.newCachedThreadPool(new ThreadFactory() { + @Override public Thread newThread(Runnable r) { Thread th = new Thread(r); th.setName("jME3 Video Processor"); @@ -239,6 +240,7 @@ public void addImage(Renderer renderer, FrameBuffer out) { renderer.readFrameBufferWithFormat(out, item.buffer, Image.Format.BGRA8); executor.submit(new Callable() { + @Override public Void call() throws Exception { if (fastMode) { item.data = item.buffer.array(); @@ -260,6 +262,7 @@ public Void call() throws Exception { } } + @Override public void initialize(RenderManager rm, ViewPort viewPort) { logger.log(Level.INFO, "initialize in VideoProcessor"); this.camera = viewPort.getCamera(); @@ -275,13 +278,16 @@ public void initialize(RenderManager rm, ViewPort viewPort) { } } + @Override public void reshape(ViewPort vp, int w, int h) { } + @Override public boolean isInitialized() { return this.isInitilized; } + @Override public void preFrame(float tpf) { if (null == writer) { try { @@ -292,14 +298,17 @@ public void preFrame(float tpf) { } } + @Override public void postQueue(RenderQueue rq) { } + @Override public void postFrame(FrameBuffer out) { numFrames++; addImage(renderManager.getRenderer(), out); } + @Override public void cleanup() { logger.log(Level.INFO, "cleanup in VideoProcessor"); logger.log(Level.INFO, "VideoProcessor numFrames: {0}", numFrames); @@ -332,22 +341,27 @@ public IsoTimer(float framerate) { this.ticks = 0; } + @Override public long getTime() { return (long) (this.ticks * (1.0f / this.framerate) * 1000f); } + @Override public long getResolution() { return 1000L; } + @Override public float getFrameRate() { return this.framerate; } + @Override public float getTimePerFrame() { - return (float) (1.0f / this.framerate); + return 1.0f / this.framerate; } + @Override public void update() { long time = System.currentTimeMillis(); long difference = time - lastTime; @@ -364,6 +378,7 @@ public void update() { this.ticks++; } + @Override public void reset() { this.ticks = 0; } diff --git a/jme3-android/src/main/java/com/jme3/asset/plugins/AndroidLocator.java b/jme3-android/src/main/java/com/jme3/asset/plugins/AndroidLocator.java index 7c7200bb92..6beeac2567 100644 --- a/jme3-android/src/main/java/com/jme3/asset/plugins/AndroidLocator.java +++ b/jme3-android/src/main/java/com/jme3/asset/plugins/AndroidLocator.java @@ -17,6 +17,7 @@ public class AndroidLocator implements AssetLocator { public AndroidLocator() { } + @Override public void setRootPath(String rootPath) { this.rootPath = rootPath; } diff --git a/jme3-android/src/main/java/com/jme3/audio/android/AndroidAL.java b/jme3-android/src/main/java/com/jme3/audio/android/AndroidAL.java index 2a0634c919..3dc8b4bbb2 100644 --- a/jme3-android/src/main/java/com/jme3/audio/android/AndroidAL.java +++ b/jme3-android/src/main/java/com/jme3/audio/android/AndroidAL.java @@ -10,44 +10,64 @@ public final class AndroidAL implements AL { public AndroidAL() { } + @Override public native String alGetString(int parameter); + @Override public native int alGenSources(); + @Override public native int alGetError(); + @Override public native void alDeleteSources(int numSources, IntBuffer sources); + @Override public native void alGenBuffers(int numBuffers, IntBuffer buffers); + @Override public native void alDeleteBuffers(int numBuffers, IntBuffer buffers); + @Override public native void alSourceStop(int source); + @Override public native void alSourcei(int source, int param, int value); + @Override public native void alBufferData(int buffer, int format, ByteBuffer data, int size, int frequency); + @Override public native void alSourcePlay(int source); + @Override public native void alSourcePause(int source); + @Override public native void alSourcef(int source, int param, float value); + @Override public native void alSource3f(int source, int param, float value1, float value2, float value3); + @Override public native int alGetSourcei(int source, int param); + @Override public native void alSourceUnqueueBuffers(int source, int numBuffers, IntBuffer buffers); + @Override public native void alSourceQueueBuffers(int source, int numBuffers, IntBuffer buffers); + @Override public native void alListener(int param, FloatBuffer data); + @Override public native void alListenerf(int param, float value); + @Override public native void alListener3f(int param, float value1, float value2, float value3); + @Override public native void alSource3i(int source, int param, int value1, int value2, int value3); } diff --git a/jme3-android/src/main/java/com/jme3/audio/android/AndroidALC.java b/jme3-android/src/main/java/com/jme3/audio/android/AndroidALC.java index a2f0a4eb62..f05cfd03d0 100644 --- a/jme3-android/src/main/java/com/jme3/audio/android/AndroidALC.java +++ b/jme3-android/src/main/java/com/jme3/audio/android/AndroidALC.java @@ -12,19 +12,27 @@ public final class AndroidALC implements ALC { public AndroidALC() { } + @Override public native void createALC(); + @Override public native void destroyALC(); + @Override public native boolean isCreated(); + @Override public native String alcGetString(int parameter); + @Override public native boolean alcIsExtensionPresent(String extension); + @Override public native void alcGetInteger(int param, IntBuffer buffer, int size); + @Override public native void alcDevicePauseSOFT(); + @Override public native void alcDeviceResumeSOFT(); } diff --git a/jme3-android/src/main/java/com/jme3/audio/android/AndroidEFX.java b/jme3-android/src/main/java/com/jme3/audio/android/AndroidEFX.java index 271d2d507e..3fa6e5e6aa 100644 --- a/jme3-android/src/main/java/com/jme3/audio/android/AndroidEFX.java +++ b/jme3-android/src/main/java/com/jme3/audio/android/AndroidEFX.java @@ -8,25 +8,36 @@ public class AndroidEFX implements EFX { public AndroidEFX() { } + @Override public native void alGenAuxiliaryEffectSlots(int numSlots, IntBuffer buffers); + @Override public native void alGenEffects(int numEffects, IntBuffer buffers); + @Override public native void alEffecti(int effect, int param, int value); + @Override public native void alAuxiliaryEffectSloti(int effectSlot, int param, int value); + @Override public native void alDeleteEffects(int numEffects, IntBuffer buffers); + @Override public native void alDeleteAuxiliaryEffectSlots(int numEffectSlots, IntBuffer buffers); + @Override public native void alGenFilters(int numFilters, IntBuffer buffers); + @Override public native void alFilteri(int filter, int param, int value); + @Override public native void alFilterf(int filter, int param, float value); + @Override public native void alDeleteFilters(int numFilters, IntBuffer buffers); + @Override public native void alEffectf(int effect, int param, float value); } diff --git a/jme3-android/src/main/java/com/jme3/audio/plugins/NativeVorbisLoader.java b/jme3-android/src/main/java/com/jme3/audio/plugins/NativeVorbisLoader.java index c4daf9d7b4..3093b0d4b2 100644 --- a/jme3-android/src/main/java/com/jme3/audio/plugins/NativeVorbisLoader.java +++ b/jme3-android/src/main/java/com/jme3/audio/plugins/NativeVorbisLoader.java @@ -46,6 +46,7 @@ public long skip(long n) throws IOException { throw new IOException("Not supported for audio streams"); } + @Override public void setTime(float time) { try { file.seekTime(time); diff --git a/jme3-android/src/main/java/com/jme3/input/android/AndroidSensorJoyInput.java b/jme3-android/src/main/java/com/jme3/input/android/AndroidSensorJoyInput.java index 4232e60827..ef9df8faf0 100644 --- a/jme3-android/src/main/java/com/jme3/input/android/AndroidSensorJoyInput.java +++ b/jme3-android/src/main/java/com/jme3/input/android/AndroidSensorJoyInput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -561,7 +561,7 @@ public void onSensorChanged(SensorEvent se) { } } } - } else if (sensorData != null) { + } else { if (!sensorData.haveData) { sensorData.haveData = true; } diff --git a/jme3-android/src/main/java/com/jme3/input/android/AndroidTouchInput.java b/jme3-android/src/main/java/com/jme3/input/android/AndroidTouchInput.java index 0a7fc38381..d02801d0e1 100644 --- a/jme3-android/src/main/java/com/jme3/input/android/AndroidTouchInput.java +++ b/jme3-android/src/main/java/com/jme3/input/android/AndroidTouchInput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -131,8 +131,8 @@ public void loadSettings(AppSettings settings) { // view width and height are 0 until the view is displayed on the screen if (androidInput.getView().getWidth() != 0 && androidInput.getView().getHeight() != 0) { - scaleX = (float)settings.getWidth() / (float)androidInput.getView().getWidth(); - scaleY = (float)settings.getHeight() / (float)androidInput.getView().getHeight(); + scaleX = settings.getWidth() / (float)androidInput.getView().getWidth(); + scaleY = settings.getHeight() / (float)androidInput.getView().getHeight(); } logger.log(Level.FINE, "Setting input scaling, scaleX: {0}, scaleY: {1}", new Object[]{scaleX, scaleY}); diff --git a/jme3-android/src/main/java/com/jme3/input/android/TouchEventPool.java b/jme3-android/src/main/java/com/jme3/input/android/TouchEventPool.java index 400a3bd38d..2bea5a8cd9 100644 --- a/jme3-android/src/main/java/com/jme3/input/android/TouchEventPool.java +++ b/jme3-android/src/main/java/com/jme3/input/android/TouchEventPool.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -87,7 +87,7 @@ public TouchEvent getNextFreeEvent() { TouchEvent evt = null; int curSize = eventPool.size(); while (curSize > 0) { - evt = (TouchEvent)eventPool.pop(); + evt = eventPool.pop(); if (evt.isConsumed()) { break; } else { diff --git a/jme3-android/src/main/java/com/jme3/renderer/android/AndroidGL.java b/jme3-android/src/main/java/com/jme3/renderer/android/AndroidGL.java index ced4260ea5..f2a99d10ce 100644 --- a/jme3-android/src/main/java/com/jme3/renderer/android/AndroidGL.java +++ b/jme3-android/src/main/java/com/jme3/renderer/android/AndroidGL.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2015 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -46,6 +46,7 @@ public class AndroidGL implements GL, GL2, GLES_30, GLExt, GLFbo { IntBuffer tmpBuff = BufferUtils.createIntBuffer(1); + @Override public void resetStats() { } @@ -86,10 +87,12 @@ private static void checkLimit(Buffer buffer) { } } + @Override public void glActiveTexture(int texture) { GLES20.glActiveTexture(texture); } + @Override public void glAttachShader(int program, int shader) { GLES20.glAttachShader(program, shader); } @@ -99,144 +102,179 @@ public void glBeginQuery(int target, int query) { GLES30.glBeginQuery(target, query); } + @Override public void glBindBuffer(int target, int buffer) { GLES20.glBindBuffer(target, buffer); } + @Override public void glBindTexture(int target, int texture) { GLES20.glBindTexture(target, texture); } + @Override public void glBlendFunc(int sfactor, int dfactor) { GLES20.glBlendFunc(sfactor, dfactor); } + @Override public void glBlendFuncSeparate(int sfactorRGB, int dfactorRGB, int sfactorAlpha, int dfactorAlpha) { GLES20.glBlendFuncSeparate(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha); } + @Override public void glBufferData(int target, FloatBuffer data, int usage) { GLES20.glBufferData(target, getLimitBytes(data), data, usage); } + @Override public void glBufferData(int target, ShortBuffer data, int usage) { GLES20.glBufferData(target, getLimitBytes(data), data, usage); } + @Override public void glBufferData(int target, ByteBuffer data, int usage) { GLES20.glBufferData(target, getLimitBytes(data), data, usage); } + @Override public void glBufferData(int target, long data_size, int usage) { GLES20.glBufferData(target, (int) data_size, null, usage); } + @Override public void glBufferSubData(int target, long offset, FloatBuffer data) { GLES20.glBufferSubData(target, (int) offset, getLimitBytes(data), data); } + @Override public void glBufferSubData(int target, long offset, ShortBuffer data) { GLES20.glBufferSubData(target, (int) offset, getLimitBytes(data), data); } + @Override public void glBufferSubData(int target, long offset, ByteBuffer data) { GLES20.glBufferSubData(target, (int) offset, getLimitBytes(data), data); } + @Override public void glGetBufferSubData(int target, long offset, ByteBuffer data) { throw new UnsupportedOperationException("OpenGL ES 2 does not support glGetBufferSubData"); } + @Override public void glClear(int mask) { GLES20.glClear(mask); } + @Override public void glClearColor(float red, float green, float blue, float alpha) { GLES20.glClearColor(red, green, blue, alpha); } + @Override public void glColorMask(boolean red, boolean green, boolean blue, boolean alpha) { GLES20.glColorMask(red, green, blue, alpha); } + @Override public void glCompileShader(int shader) { GLES20.glCompileShader(shader); } + @Override public void glCompressedTexImage2D(int target, int level, int internalformat, int width, int height, int border, ByteBuffer data) { GLES20.glCompressedTexImage2D(target, level, internalformat, width, height, 0, getLimitBytes(data), data); } + @Override public void glCompressedTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, ByteBuffer data) { GLES20.glCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, getLimitBytes(data), data); } + @Override public int glCreateProgram() { return GLES20.glCreateProgram(); } + @Override public int glCreateShader(int shaderType) { return GLES20.glCreateShader(shaderType); } + @Override public void glCullFace(int mode) { GLES20.glCullFace(mode); } + @Override public void glDeleteBuffers(IntBuffer buffers) { checkLimit(buffers); GLES20.glDeleteBuffers(buffers.limit(), buffers); } + @Override public void glDeleteProgram(int program) { GLES20.glDeleteProgram(program); } + @Override public void glDeleteShader(int shader) { GLES20.glDeleteShader(shader); } + @Override public void glDeleteTextures(IntBuffer textures) { checkLimit(textures); GLES20.glDeleteTextures(textures.limit(), textures); } + @Override public void glDepthFunc(int func) { GLES20.glDepthFunc(func); } + @Override public void glDepthMask(boolean flag) { GLES20.glDepthMask(flag); } + @Override public void glDepthRange(double nearVal, double farVal) { GLES20.glDepthRangef((float)nearVal, (float)farVal); } + @Override public void glDetachShader(int program, int shader) { GLES20.glDetachShader(program, shader); } + @Override public void glDisable(int cap) { GLES20.glDisable(cap); } + @Override public void glDisableVertexAttribArray(int index) { GLES20.glDisableVertexAttribArray(index); } + @Override public void glDrawArrays(int mode, int first, int count) { GLES20.glDrawArrays(mode, first, count); } + @Override public void glDrawRangeElements(int mode, int start, int end, int count, int type, long indices) { GLES20.glDrawElements(mode, count, type, (int)indices); } + @Override public void glEnable(int cap) { GLES20.glEnable(cap); } + @Override public void glEnableVertexAttribArray(int index) { GLES20.glEnableVertexAttribArray(index); } @@ -246,11 +284,13 @@ public void glEndQuery(int target) { GLES30.glEndQuery(target); } + @Override public void glGenBuffers(IntBuffer buffers) { checkLimit(buffers); GLES20.glGenBuffers(buffers.limit(), buffers); } + @Override public void glGenTextures(IntBuffer textures) { checkLimit(textures); GLES20.glGenTextures(textures.limit(), textures); @@ -261,29 +301,35 @@ public void glGenQueries(int num, IntBuffer buff) { GLES30.glGenQueries(num, buff); } + @Override public int glGetAttribLocation(int program, String name) { return GLES20.glGetAttribLocation(program, name); } + @Override public void glGetBoolean(int pname, ByteBuffer params) { // GLES20.glGetBoolean(pname, params); throw new UnsupportedOperationException("Today is not a good day for this"); } + @Override public int glGetError() { return GLES20.glGetError(); } + @Override public void glGetInteger(int pname, IntBuffer params) { checkLimit(params); GLES20.glGetIntegerv(pname, params); } + @Override public void glGetProgram(int program, int pname, IntBuffer params) { checkLimit(params); GLES20.glGetProgramiv(program, pname, params); } + @Override public String glGetProgramInfoLog(int program, int maxLength) { return GLES20.glGetProgramInfoLog(program); } @@ -303,51 +349,63 @@ public int glGetQueryObjectiv(int query, int pname) { return buff.get(0); } + @Override public void glGetShader(int shader, int pname, IntBuffer params) { checkLimit(params); GLES20.glGetShaderiv(shader, pname, params); } + @Override public String glGetShaderInfoLog(int shader, int maxLength) { return GLES20.glGetShaderInfoLog(shader); } + @Override public String glGetString(int name) { return GLES20.glGetString(name); } + @Override public int glGetUniformLocation(int program, String name) { return GLES20.glGetUniformLocation(program, name); } + @Override public boolean glIsEnabled(int cap) { return GLES20.glIsEnabled(cap); } + @Override public void glLineWidth(float width) { GLES20.glLineWidth(width); } + @Override public void glLinkProgram(int program) { GLES20.glLinkProgram(program); } + @Override public void glPixelStorei(int pname, int param) { GLES20.glPixelStorei(pname, param); } + @Override public void glPolygonOffset(float factor, float units) { GLES20.glPolygonOffset(factor, units); } + @Override public void glReadPixels(int x, int y, int width, int height, int format, int type, ByteBuffer data) { GLES20.glReadPixels(x, y, width, height, format, type, data); } + @Override public void glScissor(int x, int y, int width, int height) { GLES20.glScissor(x, y, width, height); } + @Override public void glShaderSource(int shader, String[] string, IntBuffer length) { if (string.length != 1) { throw new UnsupportedOperationException("Today is not a good day"); @@ -355,186 +413,231 @@ public void glShaderSource(int shader, String[] string, IntBuffer length) { GLES20.glShaderSource(shader, string[0]); } + @Override public void glStencilFuncSeparate(int face, int func, int ref, int mask) { GLES20.glStencilFuncSeparate(face, func, ref, mask); } + @Override public void glStencilOpSeparate(int face, int sfail, int dpfail, int dppass) { GLES20.glStencilOpSeparate(face, sfail, dpfail, dppass); } + @Override public void glTexImage2D(int target, int level, int internalFormat, int width, int height, int border, int format, int type, ByteBuffer data) { GLES20.glTexImage2D(target, level, internalFormat, width, height, 0, format, type, data); } + @Override public void glTexParameterf(int target, int pname, float param) { GLES20.glTexParameterf(target, pname, param); } + @Override public void glTexParameteri(int target, int pname, int param) { GLES20.glTexParameteri(target, pname, param); } + @Override public void glTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int type, ByteBuffer data) { GLES20.glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, data); } + @Override public void glUniform1(int location, FloatBuffer value) { GLES20.glUniform1fv(location, getLimitCount(value, 1), value); } + @Override public void glUniform1(int location, IntBuffer value) { GLES20.glUniform1iv(location, getLimitCount(value, 1), value); } + @Override public void glUniform1f(int location, float v0) { GLES20.glUniform1f(location, v0); } + @Override public void glUniform1i(int location, int v0) { GLES20.glUniform1i(location, v0); } + @Override public void glUniform2(int location, IntBuffer value) { GLES20.glUniform2iv(location, getLimitCount(value, 2), value); } + @Override public void glUniform2(int location, FloatBuffer value) { GLES20.glUniform2fv(location, getLimitCount(value, 2), value); } + @Override public void glUniform2f(int location, float v0, float v1) { GLES20.glUniform2f(location, v0, v1); } + @Override public void glUniform3(int location, IntBuffer value) { GLES20.glUniform3iv(location, getLimitCount(value, 3), value); } + @Override public void glUniform3(int location, FloatBuffer value) { GLES20.glUniform3fv(location, getLimitCount(value, 3), value); } + @Override public void glUniform3f(int location, float v0, float v1, float v2) { GLES20.glUniform3f(location, v0, v1, v2); } + @Override public void glUniform4(int location, FloatBuffer value) { GLES20.glUniform4fv(location, getLimitCount(value, 4), value); } + @Override public void glUniform4(int location, IntBuffer value) { GLES20.glUniform4iv(location, getLimitCount(value, 4), value); } + @Override public void glUniform4f(int location, float v0, float v1, float v2, float v3) { GLES20.glUniform4f(location, v0, v1, v2, v3); } + @Override public void glUniformMatrix3(int location, boolean transpose, FloatBuffer value) { GLES20.glUniformMatrix3fv(location, getLimitCount(value, 3 * 3), transpose, value); } + @Override public void glUniformMatrix4(int location, boolean transpose, FloatBuffer value) { GLES20.glUniformMatrix4fv(location, getLimitCount(value, 4 * 4), transpose, value); } + @Override public void glUseProgram(int program) { GLES20.glUseProgram(program); } + @Override public void glVertexAttribPointer(int index, int size, int type, boolean normalized, int stride, long pointer) { GLES20.glVertexAttribPointer(index, size, type, normalized, stride, (int)pointer); } + @Override public void glViewport(int x, int y, int width, int height) { GLES20.glViewport(x, y, width, height); } + @Override public void glBlitFramebufferEXT(int srcX0, int srcY0, int srcX1, int srcY1, int dstX0, int dstY0, int dstX1, int dstY1, int mask, int filter) { GLES30.glBlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter); } + @Override public void glBufferData(int target, IntBuffer data, int usage) { GLES20.glBufferData(target, getLimitBytes(data), data, usage); } + @Override public void glBufferSubData(int target, long offset, IntBuffer data) { GLES20.glBufferSubData(target, (int)offset, getLimitBytes(data), data); } + @Override public void glDrawArraysInstancedARB(int mode, int first, int count, int primcount) { GLES30.glDrawArraysInstanced(mode, first, count, primcount); } + @Override public void glDrawBuffers(IntBuffer bufs) { GLES30.glDrawBuffers(bufs.limit(), bufs); } + @Override public void glDrawElementsInstancedARB(int mode, int indices_count, int type, long indices_buffer_offset, int primcount) { GLES30.glDrawElementsInstanced(mode, indices_count, type, (int)indices_buffer_offset, primcount); } + @Override public void glGetMultisample(int pname, int index, FloatBuffer val) { GLES31.glGetMultisamplefv(pname, index, val); } + @Override public void glRenderbufferStorageMultisampleEXT(int target, int samples, int internalformat, int width, int height) { GLES30.glRenderbufferStorageMultisample(target, samples, internalformat, width, height); } + @Override public void glTexImage2DMultisample(int target, int samples, int internalformat, int width, int height, boolean fixedsamplelocations) { GLES31.glTexStorage2DMultisample(target, samples, internalformat, width, height, fixedsamplelocations); } + @Override public void glVertexAttribDivisorARB(int index, int divisor) { GLES30.glVertexAttribDivisor(index, divisor); } + @Override public void glBindFramebufferEXT(int param1, int param2) { GLES20.glBindFramebuffer(param1, param2); } + @Override public void glBindRenderbufferEXT(int param1, int param2) { GLES20.glBindRenderbuffer(param1, param2); } + @Override public int glCheckFramebufferStatusEXT(int param1) { return GLES20.glCheckFramebufferStatus(param1); } + @Override public void glDeleteFramebuffersEXT(IntBuffer param1) { checkLimit(param1); GLES20.glDeleteFramebuffers(param1.limit(), param1); } + @Override public void glDeleteRenderbuffersEXT(IntBuffer param1) { checkLimit(param1); GLES20.glDeleteRenderbuffers(param1.limit(), param1); } + @Override public void glFramebufferRenderbufferEXT(int param1, int param2, int param3, int param4) { GLES20.glFramebufferRenderbuffer(param1, param2, param3, param4); } + @Override public void glFramebufferTexture2DEXT(int param1, int param2, int param3, int param4, int param5) { GLES20.glFramebufferTexture2D(param1, param2, param3, param4, param5); } + @Override public void glGenFramebuffersEXT(IntBuffer param1) { checkLimit(param1); GLES20.glGenFramebuffers(param1.limit(), param1); } + @Override public void glGenRenderbuffersEXT(IntBuffer param1) { checkLimit(param1); GLES20.glGenRenderbuffers(param1.limit(), param1); } + @Override public void glGenerateMipmapEXT(int param1) { GLES20.glGenerateMipmap(param1); } + @Override public void glRenderbufferStorageEXT(int param1, int param2, int param3, int param4) { GLES20.glRenderbufferStorage(param1, param2, param3, param4); } @@ -570,16 +673,20 @@ public void glFramebufferTextureLayerEXT(int target, int attachment, int texture GLES30.glFramebufferTextureLayer(target, attachment, texture, level, layer); } + @Override public void glAlphaFunc(int func, float ref) { } + @Override public void glPointSize(float size) { } + @Override public void glPolygonMode(int face, int mode) { } // Wrapper to DrawBuffers as there's no DrawBuffer method in GLES + @Override public void glDrawBuffer(int mode) { tmpBuff.clear(); tmpBuff.put(0, mode); @@ -587,25 +694,30 @@ public void glDrawBuffer(int mode) { glDrawBuffers(tmpBuff); } + @Override public void glReadBuffer(int mode) { GLES30.glReadBuffer(mode); } + @Override public void glCompressedTexImage3D(int target, int level, int internalFormat, int width, int height, int depth, int border, ByteBuffer data) { GLES30.glCompressedTexImage3D(target, level, internalFormat, width, height, depth, border, getLimitBytes(data), data); } + @Override public void glCompressedTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, ByteBuffer data) { GLES30.glCompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, getLimitBytes(data), data); } + @Override public void glTexImage3D(int target, int level, int internalFormat, int width, int height, int depth, int border, int format, int type, ByteBuffer data) { GLES30.glTexImage3D(target, level, internalFormat, width, height, depth, border, format, type, data); } + @Override public void glTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, ByteBuffer data) { GLES30.glTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, data); diff --git a/jme3-android/src/main/java/com/jme3/system/android/JmeAndroidSystem.java b/jme3-android/src/main/java/com/jme3/system/android/JmeAndroidSystem.java index efaf4f3bbb..260aa46626 100644 --- a/jme3-android/src/main/java/com/jme3/system/android/JmeAndroidSystem.java +++ b/jme3-android/src/main/java/com/jme3/system/android/JmeAndroidSystem.java @@ -204,6 +204,7 @@ public static String getAudioRendererType() { public void showSoftKeyboard(final boolean show) { view.getHandler().post(new Runnable() { + @Override public void run() { InputMethodManager manager = (InputMethodManager)view.getContext().getSystemService(Context.INPUT_METHOD_SERVICE); diff --git a/jme3-android/src/main/java/com/jme3/system/android/OGLESContext.java b/jme3-android/src/main/java/com/jme3/system/android/OGLESContext.java index 7ea954eac4..f1c99cebd2 100644 --- a/jme3-android/src/main/java/com/jme3/system/android/OGLESContext.java +++ b/jme3-android/src/main/java/com/jme3/system/android/OGLESContext.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -202,6 +202,7 @@ protected void initInThread() { // Setup unhandled Exception Handler Thread.currentThread().setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() { + @Override public void uncaughtException(Thread thread, Throwable thrown) { listener.handleError("Exception thrown in " + thread.toString(), thrown); } @@ -254,7 +255,7 @@ public void setSettings(AppSettings settings) { } if (settings.getFrameRate() > 0) { - minFrameDuration = (long)(1000d / (double)settings.getFrameRate()); // ms + minFrameDuration = (long)(1000d / settings.getFrameRate()); // ms logger.log(Level.FINE, "Setting min tpf: {0}ms", minFrameDuration); } else { minFrameDuration = 0; @@ -414,6 +415,7 @@ protected void waitFor(boolean createdVal) { } } + @Override public void requestDialog(final int id, final String title, final String initialValue, final SoftTextDialogInputListener listener) { logger.log(Level.FINE, "requestDialog: title: {0}, initialValue: {1}", new Object[]{title, initialValue}); @@ -457,6 +459,7 @@ public void run() { AlertDialog dialogTextInput = new AlertDialog.Builder(view.getContext()).setTitle(title).setView(layoutTextDialogInput).setPositiveButton("OK", new DialogInterface.OnClickListener() { + @Override public void onClick(DialogInterface dialog, int whichButton) { /* User clicked OK, send COMPLETE action * and text */ @@ -464,6 +467,7 @@ public void onClick(DialogInterface dialog, int whichButton) { } }).setNegativeButton("Cancel", new DialogInterface.OnClickListener() { + @Override public void onClick(DialogInterface dialog, int whichButton) { /* User clicked CANCEL, send CANCEL action * and text */ diff --git a/jme3-android/src/main/java/com/jme3/texture/plugins/AndroidBufferImageLoader.java b/jme3-android/src/main/java/com/jme3/texture/plugins/AndroidBufferImageLoader.java index bf2abb7a4d..1ee3d3a800 100644 --- a/jme3-android/src/main/java/com/jme3/texture/plugins/AndroidBufferImageLoader.java +++ b/jme3-android/src/main/java/com/jme3/texture/plugins/AndroidBufferImageLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2014 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -67,6 +67,7 @@ private static void convertARGBtoABGR(int[] src, int srcOff, int[] dst, int dstO } } + @Override public Object load(AssetInfo assetInfo) throws IOException { Bitmap bitmap = null; Image.Format format; diff --git a/jme3-android/src/main/java/com/jme3/texture/plugins/AndroidNativeImageLoader.java b/jme3-android/src/main/java/com/jme3/texture/plugins/AndroidNativeImageLoader.java index 7267d3501b..af08dc4da4 100644 --- a/jme3-android/src/main/java/com/jme3/texture/plugins/AndroidNativeImageLoader.java +++ b/jme3-android/src/main/java/com/jme3/texture/plugins/AndroidNativeImageLoader.java @@ -25,6 +25,7 @@ public class AndroidNativeImageLoader implements AssetLoader { private static native Image load(InputStream in, boolean flipY, byte[] tmpArray) throws IOException; + @Override public Image load(AssetInfo info) throws IOException { boolean flip = ((TextureKey) info.getKey()).isFlipY(); InputStream in = null; diff --git a/jme3-android/src/main/java/com/jme3/util/RingBuffer.java b/jme3-android/src/main/java/com/jme3/util/RingBuffer.java index 1d3c22d7e5..f4b50c24d5 100644 --- a/jme3-android/src/main/java/com/jme3/util/RingBuffer.java +++ b/jme3-android/src/main/java/com/jme3/util/RingBuffer.java @@ -49,6 +49,7 @@ public T pop() { return item; } + @Override public Iterator iterator() { return new RingBufferIterator(); } @@ -58,14 +59,17 @@ private class RingBufferIterator implements Iterator { private int i = 0; + @Override public boolean hasNext() { return i < count; } + @Override public void remove() { throw new UnsupportedOperationException(); } + @Override public T next() { if (!hasNext()) { throw new NoSuchElementException(); diff --git a/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/file/Structure.java b/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/file/Structure.java index fac6597c5e..da3076e2ac 100644 --- a/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/file/Structure.java +++ b/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/file/Structure.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -252,7 +252,7 @@ public String getName() { Object fieldValue = this.getFieldValue("ID"); if (fieldValue instanceof Structure) { Structure id = (Structure) fieldValue; - return id == null ? null : id.getFieldValue("name").toString().substring(2);// blender adds 2-charactes as a name prefix + return id.getFieldValue("name").toString().substring(2);// blender adds 2-charactes as a name prefix } Object name = this.getFieldValue("name", null); return name == null ? null : name.toString().substring(2); diff --git a/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/materials/MaterialHelper.java b/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/materials/MaterialHelper.java index 885c5850e8..50aa6275e1 100644 --- a/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/materials/MaterialHelper.java +++ b/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/materials/MaterialHelper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -100,9 +100,11 @@ public MaterialHelper(String blenderVersion, BlenderContext blenderContext) { super(blenderVersion, blenderContext); // setting alpha masks alphaMasks.put(ALPHA_MASK_NONE, new IAlphaMask() { + @Override public void setImageSize(int width, int height) { } + @Override public byte getAlpha(float x, float y) { return (byte) 255; } @@ -111,11 +113,13 @@ public byte getAlpha(float x, float y) { private float r; private float[] center; + @Override public void setImageSize(int width, int height) { r = Math.min(width, height) * 0.5f; center = new float[] { width * 0.5f, height * 0.5f }; } + @Override public byte getAlpha(float x, float y) { float d = FastMath.abs(FastMath.sqrt((x - center[0]) * (x - center[0]) + (y - center[1]) * (y - center[1]))); return (byte) (d >= r ? 0 : 255); @@ -125,11 +129,13 @@ public byte getAlpha(float x, float y) { private float r; private float[] center; + @Override public void setImageSize(int width, int height) { r = Math.min(width, height) * 0.5f; center = new float[] { width * 0.5f, height * 0.5f }; } + @Override public byte getAlpha(float x, float y) { float d = FastMath.abs(FastMath.sqrt((x - center[0]) * (x - center[0]) + (y - center[1]) * (y - center[1]))); return (byte) (d >= r ? 0 : -255.0f * d / r + 255.0f); @@ -139,11 +145,13 @@ public byte getAlpha(float x, float y) { private float r; private float[] center; + @Override public void setImageSize(int width, int height) { r = Math.min(width, height) * 0.5f; center = new float[] { width * 0.5f, height * 0.5f }; } + @Override public byte getAlpha(float x, float y) { float d = FastMath.abs(FastMath.sqrt((x - center[0]) * (x - center[0]) + (y - center[1]) * (y - center[1]))) / r; return d >= 1.0f ? 0 : (byte) ((-FastMath.sqrt((2.0f - d) * d) + 1.0f) * 255.0f); diff --git a/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/math/DQuaternion.java b/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/math/DQuaternion.java index 9739ccd4be..11715434d0 100644 --- a/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/math/DQuaternion.java +++ b/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/math/DQuaternion.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -554,6 +554,7 @@ public int hashCode() { } + @Override public void write(JmeExporter e) throws IOException { OutputCapsule cap = e.getCapsule(this); cap.write(x, "x", 0); @@ -562,6 +563,7 @@ public void write(JmeExporter e) throws IOException { cap.write(w, "w", 1); } + @Override public void read(JmeImporter e) throws IOException { InputCapsule cap = e.getCapsule(this); x = cap.readFloat("x", 0); diff --git a/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/math/DTransform.java b/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/math/DTransform.java index 28fcda0c73..ea2440e58e 100644 --- a/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/math/DTransform.java +++ b/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/math/DTransform.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -158,6 +158,7 @@ public String toString() { return this.getClass().getSimpleName() + "[ " + translation.x + ", " + translation.y + ", " + translation.z + "]\n" + "[ " + rotation.x + ", " + rotation.y + ", " + rotation.z + ", " + rotation.w + "]\n" + "[ " + scale.x + " , " + scale.y + ", " + scale.z + "]"; } + @Override public void write(JmeExporter e) throws IOException { OutputCapsule capsule = e.getCapsule(this); capsule.write(rotation, "rot", new DQuaternion()); @@ -165,6 +166,7 @@ public void write(JmeExporter e) throws IOException { capsule.write(scale, "scale", Vector3d.UNIT_XYZ); } + @Override public void read(JmeImporter e) throws IOException { InputCapsule capsule = e.getCapsule(this); diff --git a/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/math/Vector3d.java b/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/math/Vector3d.java index 92453cfa37..ed3fca0f6d 100644 --- a/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/math/Vector3d.java +++ b/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/math/Vector3d.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -851,6 +851,7 @@ public String toString() { return "(" + x + ", " + y + ", " + z + ")"; } + @Override public void write(JmeExporter e) throws IOException { OutputCapsule capsule = e.getCapsule(this); capsule.write(x, "x", 0); @@ -858,6 +859,7 @@ public void write(JmeExporter e) throws IOException { capsule.write(z, "z", 0); } + @Override public void read(JmeImporter e) throws IOException { InputCapsule capsule = e.getCapsule(this); x = capsule.readDouble("x", 0); diff --git a/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/meshes/MeshBuffers.java b/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/meshes/MeshBuffers.java index 0ec120bad3..a14d77004c 100644 --- a/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/meshes/MeshBuffers.java +++ b/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/meshes/MeshBuffers.java @@ -251,7 +251,7 @@ public void append(boolean smooth, Vector3f[] verts, Vector3f[] normals, Map 0) { + if (vertexGroups.size() > 0) { Map group = vertexGroups.get(i); maximumWeightsPerVertex = Math.max(maximumWeightsPerVertex, group.size()); boneWeightAndIndexes.add(new TreeMap(group)); diff --git a/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/textures/GeneratedTexture.java b/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/textures/GeneratedTexture.java index 772db0c3ce..2eb5430e55 100644 --- a/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/textures/GeneratedTexture.java +++ b/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/textures/GeneratedTexture.java @@ -160,6 +160,7 @@ public TriangulatedTexture triangulate(Mesh mesh, Long geometriesOMA, UVCoordina Vector3f[] uvsArray = uvs.toArray(new Vector3f[uvs.size()]); BoundingBox boundingBox = UVCoordinatesGenerator.getBoundingBox(geometries); Set triangleTextureElements = new TreeSet(new Comparator() { + @Override public int compare(TriangleTextureElement o1, TriangleTextureElement o2) { return o1.faceIndex - o2.faceIndex; } diff --git a/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/textures/TriangulatedTexture.java b/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/textures/TriangulatedTexture.java index 9a48891098..bb63f37ccc 100644 --- a/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/textures/TriangulatedTexture.java +++ b/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/textures/TriangulatedTexture.java @@ -70,6 +70,7 @@ public TriangulatedTexture(Texture2D texture2d, List uvs, BlenderContext blenderContext) { maxTextureSize = blenderContext.getBlenderKey().getMaxTextureSize(); faceTextures = new TreeSet(new Comparator() { + @Override public int compare(TriangleTextureElement o1, TriangleTextureElement o2) { return o1.faceIndex - o2.faceIndex; } @@ -184,6 +185,7 @@ public Texture2D getResultTexture(boolean rebuild) { // sorting the parts by their height (from highest to the lowest) List list = new ArrayList(faceTextures); Collections.sort(list, new Comparator() { + @Override public int compare(TriangleTextureElement o1, TriangleTextureElement o2) { return o2.image.getHeight() - o1.image.getHeight(); } diff --git a/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/textures/blending/AbstractTextureBlender.java b/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/textures/blending/AbstractTextureBlender.java index 8ff55baac5..d1e0e31ae9 100644 --- a/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/textures/blending/AbstractTextureBlender.java +++ b/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/textures/blending/AbstractTextureBlender.java @@ -103,6 +103,7 @@ protected void blendHSV(int type, float[] materialRGB, float fac, float[] pixelC } } + @Override public void copyBlendingData(TextureBlender textureBlender) { if (textureBlender instanceof AbstractTextureBlender) { flag = ((AbstractTextureBlender) textureBlender).flag; diff --git a/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/textures/blending/TextureBlenderLuminance.java b/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/textures/blending/TextureBlenderLuminance.java index 1f2ae01e18..24349c809c 100644 --- a/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/textures/blending/TextureBlenderLuminance.java +++ b/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/textures/blending/TextureBlenderLuminance.java @@ -43,6 +43,7 @@ public TextureBlenderLuminance(int flag, boolean negateTexture, int blendType, f super(flag, negateTexture, blendType, materialColor, color, blendFactor); } + @Override public Image blend(Image image, Image baseImage, BlenderContext blenderContext) { this.prepareImagesForBlending(image, baseImage); diff --git a/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/textures/generating/NoiseGenerator.java b/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/textures/generating/NoiseGenerator.java index f3b1c30b92..7847f255fc 100644 --- a/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/textures/generating/NoiseGenerator.java +++ b/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/textures/generating/NoiseGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -109,30 +109,36 @@ public NoiseGenerator() { static { noiseFunctions.put(Integer.valueOf(0), new NoiseFunction() { // originalBlenderNoise + @Override public float execute(float x, float y, float z) { return NoiseFunctions.originalBlenderNoise(x, y, z); } + @Override public float executeSigned(float x, float y, float z) { return 2.0f * NoiseFunctions.originalBlenderNoise(x, y, z) - 1.0f; } }); noiseFunctions.put(Integer.valueOf(1), new NoiseFunction() { // orgPerlinNoise + @Override public float execute(float x, float y, float z) { return 0.5f + 0.5f * NoiseFunctions.noise3Perlin(x, y, z); } + @Override public float executeSigned(float x, float y, float z) { return NoiseFunctions.noise3Perlin(x, y, z); } }); noiseFunctions.put(Integer.valueOf(2), new NoiseFunction() { // newPerlin + @Override public float execute(float x, float y, float z) { return 0.5f + 0.5f * NoiseFunctions.newPerlin(x, y, z); } + @Override public float executeSigned(float x, float y, float z) { return this.execute(x, y, z); } @@ -142,11 +148,13 @@ public float executeSigned(float x, float y, float z) { private final float[] pa = new float[12]; // voronoi_F1 + @Override public float execute(float x, float y, float z) { NoiseFunctions.voronoi(x, y, z, da, pa, 1, NATURAL_DISTANCE_FUNCTION); return da[0]; } + @Override public float executeSigned(float x, float y, float z) { NoiseFunctions.voronoi(x, y, z, da, pa, 1, NATURAL_DISTANCE_FUNCTION); return 2.0f * da[0] - 1.0f; @@ -157,11 +165,13 @@ public float executeSigned(float x, float y, float z) { private final float[] pa = new float[12]; // voronoi_F2 + @Override public float execute(float x, float y, float z) { NoiseFunctions.voronoi(x, y, z, da, pa, 1, NATURAL_DISTANCE_FUNCTION); return da[1]; } + @Override public float executeSigned(float x, float y, float z) { NoiseFunctions.voronoi(x, y, z, da, pa, 1, NATURAL_DISTANCE_FUNCTION); return 2.0f * da[1] - 1.0f; @@ -172,11 +182,13 @@ public float executeSigned(float x, float y, float z) { private final float[] pa = new float[12]; // voronoi_F3 + @Override public float execute(float x, float y, float z) { NoiseFunctions.voronoi(x, y, z, da, pa, 1, NATURAL_DISTANCE_FUNCTION); return da[2]; } + @Override public float executeSigned(float x, float y, float z) { NoiseFunctions.voronoi(x, y, z, da, pa, 1, NATURAL_DISTANCE_FUNCTION); return 2.0f * da[2] - 1.0f; @@ -187,11 +199,13 @@ public float executeSigned(float x, float y, float z) { private final float[] pa = new float[12]; // voronoi_F4 + @Override public float execute(float x, float y, float z) { NoiseFunctions.voronoi(x, y, z, da, pa, 1, NATURAL_DISTANCE_FUNCTION); return da[3]; } + @Override public float executeSigned(float x, float y, float z) { NoiseFunctions.voronoi(x, y, z, da, pa, 1, NATURAL_DISTANCE_FUNCTION); return 2.0f * da[3] - 1.0f; @@ -202,11 +216,13 @@ public float executeSigned(float x, float y, float z) { private final float[] pa = new float[12]; // voronoi_F1F2 + @Override public float execute(float x, float y, float z) { NoiseFunctions.voronoi(x, y, z, da, pa, 1, NATURAL_DISTANCE_FUNCTION); return da[1] - da[0]; } + @Override public float executeSigned(float x, float y, float z) { NoiseFunctions.voronoi(x, y, z, da, pa, 1, NATURAL_DISTANCE_FUNCTION); return 2.0f * (da[1] - da[0]) - 1.0f; @@ -216,11 +232,13 @@ public float executeSigned(float x, float y, float z) { private final NoiseFunction voronoiF1F2NoiseFunction = noiseFunctions.get(Integer.valueOf(7)); // voronoi_Cr + @Override public float execute(float x, float y, float z) { float t = 10 * voronoiF1F2NoiseFunction.execute(x, y, z); return t > 1.0f ? 1.0f : t; } + @Override public float executeSigned(float x, float y, float z) { float t = 10.0f * voronoiF1F2NoiseFunction.execute(x, y, z); return t > 1.0f ? 1.0f : 2.0f * t - 1.0f; @@ -228,6 +246,7 @@ public float executeSigned(float x, float y, float z) { }); noiseFunctions.put(Integer.valueOf(14), new NoiseFunction() { // cellNoise + @Override public float execute(float x, float y, float z) { int xi = (int) FastMath.floor(x); int yi = (int) FastMath.floor(y); @@ -237,6 +256,7 @@ public float execute(float x, float y, float z) { return (n * (n * n * 15731 + 789221) + 1376312589) / 4294967296.0f; } + @Override public float executeSigned(float x, float y, float z) { return 2.0f * this.execute(x, y, z) - 1.0f; } @@ -248,24 +268,28 @@ public float executeSigned(float x, float y, float z) { static { distanceFunctions.put(Integer.valueOf(0), new DistanceFunction() { // real distance + @Override public float execute(float x, float y, float z, float e) { return (float) Math.sqrt(x * x + y * y + z * z); } }); distanceFunctions.put(Integer.valueOf(1), new DistanceFunction() { // distance squared + @Override public float execute(float x, float y, float z, float e) { return x * x + y * y + z * z; } }); distanceFunctions.put(Integer.valueOf(2), new DistanceFunction() { // manhattan/taxicab/cityblock distance + @Override public float execute(float x, float y, float z, float e) { return FastMath.abs(x) + FastMath.abs(y) + FastMath.abs(z); } }); distanceFunctions.put(Integer.valueOf(3), new DistanceFunction() { // Chebychev + @Override public float execute(float x, float y, float z, float e) { x = FastMath.abs(x); y = FastMath.abs(y); @@ -276,6 +300,7 @@ public float execute(float x, float y, float z, float e) { }); distanceFunctions.put(Integer.valueOf(4), new DistanceFunction() { // Minkovsky, preset exponent 0.5 (MinkovskyH) + @Override public float execute(float x, float y, float z, float e) { float d = (float) (Math.sqrt(FastMath.abs(x)) + Math.sqrt(FastMath.abs(y)) + Math.sqrt(FastMath.abs(z))); return d * d; @@ -283,6 +308,7 @@ public float execute(float x, float y, float z, float e) { }); distanceFunctions.put(Integer.valueOf(5), new DistanceFunction() { // Minkovsky, preset exponent 0.25 (Minkovsky4) + @Override public float execute(float x, float y, float z, float e) { x *= x; y *= y; @@ -292,6 +318,7 @@ public float execute(float x, float y, float z, float e) { }); distanceFunctions.put(Integer.valueOf(6), new DistanceFunction() { // Minkovsky, general case + @Override public float execute(float x, float y, float z, float e) { return (float) Math.pow(Math.pow(FastMath.abs(x), e) + Math.pow(FastMath.abs(y), e) + Math.pow(FastMath.abs(z), e), 1.0f / e); } @@ -303,6 +330,7 @@ public float execute(float x, float y, float z, float e) { static { musgraveFunctions.put(Integer.valueOf(TEX_MFRACTAL), new MusgraveFunction() { + @Override public float execute(MusgraveData musgraveData, float x, float y, float z) { float rmd, value = 1.0f, pwr = 1.0f, pwHL = (float) Math.pow(musgraveData.lacunarity, -musgraveData.h); @@ -322,6 +350,7 @@ public float execute(MusgraveData musgraveData, float x, float y, float z) { }); musgraveFunctions.put(Integer.valueOf(TEX_RIDGEDMF), new MusgraveFunction() { + @Override public float execute(MusgraveData musgraveData, float x, float y, float z) { float result, signal, weight; float pwHL = (float) Math.pow(musgraveData.lacunarity, -musgraveData.h); @@ -353,6 +382,7 @@ public float execute(MusgraveData musgraveData, float x, float y, float z) { }); musgraveFunctions.put(Integer.valueOf(TEX_HYBRIDMF), new MusgraveFunction() { + @Override public float execute(MusgraveData musgraveData, float x, float y, float z) { float result, signal, weight, rmd; float pwHL = (float) Math.pow(musgraveData.lacunarity, -musgraveData.h); @@ -386,6 +416,7 @@ public float execute(MusgraveData musgraveData, float x, float y, float z) { }); musgraveFunctions.put(Integer.valueOf(TEX_FBM), new MusgraveFunction() { + @Override public float execute(MusgraveData musgraveData, float x, float y, float z) { float rmd, value = 0.0f, pwr = 1.0f, pwHL = (float) Math.pow(musgraveData.lacunarity, -musgraveData.h); @@ -406,6 +437,7 @@ public float execute(MusgraveData musgraveData, float x, float y, float z) { }); musgraveFunctions.put(Integer.valueOf(TEX_HTERRAIN), new MusgraveFunction() { + @Override public float execute(MusgraveData musgraveData, float x, float y, float z) { float value, increment, rmd; float pwHL = (float) Math.pow(musgraveData.lacunarity, -musgraveData.h); @@ -464,7 +496,7 @@ public static float turbulence(float x, float y, float z, float noiseSize, int n sum += t * amp; } - sum *= (float) (1 << noiseDepth) / (float) ((1 << noiseDepth + 1) - 1); + sum *= (1 << noiseDepth) / (float) ((1 << noiseDepth + 1) - 1); return sum; } diff --git a/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/textures/generating/TextureGeneratorBlend.java b/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/textures/generating/TextureGeneratorBlend.java index eabe6fa745..f822e54273 100644 --- a/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/textures/generating/TextureGeneratorBlend.java +++ b/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/textures/generating/TextureGeneratorBlend.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -46,17 +46,20 @@ public final class TextureGeneratorBlend extends TextureGenerator { private static final IntensityFunction INTENSITY_FUNCTION[] = new IntensityFunction[7]; static { INTENSITY_FUNCTION[0] = new IntensityFunction() {// Linear: stype = 0 (TEX_LIN) + @Override public float getIntensity(float x, float y, float z) { return (1.0f + x) * 0.5f; } }; INTENSITY_FUNCTION[1] = new IntensityFunction() {// Quad: stype = 1 (TEX_QUAD) + @Override public float getIntensity(float x, float y, float z) { float result = (1.0f + x) * 0.5f; return result * result; } }; INTENSITY_FUNCTION[2] = new IntensityFunction() {// Ease: stype = 2 (TEX_EASE) + @Override public float getIntensity(float x, float y, float z) { float result = (1.0f + x) * 0.5f; if (result <= 0.0f) { @@ -69,23 +72,27 @@ public float getIntensity(float x, float y, float z) { } }; INTENSITY_FUNCTION[3] = new IntensityFunction() {// Diagonal: stype = 3 (TEX_DIAG) + @Override public float getIntensity(float x, float y, float z) { return (2.0f + x + y) * 0.25f; } }; INTENSITY_FUNCTION[4] = new IntensityFunction() {// Sphere: stype = 4 (TEX_SPHERE) + @Override public float getIntensity(float x, float y, float z) { float result = 1.0f - (float) Math.sqrt(x * x + y * y + z * z); return result < 0.0f ? 0.0f : result; } }; INTENSITY_FUNCTION[5] = new IntensityFunction() {// Halo: stype = 5 (TEX_HALO) + @Override public float getIntensity(float x, float y, float z) { float result = 1.0f - (float) Math.sqrt(x * x + y * y + z * z); return result <= 0.0f ? 0.0f : result * result; } }; INTENSITY_FUNCTION[6] = new IntensityFunction() {// Radial: stype = 6 (TEX_RAD) + @Override public float getIntensity(float x, float y, float z) { return (float) Math.atan2(y, x) * FastMath.INV_TWO_PI + 0.5f; } diff --git a/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/textures/generating/TextureGeneratorFactory.java b/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/textures/generating/TextureGeneratorFactory.java index a0e29f1b3a..a0eda9adc4 100644 --- a/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/textures/generating/TextureGeneratorFactory.java +++ b/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/textures/generating/TextureGeneratorFactory.java @@ -16,8 +16,6 @@ public TextureGenerator createTextureGenerator(int generatedTexture) { return new TextureGeneratorDistnoise(noiseGenerator); case TextureHelper.TEX_MAGIC: return new TextureGeneratorMagic(noiseGenerator); - case TextureHelper.TEX_MARBLE: - return new TextureGeneratorMarble(noiseGenerator); case TextureHelper.TEX_MUSGRAVE: return new TextureGeneratorMusgrave(noiseGenerator); case TextureHelper.TEX_NOISE: @@ -26,8 +24,6 @@ public TextureGenerator createTextureGenerator(int generatedTexture) { return new TextureGeneratorStucci(noiseGenerator); case TextureHelper.TEX_VORONOI: return new TextureGeneratorVoronoi(noiseGenerator); - case TextureHelper.TEX_WOOD: - return new TextureGeneratorWood(noiseGenerator); default: throw new IllegalStateException("Unknown generated texture type: " + generatedTexture); } diff --git a/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/textures/generating/TextureGeneratorMagic.java b/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/textures/generating/TextureGeneratorMagic.java index 6f3d7b599b..ff7d071967 100644 --- a/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/textures/generating/TextureGeneratorMagic.java +++ b/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/textures/generating/TextureGeneratorMagic.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -45,51 +45,61 @@ public class TextureGeneratorMagic extends TextureGenerator { private static NoiseDepthFunction[] noiseDepthFunctions = new NoiseDepthFunction[10]; static { noiseDepthFunctions[0] = new NoiseDepthFunction() { + @Override public void compute(float[] xyz, float turbulence) { xyz[1] = -(float) Math.cos(xyz[0] - xyz[1] + xyz[2]) * turbulence; } }; noiseDepthFunctions[1] = new NoiseDepthFunction() { + @Override public void compute(float[] xyz, float turbulence) { xyz[0] = (float) Math.cos(xyz[0] - xyz[1] - xyz[2]) * turbulence; } }; noiseDepthFunctions[2] = new NoiseDepthFunction() { + @Override public void compute(float[] xyz, float turbulence) { xyz[2] = (float) Math.sin(-xyz[0] - xyz[1] - xyz[2]) * turbulence; } }; noiseDepthFunctions[3] = new NoiseDepthFunction() { + @Override public void compute(float[] xyz, float turbulence) { xyz[0] = -(float) Math.cos(-xyz[0] + xyz[1] - xyz[2]) * turbulence; } }; noiseDepthFunctions[4] = new NoiseDepthFunction() { + @Override public void compute(float[] xyz, float turbulence) { xyz[1] = -(float) Math.sin(-xyz[0] + xyz[1] + xyz[2]) * turbulence; } }; noiseDepthFunctions[5] = new NoiseDepthFunction() { + @Override public void compute(float[] xyz, float turbulence) { xyz[1] = -(float) Math.cos(-xyz[0] + xyz[1] + xyz[2]) * turbulence; } }; noiseDepthFunctions[6] = new NoiseDepthFunction() { + @Override public void compute(float[] xyz, float turbulence) { xyz[0] = (float) Math.cos(xyz[0] + xyz[1] + xyz[2]) * turbulence; } }; noiseDepthFunctions[7] = new NoiseDepthFunction() { + @Override public void compute(float[] xyz, float turbulence) { xyz[2] = (float) Math.sin(xyz[0] + xyz[1] - xyz[2]) * turbulence; } }; noiseDepthFunctions[8] = new NoiseDepthFunction() { + @Override public void compute(float[] xyz, float turbulence) { xyz[0] = -(float) Math.cos(-xyz[0] - xyz[1] + xyz[2]) * turbulence; } }; noiseDepthFunctions[9] = new NoiseDepthFunction() { + @Override public void compute(float[] xyz, float turbulence) { xyz[1] = -(float) Math.sin(xyz[0] - xyz[1] + xyz[2]) * turbulence; } diff --git a/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/textures/generating/TextureGeneratorMarble.java b/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/textures/generating/TextureGeneratorMarble.java deleted file mode 100644 index 9dc7403b12..0000000000 --- a/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/textures/generating/TextureGeneratorMarble.java +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright (c) 2009-2012 jMonkeyEngine - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * * Neither the name of 'jMonkeyEngine' nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -package com.jme3.scene.plugins.blender.textures.generating; - -import com.jme3.scene.plugins.blender.BlenderContext; -import com.jme3.scene.plugins.blender.file.Structure; -import com.jme3.scene.plugins.blender.textures.TexturePixel; -import com.jme3.scene.plugins.blender.textures.generating.NoiseGenerator.NoiseFunction; - -/** - * This class generates the 'marble' texture. - * @author Marcin Roguski (Kaelthas) - */ -public class TextureGeneratorMarble extends TextureGeneratorWood { - // tex->stype - protected static final int TEX_SOFT = 0; - protected static final int TEX_SHARP = 1; - protected static final int TEX_SHARPER = 2; - - protected MarbleData marbleData; - protected int noisebasis; - protected NoiseFunction noiseFunction; - - /** - * Constructor stores the given noise generator. - * @param noiseGenerator - * the noise generator - */ - public TextureGeneratorMarble(NoiseGenerator noiseGenerator) { - super(noiseGenerator); - } - - @Override - public void readData(Structure tex, BlenderContext blenderContext) { - super.readData(tex, blenderContext); - marbleData = new MarbleData(tex); - noisebasis = marbleData.noisebasis; - noiseFunction = NoiseGenerator.noiseFunctions.get(noisebasis); - if (noiseFunction == null) { - noiseFunction = NoiseGenerator.noiseFunctions.get(0); - noisebasis = 0; - } - } - - @Override - public void getPixel(TexturePixel pixel, float x, float y, float z) { - pixel.intensity = this.marbleInt(marbleData, x, y, z); - if (colorBand != null) { - int colorbandIndex = (int) (pixel.intensity * 1000.0f); - pixel.red = colorBand[colorbandIndex][0]; - pixel.green = colorBand[colorbandIndex][1]; - pixel.blue = colorBand[colorbandIndex][2]; - - this.applyBrightnessAndContrast(bacd, pixel); - pixel.alpha = colorBand[colorbandIndex][3]; - } else { - this.applyBrightnessAndContrast(pixel, bacd.contrast, bacd.brightness); - } - } - - public float marbleInt(MarbleData marbleData, float x, float y, float z) { - int waveform; - if (marbleData.waveform > TEX_TRI || marbleData.waveform < TEX_SIN) { - waveform = 0; - } else { - waveform = marbleData.waveform; - } - - float n = 5.0f * (x + y + z); - if (noisebasis == 0) { - ++x; - ++y; - ++z; - } - float mi = n + marbleData.turbul * NoiseGenerator.NoiseFunctions.turbulence(x, y, z, marbleData.noisesize, marbleData.noisedepth, noiseFunction, marbleData.isHard); - - if (marbleData.stype >= TEX_SOFT) { - mi = waveformFunctions[waveform].execute(mi); - if (marbleData.stype == TEX_SHARP) { - mi = (float) Math.sqrt(mi); - } else if (marbleData.stype == TEX_SHARPER) { - mi = (float) Math.sqrt(Math.sqrt(mi)); - } - } - return mi; - } - - private static class MarbleData { - public final float noisesize; - public final int noisebasis; - public final int noisedepth; - public final int stype; - public final float turbul; - public final int waveform; - public final boolean isHard; - - public MarbleData(Structure tex) { - noisesize = ((Number) tex.getFieldValue("noisesize")).floatValue(); - noisebasis = ((Number) tex.getFieldValue("noisebasis")).intValue(); - noisedepth = ((Number) tex.getFieldValue("noisedepth")).intValue(); - stype = ((Number) tex.getFieldValue("stype")).intValue(); - turbul = ((Number) tex.getFieldValue("turbul")).floatValue(); - int noisetype = ((Number) tex.getFieldValue("noisetype")).intValue(); - waveform = ((Number) tex.getFieldValue("noisebasis2")).intValue(); - isHard = noisetype != TEX_NOISESOFT; - } - } -} diff --git a/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/textures/generating/TextureGeneratorWood.java b/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/textures/generating/TextureGeneratorWood.java deleted file mode 100644 index 94cf2af4ce..0000000000 --- a/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/textures/generating/TextureGeneratorWood.java +++ /dev/null @@ -1,206 +0,0 @@ -/* - * - * $Id: noise.c 14611 2008-04-29 08:24:33Z campbellbarton $ - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - * - */ -package com.jme3.scene.plugins.blender.textures.generating; - -import com.jme3.math.FastMath; -import com.jme3.scene.plugins.blender.BlenderContext; -import com.jme3.scene.plugins.blender.file.Structure; -import com.jme3.scene.plugins.blender.textures.TexturePixel; -import com.jme3.scene.plugins.blender.textures.generating.NoiseGenerator.NoiseFunction; -import com.jme3.texture.Image.Format; - -/** - * This class generates the 'wood' texture. - * @author Marcin Roguski (Kaelthas) - */ -public class TextureGeneratorWood extends TextureGenerator { - // tex->noisebasis2 - protected static final int TEX_SIN = 0; - protected static final int TEX_SAW = 1; - protected static final int TEX_TRI = 2; - - // tex->stype - protected static final int TEX_BAND = 0; - protected static final int TEX_RING = 1; - protected static final int TEX_BANDNOISE = 2; - protected static final int TEX_RINGNOISE = 3; - - // tex->noisetype - protected static final int TEX_NOISESOFT = 0; - protected static final int TEX_NOISEPERL = 1; - - protected WoodIntensityData woodIntensityData; - - /** - * Constructor stores the given noise generator. - * @param noiseGenerator - * the noise generator - */ - public TextureGeneratorWood(NoiseGenerator noiseGenerator) { - super(noiseGenerator, Format.Luminance8); - } - - @Override - public void readData(Structure tex, BlenderContext blenderContext) { - super.readData(tex, blenderContext); - woodIntensityData = new WoodIntensityData(tex); - } - - @Override - public void getPixel(TexturePixel pixel, float x, float y, float z) { - pixel.intensity = this.woodIntensity(woodIntensityData, x, y, z); - - if (colorBand != null) { - int colorbandIndex = (int) (pixel.intensity * 1000.0f); - pixel.red = colorBand[colorbandIndex][0]; - pixel.green = colorBand[colorbandIndex][1]; - pixel.blue = colorBand[colorbandIndex][2]; - - this.applyBrightnessAndContrast(bacd, pixel); - pixel.alpha = colorBand[colorbandIndex][3]; - } else { - this.applyBrightnessAndContrast(pixel, bacd.contrast, bacd.brightness); - } - } - - protected static WaveForm[] waveformFunctions = new WaveForm[3]; - static { - waveformFunctions[0] = new WaveForm() {// sinus (TEX_SIN) - - public float execute(float x) { - return 0.5f + 0.5f * (float) Math.sin(x); - } - }; - waveformFunctions[1] = new WaveForm() {// saw (TEX_SAW) - - public float execute(float x) { - int n = (int) (x * FastMath.INV_TWO_PI); - x -= n * FastMath.TWO_PI; - if (x < 0.0f) { - x += FastMath.TWO_PI; - } - return x * FastMath.INV_TWO_PI; - } - }; - waveformFunctions[2] = new WaveForm() {// triangle (TEX_TRI) - - public float execute(float x) { - return 1.0f - 2.0f * FastMath.abs((float) Math.floor(x * FastMath.INV_TWO_PI + 0.5f) - x * FastMath.INV_TWO_PI); - } - }; - } - - /** - * Computes basic wood intensity value at x,y,z. - * @param woodIntData - * @param x - * X coordinate of the texture pixel - * @param y - * Y coordinate of the texture pixel - * @param z - * Z coordinate of the texture pixel - * @return wood intensity at position [x, y, z] - */ - public float woodIntensity(WoodIntensityData woodIntData, float x, float y, float z) { - float result; - - switch (woodIntData.woodType) { - case TEX_BAND: - result = woodIntData.waveformFunction.execute((x + y + z) * 10.0f); - break; - case TEX_RING: - result = woodIntData.waveformFunction.execute((float) Math.sqrt(x * x + y * y + z * z) * 20.0f); - break; - case TEX_BANDNOISE: - if (woodIntData.noisebasis == 0) { - ++x; - ++y; - ++z; - } - result = woodIntData.turbul * NoiseGenerator.NoiseFunctions.noise(x, y, z, woodIntData.noisesize, 0, woodIntData.noiseFunction, woodIntData.isHard); - result = woodIntData.waveformFunction.execute((x + y + z) * 10.0f + result); - break; - case TEX_RINGNOISE: - if (woodIntData.noisebasis == 0) { - ++x; - ++y; - ++z; - } - result = woodIntData.turbul * NoiseGenerator.NoiseFunctions.noise(x, y, z, woodIntData.noisesize, 0, woodIntData.noiseFunction, woodIntData.isHard); - result = woodIntData.waveformFunction.execute((float) Math.sqrt(x * x + y * y + z * z) * 20.0f + result); - break; - default: - result = 0; - } - return result; - } - - /** - * A class that collects the data for wood intensity calculations. - * @author Marcin Roguski (Kaelthas) - */ - private static class WoodIntensityData { - public final WaveForm waveformFunction; - public final int noisebasis; - public NoiseFunction noiseFunction; - - public final float noisesize; - public final float turbul; - public final int noiseType; - public final int woodType; - public final boolean isHard; - - public WoodIntensityData(Structure tex) { - int waveform = ((Number) tex.getFieldValue("noisebasis2")).intValue();// wave form: TEX_SIN=0, TEX_SAW=1, TEX_TRI=2 - if (waveform > TEX_TRI || waveform < TEX_SIN) { - waveform = 0; // check to be sure noisebasis2 is initialized ahead of time - } - waveformFunction = waveformFunctions[waveform]; - int noisebasis = ((Number) tex.getFieldValue("noisebasis")).intValue(); - if (noiseFunction == null) { - noiseFunction = NoiseGenerator.noiseFunctions.get(0); - noisebasis = 0; - } - this.noisebasis = noisebasis; - - woodType = ((Number) tex.getFieldValue("stype")).intValue(); - noisesize = ((Number) tex.getFieldValue("noisesize")).floatValue(); - turbul = ((Number) tex.getFieldValue("turbul")).floatValue(); - noiseType = ((Number) tex.getFieldValue("noisetype")).intValue(); - isHard = noiseType != TEX_NOISESOFT; - } - } - - protected static interface WaveForm { - - float execute(float x); - } -} diff --git a/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/textures/io/AWTPixelInputOutput.java b/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/textures/io/AWTPixelInputOutput.java index 569c328be8..8409f29ece 100644 --- a/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/textures/io/AWTPixelInputOutput.java +++ b/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/textures/io/AWTPixelInputOutput.java @@ -11,6 +11,7 @@ * @author Marcin Roguski (Kaelthas) */ /* package */class AWTPixelInputOutput implements PixelInputOutput { + @Override public void read(Image image, int layer, TexturePixel pixel, int index) { ByteBuffer data = image.getData(layer); switch (image.getFormat()) { @@ -64,11 +65,13 @@ public void read(Image image, int layer, TexturePixel pixel, int index) { } } + @Override public void read(Image image, int layer, TexturePixel pixel, int x, int y) { int index = (y * image.getWidth() + x) * (image.getFormat().getBitsPerPixel() >> 3); this.read(image, layer, pixel, index); } + @Override public void write(Image image, int layer, TexturePixel pixel, int index) { ByteBuffer data = image.getData(layer); switch (image.getFormat()) { @@ -149,6 +152,7 @@ public void write(Image image, int layer, TexturePixel pixel, int index) { } } + @Override public void write(Image image, int layer, TexturePixel pixel, int x, int y) { int index = (y * image.getWidth() + x) * (image.getFormat().getBitsPerPixel() >> 3); this.write(image, layer, pixel, index); diff --git a/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/textures/io/DDSPixelInputOutput.java b/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/textures/io/DDSPixelInputOutput.java index d82f164a14..c5ffdb7f95 100644 --- a/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/textures/io/DDSPixelInputOutput.java +++ b/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/textures/io/DDSPixelInputOutput.java @@ -15,10 +15,12 @@ /** * For this class the index should be considered as a pixel index in AWT image format. */ + @Override public void read(Image image, int layer, TexturePixel pixel, int index) { this.read(image, layer, pixel, index % image.getWidth(), index / image.getWidth()); } + @Override public void read(Image image, int layer, TexturePixel pixel, int x, int y) { int xTexetlIndex = x % image.getWidth() >> 2; int yTexelIndex = y % image.getHeight() >> 2; @@ -161,10 +163,12 @@ public void read(Image image, int layer, TexturePixel pixel, int x, int y) { pixel.alpha = alpha; } + @Override public void write(Image image, int layer, TexturePixel pixel, int index) { throw new UnsupportedOperationException("Cannot put the DXT pixel by index because not every index contains the pixel color!"); } + @Override public void write(Image image, int layer, TexturePixel pixel, int x, int y) { throw new UnsupportedOperationException("Writing to DDS texture pixel by pixel is not yet supported!"); } diff --git a/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/textures/io/LuminancePixelInputOutput.java b/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/textures/io/LuminancePixelInputOutput.java index fae236edcb..0df0c4566a 100644 --- a/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/textures/io/LuminancePixelInputOutput.java +++ b/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/textures/io/LuminancePixelInputOutput.java @@ -11,6 +11,7 @@ * @author Marcin Roguski (Kaelthas) */ /* package */class LuminancePixelInputOutput implements PixelInputOutput { + @Override public void read(Image image, int layer, TexturePixel pixel, int index) { ByteBuffer data = image.getData(layer); switch (image.getFormat()) { @@ -36,11 +37,13 @@ public void read(Image image, int layer, TexturePixel pixel, int index) { } } + @Override public void read(Image image, int layer, TexturePixel pixel, int x, int y) { int index = y * image.getWidth() + x; this.read(image, layer, pixel, index); } + @Override public void write(Image image, int layer, TexturePixel pixel, int index) { ByteBuffer data = image.getData(layer); data.put(index, pixel.getInt()); @@ -67,6 +70,7 @@ public void write(Image image, int layer, TexturePixel pixel, int index) { } } + @Override public void write(Image image, int layer, TexturePixel pixel, int x, int y) { int index = y * image.getWidth() + x; this.write(image, layer, pixel, index); diff --git a/jme3-bullet/src/common/java/com/jme3/bullet/BulletAppState.java b/jme3-bullet/src/common/java/com/jme3/bullet/BulletAppState.java index 2dc46906ce..3ae2fdae06 100644 --- a/jme3-bullet/src/common/java/com/jme3/bullet/BulletAppState.java +++ b/jme3-bullet/src/common/java/com/jme3/bullet/BulletAppState.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -182,6 +182,7 @@ private boolean startPhysicsOnExecutor() { executor = new ScheduledThreadPoolExecutor(1); final BulletAppState app = this; Callable call = new Callable() { + @Override public Boolean call() throws Exception { detachedPhysicsLastUpdate = System.currentTimeMillis(); pSpace = new PhysicsSpace(worldMin, worldMax, broadphaseType); @@ -200,6 +201,7 @@ public Boolean call() throws Exception { } } private Callable parallelPhysicsUpdate = new Callable() { + @Override public Boolean call() throws Exception { pSpace.update(tpf * getSpeed()); return true; @@ -207,6 +209,7 @@ public Boolean call() throws Exception { }; long detachedPhysicsLastUpdate = 0; private Callable detachedPhysicsUpdate = new Callable() { + @Override public Boolean call() throws Exception { pSpace.update(getPhysicsSpace().getAccuracy() * getSpeed()); pSpace.distributeEvents(); @@ -484,6 +487,7 @@ public void setSpeed(float speed) { * @param space the space that is about to be stepped (not null) * @param f the time per physics step (in seconds, ≥0) */ + @Override public void prePhysicsTick(PhysicsSpace space, float f) { } @@ -494,6 +498,7 @@ public void prePhysicsTick(PhysicsSpace space, float f) { * @param space the space that is about to be stepped (not null) * @param f the time per physics step (in seconds, ≥0) */ + @Override public void physicsTick(PhysicsSpace space, float f) { } diff --git a/jme3-bullet/src/common/java/com/jme3/bullet/animation/BoneLink.java b/jme3-bullet/src/common/java/com/jme3/bullet/animation/BoneLink.java index 730b1b1708..1c76a31272 100644 --- a/jme3-bullet/src/common/java/com/jme3/bullet/animation/BoneLink.java +++ b/jme3-bullet/src/common/java/com/jme3/bullet/animation/BoneLink.java @@ -99,7 +99,7 @@ public class BoneLink extends PhysicsLink { * No-argument constructor needed by SavableClassUtil. Do not invoke * directly! */ - public BoneLink() { + protected BoneLink() { } /** diff --git a/jme3-bullet/src/common/java/com/jme3/bullet/animation/PhysicsLink.java b/jme3-bullet/src/common/java/com/jme3/bullet/animation/PhysicsLink.java index 22ed5a4da5..d6f5679176 100644 --- a/jme3-bullet/src/common/java/com/jme3/bullet/animation/PhysicsLink.java +++ b/jme3-bullet/src/common/java/com/jme3/bullet/animation/PhysicsLink.java @@ -130,7 +130,7 @@ abstract public class PhysicsLink * No-argument constructor needed by SavableClassUtil. Do not invoke * directly! */ - public PhysicsLink() { + protected PhysicsLink() { } /** diff --git a/jme3-bullet/src/common/java/com/jme3/bullet/animation/TorsoLink.java b/jme3-bullet/src/common/java/com/jme3/bullet/animation/TorsoLink.java index c44868116a..fcb3fdbdab 100644 --- a/jme3-bullet/src/common/java/com/jme3/bullet/animation/TorsoLink.java +++ b/jme3-bullet/src/common/java/com/jme3/bullet/animation/TorsoLink.java @@ -107,7 +107,7 @@ public class TorsoLink extends PhysicsLink { * No-argument constructor needed by SavableClassUtil. Do not invoke * directly! */ - public TorsoLink() { + protected TorsoLink() { } /** diff --git a/jme3-bullet/src/common/java/com/jme3/bullet/collision/shapes/infos/ChildCollisionShape.java b/jme3-bullet/src/common/java/com/jme3/bullet/collision/shapes/infos/ChildCollisionShape.java index 1ca8bc37c4..9665efde65 100644 --- a/jme3-bullet/src/common/java/com/jme3/bullet/collision/shapes/infos/ChildCollisionShape.java +++ b/jme3-bullet/src/common/java/com/jme3/bullet/collision/shapes/infos/ChildCollisionShape.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -65,7 +65,7 @@ public class ChildCollisionShape implements Savable { * No-argument constructor needed by SavableClassUtil. Do not invoke * directly! */ - public ChildCollisionShape() { + protected ChildCollisionShape() { } /** @@ -89,6 +89,7 @@ public ChildCollisionShape(Vector3f location, Matrix3f rotation, CollisionShape * @param ex exporter (not null) * @throws IOException from exporter */ + @Override public void write(JmeExporter ex) throws IOException { OutputCapsule capsule = ex.getCapsule(this); capsule.write(location, "location", new Vector3f()); @@ -102,6 +103,7 @@ public void write(JmeExporter ex) throws IOException { * @param im importer (not null) * @throws IOException from importer */ + @Override public void read(JmeImporter im) throws IOException { InputCapsule capsule = im.getCapsule(this); location = (Vector3f) capsule.readSavable("location", new Vector3f()); diff --git a/jme3-bullet/src/common/java/com/jme3/bullet/control/AbstractPhysicsControl.java b/jme3-bullet/src/common/java/com/jme3/bullet/control/AbstractPhysicsControl.java index 739701d9fc..38d0aa6d0e 100644 --- a/jme3-bullet/src/common/java/com/jme3/bullet/control/AbstractPhysicsControl.java +++ b/jme3-bullet/src/common/java/com/jme3/bullet/control/AbstractPhysicsControl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -231,6 +231,7 @@ public void cloneFields( Cloner cloner, Object original ) { * * @param spatial the spatial to control (or null) */ + @Override public void setSpatial(Spatial spatial) { if (this.spatial != null && this.spatial != spatial) { removeSpatialData(this.spatial); @@ -262,6 +263,7 @@ public Spatial getSpatial(){ * * @param enabled true→enable the control, false→disable it */ + @Override public void setEnabled(boolean enabled) { this.enabled = enabled; if (space != null) { @@ -284,13 +286,16 @@ public void setEnabled(boolean enabled) { * * @return true if enabled, otherwise false */ + @Override public boolean isEnabled() { return enabled; } + @Override public void update(float tpf) { } + @Override public void render(RenderManager rm, ViewPort vp) { } @@ -326,6 +331,7 @@ public void setPhysicsSpace(PhysicsSpace newSpace) { * * @return the pre-existing space, or null for none */ + @Override public PhysicsSpace getPhysicsSpace() { return space; } diff --git a/jme3-bullet/src/common/java/com/jme3/bullet/control/BetterCharacterControl.java b/jme3-bullet/src/common/java/com/jme3/bullet/control/BetterCharacterControl.java index 027d00f330..5fd6895c59 100644 --- a/jme3-bullet/src/common/java/com/jme3/bullet/control/BetterCharacterControl.java +++ b/jme3-bullet/src/common/java/com/jme3/bullet/control/BetterCharacterControl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -136,7 +136,7 @@ public class BetterCharacterControl extends AbstractPhysicsControl implements Ph * No-argument constructor needed by SavableClassUtil. Do not invoke * directly! */ - public BetterCharacterControl() { + protected BetterCharacterControl() { jumpForce = new Vector3f(); } @@ -194,6 +194,7 @@ public void render(RenderManager rm, ViewPort vp) { * @param space the space that is about to be stepped (not null) * @param tpf the time per physics step (in seconds, ≥0) */ + @Override public void prePhysicsTick(PhysicsSpace space, float tpf) { checkOnGround(); if (wantToUnDuck && checkCanUnDuck()) { @@ -245,6 +246,7 @@ public void prePhysicsTick(PhysicsSpace space, float tpf) { * @param space the space that was just stepped (not null) * @param tpf the time per physics step (in seconds, ≥0) */ + @Override public void physicsTick(PhysicsSpace space, float tpf) { rigidBody.getLinearVelocity(velocity); } diff --git a/jme3-bullet/src/common/java/com/jme3/bullet/control/CharacterControl.java b/jme3-bullet/src/common/java/com/jme3/bullet/control/CharacterControl.java index 2ee7fbe622..d83bec8908 100644 --- a/jme3-bullet/src/common/java/com/jme3/bullet/control/CharacterControl.java +++ b/jme3-bullet/src/common/java/com/jme3/bullet/control/CharacterControl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -120,6 +120,7 @@ public void cloneFields( Cloner cloner, Object original ) { this.spatial = cloner.clone(spatial); } + @Override public void setSpatial(Spatial spatial) { this.spatial = spatial; setUserObject(spatial); @@ -136,6 +137,7 @@ public Spatial getSpatial(){ return this.spatial; } + @Override public void setEnabled(boolean enabled) { this.enabled = enabled; if (space != null) { @@ -152,6 +154,7 @@ public void setEnabled(boolean enabled) { } } + @Override public boolean isEnabled() { return enabled; } @@ -172,6 +175,7 @@ public void setUseViewDirection(boolean viewDirectionEnabled) { this.useViewDirection = viewDirectionEnabled; } + @Override public void update(float tpf) { if (enabled && spatial != null) { Quaternion localRotationQuat = spatial.getLocalRotation(); @@ -195,6 +199,7 @@ public void update(float tpf) { } } + @Override public void render(RenderManager rm, ViewPort vp) { } @@ -225,6 +230,7 @@ public void setPhysicsSpace(PhysicsSpace newSpace) { space = newSpace; } + @Override public PhysicsSpace getPhysicsSpace() { return space; } diff --git a/jme3-bullet/src/common/java/com/jme3/bullet/control/GhostControl.java b/jme3-bullet/src/common/java/com/jme3/bullet/control/GhostControl.java index ca3fc72543..6bfb71fe8c 100644 --- a/jme3-bullet/src/common/java/com/jme3/bullet/control/GhostControl.java +++ b/jme3-bullet/src/common/java/com/jme3/bullet/control/GhostControl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -86,7 +86,7 @@ public class GhostControl extends PhysicsGhostObject implements PhysicsControl, * No-argument constructor needed by SavableClassUtil. Do not invoke * directly! */ - public GhostControl() { + protected GhostControl() { } /** @@ -196,6 +196,7 @@ public void cloneFields( Cloner cloner, Object original ) { * * @param spatial the spatial to control (or null) */ + @Override public void setSpatial(Spatial spatial) { this.spatial = spatial; setUserObject(spatial); @@ -222,6 +223,7 @@ public Spatial getSpatial(){ * * @param enabled true→enable the control, false→disable it */ + @Override public void setEnabled(boolean enabled) { this.enabled = enabled; if (space != null) { @@ -244,6 +246,7 @@ public void setEnabled(boolean enabled) { * * @return true if enabled, otherwise false */ + @Override public boolean isEnabled() { return enabled; } @@ -255,6 +258,7 @@ public boolean isEnabled() { * * @param tpf the time interval between frames (in seconds, ≥0) */ + @Override public void update(float tpf) { if (!enabled) { return; @@ -271,6 +275,7 @@ public void update(float tpf) { * @param rm the render manager (not null) * @param vp the view port to render (not null) */ + @Override public void render(RenderManager rm, ViewPort vp) { } @@ -307,6 +312,7 @@ public void setPhysicsSpace(PhysicsSpace newSpace) { * * @return the pre-existing space, or null for none */ + @Override public PhysicsSpace getPhysicsSpace() { return space; } diff --git a/jme3-bullet/src/common/java/com/jme3/bullet/control/KinematicRagdollControl.java b/jme3-bullet/src/common/java/com/jme3/bullet/control/KinematicRagdollControl.java index 8a99ddc226..93d6cc1d41 100644 --- a/jme3-bullet/src/common/java/com/jme3/bullet/control/KinematicRagdollControl.java +++ b/jme3-bullet/src/common/java/com/jme3/bullet/control/KinematicRagdollControl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -409,7 +409,7 @@ private void ikUpdate(float tpf){ while (it.hasNext()) { boneName = it.next(); - bone = (Bone) boneLinks.get(boneName).bone; + bone = boneLinks.get(boneName).bone; if (!bone.hasUserControl()) { Logger.getLogger(KinematicRagdollControl.class.getSimpleName()).log(Level.FINE, "{0} doesn't have user control", boneName); continue; @@ -421,7 +421,7 @@ private void ikUpdate(float tpf){ } int depth = 0; int maxDepth = ikChainDepth.get(bone.getName()); - updateBone(boneLinks.get(bone.getName()), tpf * (float) FastMath.sqrt(distance), vars, tmpRot1, tmpRot2, bone, ikTargets.get(boneName), depth, maxDepth); + updateBone(boneLinks.get(bone.getName()), tpf * FastMath.sqrt(distance), vars, tmpRot1, tmpRot2, bone, ikTargets.get(boneName), depth, maxDepth); Vector3f position = vars.vect1; @@ -693,10 +693,10 @@ protected void boneRecursion(Spatial model, Bone bone, PhysicsRigidBody parent, shape = RagdollUtils.makeShapeFromVerticeWeights(model, RagdollUtils.getBoneIndices(link.bone, skeleton, boneList), initScale, link.bone.getModelSpacePosition(), weightThreshold); } - PhysicsRigidBody shapeNode = new PhysicsRigidBody(shape, rootMass / (float) reccount); + PhysicsRigidBody shapeNode = new PhysicsRigidBody(shape, rootMass / reccount); shapeNode.setKinematic(mode == Mode.Kinematic); - totalMass += rootMass / (float) reccount; + totalMass += rootMass / reccount; link.rigidBody = shapeNode; link.initalWorldRotation = bone.getModelSpaceRotation().clone(); @@ -817,6 +817,7 @@ protected void removePhysics(PhysicsSpace space) { * * @param event (not null) */ + @Override public void collision(PhysicsCollisionEvent event) { PhysicsCollisionObject objA = event.getObjectA(); PhysicsCollisionObject objB = event.getObjectB(); diff --git a/jme3-bullet/src/common/java/com/jme3/bullet/control/RigidBodyControl.java b/jme3-bullet/src/common/java/com/jme3/bullet/control/RigidBodyControl.java index cee3401e1a..6377ee413b 100644 --- a/jme3-bullet/src/common/java/com/jme3/bullet/control/RigidBodyControl.java +++ b/jme3-bullet/src/common/java/com/jme3/bullet/control/RigidBodyControl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -89,7 +89,7 @@ public class RigidBodyControl extends PhysicsRigidBody implements PhysicsControl * No-argument constructor needed by SavableClassUtil. Do not invoke * directly! */ - public RigidBodyControl() { + protected RigidBodyControl() { } /** @@ -193,6 +193,7 @@ public void cloneFields( Cloner cloner, Object original ) { * * @param spatial the spatial to control (or null) */ + @Override public void setSpatial(Spatial spatial) { this.spatial = spatial; setUserObject(spatial); @@ -249,6 +250,7 @@ protected void createCollisionShape() { * * @param enabled true→enable the control, false→disable it */ + @Override public void setEnabled(boolean enabled) { this.enabled = enabled; if (space != null) { @@ -271,6 +273,7 @@ public void setEnabled(boolean enabled) { * * @return true if enabled, otherwise false */ + @Override public boolean isEnabled() { return enabled; } @@ -347,6 +350,7 @@ private Quaternion getSpatialRotation(){ * * @param tpf the time interval between frames (in seconds, ≥0) */ + @Override public void update(float tpf) { if (enabled && spatial != null) { if (isKinematic() && kinematicSpatial) { @@ -366,6 +370,7 @@ public void update(float tpf) { * @param rm the render manager (not null) * @param vp the view port to render (not null) */ + @Override public void render(RenderManager rm, ViewPort vp) { } @@ -401,6 +406,7 @@ public void setPhysicsSpace(PhysicsSpace newSpace) { * * @return the pre-existing space, or null for none */ + @Override public PhysicsSpace getPhysicsSpace() { return space; } diff --git a/jme3-bullet/src/common/java/com/jme3/bullet/control/VehicleControl.java b/jme3-bullet/src/common/java/com/jme3/bullet/control/VehicleControl.java index 51210c6a7a..275cb215af 100644 --- a/jme3-bullet/src/common/java/com/jme3/bullet/control/VehicleControl.java +++ b/jme3-bullet/src/common/java/com/jme3/bullet/control/VehicleControl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -80,7 +80,7 @@ public class VehicleControl extends PhysicsVehicle implements PhysicsControl, Jm * No-argument constructor needed by SavableClassUtil. Do not invoke * directly! */ - public VehicleControl() { + protected VehicleControl() { } /** @@ -159,6 +159,7 @@ public Control cloneForSpatial(Spatial spatial) { * * @return a new control (not null) */ + @Override public Object jmeClone() { VehicleControl control = new VehicleControl(collisionShape, mass); control.setAngularFactor(getAngularFactor()); @@ -231,6 +232,7 @@ public void cloneFields( Cloner cloner, Object original ) { * * @param spatial spatial to control (or null) */ + @Override public void setSpatial(Spatial spatial) { this.spatial = spatial; setUserObject(spatial); @@ -250,6 +252,7 @@ public void setSpatial(Spatial spatial) { * * @param enabled true→enable the control, false→disable it */ + @Override public void setEnabled(boolean enabled) { this.enabled = enabled; if (space != null) { @@ -272,6 +275,7 @@ public void setEnabled(boolean enabled) { * * @return true if enabled, otherwise false */ + @Override public boolean isEnabled() { return enabled; } @@ -282,6 +286,7 @@ public boolean isEnabled() { * * @param tpf the time interval between frames (in seconds, ≥0) */ + @Override public void update(float tpf) { if (enabled && spatial != null) { if (getMotionState().applyTransform(spatial)) { @@ -301,6 +306,7 @@ public void update(float tpf) { * @param rm the render manager (not null) * @param vp the view port to render (not null) */ + @Override public void render(RenderManager rm, ViewPort vp) { } @@ -336,6 +342,7 @@ public void setPhysicsSpace(PhysicsSpace newSpace) { * * @return the pre-existing space, or null for none */ + @Override public PhysicsSpace getPhysicsSpace() { return space; } diff --git a/jme3-bullet/src/common/java/com/jme3/bullet/util/CollisionShapeFactory.java b/jme3-bullet/src/common/java/com/jme3/bullet/util/CollisionShapeFactory.java index 19e14d49be..9f3bc797aa 100644 --- a/jme3-bullet/src/common/java/com/jme3/bullet/util/CollisionShapeFactory.java +++ b/jme3-bullet/src/common/java/com/jme3/bullet/util/CollisionShapeFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -229,7 +229,7 @@ public static CollisionShape createDynamicMeshShape(Spatial spatial) { */ public static CollisionShape createBoxShape(Spatial spatial) { if (spatial instanceof Geometry) { - return createSingleBoxShape((Geometry) spatial, spatial); + return createSingleBoxShape(spatial, spatial); } else if (spatial instanceof Node) { return createBoxCompoundShape((Node) spatial); } else { diff --git a/jme3-bullet/src/main/java/com/jme3/bullet/PhysicsSpace.java b/jme3-bullet/src/main/java/com/jme3/bullet/PhysicsSpace.java index f2d709131b..fde793a873 100644 --- a/jme3-bullet/src/main/java/com/jme3/bullet/PhysicsSpace.java +++ b/jme3-bullet/src/main/java/com/jme3/bullet/PhysicsSpace.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -539,7 +539,7 @@ public void add(Object obj) { Spatial node = (Spatial) obj; for (int i = 0; i < node.getNumControls(); i++) { if (node.getControl(i) instanceof PhysicsControl) { - add(((PhysicsControl) node.getControl(i))); + add(node.getControl(i)); } } } else if (obj instanceof PhysicsCollisionObject) { @@ -581,7 +581,7 @@ public void remove(Object obj) { Spatial node = (Spatial) obj; for (int i = 0; i < node.getNumControls(); i++) { if (node.getControl(i) instanceof PhysicsControl) { - remove(((PhysicsControl) node.getControl(i))); + remove(node.getControl(i)); } } } else if (obj instanceof PhysicsCollisionObject) { @@ -1129,7 +1129,7 @@ public List rayTestRaw(Vector3f from, Vector3f to, List sweepTest(CollisionShape shape, Transform start, Transform end) { List results = new LinkedList(); sweepTest(shape, start, end , results); - return (List) results; + return results; } /** diff --git a/jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/BoxCollisionShape.java b/jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/BoxCollisionShape.java index bec41ff97f..1f3ac4673f 100644 --- a/jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/BoxCollisionShape.java +++ b/jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/BoxCollisionShape.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -57,7 +57,7 @@ public class BoxCollisionShape extends CollisionShape { * No-argument constructor needed by SavableClassUtil. Do not invoke * directly! */ - public BoxCollisionShape() { + protected BoxCollisionShape() { } /** @@ -86,6 +86,7 @@ public final Vector3f getHalfExtents() { * @param ex exporter (not null) * @throws IOException from exporter */ + @Override public void write(JmeExporter ex) throws IOException { super.write(ex); OutputCapsule capsule = ex.getCapsule(this); @@ -98,6 +99,7 @@ public void write(JmeExporter ex) throws IOException { * @param im importer (not null) * @throws IOException from importer */ + @Override public void read(JmeImporter im) throws IOException { super.read(im); InputCapsule capsule = im.getCapsule(this); diff --git a/jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/CapsuleCollisionShape.java b/jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/CapsuleCollisionShape.java index 0a15b343e3..52f2af555f 100644 --- a/jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/CapsuleCollisionShape.java +++ b/jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/CapsuleCollisionShape.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -64,7 +64,7 @@ public class CapsuleCollisionShape extends CollisionShape{ * No-argument constructor needed by SavableClassUtil. Do not invoke * directly! */ - public CapsuleCollisionShape() { + protected CapsuleCollisionShape() { } /** @@ -141,6 +141,7 @@ public void setScale(Vector3f scale) { * @param ex exporter (not null) * @throws IOException from exporter */ + @Override public void write(JmeExporter ex) throws IOException { super.write(ex); OutputCapsule capsule = ex.getCapsule(this); @@ -155,6 +156,7 @@ public void write(JmeExporter ex) throws IOException { * @param im importer (not null) * @throws IOException from importer */ + @Override public void read(JmeImporter im) throws IOException { super.read(im); InputCapsule capsule = im.getCapsule(this); diff --git a/jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/CollisionShape.java b/jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/CollisionShape.java index 94d39973d9..615f23499c 100644 --- a/jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/CollisionShape.java +++ b/jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/CollisionShape.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -201,6 +201,7 @@ public void setMargin(float margin) { * @param ex exporter (not null) * @throws IOException from exporter */ + @Override public void write(JmeExporter ex) throws IOException { OutputCapsule capsule = ex.getCapsule(this); capsule.write(scale, "scale", new Vector3f(1, 1, 1)); diff --git a/jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/CompoundCollisionShape.java b/jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/CompoundCollisionShape.java index 254006676e..4520e7ef47 100644 --- a/jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/CompoundCollisionShape.java +++ b/jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/CompoundCollisionShape.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -152,6 +152,7 @@ public List getChildren() { * @param ex exporter (not null) * @throws IOException from exporter */ + @Override public void write(JmeExporter ex) throws IOException { super.write(ex); OutputCapsule capsule = ex.getCapsule(this); @@ -164,6 +165,7 @@ public void write(JmeExporter ex) throws IOException { * @param im importer (not null) * @throws IOException from importer */ + @Override public void read(JmeImporter im) throws IOException { super.read(im); InputCapsule capsule = im.getCapsule(this); diff --git a/jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/ConeCollisionShape.java b/jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/ConeCollisionShape.java index c111fbd9e2..914176dde5 100644 --- a/jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/ConeCollisionShape.java +++ b/jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/ConeCollisionShape.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -65,7 +65,7 @@ public class ConeCollisionShape extends CollisionShape { * No-argument constructor needed by SavableClassUtil. Do not invoke * directly! */ - public ConeCollisionShape() { + protected ConeCollisionShape() { } /** @@ -119,6 +119,7 @@ public float getHeight() { * @param ex exporter (not null) * @throws IOException from exporter */ + @Override public void write(JmeExporter ex) throws IOException { super.write(ex); OutputCapsule capsule = ex.getCapsule(this); @@ -133,6 +134,7 @@ public void write(JmeExporter ex) throws IOException { * @param im importer (not null) * @throws IOException from importer */ + @Override public void read(JmeImporter im) throws IOException { super.read(im); InputCapsule capsule = im.getCapsule(this); diff --git a/jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/CylinderCollisionShape.java b/jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/CylinderCollisionShape.java index 2178899f7b..7686cd3dab 100644 --- a/jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/CylinderCollisionShape.java +++ b/jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/CylinderCollisionShape.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -62,7 +62,7 @@ public class CylinderCollisionShape extends CollisionShape { * No-argument constructor needed by SavableClassUtil. Do not invoke * directly! */ - public CylinderCollisionShape() { + protected CylinderCollisionShape() { } /** @@ -128,6 +128,7 @@ public void setScale(Vector3f scale) { * @param ex exporter (not null) * @throws IOException from exporter */ + @Override public void write(JmeExporter ex) throws IOException { super.write(ex); OutputCapsule capsule = ex.getCapsule(this); @@ -141,6 +142,7 @@ public void write(JmeExporter ex) throws IOException { * @param im importer (not null) * @throws IOException from importer */ + @Override public void read(JmeImporter im) throws IOException { super.read(im); InputCapsule capsule = im.getCapsule(this); diff --git a/jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/GImpactCollisionShape.java b/jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/GImpactCollisionShape.java index 2e5dc9704e..b2007aab68 100644 --- a/jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/GImpactCollisionShape.java +++ b/jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/GImpactCollisionShape.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -68,7 +68,7 @@ public class GImpactCollisionShape extends CollisionShape { * No-argument constructor needed by SavableClassUtil. Do not invoke * directly! */ - public GImpactCollisionShape() { + protected GImpactCollisionShape() { } /** @@ -122,6 +122,7 @@ private void createCollisionMesh(Mesh mesh) { * @param ex exporter (not null) * @throws IOException from exporter */ + @Override public void write(JmeExporter ex) throws IOException { super.write(ex); OutputCapsule capsule = ex.getCapsule(this); @@ -141,6 +142,7 @@ public void write(JmeExporter ex) throws IOException { * @param im importer (not null) * @throws IOException from importer */ + @Override public void read(JmeImporter im) throws IOException { super.read(im); InputCapsule capsule = im.getCapsule(this); diff --git a/jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/HeightfieldCollisionShape.java b/jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/HeightfieldCollisionShape.java index 0a4140bdbb..649f8612d8 100644 --- a/jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/HeightfieldCollisionShape.java +++ b/jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/HeightfieldCollisionShape.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -93,7 +93,7 @@ public class HeightfieldCollisionShape extends CollisionShape { * No-argument constructor needed by SavableClassUtil. Do not invoke * directly! */ - public HeightfieldCollisionShape() { + protected HeightfieldCollisionShape() { } /** @@ -193,6 +193,7 @@ public Mesh createJmeMesh() { * @param ex exporter (not null) * @throws IOException from exporter */ + @Override public void write(JmeExporter ex) throws IOException { super.write(ex); OutputCapsule capsule = ex.getCapsule(this); @@ -212,6 +213,7 @@ public void write(JmeExporter ex) throws IOException { * @param im importer (not null) * @throws IOException from importer */ + @Override public void read(JmeImporter im) throws IOException { super.read(im); InputCapsule capsule = im.getCapsule(this); diff --git a/jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/HullCollisionShape.java b/jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/HullCollisionShape.java index d20e0e51e3..7e584844ba 100644 --- a/jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/HullCollisionShape.java +++ b/jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/HullCollisionShape.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2019 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -56,7 +56,7 @@ public class HullCollisionShape extends CollisionShape { * No-argument constructor needed by SavableClassUtil. Do not invoke * directly! */ - public HullCollisionShape() { + protected HullCollisionShape() { } /** diff --git a/jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/MeshCollisionShape.java b/jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/MeshCollisionShape.java index 60089fddeb..db95b8120e 100644 --- a/jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/MeshCollisionShape.java +++ b/jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/MeshCollisionShape.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2019 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -75,7 +75,7 @@ public class MeshCollisionShape extends CollisionShape { * No-argument constructor needed by SavableClassUtil. Do not invoke * directly! */ - public MeshCollisionShape() { + protected MeshCollisionShape() { } /** diff --git a/jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/PlaneCollisionShape.java b/jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/PlaneCollisionShape.java index 6b8bb88bbe..a21ced662c 100644 --- a/jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/PlaneCollisionShape.java +++ b/jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/PlaneCollisionShape.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -56,7 +56,7 @@ public class PlaneCollisionShape extends CollisionShape{ * No-argument constructor needed by SavableClassUtil. Do not invoke * directly! */ - public PlaneCollisionShape() { + protected PlaneCollisionShape() { } /** @@ -84,6 +84,7 @@ public final Plane getPlane() { * @param ex exporter (not null) * @throws IOException from exporter */ + @Override public void write(JmeExporter ex) throws IOException { super.write(ex); OutputCapsule capsule = ex.getCapsule(this); @@ -96,6 +97,7 @@ public void write(JmeExporter ex) throws IOException { * @param im importer (not null) * @throws IOException from importer */ + @Override public void read(JmeImporter im) throws IOException { super.read(im); InputCapsule capsule = im.getCapsule(this); diff --git a/jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/SimplexCollisionShape.java b/jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/SimplexCollisionShape.java index 6a538a1c04..2b76ed14be 100644 --- a/jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/SimplexCollisionShape.java +++ b/jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/SimplexCollisionShape.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -57,7 +57,7 @@ public class SimplexCollisionShape extends CollisionShape { * No-argument constructor needed by SavableClassUtil. Do not invoke * directly! */ - public SimplexCollisionShape() { + protected SimplexCollisionShape() { } /** @@ -118,6 +118,7 @@ public SimplexCollisionShape(Vector3f point1) { * @param ex exporter (not null) * @throws IOException from exporter */ + @Override public void write(JmeExporter ex) throws IOException { super.write(ex); OutputCapsule capsule = ex.getCapsule(this); @@ -133,6 +134,7 @@ public void write(JmeExporter ex) throws IOException { * @param im importer (not null) * @throws IOException from importer */ + @Override public void read(JmeImporter im) throws IOException { super.read(im); InputCapsule capsule = im.getCapsule(this); diff --git a/jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/SphereCollisionShape.java b/jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/SphereCollisionShape.java index dd4228e37d..665ce6f4dc 100644 --- a/jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/SphereCollisionShape.java +++ b/jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/SphereCollisionShape.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -57,7 +57,7 @@ public class SphereCollisionShape extends CollisionShape { * No-argument constructor needed by SavableClassUtil. Do not invoke * directly! */ - public SphereCollisionShape() { + protected SphereCollisionShape() { } /** @@ -85,6 +85,7 @@ public float getRadius() { * @param ex exporter (not null) * @throws IOException from exporter */ + @Override public void write(JmeExporter ex) throws IOException { super.write(ex); OutputCapsule capsule = ex.getCapsule(this); @@ -97,6 +98,7 @@ public void write(JmeExporter ex) throws IOException { * @param im importer (not null) * @throws IOException from importer */ + @Override public void read(JmeImporter im) throws IOException { super.read(im); InputCapsule capsule = im.getCapsule(this); diff --git a/jme3-bullet/src/main/java/com/jme3/bullet/joints/ConeJoint.java b/jme3-bullet/src/main/java/com/jme3/bullet/joints/ConeJoint.java index d3ec3534ac..ea05e9f659 100644 --- a/jme3-bullet/src/main/java/com/jme3/bullet/joints/ConeJoint.java +++ b/jme3-bullet/src/main/java/com/jme3/bullet/joints/ConeJoint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2019 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -64,7 +64,7 @@ public class ConeJoint extends PhysicsJoint { * No-argument constructor needed by SavableClassUtil. Do not invoke * directly! */ - public ConeJoint() { + protected ConeJoint() { } /** diff --git a/jme3-bullet/src/main/java/com/jme3/bullet/joints/HingeJoint.java b/jme3-bullet/src/main/java/com/jme3/bullet/joints/HingeJoint.java index 609516287e..29b9b80700 100644 --- a/jme3-bullet/src/main/java/com/jme3/bullet/joints/HingeJoint.java +++ b/jme3-bullet/src/main/java/com/jme3/bullet/joints/HingeJoint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -80,7 +80,7 @@ public class HingeJoint extends PhysicsJoint { * No-argument constructor needed by SavableClassUtil. Do not invoke * directly! */ - public HingeJoint() { + protected HingeJoint() { } /** @@ -242,6 +242,7 @@ public float getHingeAngle() { * @param ex exporter (not null) * @throws IOException from exporter */ + @Override public void write(JmeExporter ex) throws IOException { super.write(ex); OutputCapsule capsule = ex.getCapsule(this); @@ -268,6 +269,7 @@ public void write(JmeExporter ex) throws IOException { * @param im importer (not null) * @throws IOException from importer */ + @Override public void read(JmeImporter im) throws IOException { super.read(im); InputCapsule capsule = im.getCapsule(this); diff --git a/jme3-bullet/src/main/java/com/jme3/bullet/joints/PhysicsJoint.java b/jme3-bullet/src/main/java/com/jme3/bullet/joints/PhysicsJoint.java index f3087dfaed..f5f9edf2e4 100644 --- a/jme3-bullet/src/main/java/com/jme3/bullet/joints/PhysicsJoint.java +++ b/jme3-bullet/src/main/java/com/jme3/bullet/joints/PhysicsJoint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -76,7 +76,7 @@ public abstract class PhysicsJoint implements Savable { * No-argument constructor needed by SavableClassUtil. Do not invoke * directly! */ - public PhysicsJoint() { + protected PhysicsJoint() { } /** @@ -192,6 +192,7 @@ public void destroy() { * @param ex exporter (not null) * @throws IOException from exporter */ + @Override public void write(JmeExporter ex) throws IOException { OutputCapsule capsule = ex.getCapsule(this); capsule.write(nodeA, "nodeA", null); @@ -206,10 +207,11 @@ public void write(JmeExporter ex) throws IOException { * @param im importer (not null) * @throws IOException from importer */ + @Override public void read(JmeImporter im) throws IOException { InputCapsule capsule = im.getCapsule(this); - this.nodeA = ((PhysicsRigidBody) capsule.readSavable("nodeA", new PhysicsRigidBody())); - this.nodeB = (PhysicsRigidBody) capsule.readSavable("nodeB", new PhysicsRigidBody()); + this.nodeA = ((PhysicsRigidBody) capsule.readSavable("nodeA", null)); + this.nodeB = (PhysicsRigidBody) capsule.readSavable("nodeB", null); this.pivotA = (Vector3f) capsule.readSavable("pivotA", new Vector3f()); this.pivotB = (Vector3f) capsule.readSavable("pivotB", new Vector3f()); } diff --git a/jme3-bullet/src/main/java/com/jme3/bullet/joints/Point2PointJoint.java b/jme3-bullet/src/main/java/com/jme3/bullet/joints/Point2PointJoint.java index 932f41f7b3..4c2ddbffe9 100644 --- a/jme3-bullet/src/main/java/com/jme3/bullet/joints/Point2PointJoint.java +++ b/jme3-bullet/src/main/java/com/jme3/bullet/joints/Point2PointJoint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2019 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -57,7 +57,7 @@ public class Point2PointJoint extends PhysicsJoint { * No-argument constructor needed by SavableClassUtil. Do not invoke * directly! */ - public Point2PointJoint() { + protected Point2PointJoint() { } /** diff --git a/jme3-bullet/src/main/java/com/jme3/bullet/joints/SixDofJoint.java b/jme3-bullet/src/main/java/com/jme3/bullet/joints/SixDofJoint.java index 27e4c48b93..6d9fb7b10b 100644 --- a/jme3-bullet/src/main/java/com/jme3/bullet/joints/SixDofJoint.java +++ b/jme3-bullet/src/main/java/com/jme3/bullet/joints/SixDofJoint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2019 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -99,7 +99,7 @@ public class SixDofJoint extends PhysicsJoint { * No-argument constructor needed by SavableClassUtil. Do not invoke * directly! */ - public SixDofJoint() { + protected SixDofJoint() { } /** diff --git a/jme3-bullet/src/main/java/com/jme3/bullet/joints/SliderJoint.java b/jme3-bullet/src/main/java/com/jme3/bullet/joints/SliderJoint.java index 8299fbd659..8fa93dd131 100644 --- a/jme3-bullet/src/main/java/com/jme3/bullet/joints/SliderJoint.java +++ b/jme3-bullet/src/main/java/com/jme3/bullet/joints/SliderJoint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2019 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -60,7 +60,7 @@ public class SliderJoint extends PhysicsJoint { * No-argument constructor needed by SavableClassUtil. Do not invoke * directly! */ - public SliderJoint() { + protected SliderJoint() { } /** diff --git a/jme3-bullet/src/main/java/com/jme3/bullet/objects/PhysicsCharacter.java b/jme3-bullet/src/main/java/com/jme3/bullet/objects/PhysicsCharacter.java index 3824462e92..0341ecbe8a 100644 --- a/jme3-bullet/src/main/java/com/jme3/bullet/objects/PhysicsCharacter.java +++ b/jme3-bullet/src/main/java/com/jme3/bullet/objects/PhysicsCharacter.java @@ -71,7 +71,7 @@ public class PhysicsCharacter extends PhysicsCollisionObject { * No-argument constructor needed by SavableClassUtil. Do not invoke * directly! */ - public PhysicsCharacter() { + protected PhysicsCharacter() { } /** diff --git a/jme3-bullet/src/main/java/com/jme3/bullet/objects/PhysicsGhostObject.java b/jme3-bullet/src/main/java/com/jme3/bullet/objects/PhysicsGhostObject.java index acb3752e6a..f3efc7366d 100644 --- a/jme3-bullet/src/main/java/com/jme3/bullet/objects/PhysicsGhostObject.java +++ b/jme3-bullet/src/main/java/com/jme3/bullet/objects/PhysicsGhostObject.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2019 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -68,7 +68,7 @@ public class PhysicsGhostObject extends PhysicsCollisionObject { * No-argument constructor needed by SavableClassUtil. Do not invoke * directly! */ - public PhysicsGhostObject() { + protected PhysicsGhostObject() { } /** diff --git a/jme3-bullet/src/main/java/com/jme3/bullet/objects/PhysicsRigidBody.java b/jme3-bullet/src/main/java/com/jme3/bullet/objects/PhysicsRigidBody.java index 2cbbf3c42d..8e4a52e70a 100644 --- a/jme3-bullet/src/main/java/com/jme3/bullet/objects/PhysicsRigidBody.java +++ b/jme3-bullet/src/main/java/com/jme3/bullet/objects/PhysicsRigidBody.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -81,7 +81,7 @@ public class PhysicsRigidBody extends PhysicsCollisionObject { * No-argument constructor needed by SavableClassUtil. Do not invoke * directly! */ - public PhysicsRigidBody() { + protected PhysicsRigidBody() { } /** @@ -794,6 +794,7 @@ public void clearForces() { * * @param collisionShape the shape to apply (not null, alias created) */ + @Override public void setCollisionShape(CollisionShape collisionShape) { super.setCollisionShape(collisionShape); if (collisionShape instanceof MeshCollisionShape && mass != 0) { diff --git a/jme3-bullet/src/main/java/com/jme3/bullet/objects/PhysicsVehicle.java b/jme3-bullet/src/main/java/com/jme3/bullet/objects/PhysicsVehicle.java index 541f68281a..9ce983b6d9 100644 --- a/jme3-bullet/src/main/java/com/jme3/bullet/objects/PhysicsVehicle.java +++ b/jme3-bullet/src/main/java/com/jme3/bullet/objects/PhysicsVehicle.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2019 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -90,7 +90,7 @@ public class PhysicsVehicle extends PhysicsRigidBody { * No-argument constructor needed by SavableClassUtil. Do not invoke * directly! */ - public PhysicsVehicle() { + protected PhysicsVehicle() { } /** diff --git a/jme3-bullet/src/main/java/com/jme3/bullet/objects/VehicleWheel.java b/jme3-bullet/src/main/java/com/jme3/bullet/objects/VehicleWheel.java index 25fa2c1030..9091559586 100644 --- a/jme3-bullet/src/main/java/com/jme3/bullet/objects/VehicleWheel.java +++ b/jme3-bullet/src/main/java/com/jme3/bullet/objects/VehicleWheel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2019 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -136,7 +136,7 @@ public class VehicleWheel implements Savable { * No-argument constructor needed by SavableClassUtil. Do not invoke * directly! */ - public VehicleWheel() { + protected VehicleWheel() { } /** diff --git a/jme3-core/src/main/java/com/jme3/anim/AnimClip.java b/jme3-core/src/main/java/com/jme3/anim/AnimClip.java index be29e2105e..eb00f8c43f 100644 --- a/jme3-core/src/main/java/com/jme3/anim/AnimClip.java +++ b/jme3-core/src/main/java/com/jme3/anim/AnimClip.java @@ -16,7 +16,7 @@ public class AnimClip implements JmeCloneable, Savable { private AnimTrack[] tracks; - public AnimClip() { + protected AnimClip() { } public AnimClip(String name) { diff --git a/jme3-core/src/main/java/com/jme3/anim/Armature.java b/jme3-core/src/main/java/com/jme3/anim/Armature.java index 361603b9d1..2443702547 100644 --- a/jme3-core/src/main/java/com/jme3/anim/Armature.java +++ b/jme3-core/src/main/java/com/jme3/anim/Armature.java @@ -28,7 +28,7 @@ public class Armature implements JmeCloneable, Savable { /** * Serialization only */ - public Armature() { + protected Armature() { } /** diff --git a/jme3-core/src/main/java/com/jme3/anim/Joint.java b/jme3-core/src/main/java/com/jme3/anim/Joint.java index 1c1699f64e..d51848e20f 100644 --- a/jme3-core/src/main/java/com/jme3/anim/Joint.java +++ b/jme3-core/src/main/java/com/jme3/anim/Joint.java @@ -216,6 +216,7 @@ public void setName(String name) { this.name = name; } + @Override public void setLocalTransform(Transform localTransform) { this.localTransform.set(localTransform); } @@ -272,6 +273,7 @@ public Transform getInitialTransform() { return initialTransform; } + @Override public Transform getLocalTransform() { return localTransform; } diff --git a/jme3-core/src/main/java/com/jme3/anim/MatrixJointModelTransform.java b/jme3-core/src/main/java/com/jme3/anim/MatrixJointModelTransform.java index 5f1aadad72..782c2d93bd 100644 --- a/jme3-core/src/main/java/com/jme3/anim/MatrixJointModelTransform.java +++ b/jme3-core/src/main/java/com/jme3/anim/MatrixJointModelTransform.java @@ -22,6 +22,7 @@ public void updateModelTransform(Transform localTransform, Joint parent) { } + @Override public void getOffsetTransform(Matrix4f outTransform, Matrix4f inverseModelBindMatrix) { modelTransformMatrix.mult(inverseModelBindMatrix, outTransform); } diff --git a/jme3-core/src/main/java/com/jme3/anim/MorphTrack.java b/jme3-core/src/main/java/com/jme3/anim/MorphTrack.java index a72456c72e..a6dc4a7d90 100644 --- a/jme3-core/src/main/java/com/jme3/anim/MorphTrack.java +++ b/jme3-core/src/main/java/com/jme3/anim/MorphTrack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -59,7 +59,7 @@ public class MorphTrack implements AnimTrack { /** * Serialization-only. Do not use. */ - public MorphTrack() { + protected MorphTrack() { } /** @@ -122,7 +122,7 @@ public void setKeyframes(float[] times, float[] weights) { this.weights = weights; - assert times != null && times.length == weights.length; + assert times.length == weights.length; } } diff --git a/jme3-core/src/main/java/com/jme3/anim/SeparateJointModelTransform.java b/jme3-core/src/main/java/com/jme3/anim/SeparateJointModelTransform.java index c06b97ba4f..4cb3b155fb 100644 --- a/jme3-core/src/main/java/com/jme3/anim/SeparateJointModelTransform.java +++ b/jme3-core/src/main/java/com/jme3/anim/SeparateJointModelTransform.java @@ -23,6 +23,7 @@ public void updateModelTransform(Transform localTransform, Joint parent) { } } + @Override public void getOffsetTransform(Matrix4f outTransform, Matrix4f inverseModelBindMatrix) { modelTransform.toTransformMatrix(outTransform).mult(inverseModelBindMatrix, outTransform); } diff --git a/jme3-core/src/main/java/com/jme3/anim/SkinningControl.java b/jme3-core/src/main/java/com/jme3/anim/SkinningControl.java index 02f4808256..1542213610 100644 --- a/jme3-core/src/main/java/com/jme3/anim/SkinningControl.java +++ b/jme3-core/src/main/java/com/jme3/anim/SkinningControl.java @@ -115,7 +115,7 @@ public class SkinningControl extends AbstractControl implements Cloneable, JmeCl /** * Serialization only. Do not use. */ - public SkinningControl() { + protected SkinningControl() { } /** diff --git a/jme3-core/src/main/java/com/jme3/anim/TransformTrack.java b/jme3-core/src/main/java/com/jme3/anim/TransformTrack.java index 63eba06cfc..f5c16d67d5 100644 --- a/jme3-core/src/main/java/com/jme3/anim/TransformTrack.java +++ b/jme3-core/src/main/java/com/jme3/anim/TransformTrack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -208,10 +208,12 @@ public void setKeyframes(float[] times, Vector3f[] translations, Quaternion[] ro } } + @Override public double getLength() { return length; } + @Override public void getDataAtTime(double t, Transform transform) { float time = (float) t; diff --git a/jme3-core/src/main/java/com/jme3/anim/tween/AbstractTween.java b/jme3-core/src/main/java/com/jme3/anim/tween/AbstractTween.java index 34d4fb83e3..b53340402d 100644 --- a/jme3-core/src/main/java/com/jme3/anim/tween/AbstractTween.java +++ b/jme3-core/src/main/java/com/jme3/anim/tween/AbstractTween.java @@ -1,39 +1,34 @@ /* - * $Id$ - * - * Copyright (c) 2015, Simsilica, LLC + * Copyright (c) 2015-2020 jMonkeyEngine * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions + * modification, are permitted provided that the following conditions * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. Neither the name of the copyright holder nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of 'jMonkeyEngine' nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - package com.jme3.anim.tween; import com.jme3.util.clone.Cloner; diff --git a/jme3-core/src/main/java/com/jme3/anim/tween/Tween.java b/jme3-core/src/main/java/com/jme3/anim/tween/Tween.java index e79b4d29e6..08ab3aca29 100644 --- a/jme3-core/src/main/java/com/jme3/anim/tween/Tween.java +++ b/jme3-core/src/main/java/com/jme3/anim/tween/Tween.java @@ -1,39 +1,34 @@ /* - * $Id$ - * - * Copyright (c) 2015, Simsilica, LLC + * Copyright (c) 2015-2020 jMonkeyEngine * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions + * modification, are permitted provided that the following conditions * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. Neither the name of the copyright holder nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of 'jMonkeyEngine' nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - package com.jme3.anim.tween; /** diff --git a/jme3-core/src/main/java/com/jme3/anim/tween/Tweens.java b/jme3-core/src/main/java/com/jme3/anim/tween/Tweens.java index 0fedf9b75a..6f075aa33a 100644 --- a/jme3-core/src/main/java/com/jme3/anim/tween/Tweens.java +++ b/jme3-core/src/main/java/com/jme3/anim/tween/Tweens.java @@ -1,39 +1,34 @@ /* - * $Id$ - * - * Copyright (c) 2015, Simsilica, LLC + * Copyright (c) 2015-2020 jMonkeyEngine * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions + * modification, are permitted provided that the following conditions * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. Neither the name of the copyright holder nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of 'jMonkeyEngine' nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - package com.jme3.anim.tween; import com.jme3.anim.util.Primitives; diff --git a/jme3-core/src/main/java/com/jme3/anim/tween/action/BlendAction.java b/jme3-core/src/main/java/com/jme3/anim/tween/action/BlendAction.java index 9c5848e4da..2d73031e69 100644 --- a/jme3-core/src/main/java/com/jme3/anim/tween/action/BlendAction.java +++ b/jme3-core/src/main/java/com/jme3/anim/tween/action/BlendAction.java @@ -49,6 +49,7 @@ public BlendAction(BlendSpace blendSpace, BlendableAction... actions) { } } + @Override public void doInterpolate(double t) { blendWeight = blendSpace.getWeight(); BlendableAction firstActiveAction = (BlendableAction) actions[firstActiveIndex]; diff --git a/jme3-core/src/main/java/com/jme3/anim/tween/action/ClipAction.java b/jme3-core/src/main/java/com/jme3/anim/tween/action/ClipAction.java index fdf211962a..35dbf83aba 100644 --- a/jme3-core/src/main/java/com/jme3/anim/tween/action/ClipAction.java +++ b/jme3-core/src/main/java/com/jme3/anim/tween/action/ClipAction.java @@ -63,6 +63,7 @@ public void reset() { } + @Override public String toString() { return clip.toString(); } diff --git a/jme3-core/src/main/java/com/jme3/anim/tween/action/LinearBlendSpace.java b/jme3-core/src/main/java/com/jme3/anim/tween/action/LinearBlendSpace.java index 31d2931feb..c90764a907 100644 --- a/jme3-core/src/main/java/com/jme3/anim/tween/action/LinearBlendSpace.java +++ b/jme3-core/src/main/java/com/jme3/anim/tween/action/LinearBlendSpace.java @@ -17,7 +17,7 @@ public LinearBlendSpace(float minValue, float maxValue) { public void setBlendAction(BlendAction action) { this.action = action; Action[] actions = action.getActions(); - step = (maxValue - minValue) / (float) (actions.length - 1); + step = (maxValue - minValue) / (actions.length - 1); } @Override diff --git a/jme3-core/src/main/java/com/jme3/animation/AnimControl.java b/jme3-core/src/main/java/com/jme3/animation/AnimControl.java index 7386e10840..022170a2e0 100644 --- a/jme3-core/src/main/java/com/jme3/animation/AnimControl.java +++ b/jme3-core/src/main/java/com/jme3/animation/AnimControl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2019 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -102,7 +102,9 @@ public AnimControl(Skeleton skeleton) { } /** - * Serialization only. Do not use. + * Instantiate an animation control with no skeleton, suitable only for + * animations that don't contain any bone tracks. Also used for + * serialization. */ public AnimControl() { } @@ -144,6 +146,7 @@ public void setAnimations(HashMap animations) { /** * Retrieve an animation from the list of animations. + * * @param name The name of the animation to retrieve. * @return The animation corresponding to the given name, or null, if no * such named animation exists. @@ -155,6 +158,7 @@ public Animation getAnim(String name) { /** * Adds an animation to be available for playing to this * AnimControl. + * * @param anim The animation to add. */ public void addAnim(Animation anim) { @@ -163,6 +167,7 @@ public void addAnim(Animation anim) { /** * Remove an animation so that it is no longer available for playing. + * * @param anim The animation to remove. */ public void removeAnim(Animation anim) { @@ -231,6 +236,7 @@ public Skeleton getSkeleton() { /** * Adds a new listener to receive animation related events. + * * @param listener The listener to add. */ public void addListener(AnimEventListener listener) { @@ -244,6 +250,7 @@ public void addListener(AnimEventListener listener) { /** * Removes the given listener from listening to events. + * * @param listener * @see AnimControl#addListener(com.jme3.animation.AnimEventListener) */ @@ -308,6 +315,7 @@ public Collection getAnimationNames() { /** * Returns the length of the given named animation. + * * @param name The name of the animation * @return The length of time, in seconds, of the named animation. */ diff --git a/jme3-core/src/main/java/com/jme3/animation/Animation.java b/jme3-core/src/main/java/com/jme3/animation/Animation.java index fe0ac8ce43..6e899c5fc4 100644 --- a/jme3-core/src/main/java/com/jme3/animation/Animation.java +++ b/jme3-core/src/main/java/com/jme3/animation/Animation.java @@ -65,7 +65,7 @@ public class Animation implements Savable, Cloneable, JmeCloneable { /** * Serialization-only. Do not use. */ - public Animation() { + protected Animation() { } /** diff --git a/jme3-core/src/main/java/com/jme3/animation/AnimationFactory.java b/jme3-core/src/main/java/com/jme3/animation/AnimationFactory.java index 0b0a435c76..f8e1e77918 100644 --- a/jme3-core/src/main/java/com/jme3/animation/AnimationFactory.java +++ b/jme3-core/src/main/java/com/jme3/animation/AnimationFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -287,12 +287,12 @@ public void addKeyFrameRotationAngles(int keyFrameIndex, float x, float y, float //frames delta int dF = keyFrameIndex - prev; //angle per frame for x,y ,z - float dXAngle = (x - prevRot.eulerAngles.x) / (float) dF; - float dYAngle = (y - prevRot.eulerAngles.y) / (float) dF; - float dZAngle = (z - prevRot.eulerAngles.z) / (float) dF; + float dXAngle = (x - prevRot.eulerAngles.x) / dF; + float dYAngle = (y - prevRot.eulerAngles.y) / dF; + float dZAngle = (z - prevRot.eulerAngles.z) / dF; // the keyFrame step - int keyStep = (int) (((float) (dF)) / delta * (float) EULER_STEP); + int keyStep = (int) (dF / delta * EULER_STEP); // the current keyFrame int cursor = prev + keyStep; while (cursor < keyFrameIndex) { @@ -425,7 +425,7 @@ private void interpolate(Object[] keyFrames, Type type) { //interating over the frames for (int j = i; j <= key; j++) { // computing interpolation value - float val = (float) (j - i) / (float) span; + float val = (j - i) / (float) span; //interpolationg depending on the transform type switch (type) { case Translation: @@ -451,7 +451,7 @@ private void interpolate(Object[] keyFrames, Type type) { translations[j] = ((Vector3f) keyFrames[i]).clone(); break; case Rotation: - rotations[j] = ((Quaternion) ((Rotation) keyFrames[i]).rotation).clone(); + rotations[j] = ((Rotation) keyFrames[i]).rotation.clone(); break; case Scale: scales[j] = ((Vector3f) keyFrames[i]).clone(); diff --git a/jme3-core/src/main/java/com/jme3/animation/AudioTrack.java b/jme3-core/src/main/java/com/jme3/animation/AudioTrack.java index 1f9df35e63..41e7a151a5 100644 --- a/jme3-core/src/main/java/com/jme3/animation/AudioTrack.java +++ b/jme3-core/src/main/java/com/jme3/animation/AudioTrack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -73,18 +73,20 @@ public class AudioTrack implements ClonableTrack { //Animation listener to stop the sound when the animation ends or is changed private class OnEndListener implements AnimEventListener { + @Override public void onAnimCycleDone(AnimControl control, AnimChannel channel, String animName) { stop(); } + @Override public void onAnimChange(AnimControl control, AnimChannel channel, String animName) { } } /** - * default constructor for serialization only + * constructor for serialization only */ - public AudioTrack() { + protected AudioTrack() { } /** @@ -120,6 +122,7 @@ public AudioTrack(AudioNode audio, float length, float startOffset) { * @see Track#setTime(float, float, com.jme3.animation.AnimControl, * com.jme3.animation.AnimChannel, com.jme3.util.TempVars) */ + @Override public void setTime(float time, float weight, AnimControl control, AnimChannel channel, TempVars vars) { if (time >= length) { @@ -146,6 +149,7 @@ private void stop() { * * @return length of the track */ + @Override public float getLength() { return length; } @@ -255,6 +259,7 @@ private void setUserData(AudioTrack audioTrack) { data.addTrack(audioTrack); } + @Override public void cleanUp() { TrackInfo t = (TrackInfo) audio.getUserData("TrackInfo"); t.getTracks().remove(this); @@ -308,6 +313,7 @@ public void setStartOffset(float startOffset) { * @param ex exporter * @throws IOException exception */ + @Override public void write(JmeExporter ex) throws IOException { OutputCapsule out = ex.getCapsule(this); out.write(audio, "audio", null); @@ -321,6 +327,7 @@ public void write(JmeExporter ex) throws IOException { * @param im importer * @throws IOException Exception */ + @Override public void read(JmeImporter im) throws IOException { InputCapsule in = im.getCapsule(this); audio = (AudioNode) in.readSavable("audio", null); diff --git a/jme3-core/src/main/java/com/jme3/animation/Bone.java b/jme3-core/src/main/java/com/jme3/animation/Bone.java index 6c99e5b99f..a171002fec 100644 --- a/jme3-core/src/main/java/com/jme3/animation/Bone.java +++ b/jme3-core/src/main/java/com/jme3/animation/Bone.java @@ -176,7 +176,7 @@ public Bone(String name) { /** * Serialization only. Do not use. */ - public Bone() { + protected Bone() { } @Override diff --git a/jme3-core/src/main/java/com/jme3/animation/BoneTrack.java b/jme3-core/src/main/java/com/jme3/animation/BoneTrack.java index 3d613984cf..dda5fb5b7a 100644 --- a/jme3-core/src/main/java/com/jme3/animation/BoneTrack.java +++ b/jme3-core/src/main/java/com/jme3/animation/BoneTrack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -65,7 +65,7 @@ public final class BoneTrack implements JmeCloneable, Track { /** * Serialization-only. Do not use. */ - public BoneTrack() { + protected BoneTrack() { } /** @@ -202,6 +202,7 @@ public void setKeyframes(float[] times, Vector3f[] translations, Quaternion[] ro * @param channel * @param vars */ + @Override public void setTime(float time, float weight, AnimControl control, AnimChannel channel, TempVars vars) { BitSet affectedBones = channel.getAffectedBones(); if (affectedBones != null && !affectedBones.get(targetBoneIndex)) { @@ -268,6 +269,7 @@ public void setTime(float time, float weight, AnimControl control, AnimChannel c /** * @return the length of the track */ + @Override public float getLength() { return times == null ? 0 : times[times.length - 1] - times[0]; } diff --git a/jme3-core/src/main/java/com/jme3/animation/EffectTrack.java b/jme3-core/src/main/java/com/jme3/animation/EffectTrack.java index 597237d245..278568c3f9 100644 --- a/jme3-core/src/main/java/com/jme3/animation/EffectTrack.java +++ b/jme3-core/src/main/java/com/jme3/animation/EffectTrack.java @@ -144,9 +144,9 @@ public void onAnimChange(AnimControl control, AnimChannel channel, String animNa } /** - * default constructor only for serialization + * constructor only for serialization */ - public EffectTrack() { + protected EffectTrack() { } /** diff --git a/jme3-core/src/main/java/com/jme3/animation/Pose.java b/jme3-core/src/main/java/com/jme3/animation/Pose.java index f5d0e305ab..94a9816e76 100644 --- a/jme3-core/src/main/java/com/jme3/animation/Pose.java +++ b/jme3-core/src/main/java/com/jme3/animation/Pose.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -63,7 +63,7 @@ public Pose(String name, int targetMeshIndex, Vector3f[] offsets, int[] indices) /** * Serialization-only. Do not use. */ - public Pose() + protected Pose() { } @@ -117,6 +117,7 @@ public Pose clone() { } } + @Override public void write(JmeExporter e) throws IOException { OutputCapsule out = e.getCapsule(this); out.write(name, "name", ""); @@ -125,6 +126,7 @@ public void write(JmeExporter e) throws IOException { out.write(indices, "indices", null); } + @Override public void read(JmeImporter i) throws IOException { InputCapsule in = i.getCapsule(this); name = in.readString("name", ""); diff --git a/jme3-core/src/main/java/com/jme3/animation/PoseTrack.java b/jme3-core/src/main/java/com/jme3/animation/PoseTrack.java index 73ad142549..9388da731c 100644 --- a/jme3-core/src/main/java/com/jme3/animation/PoseTrack.java +++ b/jme3-core/src/main/java/com/jme3/animation/PoseTrack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -62,7 +62,7 @@ public PoseFrame(Pose[] poses, float[] weights) { /** * Serialization-only. Do not use. */ - public PoseFrame() + protected PoseFrame() { } @@ -87,12 +87,14 @@ public PoseFrame clone() { } } + @Override public void write(JmeExporter e) throws IOException { OutputCapsule out = e.getCapsule(this); out.write(poses, "poses", null); out.write(weights, "weights", null); } + @Override public void read(JmeImporter i) throws IOException { InputCapsule in = i.getCapsule(this); weights = in.readFloatArray("weights", null); @@ -114,7 +116,7 @@ public PoseTrack(int targetMeshIndex, float[] times, PoseFrame[] frames){ /** * Serialization-only. Do not use. */ - public PoseTrack() + protected PoseTrack() { } @@ -132,6 +134,7 @@ private void applyFrame(Mesh target, int frameIndex, float weight){ pb.updateData(pb.getData()); } + @Override public void setTime(float time, float weight, AnimControl control, AnimChannel channel, TempVars vars) { // TODO: When MeshControl is created, it will gather targets // list automatically which is then retrieved here. @@ -161,6 +164,7 @@ public void setTime(float time, float weight, AnimControl control, AnimChannel c /** * @return the length of the track */ + @Override public float getLength() { return times == null ? 0 : times[times.length - 1] - times[0]; } diff --git a/jme3-core/src/main/java/com/jme3/animation/Skeleton.java b/jme3-core/src/main/java/com/jme3/animation/Skeleton.java index e29ffb3cc8..33c81e8f03 100644 --- a/jme3-core/src/main/java/com/jme3/animation/Skeleton.java +++ b/jme3-core/src/main/java/com/jme3/animation/Skeleton.java @@ -121,7 +121,7 @@ public Skeleton(Skeleton source) { /** * Serialization only. Do not use. */ - public Skeleton() { + protected Skeleton() { } @Override diff --git a/jme3-core/src/main/java/com/jme3/animation/SkeletonControl.java b/jme3-core/src/main/java/com/jme3/animation/SkeletonControl.java index 2f54771dbc..31c4372794 100644 --- a/jme3-core/src/main/java/com/jme3/animation/SkeletonControl.java +++ b/jme3-core/src/main/java/com/jme3/animation/SkeletonControl.java @@ -113,7 +113,7 @@ public class SkeletonControl extends AbstractControl implements Cloneable, JmeCl /** * Serialization only. Do not use. */ - public SkeletonControl() { + protected SkeletonControl() { } private void switchToHardware() { diff --git a/jme3-core/src/main/java/com/jme3/animation/SpatialTrack.java b/jme3-core/src/main/java/com/jme3/animation/SpatialTrack.java index fc992d2b00..5c7e4cf0ca 100644 --- a/jme3-core/src/main/java/com/jme3/animation/SpatialTrack.java +++ b/jme3-core/src/main/java/com/jme3/animation/SpatialTrack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -101,6 +101,7 @@ public SpatialTrack(float[] times, Vector3f[] translations, * @param time * the current time of the animation */ + @Override public void setTime(float time, float weight, AnimControl control, AnimChannel channel, TempVars vars) { Spatial spatial = trackSpatial; if (spatial == null) { @@ -242,6 +243,7 @@ public Vector3f[] getTranslations() { /** * @return the length of the track */ + @Override public float getLength() { return times == null ? 0 : times[times.length - 1] - times[0]; } diff --git a/jme3-core/src/main/java/com/jme3/animation/TrackInfo.java b/jme3-core/src/main/java/com/jme3/animation/TrackInfo.java index 93fd6a88e2..5ab1345672 100644 --- a/jme3-core/src/main/java/com/jme3/animation/TrackInfo.java +++ b/jme3-core/src/main/java/com/jme3/animation/TrackInfo.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -55,11 +55,13 @@ public class TrackInfo implements Savable, JmeCloneable { public TrackInfo() { } + @Override public void write(JmeExporter ex) throws IOException { OutputCapsule c = ex.getCapsule(this); c.writeSavableArrayList(tracks, "tracks", null); } + @Override public void read(JmeImporter im) throws IOException { InputCapsule c = im.getCapsule(this); tracks = c.readSavableArrayList("tracks", null); diff --git a/jme3-core/src/main/java/com/jme3/app/AppTask.java b/jme3-core/src/main/java/com/jme3/app/AppTask.java index 1830885815..59e96c4046 100644 --- a/jme3-core/src/main/java/com/jme3/app/AppTask.java +++ b/jme3-core/src/main/java/com/jme3/app/AppTask.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -66,6 +66,7 @@ public AppTask(Callable callable) { this.callable = callable; } + @Override public boolean cancel(boolean mayInterruptIfRunning) { stateLock.lock(); try { @@ -82,6 +83,7 @@ public boolean cancel(boolean mayInterruptIfRunning) { } } + @Override public V get() throws InterruptedException, ExecutionException { stateLock.lock(); try { @@ -97,6 +99,7 @@ public V get() throws InterruptedException, ExecutionException { } } + @Override public V get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { stateLock.lock(); try { @@ -115,6 +118,7 @@ public V get(long timeout, TimeUnit unit) throws InterruptedException, Execution } } + @Override public boolean isCancelled() { stateLock.lock(); try { @@ -124,6 +128,7 @@ public boolean isCancelled() { } } + @Override public boolean isDone() { stateLock.lock(); try { diff --git a/jme3-core/src/main/java/com/jme3/app/ChaseCameraAppState.java b/jme3-core/src/main/java/com/jme3/app/ChaseCameraAppState.java index 1823e18ac9..98ef2e2d8d 100644 --- a/jme3-core/src/main/java/com/jme3/app/ChaseCameraAppState.java +++ b/jme3-core/src/main/java/com/jme3/app/ChaseCameraAppState.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -129,6 +129,7 @@ public final void registerWithInput() { inputManager.setCursorVisible(dragToRotate); } + @Override public void onAction(String name, boolean keyPressed, float tpf) { if (isEnabled()) { if (dragToRotate) { @@ -150,6 +151,7 @@ public void onAction(String name, boolean keyPressed, float tpf) { } + @Override public void onAnalog(String name, float value, float tpf) { if (isEnabled()) { if (canRotate) { diff --git a/jme3-core/src/main/java/com/jme3/app/DebugKeysAppState.java b/jme3-core/src/main/java/com/jme3/app/DebugKeysAppState.java index 8e7e3f943d..139247aec8 100644 --- a/jme3-core/src/main/java/com/jme3/app/DebugKeysAppState.java +++ b/jme3-core/src/main/java/com/jme3/app/DebugKeysAppState.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -94,6 +94,7 @@ public void cleanup() { private class DebugKeyListener implements ActionListener { + @Override public void onAction(String name, boolean value, float tpf) { if (!value) { return; diff --git a/jme3-core/src/main/java/com/jme3/app/DetailedProfiler.java b/jme3-core/src/main/java/com/jme3/app/DetailedProfiler.java index e5673df53c..8df40c1c4a 100644 --- a/jme3-core/src/main/java/com/jme3/app/DetailedProfiler.java +++ b/jme3-core/src/main/java/com/jme3/app/DetailedProfiler.java @@ -284,7 +284,7 @@ public double getAverageCpu() { if (nbFramesCpu == 0) { return 0; } - return (double) cpuSum / (double) Math.min(nbFramesCpu, MAX_FRAMES); + return cpuSum / (double) Math.min(nbFramesCpu, MAX_FRAMES); } public double getAverageGpu() { @@ -292,7 +292,7 @@ public double getAverageGpu() { return 0; } - return (double) gpuSum / (double) Math.min(nbFramesGpu, MAX_FRAMES); + return gpuSum / (double) Math.min(nbFramesGpu, MAX_FRAMES); } } diff --git a/jme3-core/src/main/java/com/jme3/app/LegacyApplication.java b/jme3-core/src/main/java/com/jme3/app/LegacyApplication.java index 1cc53b75e3..2b07b52de7 100644 --- a/jme3-core/src/main/java/com/jme3/app/LegacyApplication.java +++ b/jme3-core/src/main/java/com/jme3/app/LegacyApplication.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -126,6 +126,7 @@ public LegacyApplication( AppState... initialStates ) { * * @return The lost focus behavior of the application. */ + @Override public LostFocusBehavior getLostFocusBehavior() { return lostFocusBehavior; } @@ -142,6 +143,7 @@ public LostFocusBehavior getLostFocusBehavior() { * * @see LostFocusBehavior */ + @Override public void setLostFocusBehavior(LostFocusBehavior lostFocusBehavior) { this.lostFocusBehavior = lostFocusBehavior; } @@ -153,6 +155,7 @@ public void setLostFocusBehavior(LostFocusBehavior lostFocusBehavior) { * * @see #getLostFocusBehavior() */ + @Override public boolean isPauseOnLostFocus() { return getLostFocusBehavior() == LostFocusBehavior.PauseOnLostFocus; } @@ -173,6 +176,7 @@ public boolean isPauseOnLostFocus() { * * @see #setLostFocusBehavior(com.jme3.app.LostFocusBehavior) */ + @Override public void setPauseOnLostFocus(boolean pauseOnLostFocus) { if (pauseOnLostFocus) { setLostFocusBehavior(LostFocusBehavior.PauseOnLostFocus); @@ -227,6 +231,7 @@ private void initAssetManager(){ * * @param settings The settings to set. */ + @Override public void setSettings(AppSettings settings){ this.settings = settings; if (context != null && settings.useInput() != inputEnabled){ @@ -248,6 +253,7 @@ public void setSettings(AppSettings settings){ * frame times. By default, Application will use the Timer as returned * by the current JmeContext implementation. */ + @Override public void setTimer(Timer timer){ this.timer = timer; @@ -260,6 +266,7 @@ public void setTimer(Timer timer){ } } + @Override public Timer getTimer(){ return timer; } @@ -355,6 +362,7 @@ private void initStateManager(){ /** * @return The {@link AssetManager asset manager} for this application. */ + @Override public AssetManager getAssetManager(){ return assetManager; } @@ -362,6 +370,7 @@ public AssetManager getAssetManager(){ /** * @return the {@link InputManager input manager}. */ + @Override public InputManager getInputManager(){ return inputManager; } @@ -369,6 +378,7 @@ public InputManager getInputManager(){ /** * @return the {@link AppStateManager app state manager} */ + @Override public AppStateManager getStateManager() { return stateManager; } @@ -376,6 +386,7 @@ public AppStateManager getStateManager() { /** * @return the {@link RenderManager render manager} */ + @Override public RenderManager getRenderManager() { return renderManager; } @@ -383,6 +394,7 @@ public RenderManager getRenderManager() { /** * @return The {@link Renderer renderer} for the application */ + @Override public Renderer getRenderer(){ return renderer; } @@ -390,6 +402,7 @@ public Renderer getRenderer(){ /** * @return The {@link AudioRenderer audio renderer} for the application */ + @Override public AudioRenderer getAudioRenderer() { return audioRenderer; } @@ -397,6 +410,7 @@ public AudioRenderer getAudioRenderer() { /** * @return The {@link Listener listener} object for audio */ + @Override public Listener getListener() { return listener; } @@ -404,6 +418,7 @@ public Listener getListener() { /** * @return The {@link JmeContext display context} for the application */ + @Override public JmeContext getContext(){ return context; } @@ -411,6 +426,7 @@ public JmeContext getContext(){ /** * @return The {@link Camera camera} for the application */ + @Override public Camera getCamera(){ return cam; } @@ -420,6 +436,7 @@ public Camera getCamera(){ * * @see #start(com.jme3.system.JmeContext.Type) */ + @Override public void start(){ start(JmeContext.Type.Display, false); } @@ -429,6 +446,7 @@ public void start(){ * * @see #start(com.jme3.system.JmeContext.Type) */ + @Override public void start(boolean waitFor){ start(JmeContext.Type.Display, waitFor); } @@ -468,6 +486,7 @@ public void start(JmeContext.Type contextType, boolean waitFor){ * specific steps within a single update frame. Value defaults * to null. */ + @Override public void setAppProfiler(AppProfiler prof) { this.prof = prof; if (renderManager != null) { @@ -478,6 +497,7 @@ public void setAppProfiler(AppProfiler prof) { /** * Returns the current AppProfiler hook, or null if none is set. */ + @Override public AppProfiler getAppProfiler() { return prof; } @@ -538,6 +558,7 @@ public void startCanvas(boolean waitFor){ /** * Internal use only. */ + @Override public void reshape(int w, int h){ if (renderManager != null) { renderManager.notifyReshape(w, h); @@ -551,6 +572,7 @@ public void reshape(int w, int h){ * applied immediately; calling this method forces the context * to restart, applying the new settings. */ + @Override public void restart(){ context.setSettings(settings); context.restart(); @@ -564,6 +586,7 @@ public void restart(){ * * @see #stop(boolean) */ + @Override public void stop(){ stop(false); } @@ -573,6 +596,7 @@ public void stop(){ * and making necessary cleanup operations. * After the application has stopped, it cannot be used anymore. */ + @Override public void stop(boolean waitFor){ logger.log(Level.FINE, "Closing application: {0}", getClass().getName()); context.destroy(waitFor); @@ -588,6 +612,7 @@ public void stop(boolean waitFor){ * perspective projection with 45° field of view, with near * and far values 1 and 1000 units respectively. */ + @Override public void initialize(){ if (assetManager == null){ initAssetManager(); @@ -611,6 +636,7 @@ public void initialize(){ /** * Internal use only. */ + @Override public void handleError(String errMsg, Throwable t){ // Print error to log. logger.log(Level.SEVERE, errMsg, t); @@ -630,6 +656,7 @@ public void handleError(String errMsg, Throwable t){ /** * Internal use only. */ + @Override public void gainFocus(){ if (lostFocusBehavior != LostFocusBehavior.Disabled) { if (lostFocusBehavior == LostFocusBehavior.PauseOnLostFocus) { @@ -645,6 +672,7 @@ public void gainFocus(){ /** * Internal use only. */ + @Override public void loseFocus(){ if (lostFocusBehavior != LostFocusBehavior.Disabled){ if (lostFocusBehavior == LostFocusBehavior.PauseOnLostFocus) { @@ -657,6 +685,7 @@ public void loseFocus(){ /** * Internal use only. */ + @Override public void requestClose(boolean esc){ context.destroy(false); } @@ -671,6 +700,7 @@ public void requestClose(boolean esc){ * * @param callable The callable to run in the main jME3 thread */ + @Override public Future enqueue(Callable callable) { AppTask task = new AppTask(callable); taskQueue.add(task); @@ -687,6 +717,7 @@ public Future enqueue(Callable callable) { * * @param runnable The runnable to run in the main jME3 thread */ + @Override public void enqueue(Runnable runnable){ enqueue(new RunnableWrapper(runnable)); } @@ -707,6 +738,7 @@ protected void runQueuedTasks() { * Do not call manually. * Callback from ContextListener. */ + @Override public void update(){ // Make sure the audio renderer is available to callables AudioContext.setAudioRenderer(audioRenderer); @@ -752,6 +784,7 @@ protected void destroyInput(){ * Do not call manually. * Callback from ContextListener. */ + @Override public void destroy(){ stateManager.cleanup(); @@ -766,10 +799,12 @@ public void destroy(){ * @return The GUI viewport. Which is used for the on screen * statistics and FPS. */ + @Override public ViewPort getGuiViewPort() { return guiViewPort; } + @Override public ViewPort getViewPort() { return viewPort; } diff --git a/jme3-core/src/main/java/com/jme3/app/SimpleApplication.java b/jme3-core/src/main/java/com/jme3/app/SimpleApplication.java index 5a1fab7a94..940844a0ee 100644 --- a/jme3-core/src/main/java/com/jme3/app/SimpleApplication.java +++ b/jme3-core/src/main/java/com/jme3/app/SimpleApplication.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -32,6 +32,7 @@ package com.jme3.app; import com.jme3.app.state.AppState; +import com.jme3.app.state.ConstantVerifierState; import com.jme3.audio.AudioListenerState; import com.jme3.font.BitmapFont; import com.jme3.font.BitmapText; @@ -81,6 +82,7 @@ public abstract class SimpleApplication extends LegacyApplication { private class AppActionListener implements ActionListener { + @Override public void onAction(String name, boolean value, float tpf) { if (!value) { return; @@ -97,7 +99,8 @@ public void onAction(String name, boolean value, float tpf) { } public SimpleApplication() { - this(new StatsAppState(), new FlyCamAppState(), new AudioListenerState(), new DebugKeysAppState()); + this(new StatsAppState(), new FlyCamAppState(), new AudioListenerState(), new DebugKeysAppState(), + new ConstantVerifierState()); } public SimpleApplication( AppState... initialStates ) { diff --git a/jme3-core/src/main/java/com/jme3/app/StatsView.java b/jme3-core/src/main/java/com/jme3/app/StatsView.java index 4e9411f18f..d6e1382321 100644 --- a/jme3-core/src/main/java/com/jme3/app/StatsView.java +++ b/jme3-core/src/main/java/com/jme3/app/StatsView.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -96,6 +96,7 @@ public float getHeight() { return statText.getLineHeight() * statLabels.length; } + @Override public void update(float tpf) { if (!isEnabled()) @@ -133,6 +134,7 @@ public void cloneFields( Cloner cloner, Object original ) { throw new UnsupportedOperationException("Not yet implemented."); } + @Override public void setSpatial(Spatial spatial) { } @@ -145,6 +147,7 @@ public boolean isEnabled() { return enabled; } + @Override public void render(RenderManager rm, ViewPort vp) { } diff --git a/jme3-core/src/main/java/com/jme3/app/state/ConstantVerifierState.java b/jme3-core/src/main/java/com/jme3/app/state/ConstantVerifierState.java new file mode 100644 index 0000000000..1b4cd2e7a3 --- /dev/null +++ b/jme3-core/src/main/java/com/jme3/app/state/ConstantVerifierState.java @@ -0,0 +1,209 @@ +/* + * Copyright (c) 2014 jMonkeyEngine + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of 'jMonkeyEngine' nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package com.jme3.app.state; + +import java.util.Arrays; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.jme3.app.Application; +import com.jme3.math.*; +import com.jme3.util.SafeArrayList; + +import static java.lang.Float.NaN; +import static java.lang.Float.POSITIVE_INFINITY; +import static java.lang.Float.NEGATIVE_INFINITY; + +/** + * Checks the various JME 'constants' for drift using either asserts + * or straight checks. The list of constants can also be configured + * but defaults to the standard JME Vector3f, Quaternion, etc. constants. + * + * @author Paul Speed + */ +public class ConstantVerifierState extends BaseAppState { + + static final Logger log = Logger.getLogger(BaseAppState.class.getName()); + + // Note: I've used actual constructed objects for the good values + // instead of clone just to better catch cases where the values + // might have been corrupted even before the app state was touched. -pspeed + public static final Checker[] DEFAULT_CHECKS = new Checker[] { + new Checker(Vector3f.ZERO, new Vector3f(0, 0, 0)), + new Checker(Vector3f.NAN, new Vector3f(NaN, NaN, NaN)), + new Checker(Vector3f.UNIT_X, new Vector3f(1, 0, 0)), + new Checker(Vector3f.UNIT_Y, new Vector3f(0, 1, 0)), + new Checker(Vector3f.UNIT_Z, new Vector3f(0, 0, 1)), + new Checker(Vector3f.UNIT_XYZ, new Vector3f(1, 1, 1)), + new Checker(Vector3f.POSITIVE_INFINITY, new Vector3f(POSITIVE_INFINITY, POSITIVE_INFINITY, POSITIVE_INFINITY)), + new Checker(Vector3f.NEGATIVE_INFINITY, new Vector3f(NEGATIVE_INFINITY, NEGATIVE_INFINITY, NEGATIVE_INFINITY)), + new Checker(Quaternion.IDENTITY, new Quaternion()), + new Checker(Quaternion.DIRECTION_Z, new Quaternion().fromAxes(Vector3f.UNIT_X, Vector3f.UNIT_Y, Vector3f.UNIT_Z)), + new Checker(Quaternion.ZERO, new Quaternion(0, 0, 0, 0)), + new Checker(Vector2f.ZERO, new Vector2f(0f, 0f)), + new Checker(Vector2f.UNIT_XY, new Vector2f(1f, 1f)), + new Checker(Vector4f.ZERO, new Vector4f(0, 0, 0, 0)), + new Checker(Vector4f.NAN, new Vector4f(NaN, NaN, NaN, NaN)), + new Checker(Vector4f.UNIT_X, new Vector4f(1, 0, 0, 0)), + new Checker(Vector4f.UNIT_Y, new Vector4f(0, 1, 0, 0)), + new Checker(Vector4f.UNIT_Z, new Vector4f(0, 0, 1, 0)), + new Checker(Vector4f.UNIT_W, new Vector4f(0, 0, 0, 1)), + new Checker(Vector4f.UNIT_XYZW, new Vector4f(1, 1, 1, 1)), + new Checker(Vector4f.POSITIVE_INFINITY, new Vector4f(POSITIVE_INFINITY, POSITIVE_INFINITY, POSITIVE_INFINITY, POSITIVE_INFINITY)), + new Checker(Vector4f.NEGATIVE_INFINITY, new Vector4f(NEGATIVE_INFINITY, NEGATIVE_INFINITY, NEGATIVE_INFINITY, NEGATIVE_INFINITY)), + new Checker(Matrix3f.ZERO, new Matrix3f(0, 0, 0, 0, 0, 0, 0, 0, 0)), + new Checker(Matrix3f.IDENTITY, new Matrix3f()), + new Checker(Matrix4f.ZERO, new Matrix4f(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)), + new Checker(Matrix4f.IDENTITY, new Matrix4f()) + }; + + public enum ErrorType { Assert, Exception, Log }; + + private SafeArrayList checkers = new SafeArrayList<>(Checker.class); + private ErrorType errorType; + + /** + * Creates a verifier app state that will check all of the default + * constant checks using asserts. + */ + public ConstantVerifierState() { + this(ErrorType.Assert); + } + + /** + * Creates a verifier app state that will check all of the default + * constant checks using the specified error reporting mechanism. + */ + public ConstantVerifierState( ErrorType errorType ) { + this(errorType, DEFAULT_CHECKS); + } + + /** + * Creates a verifier app state that will check all of the specified + * checks and report errors using the specified error type. + */ + public ConstantVerifierState( ErrorType errorType, Checker... checkers ) { + this.errorType = errorType; + this.checkers.addAll(Arrays.asList(checkers)); + } + + public void addChecker( Object constant, Object goodValue ) { + checkers.add(new Checker(constant, goodValue)); + } + + public void setErrorType( ErrorType errorType ) { + this.errorType = errorType; + } + + public ErrorType getErrorType() { + return errorType; + } + + protected SafeArrayList getCheckers() { + return checkers; + } + + @Override + protected void initialize( Application app ) { + } + + @Override + protected void cleanup( Application app ) { + } + + @Override + protected void onEnable() { + } + + @Override + protected void onDisable() { + } + + @Override + public void postRender() { + // Check as late in the frame as possible. Subclasses can check earlier + // if they like. + checkValues(); + } + + protected void checkValues() { + for( Checker checker : checkers.getArray() ) { + switch( errorType ) { + default: + case Assert: + assert checker.isValid() : checker.toString(); + break; + case Exception: + if( !checker.isValid() ) { + throw new RuntimeException("Constant has changed, " + checker.toString()); + } + break; + case Log: + if( !checker.isValid() ) { + log.severe("Constant has changed, " + checker.toString()); + } + break; + } + } + } + + /** + * Checks the specified 'constant' value against it's known good + * value. These should obviously be different instances for this to + * mean anything. + */ + private static class Checker { + private Object constant; + private Object goodValue; + + public Checker( Object constant, Object goodValue ) { + if( constant == null ) { + throw new IllegalArgumentException("Constant cannot be null"); + } + if( !constant.equals(goodValue) ) { + throw new IllegalArgumentException("Constant value:" + constant + " does not match value:" + goodValue); + } + this.constant = constant; + this.goodValue = goodValue; + } + + public boolean isValid() { + return constant.equals(goodValue); + } + + @Override + public String toString() { + return "Constant:" + constant + ", correct value:" + goodValue + ", type:" + goodValue.getClass(); + } + } +} diff --git a/jme3-core/src/main/java/com/jme3/app/state/ScreenshotAppState.java b/jme3-core/src/main/java/com/jme3/app/state/ScreenshotAppState.java index 4a2b1acc89..a1cd85fd83 100644 --- a/jme3-core/src/main/java/com/jme3/app/state/ScreenshotAppState.java +++ b/jme3-core/src/main/java/com/jme3/app/state/ScreenshotAppState.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -187,6 +187,7 @@ public void initialize(AppStateManager stateManager, Application app) { super.initialize(stateManager, app); } + @Override public void onAction(String name, boolean value, float tpf) { if (value){ capture = true; @@ -197,6 +198,7 @@ public void takeScreenshot() { capture = true; } + @Override public void initialize(RenderManager rm, ViewPort vp) { renderer = rm.getRenderer(); this.rm = rm; @@ -208,18 +210,22 @@ public boolean isInitialized() { return super.isInitialized() && renderer != null; } + @Override public void reshape(ViewPort vp, int w, int h) { outBuf = BufferUtils.createByteBuffer(w * h * 4); width = w; height = h; } + @Override public void preFrame(float tpf) { } + @Override public void postQueue(RenderQueue rq) { } + @Override public void postFrame(FrameBuffer out) { if (capture){ capture = false; diff --git a/jme3-core/src/main/java/com/jme3/asset/AssetKey.java b/jme3-core/src/main/java/com/jme3/asset/AssetKey.java index 4066d7e14f..f8439c1112 100644 --- a/jme3-core/src/main/java/com/jme3/asset/AssetKey.java +++ b/jme3-core/src/main/java/com/jme3/asset/AssetKey.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -191,11 +191,13 @@ public String toString(){ return name; } + @Override public void write(JmeExporter ex) throws IOException { OutputCapsule oc = ex.getCapsule(this); oc.write(name, "name", null); } + @Override public void read(JmeImporter im) throws IOException { InputCapsule ic = im.getCapsule(this); name = reducePath(ic.readString("name", null)); diff --git a/jme3-core/src/main/java/com/jme3/asset/CloneableAssetProcessor.java b/jme3-core/src/main/java/com/jme3/asset/CloneableAssetProcessor.java index bc6529b6b1..6303e1a5eb 100644 --- a/jme3-core/src/main/java/com/jme3/asset/CloneableAssetProcessor.java +++ b/jme3-core/src/main/java/com/jme3/asset/CloneableAssetProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -39,10 +39,12 @@ */ public class CloneableAssetProcessor implements AssetProcessor { + @Override public Object postProcess(AssetKey key, Object obj) { return obj; } + @Override public Object createClone(Object obj) { CloneableSmartAsset asset = (CloneableSmartAsset) obj; return asset.clone(); diff --git a/jme3-core/src/main/java/com/jme3/asset/DesktopAssetManager.java b/jme3-core/src/main/java/com/jme3/asset/DesktopAssetManager.java index 0c92e19e91..6816fceac6 100644 --- a/jme3-core/src/main/java/com/jme3/asset/DesktopAssetManager.java +++ b/jme3-core/src/main/java/com/jme3/asset/DesktopAssetManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -99,26 +99,32 @@ private void loadConfigFile(URL configFile) { } } + @Override public void addClassLoader(ClassLoader loader) { classLoaders.add(loader); } + @Override public void removeClassLoader(ClassLoader loader) { classLoaders.remove(loader); } + @Override public List getClassLoaders(){ return Collections.unmodifiableList(classLoaders); } + @Override public void addAssetEventListener(AssetEventListener listener) { eventListeners.add(listener); } + @Override public void removeAssetEventListener(AssetEventListener listener) { eventListeners.remove(listener); } + @Override public void clearAssetEventListeners() { eventListeners.clear(); } @@ -128,6 +134,7 @@ public void setAssetEventListener(AssetEventListener listener){ eventListeners.add(listener); } + @Override public void registerLoader(Class loader, String ... extensions){ handler.addLoader(loader, extensions); if (logger.isLoggable(Level.FINER)){ @@ -150,6 +157,7 @@ public void registerLoader(String clsName, String ... extensions){ } } + @Override public void unregisterLoader(Class loaderClass) { handler.removeLoader(loaderClass); if (logger.isLoggable(Level.FINER)){ @@ -158,6 +166,7 @@ public void unregisterLoader(Class loaderClass) { } } + @Override public void registerLocator(String rootPath, Class locatorClass){ handler.addLocator(locatorClass, rootPath); if (logger.isLoggable(Level.FINER)){ @@ -180,6 +189,7 @@ public void registerLocator(String rootPath, String clsName){ } } + @Override public void unregisterLocator(String rootPath, Class clazz){ handler.removeLocator(clazz, rootPath); if (logger.isLoggable(Level.FINER)){ @@ -188,6 +198,7 @@ public void unregisterLocator(String rootPath, Class cla } } + @Override public AssetInfo locateAsset(AssetKey key){ AssetInfo info = handler.tryLocate(key); if (info == null){ @@ -383,48 +394,59 @@ public T loadAsset(AssetKey key){ return clone; } + @Override public Object loadAsset(String name){ return loadAsset(new AssetKey(name)); } + @Override public Texture loadTexture(TextureKey key){ - return (Texture) loadAsset(key); + return loadAsset(key); } + @Override public Material loadMaterial(String name){ - return (Material) loadAsset(new MaterialKey(name)); + return loadAsset(new MaterialKey(name)); } + @Override public Texture loadTexture(String name){ TextureKey key = new TextureKey(name, true); key.setGenerateMips(true); return loadTexture(key); } + @Override public AudioData loadAudio(AudioKey key){ - return (AudioData) loadAsset(key); + return loadAsset(key); } + @Override public AudioData loadAudio(String name){ return loadAudio(new AudioKey(name, false)); } + @Override public BitmapFont loadFont(String name){ return (BitmapFont) loadAsset(new AssetKey(name)); } + @Override public Spatial loadModel(ModelKey key){ - return (Spatial) loadAsset(key); + return loadAsset(key); } + @Override public Spatial loadModel(String name){ return loadModel(new ModelKey(name)); } + @Override public FilterPostProcessor loadFilter(FilterKey key){ - return (FilterPostProcessor) loadAsset(key); + return loadAsset(key); } + @Override public FilterPostProcessor loadFilter(String name){ return loadFilter(new FilterKey(name)); } diff --git a/jme3-core/src/main/java/com/jme3/asset/ImplHandler.java b/jme3-core/src/main/java/com/jme3/asset/ImplHandler.java index 581c18b4ee..ca7fe2381d 100644 --- a/jme3-core/src/main/java/com/jme3/asset/ImplHandler.java +++ b/jme3-core/src/main/java/com/jme3/asset/ImplHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -120,16 +120,11 @@ protected T initialValue(){ ((AssetLocator)obj).setRootPath(path); } return obj; - } catch (InstantiationException ex) { + } catch (InstantiationException | IllegalAccessException ex) { logger.log(Level.SEVERE,"Cannot create locator of type {0}, does" - + " the class have an empty and publically accessible"+ + + " the class have an empty and publicly accessible"+ " constructor?", type.getName()); logger.throwing(type.getName(), "", ex); - } catch (IllegalAccessException ex) { - logger.log(Level.SEVERE,"Cannot create locator of type {0}, " - + "does the class have an empty and publically " - + "accessible constructor?", type.getName()); - logger.throwing(type.getName(), "", ex); } return null; } diff --git a/jme3-core/src/main/java/com/jme3/asset/ThreadingManager.java b/jme3-core/src/main/java/com/jme3/asset/ThreadingManager.java index 28f1cdb04d..4fe8bca133 100644 --- a/jme3-core/src/main/java/com/jme3/asset/ThreadingManager.java +++ b/jme3-core/src/main/java/com/jme3/asset/ThreadingManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -53,6 +53,7 @@ public ThreadingManager(AssetManager owner){ } protected class LoadingThreadFactory implements ThreadFactory { + @Override public Thread newThread(Runnable r) { Thread t = new Thread(r, "jME3-threadpool-" + (nextThreadId++)); t.setDaemon(true); @@ -69,6 +70,7 @@ public LoadingTask(AssetKey assetKey) { this.assetKey = assetKey; } + @Override public T call() throws Exception { return owner.loadAsset(assetKey); } diff --git a/jme3-core/src/main/java/com/jme3/asset/cache/SimpleAssetCache.java b/jme3-core/src/main/java/com/jme3/asset/cache/SimpleAssetCache.java index 0b3617ac05..94818a1592 100644 --- a/jme3-core/src/main/java/com/jme3/asset/cache/SimpleAssetCache.java +++ b/jme3-core/src/main/java/com/jme3/asset/cache/SimpleAssetCache.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -46,25 +46,31 @@ public class SimpleAssetCache implements AssetCache { private final ConcurrentHashMap keyToAssetMap = new ConcurrentHashMap(); + @Override public void addToCache(AssetKey key, T obj) { keyToAssetMap.put(key, obj); } + @Override public void registerAssetClone(AssetKey key, T clone) { } + @Override public T getFromCache(AssetKey key) { return (T) keyToAssetMap.get(key); } + @Override public boolean deleteFromCache(AssetKey key) { return keyToAssetMap.remove(key) != null; } + @Override public void clearCache() { keyToAssetMap.clear(); } + @Override public void notifyNoAssetClone() { } diff --git a/jme3-core/src/main/java/com/jme3/asset/cache/WeakRefAssetCache.java b/jme3-core/src/main/java/com/jme3/asset/cache/WeakRefAssetCache.java index 42f73f4a5a..23e96fd389 100644 --- a/jme3-core/src/main/java/com/jme3/asset/cache/WeakRefAssetCache.java +++ b/jme3-core/src/main/java/com/jme3/asset/cache/WeakRefAssetCache.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -84,6 +84,7 @@ private void removeCollectedAssets(){ } } + @Override public void addToCache(AssetKey key, T obj) { removeCollectedAssets(); @@ -93,6 +94,7 @@ public void addToCache(AssetKey key, T obj) { assetCache.put(key, ref); } + @Override public T getFromCache(AssetKey key) { AssetRef ref = assetCache.get(key); if (ref != null){ @@ -102,17 +104,21 @@ public T getFromCache(AssetKey key) { } } + @Override public boolean deleteFromCache(AssetKey key) { return assetCache.remove(key) != null; } + @Override public void clearCache() { assetCache.clear(); } + @Override public void registerAssetClone(AssetKey key, T clone) { } + @Override public void notifyNoAssetClone() { } } diff --git a/jme3-core/src/main/java/com/jme3/asset/cache/WeakRefCloneAssetCache.java b/jme3-core/src/main/java/com/jme3/asset/cache/WeakRefCloneAssetCache.java index c7446dfc39..989376c3d8 100644 --- a/jme3-core/src/main/java/com/jme3/asset/cache/WeakRefCloneAssetCache.java +++ b/jme3-core/src/main/java/com/jme3/asset/cache/WeakRefCloneAssetCache.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -119,6 +119,7 @@ private void removeCollectedAssets(){ } } + @Override public void addToCache(AssetKey originalKey, T obj) { // Make room for new asset removeCollectedAssets(); @@ -143,16 +144,19 @@ public void addToCache(AssetKey originalKey, T obj) { loadStack.add(originalKey); } + @Override public void registerAssetClone(AssetKey key, T clone) { ArrayList loadStack = assetLoadStack.get(); ((CloneableSmartAsset)clone).setKey(loadStack.remove(loadStack.size() - 1)); } + @Override public void notifyNoAssetClone() { ArrayList loadStack = assetLoadStack.get(); loadStack.remove(loadStack.size() - 1); } + @Override public T getFromCache(AssetKey key) { AssetRef smartInfo = smartCache.get(key); if (smartInfo == null) { @@ -177,6 +181,7 @@ public T getFromCache(AssetKey key) { } } + @Override public boolean deleteFromCache(AssetKey key) { ArrayList loadStack = assetLoadStack.get(); @@ -188,6 +193,7 @@ public boolean deleteFromCache(AssetKey key) { return smartCache.remove(key) != null; } + @Override public void clearCache() { ArrayList loadStack = assetLoadStack.get(); diff --git a/jme3-core/src/main/java/com/jme3/audio/AudioBuffer.java b/jme3-core/src/main/java/com/jme3/audio/AudioBuffer.java index 230299f5de..8350d995b6 100644 --- a/jme3-core/src/main/java/com/jme3/audio/AudioBuffer.java +++ b/jme3-core/src/main/java/com/jme3/audio/AudioBuffer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -59,6 +59,7 @@ protected AudioBuffer(int id){ super(id); } + @Override public DataType getDataType() { return DataType.Buffer; } @@ -67,6 +68,7 @@ public DataType getDataType() { * @return The duration of the audio in seconds. It is expected * that audio is uncompressed. */ + @Override public float getDuration(){ int bytesPerSec = (bitsPerSample / 8) * channels * sampleRate; if (audioData != null) @@ -98,6 +100,7 @@ public ByteBuffer getData(){ return audioData; } + @Override public void resetObject() { id = -1; setUpdateNeeded(); diff --git a/jme3-core/src/main/java/com/jme3/audio/AudioNode.java b/jme3-core/src/main/java/com/jme3/audio/AudioNode.java index fead019aea..5b56bee660 100644 --- a/jme3-core/src/main/java/com/jme3/audio/AudioNode.java +++ b/jme3-core/src/main/java/com/jme3/audio/AudioNode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012, 2016, 2018-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -161,7 +161,7 @@ public AudioNode(AssetManager assetManager, String name, DataType type) { @Deprecated public AudioNode(AssetManager assetManager, String name, boolean stream, boolean streamCache) { this.audioKey = new AudioKey(name, stream, streamCache); - this.data = (AudioData) assetManager.loadAsset(audioKey); + this.data = assetManager.loadAsset(audioKey); } /** @@ -252,6 +252,7 @@ public void pause(){ /** * Do not use. */ + @Override public final void setChannel(int channel) { if (status != AudioSource.Status.Stopped) { throw new IllegalStateException("Can only set source id when stopped"); @@ -263,6 +264,7 @@ public final void setChannel(int channel) { /** * Do not use. */ + @Override public int getChannel() { return channel; } @@ -271,6 +273,7 @@ public int getChannel() { * @return The {#link Filter dry filter} that is set. * @see AudioNode#setDryFilter(com.jme3.audio.Filter) */ + @Override public Filter getDryFilter() { return dryFilter; } @@ -315,6 +318,7 @@ public void setAudioData(AudioData audioData, AudioKey audioKey) { * {@link AudioNode#setAudioData(com.jme3.audio.AudioData, com.jme3.audio.AudioKey) } * or any of the constructors that initialize the audio data. */ + @Override public AudioData getAudioData() { return data; } @@ -324,6 +328,7 @@ public AudioData getAudioData() { * The status will be changed when either the {@link AudioNode#play() } * or {@link AudioNode#stop() } methods are called. */ + @Override public AudioSource.Status getStatus() { return status; } @@ -331,6 +336,7 @@ public AudioSource.Status getStatus() { /** * Do not use. */ + @Override public final void setStatus(AudioSource.Status status) { this.status = status; } @@ -353,6 +359,7 @@ public DataType getType() { * otherwise, false. * @see AudioNode#setLooping(boolean) */ + @Override public boolean isLooping() { return loop; } @@ -373,6 +380,7 @@ public void setLooping(boolean loop) { * * @see AudioNode#setPitch(float) */ + @Override public float getPitch() { return pitch; } @@ -399,6 +407,7 @@ public void setPitch(float pitch) { * * @see AudioNode#setVolume(float) */ + @Override public float getVolume() { return volume; } @@ -424,6 +433,7 @@ public void setVolume(float volume) { /** * @return the time offset in the sound sample when to start playing. */ + @Override public float getTimeOffset() { return timeOffset; } @@ -456,6 +466,7 @@ public float getPlaybackTime() { return 0; } + @Override public Vector3f getPosition() { return getWorldTranslation(); } @@ -465,6 +476,7 @@ public Vector3f getPosition() { * * @see AudioNode#setVelocity(com.jme3.math.Vector3f) */ + @Override public Vector3f getVelocity() { return velocity; } @@ -487,6 +499,7 @@ public void setVelocity(Vector3f velocity) { * * @see AudioNode#setReverbEnabled(boolean) */ + @Override public boolean isReverbEnabled() { return reverbEnabled; } @@ -513,6 +526,7 @@ public void setReverbEnabled(boolean reverbEnabled) { * * @see AudioNode#setReverbFilter(com.jme3.audio.Filter) */ + @Override public Filter getReverbFilter() { return reverbFilter; } @@ -538,6 +552,7 @@ public void setReverbFilter(Filter reverbFilter) { * * @see AudioNode#setMaxDistance(float) */ + @Override public float getMaxDistance() { return maxDistance; } @@ -572,6 +587,7 @@ public void setMaxDistance(float maxDistance) { * * @see AudioNode#setRefDistance(float) */ + @Override public float getRefDistance() { return refDistance; } @@ -601,6 +617,7 @@ public void setRefDistance(float refDistance) { * * @see AudioNode#setDirectional(boolean) */ + @Override public boolean isDirectional() { return directional; } @@ -626,6 +643,7 @@ public void setDirectional(boolean directional) { * * @see AudioNode#setDirection(com.jme3.math.Vector3f) */ + @Override public Vector3f getDirection() { return direction; } @@ -648,6 +666,7 @@ public void setDirection(Vector3f direction) { * * @see AudioNode#setInnerAngle(float) */ + @Override public float getInnerAngle() { return innerAngle; } @@ -669,6 +688,7 @@ public void setInnerAngle(float innerAngle) { * * @see AudioNode#setOuterAngle(float) */ + @Override public float getOuterAngle() { return outerAngle; } @@ -690,6 +710,7 @@ public void setOuterAngle(float outerAngle) { * * @see AudioNode#setPositional(boolean) */ + @Override public boolean isPositional() { return positional; } diff --git a/jme3-core/src/main/java/com/jme3/audio/AudioStream.java b/jme3-core/src/main/java/com/jme3/audio/AudioStream.java index 1047c673bc..5ae74a4a62 100644 --- a/jme3-core/src/main/java/com/jme3/audio/AudioStream.java +++ b/jme3-core/src/main/java/com/jme3/audio/AudioStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -115,6 +115,7 @@ public int readSamples(byte[] buf) { return readSamples(buf, 0, buf.length); } + @Override public float getDuration() { return duration; } @@ -181,6 +182,7 @@ public boolean isEOF() { * * @throws IOException */ + @Override public void close() { if (in != null && open) { try { diff --git a/jme3-core/src/main/java/com/jme3/audio/Filter.java b/jme3-core/src/main/java/com/jme3/audio/Filter.java index b46270c11e..9faa1f051b 100644 --- a/jme3-core/src/main/java/com/jme3/audio/Filter.java +++ b/jme3-core/src/main/java/com/jme3/audio/Filter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -47,10 +47,12 @@ protected Filter(int id){ super(id); } + @Override public void write(JmeExporter ex) throws IOException { // nothing to save } + @Override public void read(JmeImporter im) throws IOException { // nothing to read } diff --git a/jme3-core/src/main/java/com/jme3/audio/LowPassFilter.java b/jme3-core/src/main/java/com/jme3/audio/LowPassFilter.java index 4445c2463c..8ce385773c 100644 --- a/jme3-core/src/main/java/com/jme3/audio/LowPassFilter.java +++ b/jme3-core/src/main/java/com/jme3/audio/LowPassFilter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -76,6 +76,7 @@ public void setVolume(float volume) { this.updateNeeded = true; } + @Override public void write(JmeExporter ex) throws IOException{ super.write(ex); OutputCapsule oc = ex.getCapsule(this); diff --git a/jme3-core/src/main/java/com/jme3/audio/openal/ALAudioRenderer.java b/jme3-core/src/main/java/com/jme3/audio/openal/ALAudioRenderer.java index a4bcddeead..e127ac3c1a 100644 --- a/jme3-core/src/main/java/com/jme3/audio/openal/ALAudioRenderer.java +++ b/jme3-core/src/main/java/com/jme3/audio/openal/ALAudioRenderer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -216,6 +216,7 @@ private void destroyOpenAL() { alc.destroyALC(); } + @Override public void initialize() { if (decoderThread.isAlive()) { throw new IllegalStateException("Initialize already called"); @@ -237,6 +238,7 @@ private void checkDead() { } } + @Override public void run() { long updateRateNanos = (long) (UPDATE_RATE * 1000000000); mainloop: @@ -267,6 +269,7 @@ public void run() { } } + @Override public void cleanup() { // kill audio thread if (!decoderThread.isAlive()) { @@ -359,6 +362,7 @@ public float getSourcePlaybackTime(AudioSource src) { } } + @Override public void updateSourceParam(AudioSource src, AudioParam param) { checkDead(); synchronized (threadLock) { @@ -585,6 +589,7 @@ private void setSourceParams(int id, AudioSource src, boolean forceNonLoop) { } } + @Override public void updateListenerParam(Listener listener, ListenerParam param) { checkDead(); synchronized (threadLock) { @@ -651,6 +656,7 @@ private void freeChannel(int index) { } } + @Override public void setEnvironment(Environment env) { checkDead(); synchronized (threadLock) { @@ -821,7 +827,7 @@ private void clearChannel(int index) { al.alSourcei(sourceId, EFX.AL_DIRECT_FILTER, EFX.AL_FILTER_NULL); } if (src.isPositional()) { - AudioSource pas = (AudioSource) src; + AudioSource pas = src; if (pas.isReverbEnabled() && supportEfx) { al.alSource3i(sourceId, EFX.AL_AUXILIARY_SEND_FILTER, 0, 0, EFX.AL_FILTER_NULL); } @@ -845,6 +851,7 @@ private AudioSource.Status convertStatus(int oalStatus) { } } + @Override public void update(float tpf) { synchronized (threadLock) { updateInRenderThread(tpf); @@ -977,6 +984,7 @@ public void updateInDecoderThread(float tpf) { objManager.deleteUnused(this); } + @Override public void setListener(Listener listener) { checkDead(); synchronized (threadLock) { @@ -996,6 +1004,7 @@ public void setListener(Listener listener) { } } + @Override public void pauseAll() { if (!supportPauseDevice) { throw new UnsupportedOperationException("Pause device is NOT supported!"); @@ -1004,6 +1013,7 @@ public void pauseAll() { alc.alcDevicePauseSOFT(); } + @Override public void resumeAll() { if (!supportPauseDevice) { throw new UnsupportedOperationException("Pause device is NOT supported!"); @@ -1012,6 +1022,7 @@ public void resumeAll() { alc.alcDeviceResumeSOFT(); } + @Override public void playSourceInstance(AudioSource src) { checkDead(); synchronized (threadLock) { @@ -1049,6 +1060,7 @@ public void playSourceInstance(AudioSource src) { } } + @Override public void playSource(AudioSource src) { checkDead(); synchronized (threadLock) { @@ -1087,6 +1099,7 @@ public void playSource(AudioSource src) { } } + @Override public void pauseSource(AudioSource src) { checkDead(); synchronized (threadLock) { @@ -1103,6 +1116,7 @@ public void pauseSource(AudioSource src) { } } + @Override public void stopSource(AudioSource src) { synchronized (threadLock) { if (audioDisabled) { @@ -1196,6 +1210,7 @@ private void updateAudioData(AudioData ad) { } } + @Override public void deleteFilter(Filter filter) { int id = filter.getId(); if (id != -1) { @@ -1206,6 +1221,7 @@ public void deleteFilter(Filter filter) { } } + @Override public void deleteAudioData(AudioData ad) { synchronized (threadLock) { if (audioDisabled) { diff --git a/jme3-core/src/main/java/com/jme3/bounding/BoundingBox.java b/jme3-core/src/main/java/com/jme3/bounding/BoundingBox.java index 6e422dea42..37722efb26 100644 --- a/jme3-core/src/main/java/com/jme3/bounding/BoundingBox.java +++ b/jme3-core/src/main/java/com/jme3/bounding/BoundingBox.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2013 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -106,6 +106,7 @@ public BoundingBox(Vector3f min, Vector3f max) { setMinMax(min, max); } + @Override public Type getType() { return Type.AABB; } @@ -117,6 +118,7 @@ public Type getType() { * @param points * the points to contain. */ + @Override public void computeFromPoints(FloatBuffer points) { containAABB(points); } @@ -293,6 +295,7 @@ public void containAABB(FloatBuffer points) { * @param store * box to store result in */ + @Override public BoundingVolume transform(Transform trans, BoundingVolume store) { BoundingBox box; @@ -326,6 +329,7 @@ public BoundingVolume transform(Transform trans, BoundingVolume store) { return box; } + @Override public BoundingVolume transform(Matrix4f trans, BoundingVolume store) { BoundingBox box; if (store == null || store.getType() != Type.AABB) { @@ -365,6 +369,7 @@ public BoundingVolume transform(Matrix4f trans, BoundingVolume store) { * @param plane * the plane to check against. */ + @Override public Plane.Side whichSide(Plane plane) { float radius = FastMath.abs(xExtent * plane.getNormal().getX()) + FastMath.abs(yExtent * plane.getNormal().getY()) @@ -392,6 +397,7 @@ public Plane.Side whichSide(Plane plane) { * @return this box (with its components modified) or null if the second * volume is of some type other than AABB or Sphere */ + @Override public BoundingVolume merge(BoundingVolume volume) { return mergeLocal(volume); } @@ -406,6 +412,7 @@ public BoundingVolume merge(BoundingVolume volume) { * @return this box (with its components modified) or null if the second * volume is of some type other than AABB or Sphere */ + @Override public BoundingVolume mergeLocal(BoundingVolume volume) { if (volume == null) { return this; @@ -548,6 +555,7 @@ private BoundingBox mergeLocal(Vector3f c, float x, float y, float z) { * a new store is created. * @return the new BoundingBox */ + @Override public BoundingVolume clone(BoundingVolume store) { if (store != null && store.getType() == Type.AABB) { BoundingBox rVal = (BoundingBox) store; @@ -584,6 +592,7 @@ public String toString() { * * @see BoundingVolume#intersects(com.jme3.bounding.BoundingVolume) */ + @Override public boolean intersects(BoundingVolume bv) { return bv.intersectsBoundingBox(this); } @@ -593,6 +602,7 @@ public boolean intersects(BoundingVolume bv) { * * @see BoundingVolume#intersectsSphere(com.jme3.bounding.BoundingSphere) */ + @Override public boolean intersectsSphere(BoundingSphere bs) { return bs.intersectsBoundingBox(this); } @@ -604,6 +614,7 @@ public boolean intersectsSphere(BoundingSphere bs) { * * @see BoundingVolume#intersectsBoundingBox(com.jme3.bounding.BoundingBox) */ + @Override public boolean intersectsBoundingBox(BoundingBox bb) { assert Vector3f.isValidVector(center) && Vector3f.isValidVector(bb.center); @@ -636,6 +647,7 @@ public boolean intersectsBoundingBox(BoundingBox bb) { * * @see BoundingVolume#intersects(com.jme3.math.Ray) */ + @Override public boolean intersects(Ray ray) { assert Vector3f.isValidVector(center); @@ -801,7 +813,7 @@ public int collideWith(Collidable other, CollisionResults results) { } return 0; } else if (other instanceof Spatial) { - return ((Spatial)other).collideWith(this, results); + return other.collideWith(this, results); } else { throw new UnsupportedCollisionException("With: " + other.getClass().getSimpleName()); } @@ -853,6 +865,7 @@ public boolean intersects(Vector3f point) { && FastMath.abs(center.z - point.z) <= zExtent; } + @Override public float distanceToEdge(Vector3f point) { // compute coordinates of point in box coordinate system TempVars vars= TempVars.get(); diff --git a/jme3-core/src/main/java/com/jme3/bounding/BoundingSphere.java b/jme3-core/src/main/java/com/jme3/bounding/BoundingSphere.java index 7936c72244..ba6fefb4aa 100644 --- a/jme3-core/src/main/java/com/jme3/bounding/BoundingSphere.java +++ b/jme3-core/src/main/java/com/jme3/bounding/BoundingSphere.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -85,6 +85,7 @@ public BoundingSphere(float r, Vector3f c) { this.radius = r; } + @Override public Type getType() { return Type.Sphere; } @@ -116,6 +117,7 @@ public void setRadius(float radius) { * @param points * the points to contain. */ + @Override public void computeFromPoints(FloatBuffer points) { calcWelzl(points); } @@ -383,6 +385,7 @@ public void averagePoints(Vector3f[] points) { * @return BoundingVolume * @return ref */ + @Override public BoundingVolume transform(Transform trans, BoundingVolume store) { BoundingSphere sphere; if (store == null || store.getType() != BoundingVolume.Type.Sphere) { @@ -398,6 +401,7 @@ public BoundingVolume transform(Transform trans, BoundingVolume store) { return sphere; } + @Override public BoundingVolume transform(Matrix4f trans, BoundingVolume store) { BoundingSphere sphere; if (store == null || store.getType() != BoundingVolume.Type.Sphere) { @@ -441,6 +445,7 @@ private float getMaxAxis(Vector3f scale) { * the plane to check against. * @return side */ + @Override public Plane.Side whichSide(Plane plane) { float distance = plane.pseudoDistance(center); @@ -461,6 +466,7 @@ public Plane.Side whichSide(Plane plane) { * the sphere to combine with this sphere. * @return a new sphere */ + @Override public BoundingVolume merge(BoundingVolume volume) { if (volume == null) { return this; @@ -506,6 +512,7 @@ public BoundingVolume merge(BoundingVolume volume) { * the sphere to combine with this sphere. * @return this */ + @Override public BoundingVolume mergeLocal(BoundingVolume volume) { if (volume == null) { return this; @@ -629,6 +636,7 @@ private BoundingVolume merge(float temp_radius, Vector3f temp_center, * a new store is created. * @return the new BoundingSphere */ + @Override public BoundingVolume clone(BoundingVolume store) { if (store != null && store.getType() == Type.Sphere) { BoundingSphere rVal = (BoundingSphere) store; @@ -661,6 +669,7 @@ public String toString() { * * @see com.jme.bounding.BoundingVolume#intersects(com.jme.bounding.BoundingVolume) */ + @Override public boolean intersects(BoundingVolume bv) { return bv.intersectsSphere(this); } @@ -670,6 +679,7 @@ public boolean intersects(BoundingVolume bv) { * * @see com.jme.bounding.BoundingVolume#intersectsSphere(com.jme.bounding.BoundingSphere) */ + @Override public boolean intersectsSphere(BoundingSphere bs) { return Intersection.intersect(bs, center, radius); } @@ -679,6 +689,7 @@ public boolean intersectsSphere(BoundingSphere bs) { * * @see com.jme.bounding.BoundingVolume#intersectsBoundingBox(com.jme.bounding.BoundingBox) */ + @Override public boolean intersectsBoundingBox(BoundingBox bb) { return Intersection.intersect(bb, center, radius); } @@ -697,6 +708,7 @@ public boolean intersectsBoundingBox(BoundingBox bb) { * * @see com.jme.bounding.BoundingVolume#intersects(com.jme.math.Ray) */ + @Override public boolean intersects(Ray ray) { assert Vector3f.isValidVector(center); @@ -988,6 +1000,7 @@ private int collideWithTri(Triangle tri, CollisionResults results) { } } + @Override public int collideWith(Collidable other, CollisionResults results) { if (other instanceof Ray) { Ray ray = (Ray) other; @@ -1003,7 +1016,7 @@ public int collideWith(Collidable other, CollisionResults results) { } return 0; } else if (other instanceof Spatial) { - return ((Spatial)other).collideWith(this, results); + return other.collideWith(this, results); } else { throw new UnsupportedCollisionException(); } @@ -1034,6 +1047,7 @@ public boolean intersects(Vector3f point) { return center.distanceSquared(point) <= (getRadius() * getRadius()); } + @Override public float distanceToEdge(Vector3f point) { return center.distance(point) - radius; } diff --git a/jme3-core/src/main/java/com/jme3/bounding/BoundingVolume.java b/jme3-core/src/main/java/com/jme3/bounding/BoundingVolume.java index 4491fcedf1..504a61e28a 100644 --- a/jme3-core/src/main/java/com/jme3/bounding/BoundingVolume.java +++ b/jme3-core/src/main/java/com/jme3/bounding/BoundingVolume.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -317,10 +317,12 @@ public BoundingVolume clone() { } } + @Override public void write(JmeExporter e) throws IOException { e.getCapsule(this).write(center, "center", Vector3f.ZERO); } + @Override public void read(JmeImporter e) throws IOException { center = (Vector3f) e.getCapsule(this).readSavable("center", Vector3f.ZERO.clone()); } diff --git a/jme3-core/src/main/java/com/jme3/cinematic/Cinematic.java b/jme3-core/src/main/java/com/jme3/cinematic/Cinematic.java index 3bcbc17a74..9c5af0e35b 100644 --- a/jme3-core/src/main/java/com/jme3/cinematic/Cinematic.java +++ b/jme3-core/src/main/java/com/jme3/cinematic/Cinematic.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -105,7 +105,7 @@ public class Cinematic extends AbstractCinematicEvent implements AppState { * Used for serialization creates a cinematic, don't use this constructor * directly */ - public Cinematic() { + protected Cinematic() { super(); } @@ -270,6 +270,7 @@ public void setSpeed(float speed) { * @param stateManager the state manager * @param app the application */ + @Override public void initialize(AppStateManager stateManager, Application app) { initEvent(app, this); for (CinematicEvent cinematicEvent : cinematicEvents) { @@ -288,6 +289,7 @@ public void initialize(AppStateManager stateManager, Application app) { * * @return true if initialized, otherwise false */ + @Override public boolean isInitialized() { return initialized; } @@ -312,6 +314,7 @@ public String getId() { * * @param enabled true or false */ + @Override public void setEnabled(boolean enabled) { if (enabled) { play(); @@ -324,6 +327,7 @@ public void setEnabled(boolean enabled) { * * @return true if enabled */ + @Override public boolean isEnabled() { return playState == PlayState.Playing; } @@ -333,6 +337,7 @@ public boolean isEnabled() { * * @param stateManager the state manager */ + @Override public void stateAttached(AppStateManager stateManager) { } @@ -341,6 +346,7 @@ public void stateAttached(AppStateManager stateManager) { * * @param stateManager the state manager */ + @Override public void stateDetached(AppStateManager stateManager) { stop(); } @@ -508,6 +514,7 @@ public boolean removeCinematicEvent(KeyFrame keyFrame, CinematicEvent cinematicE * * @see AppState#render(com.jme3.renderer.RenderManager) */ + @Override public void render(RenderManager rm) { } @@ -516,6 +523,7 @@ public void render(RenderManager rm) { * * @see AppState#postRender() */ + @Override public void postRender() { } @@ -524,6 +532,7 @@ public void postRender() { * * @see AppState#cleanup() */ + @Override public void cleanup() { } diff --git a/jme3-core/src/main/java/com/jme3/cinematic/KeyFrame.java b/jme3-core/src/main/java/com/jme3/cinematic/KeyFrame.java index 458a482a94..d8ad5b69d4 100644 --- a/jme3-core/src/main/java/com/jme3/cinematic/KeyFrame.java +++ b/jme3-core/src/main/java/com/jme3/cinematic/KeyFrame.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -69,12 +69,14 @@ public boolean isEmpty(){ return cinematicEvents.isEmpty(); } + @Override public void write(JmeExporter ex) throws IOException { OutputCapsule oc = ex.getCapsule(this); oc.writeSavableArrayList((ArrayList) cinematicEvents, "cinematicEvents", null); oc.write(index, "index", 0); } + @Override public void read(JmeImporter im) throws IOException { InputCapsule ic = im.getCapsule(this); cinematicEvents = ic.readSavableArrayList("cinematicEvents", null); diff --git a/jme3-core/src/main/java/com/jme3/cinematic/MotionPath.java b/jme3-core/src/main/java/com/jme3/cinematic/MotionPath.java index a0f978f0a1..1e6155d185 100644 --- a/jme3-core/src/main/java/com/jme3/cinematic/MotionPath.java +++ b/jme3-core/src/main/java/com/jme3/cinematic/MotionPath.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -192,7 +192,7 @@ public Vector2f getWayPointIndexForDistance(float distance, Vector2f store) { int i = 0; for (Float len : spline.getSegmentsLength()) { if (sum + len >= distance) { - return new Vector2f((float) i, (distance - sum) / len); + return new Vector2f(i, (distance - sum) / len); } sum += len; i++; diff --git a/jme3-core/src/main/java/com/jme3/cinematic/TimeLine.java b/jme3-core/src/main/java/com/jme3/cinematic/TimeLine.java index e51c909ddb..554d586819 100644 --- a/jme3-core/src/main/java/com/jme3/cinematic/TimeLine.java +++ b/jme3-core/src/main/java/com/jme3/cinematic/TimeLine.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -93,7 +93,7 @@ public int getKeyFrameIndexFromTime(float time) { } public float getKeyFrameTime(KeyFrame keyFrame) { - return (float)keyFrame.getIndex()/(float)keyFramesPerSeconds; + return keyFrame.getIndex()/(float)keyFramesPerSeconds; } public Collection getAllKeyFrames() { @@ -104,6 +104,7 @@ public int getLastKeyFrameIndex() { return lastKeyFrameIndex; } + @Override public void write(JmeExporter ex) throws IOException { OutputCapsule oc = ex.getCapsule(this); ArrayList list = new ArrayList(); @@ -111,6 +112,7 @@ public void write(JmeExporter ex) throws IOException { oc.writeSavableArrayList(list, "keyFrames", null); } + @Override public void read(JmeImporter im) throws IOException { InputCapsule ic = im.getCapsule(this); ArrayList list = ic.readSavableArrayList("keyFrames", null); diff --git a/jme3-core/src/main/java/com/jme3/cinematic/events/AbstractCinematicEvent.java b/jme3-core/src/main/java/com/jme3/cinematic/events/AbstractCinematicEvent.java index 6fb4899c36..a65a078827 100644 --- a/jme3-core/src/main/java/com/jme3/cinematic/events/AbstractCinematicEvent.java +++ b/jme3-core/src/main/java/com/jme3/cinematic/events/AbstractCinematicEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -104,6 +104,7 @@ public AbstractCinematicEvent(float initialDuration, LoopMode loopMode) { * or when it was force-stopped during playback. * By default, this method just calls regular stop(). */ + @Override public void forceStop(){ stop(); } @@ -111,6 +112,7 @@ public void forceStop(){ /** * Play this event. */ + @Override public void play() { onPlay(); playState = PlayState.Playing; @@ -131,6 +133,7 @@ public void play() { * Used internally only. * @param tpf time per frame. */ + @Override public void internalUpdate(float tpf) { if (playState == PlayState.Playing) { time = time + (tpf * speed); @@ -161,6 +164,7 @@ public void internalUpdate(float tpf) { * Stops the animation. * Next time when play() is called, the animation starts from the beginning. */ + @Override public void stop() { onStop(); time = 0; @@ -182,6 +186,7 @@ public void stop() { * Pause this event. * Next time when play() is called, the animation restarts from here. */ + @Override public void pause() { onPause(); playState = PlayState.Paused; @@ -202,6 +207,7 @@ public void pause() { * Returns the actual duration of the animation (initialDuration/speed) * @return the duration (in seconds) */ + @Override public float getDuration() { return initialDuration / speed; } @@ -212,6 +218,7 @@ public float getDuration() { * At speed = 2, the animation will last initialDuration/2... * @param speed */ + @Override public void setSpeed(float speed) { this.speed = speed; } @@ -220,6 +227,7 @@ public void setSpeed(float speed) { * Returns the speed of the animation. * @return the speed */ + @Override public float getSpeed() { return speed; } @@ -228,6 +236,7 @@ public float getSpeed() { * Returns the current playstate of the animation (playing or paused or stopped). * @return the enum value */ + @Override public PlayState getPlayState() { return playState; } @@ -236,6 +245,7 @@ public PlayState getPlayState() { * Returns the initial duration of the animation at speed = 1 in seconds. * @return the duration in seconds */ + @Override public float getInitialDuration() { return initialDuration; } @@ -244,6 +254,7 @@ public float getInitialDuration() { * Sets the duration of the animation at speed = 1 in seconds. * @param initialDuration */ + @Override public void setInitialDuration(float initialDuration) { this.initialDuration = initialDuration; } @@ -253,6 +264,7 @@ public void setInitialDuration(float initialDuration) { * @see LoopMode * @return the enum value */ + @Override public LoopMode getLoopMode() { return loopMode; } @@ -262,6 +274,7 @@ public LoopMode getLoopMode() { * @see LoopMode * @param loopMode */ + @Override public void setLoopMode(LoopMode loopMode) { this.loopMode = loopMode; } @@ -271,6 +284,7 @@ public void setLoopMode(LoopMode loopMode) { * @param ex exporter * @throws IOException */ + @Override public void write(JmeExporter ex) throws IOException { OutputCapsule oc = ex.getCapsule(this); oc.write(playState, "playState", PlayState.Stopped); @@ -284,6 +298,7 @@ public void write(JmeExporter ex) throws IOException { * @param im importer * @throws IOException */ + @Override public void read(JmeImporter im) throws IOException { InputCapsule ic = im.getCapsule(this); playState = ic.readEnum("playState", PlayState.class, PlayState.Stopped); @@ -297,6 +312,7 @@ public void read(JmeImporter im) throws IOException { * @param app * @param cinematic */ + @Override public void initEvent(Application app, Cinematic cinematic) { } @@ -331,6 +347,7 @@ public void removeListener(CinematicEventListener listener) { * Fast-forward the event to the given timestamp. Time=0 is the start of the event. * @param time the time to fast forward to. */ + @Override public void setTime(float time) { this.time = time ; } @@ -338,10 +355,12 @@ public void setTime(float time) { /** * Return the current timestamp of the event. Time=0 is the start of the event. */ + @Override public float getTime() { return time; } + @Override public void dispose() { } diff --git a/jme3-core/src/main/java/com/jme3/cinematic/events/AnimationEvent.java b/jme3-core/src/main/java/com/jme3/cinematic/events/AnimationEvent.java index 9616ebca54..cc409b8ec5 100644 --- a/jme3-core/src/main/java/com/jme3/cinematic/events/AnimationEvent.java +++ b/jme3-core/src/main/java/com/jme3/cinematic/events/AnimationEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2019 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -75,7 +75,7 @@ public class AnimationEvent extends AbstractCinematicEvent { * used for serialization don't call directly use one of the following * constructors */ - public AnimationEvent() { + protected AnimationEvent() { super(); } diff --git a/jme3-core/src/main/java/com/jme3/cinematic/events/MotionEvent.java b/jme3-core/src/main/java/com/jme3/cinematic/events/MotionEvent.java index e7d217f45f..f4d56e21d4 100644 --- a/jme3-core/src/main/java/com/jme3/cinematic/events/MotionEvent.java +++ b/jme3-core/src/main/java/com/jme3/cinematic/events/MotionEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -159,6 +159,7 @@ public MotionEvent(Spatial spatial, MotionPath path, float initialDuration, Loop this.loopMode = loopMode; } + @Override public void update(float tpf) { if (isControl) { internalUpdate(tpf); @@ -200,6 +201,7 @@ public void setTime(float time) { onUpdate(0); } + @Override public void onUpdate(float tpf) { traveledDistance = path.interpolatePath(time, this, tpf); computeTargetDirection(); @@ -457,9 +459,11 @@ public boolean isEnabled() { return playState != PlayState.Stopped; } + @Override public void render(RenderManager rm, ViewPort vp) { } + @Override public void setSpatial(Spatial spatial) { this.spatial = spatial; } diff --git a/jme3-core/src/main/java/com/jme3/collision/CollisionResult.java b/jme3-core/src/main/java/com/jme3/collision/CollisionResult.java index d66ec62cfc..d0f6cb91e5 100644 --- a/jme3-core/src/main/java/com/jme3/collision/CollisionResult.java +++ b/jme3-core/src/main/java/com/jme3/collision/CollisionResult.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -97,6 +97,7 @@ public Triangle getTriangle(Triangle store){ return store; } + @Override public int compareTo(CollisionResult other) { return Float.compare(distance, other.distance); } @@ -134,6 +135,7 @@ public int getTriangleIndex() { return triangleIndex; } + @Override public String toString() { return "CollisionResult[geometry=" + geometry + ", contactPoint=" + contactPoint diff --git a/jme3-core/src/main/java/com/jme3/collision/CollisionResults.java b/jme3-core/src/main/java/com/jme3/collision/CollisionResults.java index 93c5c81b58..8728106c2c 100644 --- a/jme3-core/src/main/java/com/jme3/collision/CollisionResults.java +++ b/jme3-core/src/main/java/com/jme3/collision/CollisionResults.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -61,6 +61,7 @@ public void clear(){ * * @return the iterator */ + @Override public Iterator iterator() { if (results == null) { List dumbCompiler = Collections.emptyList(); diff --git a/jme3-core/src/main/java/com/jme3/collision/SweepSphere.java b/jme3-core/src/main/java/com/jme3/collision/SweepSphere.java index 75470dcb57..c1895449c3 100644 --- a/jme3-core/src/main/java/com/jme3/collision/SweepSphere.java +++ b/jme3-core/src/main/java/com/jme3/collision/SweepSphere.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -412,6 +412,7 @@ public static void main(String[] args){ } } + @Override public int collideWith(Collidable other, CollisionResults results) throws UnsupportedCollisionException { if (other instanceof AbstractTriangle){ diff --git a/jme3-core/src/main/java/com/jme3/collision/bih/BIHNode.java b/jme3-core/src/main/java/com/jme3/collision/bih/BIHNode.java index 52e4f91ca8..6f422baed3 100644 --- a/jme3-core/src/main/java/com/jme3/collision/bih/BIHNode.java +++ b/jme3-core/src/main/java/com/jme3/collision/bih/BIHNode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -111,6 +111,7 @@ public void setRightPlane(float rightPlane) { this.rightPlane = rightPlane; } + @Override public void write(JmeExporter ex) throws IOException { OutputCapsule oc = ex.getCapsule(this); oc.write(leftIndex, "left_index", 0); @@ -122,6 +123,7 @@ public void write(JmeExporter ex) throws IOException { oc.write(right, "right_node", null); } + @Override public void read(JmeImporter im) throws IOException { InputCapsule ic = im.getCapsule(this); leftIndex = ic.readInt("left_index", 0); diff --git a/jme3-core/src/main/java/com/jme3/collision/bih/BIHTree.java b/jme3-core/src/main/java/com/jme3/collision/bih/BIHTree.java index 2d7a4dc24e..8813cbed13 100644 --- a/jme3-core/src/main/java/com/jme3/collision/bih/BIHTree.java +++ b/jme3-core/src/main/java/com/jme3/collision/bih/BIHTree.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -461,6 +461,7 @@ private int collideWithBoundingVolume(BoundingVolume bv, return root.intersectWhere(bv, bbox, worldMatrix, this, results); } + @Override public int collideWith(Collidable other, Matrix4f worldMatrix, BoundingVolume worldBound, @@ -477,6 +478,7 @@ public int collideWith(Collidable other, } } + @Override public void write(JmeExporter ex) throws IOException { OutputCapsule oc = ex.getCapsule(this); oc.write(mesh, "mesh", null); @@ -486,6 +488,7 @@ public void write(JmeExporter ex) throws IOException { oc.write(triIndices, "indices", null); } + @Override public void read(JmeImporter im) throws IOException { InputCapsule ic = im.getCapsule(this); mesh = (Mesh) ic.readSavable("mesh", null); diff --git a/jme3-core/src/main/java/com/jme3/collision/bih/TriangleAxisComparator.java b/jme3-core/src/main/java/com/jme3/collision/bih/TriangleAxisComparator.java index 836a972e96..e503a63340 100644 --- a/jme3-core/src/main/java/com/jme3/collision/bih/TriangleAxisComparator.java +++ b/jme3-core/src/main/java/com/jme3/collision/bih/TriangleAxisComparator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -42,6 +42,7 @@ public TriangleAxisComparator(int axis){ this.axis = axis; } + @Override public int compare(BIHTriangle o1, BIHTriangle o2) { float v1, v2; Vector3f c1 = o1.getCenter(); diff --git a/jme3-core/src/main/java/com/jme3/effect/ParticleEmitter.java b/jme3-core/src/main/java/com/jme3/effect/ParticleEmitter.java index 19268b8175..367cab86b8 100644 --- a/jme3-core/src/main/java/com/jme3/effect/ParticleEmitter.java +++ b/jme3-core/src/main/java/com/jme3/effect/ParticleEmitter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -141,6 +141,7 @@ public void cloneFields( Cloner cloner, Object original ) { this.parentEmitter = cloner.clone(parentEmitter); } + @Override public void setSpatial(Spatial spatial) { } @@ -152,17 +153,21 @@ public boolean isEnabled() { return parentEmitter.isEnabled(); } + @Override public void update(float tpf) { parentEmitter.updateFromControl(tpf); } + @Override public void render(RenderManager rm, ViewPort vp) { parentEmitter.renderFromControl(rm, vp); } + @Override public void write(JmeExporter ex) throws IOException { } + @Override public void read(JmeImporter im) throws IOException { } } @@ -180,6 +185,7 @@ public ParticleEmitter clone(boolean cloneMaterial) { /** * The old clone() method that did not use the new Cloner utility. */ + @Override public ParticleEmitter oldClone(boolean cloneMaterial) { ParticleEmitter clone = (ParticleEmitter) super.clone(cloneMaterial); clone.shape = shape.deepClone(); @@ -297,7 +303,7 @@ public ParticleEmitter(String name, Type type, int numParticles) { /** * For serialization only. Do not use. */ - public ParticleEmitter() { + protected ParticleEmitter() { super(); setBatchHint(BatchHint.Never); } diff --git a/jme3-core/src/main/java/com/jme3/environment/generation/PrefilteredEnvMapFaceGenerator.java b/jme3-core/src/main/java/com/jme3/environment/generation/PrefilteredEnvMapFaceGenerator.java index cd4f969981..6d37f90fb1 100644 --- a/jme3-core/src/main/java/com/jme3/environment/generation/PrefilteredEnvMapFaceGenerator.java +++ b/jme3-core/src/main/java/com/jme3/environment/generation/PrefilteredEnvMapFaceGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -211,7 +211,7 @@ private Vector3f prefilterEnvMapTexel(CubeMapWrapper envMapReader, float roughne nbRotations = numSamples == 1 ? 1 : 18; } - float rad = 2f * FastMath.PI / (float) nbRotations; + float rad = 2f * FastMath.PI / nbRotations; // offset rotation to avoid sampling pattern float gi = (float) (FastMath.abs(N.z + N.x) * 256.0); float offset = rad * (FastMath.cos((gi * 0.5f) % (2f * FastMath.PI)) * 0.5f + 0.5f); diff --git a/jme3-core/src/main/java/com/jme3/environment/generation/RunnableWithProgress.java b/jme3-core/src/main/java/com/jme3/environment/generation/RunnableWithProgress.java index dec5abd2a5..f47887e0ea 100644 --- a/jme3-core/src/main/java/com/jme3/environment/generation/RunnableWithProgress.java +++ b/jme3-core/src/main/java/com/jme3/environment/generation/RunnableWithProgress.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -66,7 +66,7 @@ protected void setEnd(int end) { * @return fraction (≥0, ≤1) */ public double getProgress() { - return (double) progress / (double) end; + return progress / (double) end; } /** diff --git a/jme3-core/src/main/java/com/jme3/environment/util/CubeMapWrapper.java b/jme3-core/src/main/java/com/jme3/environment/util/CubeMapWrapper.java index d03dbe88c3..8ea7a19094 100644 --- a/jme3-core/src/main/java/com/jme3/environment/util/CubeMapWrapper.java +++ b/jme3-core/src/main/java/com/jme3/environment/util/CubeMapWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -148,7 +148,7 @@ public ColorRGBA getPixel(int x, int y, int face, ColorRGBA store) { store = new ColorRGBA(); } raster.setSlice(face); - return raster.getPixel((int) x, (int) y, store); + return raster.getPixel(x, y, store); } /** @@ -170,7 +170,7 @@ public ColorRGBA getPixel(int x, int y, int face, int mipLevel, ColorRGBA store) } mipMapRaster.setSlice(face); mipMapRaster.setMipLevel(mipLevel); - return mipMapRaster.getPixel((int) x, (int) y, store); + return mipMapRaster.getPixel(x, y, store); } /** @@ -209,7 +209,7 @@ public void setPixel(Vector3f vector, int mipLevel, ColorRGBA color) { */ public void setPixel(int x, int y, int face, ColorRGBA color) { raster.setSlice(face); - raster.setPixel((int) x, (int) y, color); + raster.setPixel(x, y, color); } /** @@ -227,7 +227,7 @@ public void setPixel(int x, int y, int face, int mipLevel, ColorRGBA color) { mipMapRaster.setSlice(face); mipMapRaster.setMipLevel(mipLevel); - mipMapRaster.setPixel((int) x, (int) y, color); + mipMapRaster.setPixel(x, y, color); } /** diff --git a/jme3-core/src/main/java/com/jme3/environment/util/EnvMapUtils.java b/jme3-core/src/main/java/com/jme3/environment/util/EnvMapUtils.java index 8f7ad841c6..1897539d3b 100644 --- a/jme3-core/src/main/java/com/jme3/environment/util/EnvMapUtils.java +++ b/jme3-core/src/main/java/com/jme3/environment/util/EnvMapUtils.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -194,8 +194,8 @@ static float getSolidAngleAndVector(int x, int y, int mapSize, int face, Vector3 /* transform from [0..res - 1] to [- (1 - 1 / res) .. (1 - 1 / res)] (+ 0.5f is for texel center addressing) */ - float u = (2.0f * ((float) x + 0.5f) / (float) mapSize) - 1.0f; - float v = (2.0f * ((float) y + 0.5f) / (float) mapSize) - 1.0f; + float u = (2.0f * (x + 0.5f) / mapSize) - 1.0f; + float v = (2.0f * (y + 0.5f) / mapSize) - 1.0f; getVectorFromCubemapFaceTexCoord(x, y, mapSize, face, store, fixSeamsMethod); @@ -203,7 +203,7 @@ static float getSolidAngleAndVector(int x, int y, int mapSize, int face, Vector3 * U and V are the -1..1 texture coordinate on the current face. * Get projected area for this texel */ float x0, y0, x1, y1; - float invRes = 1.0f / (float) mapSize; + float invRes = 1.0f / mapSize; x0 = u - invRes; y0 = v - invRes; x1 = u + invRes; @@ -246,19 +246,19 @@ public static Vector3f getVectorFromCubemapFaceTexCoord(int x, int y, int mapSiz if (fixSeamsMethod == FixSeamsMethod.Stretch) { /* Code from Nvtt : https://github.com/castano/nvidia-texture-tools/blob/master/src/nvtt/CubeSurface.cpp#L77 * transform from [0..res - 1] to [-1 .. 1], match up edges exactly. */ - u = (2.0f * (float) x / ((float) mapSize - 1.0f)) - 1.0f; - v = (2.0f * (float) y / ((float) mapSize - 1.0f)) - 1.0f; + u = (2.0f * x / (mapSize - 1.0f)) - 1.0f; + v = (2.0f * y / (mapSize - 1.0f)) - 1.0f; } else { //Done if any other fix method or no fix method is set /* transform from [0..res - 1] to [- (1 - 1 / res) .. (1 - 1 / res)] * (+ 0.5f is for texel center addressing) */ - u = (2.0f * ((float) x + 0.5f) / (float) (mapSize)) - 1.0f; - v = (2.0f * ((float) y + 0.5f) / (float) (mapSize)) - 1.0f; + u = (2.0f * (x + 0.5f) / mapSize) - 1.0f; + v = (2.0f * (y + 0.5f) / mapSize) - 1.0f; } if (fixSeamsMethod == FixSeamsMethod.Wrap) { // Warp texel centers in the proximity of the edges. - float a = pow((float) mapSize, 2.0f) / pow(((float) mapSize - 1f), 3.0f); + float a = pow(mapSize, 2.0f) / pow(mapSize - 1f, 3.0f); u = a * pow(u, 3f) + u; v = a * pow(v, 3f) + v; } @@ -362,14 +362,14 @@ public static int getCubemapFaceTexCoordFromVector(Vector3f texelVect, int mapSi if (fixSeamsMethod == FixSeamsMethod.Stretch) { /* Code from Nvtt : http://code.google.com/p/nvidia-texture-tools/source/browse/trunk/src/nvtt/CubeSurface.cpp * transform from [0..res - 1] to [-1 .. 1], match up edges exactly. */ - u = Math.round((u + 1.0f) * ((float) mapSize - 1.0f) * 0.5f); - v = Math.round((v + 1.0f) * ((float) mapSize - 1.0f) * 0.5f); + u = Math.round((u + 1.0f) * (mapSize - 1.0f) * 0.5f); + v = Math.round((v + 1.0f) * (mapSize - 1.0f) * 0.5f); } else { //Done if any other fix method or no fix method is set /* transform from [0..res - 1] to [- (1 - 1 / res) .. (1 - 1 / res)] * (+ 0.5f is for texel center addressing) */ - u = Math.round((u + 1.0f) * ((float) mapSize) * 0.5f - 0.5f); - v = Math.round((v + 1.0f) * ((float) mapSize) * 0.5f - 0.5f); + u = Math.round((u + 1.0f) * mapSize * 0.5f - 0.5f); + v = Math.round((v + 1.0f) * mapSize * 0.5f - 0.5f); } @@ -533,7 +533,7 @@ public static Vector4f getHammersleyPoint(int i, final int nbrSample, Vector4f s } float phi; long ui = i; - store.setX((float) i / (float) nbrSample); + store.setX(i / (float) nbrSample); /* From http://holger.dammertz.org/stuff/notes_HammersleyOnHemisphere.html * Radical Inverse : Van der Corput */ @@ -544,7 +544,7 @@ public static Vector4f getHammersleyPoint(int i, final int nbrSample, Vector4f s ui = ((ui & 0x00FF00FF) << 8) | ((ui & 0xFF00FF00) >>> 8); ui = ui & 0xffffffff; - store.setY(2.3283064365386963e-10f * (float) (ui)); /* 0x100000000 */ + store.setY(2.3283064365386963e-10f * ui); /* 0x100000000 */ phi = 2.0f * PI * store.y; store.setZ(cos(phi)); @@ -611,7 +611,7 @@ public static Node getCubeMapCrossDebugView(TextureCubeMap cubeMap, AssetManager int size = cubeMap.getImage().getWidth(); Picture[] pics = new Picture[6]; - float ratio = 128f / (float) size; + float ratio = 128f / size; for (int i = 0; i < 6; i++) { pics[i] = new Picture("bla"); diff --git a/jme3-core/src/main/java/com/jme3/export/NullSavable.java b/jme3-core/src/main/java/com/jme3/export/NullSavable.java index a57dcc7012..e3384a4ca7 100644 --- a/jme3-core/src/main/java/com/jme3/export/NullSavable.java +++ b/jme3-core/src/main/java/com/jme3/export/NullSavable.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -41,8 +41,10 @@ * @author Kirill Vainer */ public class NullSavable implements Savable { + @Override public void write(JmeExporter ex) throws IOException { } + @Override public void read(JmeImporter im) throws IOException { } } diff --git a/jme3-core/src/main/java/com/jme3/font/BitmapCharacter.java b/jme3-core/src/main/java/com/jme3/font/BitmapCharacter.java index 1fb13ab934..bb6113e174 100644 --- a/jme3-core/src/main/java/com/jme3/font/BitmapCharacter.java +++ b/jme3-core/src/main/java/com/jme3/font/BitmapCharacter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -152,6 +152,7 @@ public int getKerning(int second){ return i.intValue(); } + @Override public void write(JmeExporter ex) throws IOException { OutputCapsule oc = ex.getCapsule(this); oc.write(c, "c", 0); @@ -177,6 +178,7 @@ public void write(JmeExporter ex) throws IOException { oc.write(amounts, "amounts", null); } + @Override public void read(JmeImporter im) throws IOException { InputCapsule ic = im.getCapsule(this); c = (char) ic.readInt("c", 0); diff --git a/jme3-core/src/main/java/com/jme3/font/BitmapFont.java b/jme3-core/src/main/java/com/jme3/font/BitmapFont.java index 694278057d..fdf214e4b3 100644 --- a/jme3-core/src/main/java/com/jme3/font/BitmapFont.java +++ b/jme3-core/src/main/java/com/jme3/font/BitmapFont.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -215,7 +215,7 @@ public float getLineWidth(CharSequence text){ firstCharOfLine = true; continue; } - BitmapCharacter c = charSet.getCharacter((int) theChar); + BitmapCharacter c = charSet.getCharacter(theChar); if (c != null){ if (theChar == '\\' && i, Savable, Cloneable, Jme /** * This assumes lastDistance have been computed in a previous step. */ + @Override public int compare(Light l1, Light l2) { if (l1.lastDistance < l2.lastDistance) return -1; @@ -69,9 +70,9 @@ else if (l1.lastDistance > l2.lastDistance) }; /** - * Default constructor for serialization. Do not use + * constructor for serialization. Do not use */ - public LightList(){ + protected LightList(){ } /** @@ -266,15 +267,18 @@ public void update(LightList local, LightList parent){ * * @return an iterator that can be used to iterate over this LightList. */ + @Override public Iterator iterator() { return new Iterator(){ int index = 0; + @Override public boolean hasNext() { return index < size(); } + @Override public Light next() { if (!hasNext()) throw new NoSuchElementException(); @@ -282,6 +286,7 @@ public Light next() { return list[index++]; } + @Override public void remove() { LightList.this.remove(--index); } @@ -322,6 +327,7 @@ public void cloneFields( Cloner cloner, Object original ) { this.distToOwner = cloner.clone(distToOwner); } + @Override public void write(JmeExporter ex) throws IOException { OutputCapsule oc = ex.getCapsule(this); // oc.write(owner, "owner", null); @@ -333,6 +339,7 @@ public void write(JmeExporter ex) throws IOException { oc.writeSavableArrayList(lights, "lights", null); } + @Override public void read(JmeImporter im) throws IOException { InputCapsule ic = im.getCapsule(this); // owner = (Spatial) ic.readSavable("owner", null); diff --git a/jme3-core/src/main/java/com/jme3/light/LightProbe.java b/jme3-core/src/main/java/com/jme3/light/LightProbe.java index a53c4ddbd7..ee965241d3 100644 --- a/jme3-core/src/main/java/com/jme3/light/LightProbe.java +++ b/jme3-core/src/main/java/com/jme3/light/LightProbe.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -206,7 +206,7 @@ public void read(JmeImporter im) throws IOException { */ @Deprecated public BoundingVolume getBounds() { - return new BoundingSphere(((SphereProbeArea)area).getRadius(), ((SphereProbeArea)area).getCenter()); + return new BoundingSphere(area.getRadius(), ((SphereProbeArea)area).getCenter()); } /** diff --git a/jme3-core/src/main/java/com/jme3/light/OrientedBoxProbeArea.java b/jme3-core/src/main/java/com/jme3/light/OrientedBoxProbeArea.java index 6b1e1b5940..ae479a1ea1 100644 --- a/jme3-core/src/main/java/com/jme3/light/OrientedBoxProbeArea.java +++ b/jme3-core/src/main/java/com/jme3/light/OrientedBoxProbeArea.java @@ -202,6 +202,7 @@ private void updateMatrix() { vars.release(); } + @Override public Matrix4f getUniformMatrix() { return uniformMatrix; } @@ -219,6 +220,7 @@ public Vector3f getCenter() { return transform.getTranslation(); } + @Override public void setCenter(Vector3f center) { transform.setTranslation(center); updateMatrix(); diff --git a/jme3-core/src/main/java/com/jme3/light/SphereProbeArea.java b/jme3-core/src/main/java/com/jme3/light/SphereProbeArea.java index ded9bfffa3..90f409bcfb 100644 --- a/jme3-core/src/main/java/com/jme3/light/SphereProbeArea.java +++ b/jme3-core/src/main/java/com/jme3/light/SphereProbeArea.java @@ -28,11 +28,13 @@ public Vector3f getCenter() { return center; } + @Override public void setCenter(Vector3f center) { this.center.set(center); updateMatrix(); } + @Override public float getRadius() { return radius; } diff --git a/jme3-core/src/main/java/com/jme3/material/MatParam.java b/jme3-core/src/main/java/com/jme3/material/MatParam.java index 06bb1c8c86..f182d6b3f4 100644 --- a/jme3-core/src/main/java/com/jme3/material/MatParam.java +++ b/jme3-core/src/main/java/com/jme3/material/MatParam.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -66,7 +66,7 @@ public MatParam(VarType type, String name, Object value) { /** * Serialization only. Do not use. */ - public MatParam() { + protected MatParam() { } /** @@ -298,6 +298,7 @@ public MatParam clone() { } } + @Override public void write(JmeExporter ex) throws IOException { OutputCapsule oc = ex.getCapsule(this); oc.write(type, "varType", null); @@ -320,6 +321,7 @@ public void write(JmeExporter ex) throws IOException { } } + @Override public void read(JmeImporter im) throws IOException { InputCapsule ic = im.getCapsule(this); type = ic.readEnum("varType", VarType.class, null); diff --git a/jme3-core/src/main/java/com/jme3/material/MatParamOverride.java b/jme3-core/src/main/java/com/jme3/material/MatParamOverride.java index 1b4aad4805..7b41f6f060 100644 --- a/jme3-core/src/main/java/com/jme3/material/MatParamOverride.java +++ b/jme3-core/src/main/java/com/jme3/material/MatParamOverride.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2016 jMonkeyEngine + * Copyright (c) 2009-2019 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -83,7 +83,7 @@ public final class MatParamOverride extends MatParam { /** * Serialization only. Do not use. */ - public MatParamOverride() { + protected MatParamOverride() { super(); } diff --git a/jme3-core/src/main/java/com/jme3/material/MatParamTexture.java b/jme3-core/src/main/java/com/jme3/material/MatParamTexture.java index 4fffd1616f..77ff897d93 100644 --- a/jme3-core/src/main/java/com/jme3/material/MatParamTexture.java +++ b/jme3-core/src/main/java/com/jme3/material/MatParamTexture.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -104,6 +104,6 @@ public void read(JmeImporter im) throws IOException { super.read(im); InputCapsule ic = im.getCapsule(this); texture = (Texture) value; - colorSpace = (ColorSpace) ic.readEnum("colorSpace", ColorSpace.class, null); + colorSpace = ic.readEnum("colorSpace", ColorSpace.class, null); } } \ No newline at end of file diff --git a/jme3-core/src/main/java/com/jme3/material/Material.java b/jme3-core/src/main/java/com/jme3/material/Material.java index 15bd3c17df..3f27bb9a14 100644 --- a/jme3-core/src/main/java/com/jme3/material/Material.java +++ b/jme3-core/src/main/java/com/jme3/material/Material.java @@ -139,10 +139,12 @@ public void setName(String name) { this.name = name; } + @Override public void setKey(AssetKey key) { this.key = key; } + @Override public AssetKey getKey() { return key; } @@ -1040,6 +1042,7 @@ public void render(Geometry geom, RenderManager rm) { render(geom, geom.getWorldLightList(), rm); } + @Override public void write(JmeExporter ex) throws IOException { OutputCapsule oc = ex.getCapsule(this); oc.write(def.getAssetName(), "material_def", null); @@ -1057,6 +1060,7 @@ public String toString() { "]"; } + @Override public void read(JmeImporter im) throws IOException { InputCapsule ic = im.getCapsule(this); diff --git a/jme3-core/src/main/java/com/jme3/material/MaterialDef.java b/jme3-core/src/main/java/com/jme3/material/MaterialDef.java index 59e84db62c..9cbd482e00 100644 --- a/jme3-core/src/main/java/com/jme3/material/MaterialDef.java +++ b/jme3-core/src/main/java/com/jme3/material/MaterialDef.java @@ -59,7 +59,7 @@ public class MaterialDef{ /** * Serialization only. Do not use. */ - public MaterialDef(){ + protected MaterialDef(){ } /** diff --git a/jme3-core/src/main/java/com/jme3/material/MaterialProcessor.java b/jme3-core/src/main/java/com/jme3/material/MaterialProcessor.java index 49d04c5db9..ce119cf6b5 100644 --- a/jme3-core/src/main/java/com/jme3/material/MaterialProcessor.java +++ b/jme3-core/src/main/java/com/jme3/material/MaterialProcessor.java @@ -36,10 +36,12 @@ public class MaterialProcessor implements AssetProcessor { + @Override public Object postProcess(AssetKey key, Object obj) { return null; } + @Override public Object createClone(Object obj) { return ((Material) obj).clone(); } diff --git a/jme3-core/src/main/java/com/jme3/material/RenderState.java b/jme3-core/src/main/java/com/jme3/material/RenderState.java index 5413c3880c..a61e3e10ab 100644 --- a/jme3-core/src/main/java/com/jme3/material/RenderState.java +++ b/jme3-core/src/main/java/com/jme3/material/RenderState.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -486,6 +486,7 @@ public enum StencilOperation { BlendFunc sfactorAlpha = BlendFunc.One; BlendFunc dfactorAlpha = BlendFunc.One; + @Override public void write(JmeExporter ex) throws IOException { OutputCapsule oc = ex.getCapsule(this); oc.write(true, "pointSprite", false); @@ -529,6 +530,7 @@ public void write(JmeExporter ex) throws IOException { } + @Override public void read(JmeImporter im) throws IOException { InputCapsule ic = im.getCapsule(this); wireframe = ic.readBoolean("wireframe", false); diff --git a/jme3-core/src/main/java/com/jme3/material/TechniqueDef.java b/jme3-core/src/main/java/com/jme3/material/TechniqueDef.java index cd0c1da866..7fd57de0b0 100644 --- a/jme3-core/src/main/java/com/jme3/material/TechniqueDef.java +++ b/jme3-core/src/main/java/com/jme3/material/TechniqueDef.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -181,7 +181,7 @@ public TechniqueDef(String name, int sortId){ /** * Serialization only. Do not use. */ - public TechniqueDef() { + protected TechniqueDef() { shaderLanguages = new EnumMap(Shader.ShaderType.class); shaderNames = new EnumMap(Shader.ShaderType.class); defineNames = new ArrayList(); @@ -650,6 +650,7 @@ public List getWorldBindings() { return worldBinds; } + @Override public void write(JmeExporter ex) throws IOException{ OutputCapsule oc = ex.getCapsule(this); oc.write(name, "name", null); @@ -680,6 +681,7 @@ public void write(JmeExporter ex) throws IOException{ // oc.write(worldBinds, "worldBinds", null); } + @Override public void read(JmeImporter im) throws IOException{ InputCapsule ic = im.getCapsule(this); name = ic.readString("name", null); diff --git a/jme3-core/src/main/java/com/jme3/math/AbstractTriangle.java b/jme3-core/src/main/java/com/jme3/math/AbstractTriangle.java index 5bd6442b6a..777e3a9b34 100644 --- a/jme3-core/src/main/java/com/jme3/math/AbstractTriangle.java +++ b/jme3-core/src/main/java/com/jme3/math/AbstractTriangle.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -41,6 +41,7 @@ public abstract class AbstractTriangle implements Collidable { public abstract Vector3f get3(); public abstract void set(Vector3f v1, Vector3f v2, Vector3f v3); + @Override public int collideWith(Collidable other, CollisionResults results){ return other.collideWith(this, results); } diff --git a/jme3-core/src/main/java/com/jme3/math/ColorRGBA.java b/jme3-core/src/main/java/com/jme3/math/ColorRGBA.java index f403bbaa6c..01d76b13a1 100644 --- a/jme3-core/src/main/java/com/jme3/math/ColorRGBA.java +++ b/jme3-core/src/main/java/com/jme3/math/ColorRGBA.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine All rights reserved. + * Copyright (c) 2009-2020 jMonkeyEngine All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -462,6 +462,7 @@ public int hashCode() { return hash; } + @Override public void write(JmeExporter e) throws IOException { OutputCapsule capsule = e.getCapsule(this); capsule.write(r, "r", 0); @@ -470,6 +471,7 @@ public void write(JmeExporter e) throws IOException { capsule.write(a, "a", 0); } + @Override public void read(JmeImporter e) throws IOException { InputCapsule capsule = e.getCapsule(this); r = capsule.readFloat("r", 0); diff --git a/jme3-core/src/main/java/com/jme3/math/FastMath.java b/jme3-core/src/main/java/com/jme3/math/FastMath.java index 49c993a091..6358a142a3 100644 --- a/jme3-core/src/main/java/com/jme3/math/FastMath.java +++ b/jme3-core/src/main/java/com/jme3/math/FastMath.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -250,7 +250,7 @@ public static float interpolateCatmullRom(float u, float T, float p0, float p1, c3 = 2 * T * p0 + (T - 3) * p1 + (3 - 2 * T) * p2 + -T * p3; c4 = -T * p0 + (2 - T) * p1 + (T - 2) * p2 + T * p3; - return (float) (((c4 * u + c3) * u + c2) * u + c1); + return ((c4 * u + c3) * u + c2) * u + c1; } /**Interpolate a spline between at least 4 control points following the Catmull-Rom equation. diff --git a/jme3-core/src/main/java/com/jme3/math/Line.java b/jme3-core/src/main/java/com/jme3/math/Line.java index 1ca99b4be7..611d9c9fb1 100644 --- a/jme3-core/src/main/java/com/jme3/math/Line.java +++ b/jme3-core/src/main/java/com/jme3/math/Line.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -150,7 +150,7 @@ public void orthogonalLineFit(FloatBuffer points) { origin.addLocal(compVec1); } - origin.multLocal(1f / (float) length); + origin.multLocal(1f / length); // compute sums of products float sumXX = 0.0f, sumXY = 0.0f, sumXZ = 0.0f; @@ -213,12 +213,14 @@ public Vector3f random(Vector3f result) { return result; } + @Override public void write(JmeExporter e) throws IOException { OutputCapsule capsule = e.getCapsule(this); capsule.write(origin, "origin", Vector3f.ZERO); capsule.write(direction, "direction", Vector3f.ZERO); } + @Override public void read(JmeImporter e) throws IOException { InputCapsule capsule = e.getCapsule(this); origin = (Vector3f) capsule.readSavable("origin", Vector3f.ZERO.clone()); diff --git a/jme3-core/src/main/java/com/jme3/math/LineSegment.java b/jme3-core/src/main/java/com/jme3/math/LineSegment.java index b01edeb503..c21efdddf7 100644 --- a/jme3-core/src/main/java/com/jme3/math/LineSegment.java +++ b/jme3-core/src/main/java/com/jme3/math/LineSegment.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -575,6 +575,7 @@ public Vector3f getNegativeEnd(Vector3f store) { return origin.subtract((direction.mult(extent, store)), store); } + @Override public void write(JmeExporter e) throws IOException { OutputCapsule capsule = e.getCapsule(this); capsule.write(origin, "origin", Vector3f.ZERO); @@ -582,6 +583,7 @@ public void write(JmeExporter e) throws IOException { capsule.write(extent, "extent", 0); } + @Override public void read(JmeImporter e) throws IOException { InputCapsule capsule = e.getCapsule(this); origin = (Vector3f) capsule.readSavable("origin", Vector3f.ZERO.clone()); diff --git a/jme3-core/src/main/java/com/jme3/math/Matrix3f.java b/jme3-core/src/main/java/com/jme3/math/Matrix3f.java index ca9e7287b8..757ddbe0ef 100644 --- a/jme3-core/src/main/java/com/jme3/math/Matrix3f.java +++ b/jme3-core/src/main/java/com/jme3/math/Matrix3f.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -1210,7 +1210,7 @@ public int hashCode() { */ @Override public boolean equals(Object o) { - if (!(o instanceof Matrix3f) || o == null) { + if (o == null || o.getClass() != getClass()) { return false; } @@ -1252,6 +1252,7 @@ public boolean equals(Object o) { return true; } + @Override public void write(JmeExporter e) throws IOException { OutputCapsule cap = e.getCapsule(this); cap.write(m00, "m00", 1); @@ -1265,6 +1266,7 @@ public void write(JmeExporter e) throws IOException { cap.write(m22, "m22", 1); } + @Override public void read(JmeImporter e) throws IOException { InputCapsule cap = e.getCapsule(this); m00 = cap.readFloat("m00", 1); diff --git a/jme3-core/src/main/java/com/jme3/math/Matrix4f.java b/jme3-core/src/main/java/com/jme3/math/Matrix4f.java index ff51e3c7bf..6e7064f267 100644 --- a/jme3-core/src/main/java/com/jme3/math/Matrix4f.java +++ b/jme3-core/src/main/java/com/jme3/math/Matrix4f.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -2161,7 +2161,7 @@ public int hashCode() { */ @Override public boolean equals(Object o) { - if (!(o instanceof Matrix4f) || o == null) { + if (o == null || o.getClass() != getClass()) { return false; } @@ -2225,6 +2225,7 @@ public boolean equals(Object o) { return true; } + @Override public void write(JmeExporter e) throws IOException { OutputCapsule cap = e.getCapsule(this); cap.write(m00, "m00", 1); @@ -2245,6 +2246,7 @@ public void write(JmeExporter e) throws IOException { cap.write(m33, "m33", 1); } + @Override public void read(JmeImporter e) throws IOException { InputCapsule cap = e.getCapsule(this); m00 = cap.readFloat("m00", 1); diff --git a/jme3-core/src/main/java/com/jme3/math/Plane.java b/jme3-core/src/main/java/com/jme3/math/Plane.java index 3da90b2bc3..078f8a335d 100644 --- a/jme3-core/src/main/java/com/jme3/math/Plane.java +++ b/jme3-core/src/main/java/com/jme3/math/Plane.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -269,12 +269,14 @@ public String toString() { + constant + "]"; } + @Override public void write(JmeExporter e) throws IOException { OutputCapsule capsule = e.getCapsule(this); capsule.write(normal, "normal", Vector3f.ZERO); capsule.write(constant, "constant", 0); } + @Override public void read(JmeImporter e) throws IOException { InputCapsule capsule = e.getCapsule(this); normal = (Vector3f) capsule.readSavable("normal", Vector3f.ZERO.clone()); diff --git a/jme3-core/src/main/java/com/jme3/math/Quaternion.java b/jme3-core/src/main/java/com/jme3/math/Quaternion.java index 0a5b818b6c..84671660d7 100644 --- a/jme3-core/src/main/java/com/jme3/math/Quaternion.java +++ b/jme3-core/src/main/java/com/jme3/math/Quaternion.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -1371,15 +1371,17 @@ public void writeExternal(ObjectOutput out) throws IOException { * a vector indicating the local up direction. * (typically {0, 1, 0} in jME.) */ - public void lookAt(Vector3f direction, Vector3f up) { + public Quaternion lookAt(Vector3f direction, Vector3f up) { TempVars vars = TempVars.get(); vars.vect3.set(direction).normalizeLocal(); vars.vect1.set(up).crossLocal(direction).normalizeLocal(); vars.vect2.set(direction).crossLocal(vars.vect1).normalizeLocal(); fromAxes(vars.vect1, vars.vect2, vars.vect3); vars.release(); + return this; } + @Override public void write(JmeExporter e) throws IOException { OutputCapsule cap = e.getCapsule(this); cap.write(x, "x", 0); @@ -1388,6 +1390,7 @@ public void write(JmeExporter e) throws IOException { cap.write(w, "w", 1); } + @Override public void read(JmeImporter e) throws IOException { InputCapsule cap = e.getCapsule(this); x = cap.readFloat("x", 0); diff --git a/jme3-core/src/main/java/com/jme3/math/Ray.java b/jme3-core/src/main/java/com/jme3/math/Ray.java index 81e54d99ff..a3fce28165 100644 --- a/jme3-core/src/main/java/com/jme3/math/Ray.java +++ b/jme3-core/src/main/java/com/jme3/math/Ray.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -383,6 +383,7 @@ public boolean intersectsWherePlane(Plane p, Vector3f loc) { return true; } + @Override public int collideWith(Collidable other, CollisionResults results) { if (other instanceof BoundingVolume) { BoundingVolume bv = (BoundingVolume) other; @@ -492,16 +493,19 @@ public void set(Ray source) { direction.set(source.getDirection()); } + @Override public String toString() { return getClass().getSimpleName() + " [Origin: " + origin + ", Direction: " + direction + "]"; } + @Override public void write(JmeExporter e) throws IOException { OutputCapsule capsule = e.getCapsule(this); capsule.write(origin, "origin", Vector3f.ZERO); capsule.write(direction, "direction", Vector3f.ZERO); } + @Override public void read(JmeImporter e) throws IOException { InputCapsule capsule = e.getCapsule(this); origin = (Vector3f) capsule.readSavable("origin", Vector3f.ZERO.clone()); diff --git a/jme3-core/src/main/java/com/jme3/math/Rectangle.java b/jme3-core/src/main/java/com/jme3/math/Rectangle.java index e8ba4c23d3..48e0fcd2a2 100644 --- a/jme3-core/src/main/java/com/jme3/math/Rectangle.java +++ b/jme3-core/src/main/java/com/jme3/math/Rectangle.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -167,6 +167,7 @@ public Vector3f random(Vector3f result) { return result; } + @Override public void write(JmeExporter e) throws IOException { OutputCapsule capsule = e.getCapsule(this); capsule.write(a, "a", Vector3f.ZERO); @@ -174,6 +175,7 @@ public void write(JmeExporter e) throws IOException { capsule.write(c, "c", Vector3f.ZERO); } + @Override public void read(JmeImporter e) throws IOException { InputCapsule capsule = e.getCapsule(this); a = (Vector3f) capsule.readSavable("a", Vector3f.ZERO.clone()); diff --git a/jme3-core/src/main/java/com/jme3/math/Ring.java b/jme3-core/src/main/java/com/jme3/math/Ring.java index 1c9eebc457..639dc70274 100644 --- a/jme3-core/src/main/java/com/jme3/math/Ring.java +++ b/jme3-core/src/main/java/com/jme3/math/Ring.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -200,6 +200,7 @@ public Vector3f random(Vector3f result) { return result; } + @Override public void write(JmeExporter e) throws IOException { OutputCapsule capsule = e.getCapsule(this); capsule.write(center, "center", Vector3f.ZERO); @@ -208,6 +209,7 @@ public void write(JmeExporter e) throws IOException { capsule.write(outerRadius, "outerRadius", 1f); } + @Override public void read(JmeImporter e) throws IOException { InputCapsule capsule = e.getCapsule(this); center = (Vector3f) capsule.readSavable("center", diff --git a/jme3-core/src/main/java/com/jme3/math/Spline.java b/jme3-core/src/main/java/com/jme3/math/Spline.java index 2f3155c55a..544aab5943 100644 --- a/jme3-core/src/main/java/com/jme3/math/Spline.java +++ b/jme3-core/src/main/java/com/jme3/math/Spline.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -458,7 +458,7 @@ public void write(JmeExporter ex) throws IOException { public void read(JmeImporter im) throws IOException { InputCapsule in = im.getCapsule(this); - controlPoints = (ArrayList) in.readSavableArrayList("controlPoints", new ArrayList()); /* Empty List as default, prevents null pointers */ + controlPoints = in.readSavableArrayList("controlPoints", new ArrayList<>()); /* Empty List as default, prevents null pointers */ float list[] = in.readFloatArray("segmentsLength", null); if (list != null) { segmentsLength = new ArrayList(); @@ -468,7 +468,7 @@ public void read(JmeImporter im) throws IOException { } type = in.readEnum("pathSplineType", SplineType.class, SplineType.CatmullRom); totalLength = in.readFloat("totalLength", 0); - CRcontrolPoints = (ArrayList) in.readSavableArrayList("CRControlPoints", null); + CRcontrolPoints = in.readSavableArrayList("CRControlPoints", null); curveTension = in.readFloat("curveTension", 0.5f); cycle = in.readBoolean("cycle", false); knots = in.readSavableArrayList("knots", null); diff --git a/jme3-core/src/main/java/com/jme3/math/Vector2f.java b/jme3-core/src/main/java/com/jme3/math/Vector2f.java index e2c3a96c09..e74c208472 100644 --- a/jme3-core/src/main/java/com/jme3/math/Vector2f.java +++ b/jme3-core/src/main/java/com/jme3/math/Vector2f.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -635,6 +635,7 @@ public Vector2f zero() { * * @return the hash code value of this vector. */ + @Override public int hashCode() { int hash = 37; hash += 37 * hash + Float.floatToIntBits(x); @@ -676,6 +677,7 @@ public float[] toArray(float[] floats) { * the object to compare for equality * @return true if they are equal */ + @Override public boolean equals(Object o) { if (!(o instanceof Vector2f)) { return false; @@ -717,6 +719,7 @@ public boolean isSimilar(Vector2f other, float epsilon) { * * @return the string representation of this vector. */ + @Override public String toString() { return "(" + x + ", " + y + ")"; } @@ -749,12 +752,14 @@ public void writeExternal(ObjectOutput out) throws IOException { out.writeFloat(y); } + @Override public void write(JmeExporter e) throws IOException { OutputCapsule capsule = e.getCapsule(this); capsule.write(x, "x", 0); capsule.write(y, "y", 0); } + @Override public void read(JmeImporter e) throws IOException { InputCapsule capsule = e.getCapsule(this); x = capsule.readFloat("x", 0); diff --git a/jme3-core/src/main/java/com/jme3/math/Vector3f.java b/jme3-core/src/main/java/com/jme3/math/Vector3f.java index 04638ef2b7..ed28f77d84 100644 --- a/jme3-core/src/main/java/com/jme3/math/Vector3f.java +++ b/jme3-core/src/main/java/com/jme3/math/Vector3f.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -958,6 +958,7 @@ public float[] toArray(float[] floats) { * the object to compare for equality * @return true if they are equal */ + @Override public boolean equals(Object o) { if (!(o instanceof Vector3f)) { return false; } @@ -996,6 +997,7 @@ public boolean isSimilar(Vector3f other, float epsilon) { * the same hash code value. * @return the hash code value of this vector. */ + @Override public int hashCode() { int hash = 37; hash += 37 * hash + Float.floatToIntBits(x); @@ -1012,10 +1014,12 @@ public int hashCode() { * * @return the string representation of this vector. */ + @Override public String toString() { return "(" + x + ", " + y + ", " + z + ")"; } + @Override public void write(JmeExporter e) throws IOException { OutputCapsule capsule = e.getCapsule(this); capsule.write(x, "x", 0); @@ -1023,6 +1027,7 @@ public void write(JmeExporter e) throws IOException { capsule.write(z, "z", 0); } + @Override public void read(JmeImporter e) throws IOException { InputCapsule capsule = e.getCapsule(this); x = capsule.readFloat("x", 0); diff --git a/jme3-core/src/main/java/com/jme3/math/Vector4f.java b/jme3-core/src/main/java/com/jme3/math/Vector4f.java index d7c3e48f19..a669fcf14d 100644 --- a/jme3-core/src/main/java/com/jme3/math/Vector4f.java +++ b/jme3-core/src/main/java/com/jme3/math/Vector4f.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -862,6 +862,7 @@ public float[] toArray(float[] floats) { * the object to compare for equality * @return true if they are equal */ + @Override public boolean equals(Object o) { if (!(o instanceof Vector4f)) { return false; } @@ -904,6 +905,7 @@ public boolean isSimilar(Vector4f other, float epsilon) { * the same hash code value. * @return the hash code value of this vector. */ + @Override public int hashCode() { int hash = 37; hash += 37 * hash + Float.floatToIntBits(x); @@ -921,10 +923,12 @@ public int hashCode() { * * @return the string representation of this vector. */ + @Override public String toString() { return "(" + x + ", " + y + ", " + z + ", " + w + ")"; } + @Override public void write(JmeExporter e) throws IOException { OutputCapsule capsule = e.getCapsule(this); capsule.write(x, "x", 0); @@ -933,6 +937,7 @@ public void write(JmeExporter e) throws IOException { capsule.write(w, "w", 0); } + @Override public void read(JmeImporter e) throws IOException { InputCapsule capsule = e.getCapsule(this); x = capsule.readFloat("x", 0); diff --git a/jme3-core/src/main/java/com/jme3/post/Filter.java b/jme3-core/src/main/java/com/jme3/post/Filter.java index d594b7be8a..aabe3b1544 100644 --- a/jme3-core/src/main/java/com/jme3/post/Filter.java +++ b/jme3-core/src/main/java/com/jme3/post/Filter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -336,6 +336,7 @@ protected void postFrame(RenderManager renderManager, ViewPort viewPort, FrameBu * @param ex * @throws IOException */ + @Override public void write(JmeExporter ex) throws IOException { OutputCapsule oc = ex.getCapsule(this); oc.write(name, "name", ""); @@ -347,6 +348,7 @@ public void write(JmeExporter ex) throws IOException { * is loaded else only basic properties of the filter will be loaded * This method should always begin by super.read(im); */ + @Override public void read(JmeImporter im) throws IOException { InputCapsule ic = im.getCapsule(this); name = ic.readString("name", ""); diff --git a/jme3-core/src/main/java/com/jme3/post/FilterPostProcessor.java b/jme3-core/src/main/java/com/jme3/post/FilterPostProcessor.java index d3580ccab1..6285402353 100644 --- a/jme3-core/src/main/java/com/jme3/post/FilterPostProcessor.java +++ b/jme3-core/src/main/java/com/jme3/post/FilterPostProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -99,7 +99,7 @@ public FilterPostProcessor(AssetManager assetManager) { * Don't use this constructor, use {@link #FilterPostProcessor(AssetManager assetManager)}
* This constructor is used for serialization only */ - public FilterPostProcessor() { + protected FilterPostProcessor() { } /** @@ -137,6 +137,7 @@ public Iterator getFilterIterator() { return filters.iterator(); } + @Override public void initialize(RenderManager rm, ViewPort vp) { renderManager = rm; renderer = rm.getRenderer(); @@ -230,10 +231,12 @@ private void renderProcessing(Renderer r, FrameBuffer buff, Material mat) { renderManager.renderGeometry(fsQuad); } + @Override public boolean isInitialized() { return viewPort != null; } + @Override public void postQueue(RenderQueue rq) { for (Filter filter : filters.getArray()) { if (filter.isEnabled()) { @@ -323,6 +326,7 @@ private void renderFilterChain(Renderer r, FrameBuffer sceneFb) { } } + @Override public void postFrame(FrameBuffer out) { FrameBuffer sceneBuffer = renderFrameBuffer; @@ -340,6 +344,7 @@ public void postFrame(FrameBuffer out) { } } + @Override public void preFrame(float tpf) { if (filters.isEmpty() || lastFilterIndex == -1) { //If the camera is initialized and there are no filter to render, the camera viewport is restored as it was @@ -408,6 +413,7 @@ private void updateLastFilterIndex() { } } + @Override public void cleanup() { if (viewPort != null) { //reset the viewport camera viewport to its initial value @@ -438,6 +444,7 @@ public void setProfiler(AppProfiler profiler) { this.prof = profiler; } + @Override public void reshape(ViewPort vp, int w, int h) { Camera cam = vp.getCamera(); //this has no effect at first init but is useful when resizing the canvas with multi views @@ -543,12 +550,14 @@ public void setFrameBufferFormat(Format fbFormat) { this.fbFormat = fbFormat; } + @Override public void write(JmeExporter ex) throws IOException { OutputCapsule oc = ex.getCapsule(this); oc.write(numSamples, "numSamples", 0); oc.writeSavableArrayList(new ArrayList(filters), "filters", null); } + @Override public void read(JmeImporter im) throws IOException { InputCapsule ic = im.getCapsule(this); numSamples = ic.readInt("numSamples", 0); diff --git a/jme3-core/src/main/java/com/jme3/post/HDRRenderer.java b/jme3-core/src/main/java/com/jme3/post/HDRRenderer.java index 424f3b689a..bd10f8f4e3 100644 --- a/jme3-core/src/main/java/com/jme3/post/HDRRenderer.java +++ b/jme3-core/src/main/java/com/jme3/post/HDRRenderer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -252,10 +252,12 @@ private void updateAverageLuminance(Renderer r){ renderProcessing(r, scene1FB[curSrc], hdr1); } + @Override public boolean isInitialized(){ return viewPort != null; } + @Override public void reshape(ViewPort vp, int w, int h){ if (mainSceneFB != null){ renderer.deleteFrameBuffer(mainSceneFB); @@ -290,6 +292,7 @@ public void reshape(ViewPort vp, int w, int h){ createLumShaders(); } + @Override public void initialize(RenderManager rm, ViewPort vp){ if (!enabled) return; @@ -335,6 +338,7 @@ public void initialize(RenderManager rm, ViewPort vp){ } + @Override public void preFrame(float tpf) { if (!enabled) return; @@ -343,9 +347,11 @@ public void preFrame(float tpf) { blendFactor = (time / throttle); } + @Override public void postQueue(RenderQueue rq) { } + @Override public void postFrame(FrameBuffer out) { if (!enabled) return; @@ -404,6 +410,7 @@ public void postFrame(FrameBuffer out) { renderManager.setCamera(viewPort.getCamera(), false); } + @Override public void cleanup() { if (!enabled) return; diff --git a/jme3-core/src/main/java/com/jme3/post/PreDepthProcessor.java b/jme3-core/src/main/java/com/jme3/post/PreDepthProcessor.java index a3125dd1e1..835e418fd5 100644 --- a/jme3-core/src/main/java/com/jme3/post/PreDepthProcessor.java +++ b/jme3-core/src/main/java/com/jme3/post/PreDepthProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -65,22 +65,27 @@ public PreDepthProcessor(AssetManager assetManager){ forcedRS.setDepthWrite(false); } + @Override public void initialize(RenderManager rm, ViewPort vp) { this.rm = rm; this.vp = vp; } + @Override public void reshape(ViewPort vp, int w, int h) { this.vp = vp; } + @Override public boolean isInitialized() { return vp != null; } + @Override public void preFrame(float tpf) { } + @Override public void postQueue(RenderQueue rq) { // lay depth first rm.setForcedMaterial(preDepth); @@ -90,10 +95,12 @@ public void postQueue(RenderQueue rq) { rm.setForcedRenderState(forcedRS); } + @Override public void postFrame(FrameBuffer out) { rm.setForcedRenderState(null); } + @Override public void cleanup() { vp = null; } diff --git a/jme3-core/src/main/java/com/jme3/renderer/Camera.java b/jme3-core/src/main/java/com/jme3/renderer/Camera.java index 79dd24059c..c7bd6a7d81 100644 --- a/jme3-core/src/main/java/com/jme3/renderer/Camera.java +++ b/jme3-core/src/main/java/com/jme3/renderer/Camera.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -1432,6 +1432,7 @@ public String toString() { + "near=" + frustumNear + ", far=" + frustumFar + "]"; } + @Override public void write(JmeExporter e) throws IOException { OutputCapsule capsule = e.getCapsule(this); capsule.write(location, "location", Vector3f.ZERO); @@ -1455,6 +1456,7 @@ public void write(JmeExporter e) throws IOException { capsule.write(name, "name", null); } + @Override public void read(JmeImporter e) throws IOException { InputCapsule capsule = e.getCapsule(this); location = (Vector3f) capsule.readSavable("location", Vector3f.ZERO.clone()); diff --git a/jme3-core/src/main/java/com/jme3/renderer/RenderContext.java b/jme3-core/src/main/java/com/jme3/renderer/RenderContext.java index f7626f1bd5..c931531bc2 100644 --- a/jme3-core/src/main/java/com/jme3/renderer/RenderContext.java +++ b/jme3-core/src/main/java/com/jme3/renderer/RenderContext.java @@ -32,7 +32,6 @@ package com.jme3.renderer; import com.jme3.material.RenderState; -import com.jme3.material.RenderState.BlendFunc; import com.jme3.math.ColorRGBA; import com.jme3.scene.Mesh; import com.jme3.scene.VertexBuffer; @@ -49,123 +48,123 @@ public class RenderContext { /** * @see RenderState#setFaceCullMode(com.jme3.material.RenderState.FaceCullMode) */ - public RenderState.FaceCullMode cullMode = RenderState.FaceCullMode.Off; + public RenderState.FaceCullMode cullMode; /** - * @see RenderState#setDepthTest(boolean) + * @see RenderState#setDepthTest(boolean) */ - public boolean depthTestEnabled = false; + public boolean depthTestEnabled; /** - * @see RenderState#setDepthWrite(boolean) + * @see RenderState#setDepthWrite(boolean) */ - public boolean depthWriteEnabled = true; + public boolean depthWriteEnabled; /** - * @see RenderState#setColorWrite(boolean) + * @see RenderState#setColorWrite(boolean) */ - public boolean colorWriteEnabled = true; + public boolean colorWriteEnabled; /** - * @see Renderer#setClipRect(int, int, int, int) + * @see Renderer#setClipRect(int, int, int, int) */ - public boolean clipRectEnabled = false; + public boolean clipRectEnabled; /** - * @see RenderState#setPolyOffset(float, float) + * @see RenderState#setPolyOffset(float, float) */ - public boolean polyOffsetEnabled = false; - + public boolean polyOffsetEnabled; + /** - * @see RenderState#setPolyOffset(float, float) + * @see RenderState#setPolyOffset(float, float) */ - public float polyOffsetFactor = 0; - + public float polyOffsetFactor; + /** - * @see RenderState#setPolyOffset(float, float) + * @see RenderState#setPolyOffset(float, float) */ - public float polyOffsetUnits = 0; + public float polyOffsetUnits; /** - * @see Mesh#setPointSize(float) + * @see Mesh#setPointSize(float) */ - public float pointSize = 1; - + public float pointSize; + /** * @see RenderState#setLineWidth(float) */ - public float lineWidth = 1; + public float lineWidth; /** - * @see RenderState#setBlendMode(com.jme3.material.RenderState.BlendMode) + * @see RenderState#setBlendMode(com.jme3.material.RenderState.BlendMode) */ - public RenderState.BlendMode blendMode = RenderState.BlendMode.Off; + public RenderState.BlendMode blendMode; /** - * @see RenderState#setBlendEquation(com.jme3.material.RenderState.BlendEquation) + * @see RenderState#setBlendEquation(com.jme3.material.RenderState.BlendEquation) */ - public RenderState.BlendEquation blendEquation = RenderState.BlendEquation.Add; - + public RenderState.BlendEquation blendEquation; + /** - * @see RenderState#setBlendEquationAlpha(com.jme3.material.RenderState.BlendEquationAlpha) + * @see RenderState#setBlendEquationAlpha(com.jme3.material.RenderState.BlendEquationAlpha) */ - public RenderState.BlendEquationAlpha blendEquationAlpha = RenderState.BlendEquationAlpha.InheritColor; + public RenderState.BlendEquationAlpha blendEquationAlpha; /** * @see RenderState#setCustomBlendFactors(com.jme3.material.RenderState.BlendFunc, com.jme3.material.RenderState.BlendFunc, * com.jme3.material.RenderState.BlendFunc, com.jme3.material.RenderState.BlendFunc) */ - public RenderState.BlendFunc sfactorRGB = RenderState.BlendFunc.One; + public RenderState.BlendFunc sfactorRGB; /** * @see RenderState#setCustomBlendFactors(com.jme3.material.RenderState.BlendFunc, com.jme3.material.RenderState.BlendFunc, * com.jme3.material.RenderState.BlendFunc, com.jme3.material.RenderState.BlendFunc) */ - public RenderState.BlendFunc dfactorRGB = RenderState.BlendFunc.One; + public RenderState.BlendFunc dfactorRGB; /** * @see RenderState#setCustomBlendFactors(com.jme3.material.RenderState.BlendFunc, com.jme3.material.RenderState.BlendFunc, * com.jme3.material.RenderState.BlendFunc, com.jme3.material.RenderState.BlendFunc) */ - public RenderState.BlendFunc sfactorAlpha = RenderState.BlendFunc.One; + public RenderState.BlendFunc sfactorAlpha; /** * @see RenderState#setCustomBlendFactors(com.jme3.material.RenderState.BlendFunc, com.jme3.material.RenderState.BlendFunc, * com.jme3.material.RenderState.BlendFunc, com.jme3.material.RenderState.BlendFunc) */ - public RenderState.BlendFunc dfactorAlpha = RenderState.BlendFunc.One; + public RenderState.BlendFunc dfactorAlpha; /** - * @see RenderState#setWireframe(boolean) + * @see RenderState#setWireframe(boolean) */ - public boolean wireframe = false; + public boolean wireframe; /** - * @see Renderer#setShader(com.jme3.shader.Shader) + * @see Renderer#setShader(com.jme3.shader.Shader) */ public int boundShaderProgram; - + /** - * @see Renderer#setShader(com.jme3.shader.Shader) + * @see Renderer#setShader(com.jme3.shader.Shader) */ public Shader boundShader; /** - * @see Renderer#setFrameBuffer(com.jme3.texture.FrameBuffer) + * @see Renderer#setFrameBuffer(com.jme3.texture.FrameBuffer) */ - public int boundFBO = 0; - + public int boundFBO; + /** - * @see Renderer#setFrameBuffer(com.jme3.texture.FrameBuffer) + * @see Renderer#setFrameBuffer(com.jme3.texture.FrameBuffer) */ public FrameBuffer boundFB; /** * Currently bound Renderbuffer - * - * @see Renderer#setFrameBuffer(com.jme3.texture.FrameBuffer) + * + * @see Renderer#setFrameBuffer(com.jme3.texture.FrameBuffer) */ - public int boundRB = 0; + public int boundRB; /** * Currently bound draw buffer @@ -174,20 +173,20 @@ public class RenderContext { * 0 = GL_COLOR_ATTACHMENT0 * n = GL_COLOR_ATTACHMENTn * where n is an integer greater than 1 - * - * @see Renderer#setFrameBuffer(com.jme3.texture.FrameBuffer) - * @see FrameBuffer#setTargetIndex(int) + * + * @see Renderer#setFrameBuffer(com.jme3.texture.FrameBuffer) + * @see FrameBuffer#setTargetIndex(int) */ - public int boundDrawBuf = -1; + public int boundDrawBuf; /** * Currently bound read buffer * * @see RenderContext#boundDrawBuf - * @see Renderer#setFrameBuffer(com.jme3.texture.FrameBuffer) - * @see FrameBuffer#setTargetIndex(int) + * @see Renderer#setFrameBuffer(com.jme3.texture.FrameBuffer) + * @see FrameBuffer#setTargetIndex(int) */ - public int boundReadBuf = -1; + public int boundReadBuf; /** * Currently bound element array vertex buffer. @@ -207,118 +206,114 @@ public class RenderContext { * @see Renderer#renderMesh(com.jme3.scene.Mesh, int, int, com.jme3.scene.VertexBuffer[]) */ public int boundArrayVBO; - + /** * Currently bound pixel pack pixel buffer. */ public int boundPixelPackPBO; - public int numTexturesSet = 0; + public int numTexturesSet; /** * Current bound texture IDs for each texture unit. - * - * @see Renderer#setTexture(int, com.jme3.texture.Texture) + * + * @see Renderer#setTexture(int, com.jme3.texture.Texture) */ - public Image[] boundTextures = new Image[16]; + public final Image[] boundTextures = new Image[16]; /** * IDList for texture units - * - * @see Renderer#setTexture(int, com.jme3.texture.Texture) + * + * @see Renderer#setTexture(int, com.jme3.texture.Texture) */ - public IDList textureIndexList = new IDList(); + public final IDList textureIndexList = new IDList(); /** * Currently bound texture unit - * - * @see Renderer#setTexture(int, com.jme3.texture.Texture) + * + * @see Renderer#setTexture(int, com.jme3.texture.Texture) */ - public int boundTextureUnit = 0; + public int boundTextureUnit; /** * Stencil Buffer state */ - public boolean stencilTest = false; - public RenderState.StencilOperation frontStencilStencilFailOperation = RenderState.StencilOperation.Keep; - public RenderState.StencilOperation frontStencilDepthFailOperation = RenderState.StencilOperation.Keep; - public RenderState.StencilOperation frontStencilDepthPassOperation = RenderState.StencilOperation.Keep; - public RenderState.StencilOperation backStencilStencilFailOperation = RenderState.StencilOperation.Keep; - public RenderState.StencilOperation backStencilDepthFailOperation = RenderState.StencilOperation.Keep; - public RenderState.StencilOperation backStencilDepthPassOperation = RenderState.StencilOperation.Keep; - public RenderState.TestFunction frontStencilFunction = RenderState.TestFunction.Always; - public RenderState.TestFunction backStencilFunction = RenderState.TestFunction.Always; + public boolean stencilTest; + public RenderState.StencilOperation frontStencilStencilFailOperation; + public RenderState.StencilOperation frontStencilDepthFailOperation; + public RenderState.StencilOperation frontStencilDepthPassOperation; + public RenderState.StencilOperation backStencilStencilFailOperation; + public RenderState.StencilOperation backStencilDepthFailOperation; + public RenderState.StencilOperation backStencilDepthPassOperation; + public RenderState.TestFunction frontStencilFunction; + public RenderState.TestFunction backStencilFunction; /** * Vertex attribs currently bound and enabled. If a slot is null, then * it is disabled. */ - public VertexBuffer[] boundAttribs = new VertexBuffer[16]; + public final VertexBuffer[] boundAttribs = new VertexBuffer[16]; /** * IDList for vertex attributes */ - public IDList attribIndexList = new IDList(); - + public final IDList attribIndexList = new IDList(); + /** * depth test function */ - public RenderState.TestFunction depthFunc = RenderState.TestFunction.Less; - + public RenderState.TestFunction depthFunc; + /** * alpha test function */ - public RenderState.TestFunction alphaFunc = RenderState.TestFunction.Greater; + public RenderState.TestFunction alphaFunc; public int initialDrawBuf; public int initialReadBuf; - - public ColorRGBA clearColor = new ColorRGBA(0,0,0,0); - - /** - * Reset the RenderContext to default GL state - */ - public void reset(){ + + public ColorRGBA clearColor = new ColorRGBA(0, 0, 0, 0); + + public RenderContext() { + init(); + } + + + private void init() { cullMode = RenderState.FaceCullMode.Off; depthTestEnabled = false; - depthWriteEnabled = false; - colorWriteEnabled = false; + depthWriteEnabled = true; + colorWriteEnabled = true; clipRectEnabled = false; polyOffsetEnabled = false; polyOffsetFactor = 0; polyOffsetUnits = 0; pointSize = 1; + lineWidth = 1; blendMode = RenderState.BlendMode.Off; blendEquation = RenderState.BlendEquation.Add; blendEquationAlpha = RenderState.BlendEquationAlpha.InheritColor; - sfactorRGB = BlendFunc.One; - dfactorRGB = BlendFunc.One; - sfactorAlpha = BlendFunc.One; - dfactorAlpha = BlendFunc.One; + sfactorRGB = RenderState.BlendFunc.One; + dfactorRGB = RenderState.BlendFunc.One; + sfactorAlpha = RenderState.BlendFunc.One; + dfactorAlpha = RenderState.BlendFunc.One; wireframe = false; + boundShaderProgram = 0; boundShader = null; boundFBO = 0; boundFB = null; boundRB = 0; - boundDrawBuf = -1; + boundDrawBuf = -1; boundReadBuf = -1; boundElementArrayVBO = 0; boundVertexArray = 0; boundArrayVBO = 0; boundPixelPackPBO = 0; numTexturesSet = 0; - for (int i = 0; i < boundTextures.length; i++) - boundTextures[i] = null; - - textureIndexList.reset(); boundTextureUnit = 0; - for (int i = 0; i < boundAttribs.length; i++) - boundAttribs[i] = null; - - attribIndexList.reset(); - stencilTest = false; + frontStencilStencilFailOperation = RenderState.StencilOperation.Keep; frontStencilDepthFailOperation = RenderState.StencilOperation.Keep; frontStencilDepthPassOperation = RenderState.StencilOperation.Keep; @@ -327,9 +322,30 @@ public void reset(){ backStencilDepthPassOperation = RenderState.StencilOperation.Keep; frontStencilFunction = RenderState.TestFunction.Always; backStencilFunction = RenderState.TestFunction.Always; - - depthFunc = RenderState.TestFunction.LessOrEqual; + + depthFunc = RenderState.TestFunction.Less; alphaFunc = RenderState.TestFunction.Greater; - clearColor.set(0,0,0,0); + cullMode = RenderState.FaceCullMode.Off; + + clearColor.set(0, 0, 0, 0); + } + + /** + * Reset the RenderContext to default GL state + */ + public void reset(){ + init(); + + for (int i = 0; i < boundTextures.length; i++) { + boundTextures[i] = null; + } + + textureIndexList.reset(); + + for (int i = 0; i < boundAttribs.length; i++) { + boundAttribs[i] = null; + } + + attribIndexList.reset(); } } diff --git a/jme3-core/src/main/java/com/jme3/renderer/opengl/GLDebugDesktop.java b/jme3-core/src/main/java/com/jme3/renderer/opengl/GLDebugDesktop.java index 3dfd2a8ca7..396a1bc970 100644 --- a/jme3-core/src/main/java/com/jme3/renderer/opengl/GLDebugDesktop.java +++ b/jme3-core/src/main/java/com/jme3/renderer/opengl/GLDebugDesktop.java @@ -16,61 +16,73 @@ public GLDebugDesktop(GL gl, GLExt glext, GLFbo glfbo) { this.gl4 = gl instanceof GL4 ? (GL4) gl : null; } + @Override public void glAlphaFunc(int func, float ref) { gl2.glAlphaFunc(func, ref); checkError(); } + @Override public void glPointSize(float size) { gl2.glPointSize(size); checkError(); } + @Override public void glPolygonMode(int face, int mode) { gl2.glPolygonMode(face, mode); checkError(); } + @Override public void glDrawBuffer(int mode) { gl2.glDrawBuffer(mode); checkError(); } + @Override public void glReadBuffer(int mode) { gl2.glReadBuffer(mode); checkError(); } + @Override public void glCompressedTexImage3D(int target, int level, int internalformat, int width, int height, int depth, int border, ByteBuffer data) { gl2.glCompressedTexImage3D(target, level, internalformat, width, height, depth, border, data); checkError(); } + @Override public void glCompressedTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, ByteBuffer data) { gl2.glCompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, data); checkError(); } + @Override public void glTexImage3D(int target, int level, int internalFormat, int width, int height, int depth, int border, int format, int type, ByteBuffer data) { gl2.glTexImage3D(target, level, internalFormat, width, height, depth, border, format, type, data); checkError(); } + @Override public void glTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, ByteBuffer data) { gl2.glTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, data); checkError(); } + @Override public void glBindFragDataLocation(int param1, int param2, String param3) { gl3.glBindFragDataLocation(param1, param2, param3); checkError(); } + @Override public void glBindVertexArray(int param1) { gl3.glBindVertexArray(param1); checkError(); } + @Override public void glGenVertexArrays(IntBuffer param1) { gl3.glGenVertexArrays(param1); checkError(); @@ -121,6 +133,7 @@ public void glShaderStorageBlockBinding(int program, int storageBlockIndex, int checkError(); } + @Override public void glBlendEquationSeparate(int colorMode, int alphaMode) { gl.glBlendEquationSeparate(colorMode, alphaMode); checkError(); diff --git a/jme3-core/src/main/java/com/jme3/renderer/opengl/GLDebugES.java b/jme3-core/src/main/java/com/jme3/renderer/opengl/GLDebugES.java index 19546f20f2..fd8d764e70 100644 --- a/jme3-core/src/main/java/com/jme3/renderer/opengl/GLDebugES.java +++ b/jme3-core/src/main/java/com/jme3/renderer/opengl/GLDebugES.java @@ -16,15 +16,18 @@ public GLDebugES(GL gl, GLExt glext, GLFbo glfbo) { this.glfbo = glfbo; } + @Override public void resetStats() { gl.resetStats(); } + @Override public void glActiveTexture(int texture) { gl.glActiveTexture(texture); checkError(); } + @Override public void glAttachShader(int program, int shader) { gl.glAttachShader(program, shader); checkError(); @@ -36,169 +39,202 @@ public void glBeginQuery(int target, int query) { checkError(); } + @Override public void glBindBuffer(int target, int buffer) { gl.glBindBuffer(target, buffer); checkError(); } + @Override public void glBindTexture(int target, int texture) { gl.glBindTexture(target, texture); checkError(); } + @Override public void glBlendFunc(int sfactor, int dfactor) { gl.glBlendFunc(sfactor, dfactor); checkError(); } + @Override public void glBlendFuncSeparate(int sfactorRGB, int dfactorRGB, int sfactorAlpha, int dFactorAlpha) { gl.glBlendFuncSeparate(sfactorRGB, dfactorRGB, sfactorAlpha, dFactorAlpha); checkError(); } + @Override public void glBufferData(int target, FloatBuffer data, int usage) { gl.glBufferData(target, data, usage); checkError(); } + @Override public void glBufferData(int target, ShortBuffer data, int usage) { gl.glBufferData(target, data, usage); checkError(); } + @Override public void glBufferData(int target, ByteBuffer data, int usage) { gl.glBufferData(target, data, usage); checkError(); } + @Override public void glBufferSubData(int target, long offset, FloatBuffer data) { gl.glBufferSubData(target, offset, data); checkError(); } + @Override public void glBufferSubData(int target, long offset, ShortBuffer data) { gl.glBufferSubData(target, offset, data); checkError(); } + @Override public void glBufferSubData(int target, long offset, ByteBuffer data) { gl.glBufferSubData(target, offset, data); checkError(); } + @Override public void glClear(int mask) { gl.glClear(mask); checkError(); } + @Override public void glClearColor(float red, float green, float blue, float alpha) { gl.glClearColor(red, green, blue, alpha); checkError(); } + @Override public void glColorMask(boolean red, boolean green, boolean blue, boolean alpha) { gl.glColorMask(red, green, blue, alpha); checkError(); } + @Override public void glCompileShader(int shader) { gl.glCompileShader(shader); checkError(); } + @Override public void glCompressedTexImage2D(int target, int level, int internalformat, int width, int height, int border, ByteBuffer data) { gl.glCompressedTexImage2D(target, level, internalformat, width, height, border, data); checkError(); } + @Override public void glCompressedTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, ByteBuffer data) { gl.glCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, data); checkError(); } + @Override public int glCreateProgram() { int program = gl.glCreateProgram(); checkError(); return program; } + @Override public int glCreateShader(int shaderType) { int shader = gl.glCreateShader(shaderType); checkError(); return shader; } + @Override public void glCullFace(int mode) { gl.glCullFace(mode); checkError(); } + @Override public void glDeleteBuffers(IntBuffer buffers) { gl.glDeleteBuffers(buffers); checkError(); } + @Override public void glDeleteProgram(int program) { gl.glDeleteProgram(program); checkError(); } + @Override public void glDeleteShader(int shader) { gl.glDeleteShader(shader); checkError(); } + @Override public void glDeleteTextures(IntBuffer textures) { gl.glDeleteTextures(textures); checkError(); } + @Override public void glDepthFunc(int func) { gl.glDepthFunc(func); checkError(); } + @Override public void glDepthMask(boolean flag) { gl.glDepthMask(flag); checkError(); } + @Override public void glDepthRange(double nearVal, double farVal) { gl.glDepthRange(nearVal, farVal); checkError(); } + @Override public void glDetachShader(int program, int shader) { gl.glDetachShader(program, shader); checkError(); } + @Override public void glDisable(int cap) { gl.glDisable(cap); checkError(); } + @Override public void glDisableVertexAttribArray(int index) { gl.glDisableVertexAttribArray(index); checkError(); } + @Override public void glDrawArrays(int mode, int first, int count) { gl.glDrawArrays(mode, first, count); checkError(); } + @Override public void glDrawRangeElements(int mode, int start, int end, int count, int type, long indices) { gl.glDrawRangeElements(mode, start, end, count, type, indices); checkError(); } + @Override public void glEnable(int cap) { gl.glEnable(cap); checkError(); } + @Override public void glEnableVertexAttribArray(int index) { gl.glEnableVertexAttribArray(index); checkError(); @@ -209,11 +245,13 @@ public void glEndQuery(int target) { checkError(); } + @Override public void glGenBuffers(IntBuffer buffers) { gl.glGenBuffers(buffers); checkError(); } + @Override public void glGenTextures(IntBuffer textures) { gl.glGenTextures(textures); checkError(); @@ -225,32 +263,38 @@ public void glGenQueries(int num, IntBuffer ids) { checkError(); } + @Override public int glGetAttribLocation(int program, String name) { int location = gl.glGetAttribLocation(program, name); checkError(); return location; } + @Override public void glGetBoolean(int pname, ByteBuffer params) { gl.glGetBoolean(pname, params); checkError(); } + @Override public int glGetError() { // No need to check for error here? Haha return gl.glGetError(); } + @Override public void glGetInteger(int pname, IntBuffer params) { gl.glGetInteger(pname, params); checkError(); } + @Override public void glGetProgram(int program, int pname, IntBuffer params) { gl.glGetProgram(program, pname, params); checkError(); } + @Override public String glGetProgramInfoLog(int program, int maxSize) { String infoLog = gl.glGetProgramInfoLog(program, maxSize); checkError(); @@ -271,251 +315,300 @@ public int glGetQueryObjectiv(int query, int pname) { return res; } + @Override public void glGetShader(int shader, int pname, IntBuffer params) { gl.glGetShader(shader, pname, params); checkError(); } + @Override public String glGetShaderInfoLog(int shader, int maxSize) { String infoLog = gl.glGetShaderInfoLog(shader, maxSize); checkError(); return infoLog; } + @Override public String glGetString(int name) { String string = gl.glGetString(name); checkError(); return string; } + @Override public int glGetUniformLocation(int program, String name) { int location = gl.glGetUniformLocation(program, name); checkError(); return location; } + @Override public boolean glIsEnabled(int cap) { boolean enabled = gl.glIsEnabled(cap); checkError(); return enabled; } + @Override public void glLineWidth(float width) { gl.glLineWidth(width); checkError(); } + @Override public void glLinkProgram(int program) { gl.glLinkProgram(program); checkError(); } + @Override public void glPixelStorei(int pname, int param) { gl.glPixelStorei(pname, param); checkError(); } + @Override public void glPolygonOffset(float factor, float units) { gl.glPolygonOffset(factor, units); checkError(); } + @Override public void glReadPixels(int x, int y, int width, int height, int format, int type, ByteBuffer data) { gl.glReadPixels(x, y, width, height, format, type, data); checkError(); } + @Override public void glReadPixels(int x, int y, int width, int height, int format, int type, long offset) { gl.glReadPixels(x, y, width, height, format, type, offset); checkError(); } + @Override public void glScissor(int x, int y, int width, int height) { gl.glScissor(x, y, width, height); checkError(); } + @Override public void glShaderSource(int shader, String[] string, IntBuffer length) { gl.glShaderSource(shader, string, length); checkError(); } + @Override public void glStencilFuncSeparate(int face, int func, int ref, int mask) { gl.glStencilFuncSeparate(face, func, ref, mask); checkError(); } + @Override public void glStencilOpSeparate(int face, int sfail, int dpfail, int dppass) { gl.glStencilOpSeparate(face, sfail, dpfail, dppass); checkError(); } + @Override public void glTexImage2D(int target, int level, int internalFormat, int width, int height, int border, int format, int type, ByteBuffer data) { gl.glTexImage2D(target, level, internalFormat, width, height, border, format, type, data); checkError(); } + @Override public void glTexParameterf(int target, int pname, float param) { gl.glTexParameterf(target, pname, param); checkError(); } + @Override public void glTexParameteri(int target, int pname, int param) { gl.glTexParameteri(target, pname, param); checkError(); } + @Override public void glTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int type, ByteBuffer data) { gl.glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, data); checkError(); } + @Override public void glUniform1(int location, FloatBuffer value) { gl.glUniform1(location, value); checkError(); } + @Override public void glUniform1(int location, IntBuffer value) { gl.glUniform1(location, value); checkError(); } + @Override public void glUniform1f(int location, float v0) { gl.glUniform1f(location, v0); checkError(); } + @Override public void glUniform1i(int location, int v0) { gl.glUniform1i(location, v0); checkError(); } + @Override public void glUniform2(int location, IntBuffer value) { gl.glUniform2(location, value); checkError(); } + @Override public void glUniform2(int location, FloatBuffer value) { gl.glUniform2(location, value); checkError(); } + @Override public void glUniform2f(int location, float v0, float v1) { gl.glUniform2f(location, v0, v1); checkError(); } + @Override public void glUniform3(int location, IntBuffer value) { gl.glUniform3(location, value); checkError(); } + @Override public void glUniform3(int location, FloatBuffer value) { gl.glUniform3(location, value); checkError(); } + @Override public void glUniform3f(int location, float v0, float v1, float v2) { gl.glUniform3f(location, v0, v1, v2); checkError(); } + @Override public void glUniform4(int location, FloatBuffer value) { gl.glUniform4(location, value); checkError(); } + @Override public void glUniform4(int location, IntBuffer value) { gl.glUniform4(location, value); checkError(); } + @Override public void glUniform4f(int location, float v0, float v1, float v2, float v3) { gl.glUniform4f(location, v0, v1, v2, v3); checkError(); } + @Override public void glUniformMatrix3(int location, boolean transpose, FloatBuffer value) { gl.glUniformMatrix3(location, transpose, value); checkError(); } + @Override public void glUniformMatrix4(int location, boolean transpose, FloatBuffer value) { gl.glUniformMatrix4(location, transpose, value); checkError(); } + @Override public void glUseProgram(int program) { gl.glUseProgram(program); checkError(); } + @Override public void glVertexAttribPointer(int index, int size, int type, boolean normalized, int stride, long pointer) { gl.glVertexAttribPointer(index, size, type, normalized, stride, pointer); checkError(); } + @Override public void glViewport(int x, int y, int width, int height) { gl.glViewport(x, y, width, height); checkError(); } + @Override public void glBindFramebufferEXT(int param1, int param2) { glfbo.glBindFramebufferEXT(param1, param2); checkError(); } + @Override public void glBindRenderbufferEXT(int param1, int param2) { glfbo.glBindRenderbufferEXT(param1, param2); checkError(); } + @Override public int glCheckFramebufferStatusEXT(int param1) { int result = glfbo.glCheckFramebufferStatusEXT(param1); checkError(); return result; } + @Override public void glDeleteFramebuffersEXT(IntBuffer param1) { glfbo.glDeleteFramebuffersEXT(param1); checkError(); } + @Override public void glDeleteRenderbuffersEXT(IntBuffer param1) { glfbo.glDeleteRenderbuffersEXT(param1); checkError(); } + @Override public void glFramebufferRenderbufferEXT(int param1, int param2, int param3, int param4) { glfbo.glFramebufferRenderbufferEXT(param1, param2, param3, param4); checkError(); } + @Override public void glFramebufferTexture2DEXT(int param1, int param2, int param3, int param4, int param5) { glfbo.glFramebufferTexture2DEXT(param1, param2, param3, param4, param5); checkError(); } + @Override public void glGenFramebuffersEXT(IntBuffer param1) { glfbo.glGenFramebuffersEXT(param1); checkError(); } + @Override public void glGenRenderbuffersEXT(IntBuffer param1) { glfbo.glGenRenderbuffersEXT(param1); checkError(); } + @Override public void glGenerateMipmapEXT(int param1) { glfbo.glGenerateMipmapEXT(param1); checkError(); } + @Override public void glRenderbufferStorageEXT(int param1, int param2, int param3, int param4) { glfbo.glRenderbufferStorageEXT(param1, param2, param3, param4); checkError(); } + @Override public void glBlitFramebufferEXT(int srcX0, int srcY0, int srcX1, int srcY1, int dstX0, int dstY0, int dstX1, int dstY1, int mask, int filter) { glfbo.glBlitFramebufferEXT(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter); checkError(); @@ -533,46 +626,55 @@ public void glGetBufferSubData(int target, long offset, ByteBuffer data) { checkError(); } + @Override public void glBufferData(int target, IntBuffer data, int usage) { glext.glBufferData(target, data, usage); checkError(); } + @Override public void glBufferSubData(int target, long offset, IntBuffer data) { glext.glBufferSubData(target, offset, data); checkError(); } + @Override public void glDrawArraysInstancedARB(int mode, int first, int count, int primcount) { glext.glDrawArraysInstancedARB(mode, first, count, primcount); checkError(); } + @Override public void glDrawBuffers(IntBuffer bufs) { glext.glDrawBuffers(bufs); checkError(); } + @Override public void glDrawElementsInstancedARB(int mode, int indices_count, int type, long indices_buffer_offset, int primcount) { glext.glDrawElementsInstancedARB(mode, indices_count, type, indices_buffer_offset, primcount); checkError(); } + @Override public void glGetMultisample(int pname, int index, FloatBuffer val) { glext.glGetMultisample(pname, index, val); checkError(); } + @Override public void glRenderbufferStorageMultisampleEXT(int target, int samples, int internalformat, int width, int height) { glfbo.glRenderbufferStorageMultisampleEXT(target, samples, internalformat, width, height); checkError(); } + @Override public void glTexImage2DMultisample(int target, int samples, int internalformat, int width, int height, boolean fixedsamplelocations) { glext.glTexImage2DMultisample(target, samples, internalformat, width, height, fixedsamplelocations); checkError(); } + @Override public void glVertexAttribDivisorARB(int index, int divisor) { glext.glVertexAttribDivisorARB(index, divisor); checkError(); @@ -610,49 +712,58 @@ public void glFramebufferTextureLayerEXT(int param1, int param2, int param3, int checkError(); } + @Override public void glAlphaFunc(int func, float ref) { ((GL2)gl).glAlphaFunc(func, ref); checkError(); } + @Override public void glPointSize(float size) { ((GL2)gl).glPointSize(size); checkError(); } + @Override public void glPolygonMode(int face, int mode) { ((GL2)gl).glPolygonMode(face, mode); checkError(); } + @Override public void glDrawBuffer(int mode) { ((GL2)gl).glDrawBuffer(mode); checkError(); } + @Override public void glReadBuffer(int mode) { ((GL2)gl).glReadBuffer(mode); checkError(); } + @Override public void glCompressedTexImage3D(int target, int level, int internalFormat, int width, int height, int depth, int border, ByteBuffer data) { ((GL2)gl).glCompressedTexImage3D(target, level, internalFormat, width, height, depth, border, data); checkError(); } + @Override public void glCompressedTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, ByteBuffer data) { ((GL2)gl).glCompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, data); checkError(); } + @Override public void glTexImage3D(int target, int level, int internalFormat, int width, int height, int depth, int border, int format, int type, ByteBuffer data) { ((GL2)gl).glTexImage3D(target, level, internalFormat, width, height, depth, border, format, type, data); checkError(); } + @Override public void glTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, ByteBuffer data) { ((GL2)gl).glTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, data); diff --git a/jme3-core/src/main/java/com/jme3/renderer/opengl/GLRenderer.java b/jme3-core/src/main/java/com/jme3/renderer/opengl/GLRenderer.java index d20c78b309..23bd4d5f74 100644 --- a/jme3-core/src/main/java/com/jme3/renderer/opengl/GLRenderer.java +++ b/jme3-core/src/main/java/com/jme3/renderer/opengl/GLRenderer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -126,6 +126,7 @@ public EnumSet getCaps() { } // Not making public yet ... + @Override public EnumMap getLimits() { return limits; } @@ -595,6 +596,7 @@ private boolean getBoolean(int en) { } @SuppressWarnings("fallthrough") + @Override public void initialize() { loadCapabilities(); @@ -612,7 +614,7 @@ public void initialize() { int vaoId = intBuf16.get(0); gl3.glBindVertexArray(vaoId); } - if (gl2 != null) { + if (gl2 != null && !(gl instanceof GLES_30)) { gl2.glEnable(GL2.GL_VERTEX_PROGRAM_POINT_SIZE); if (!caps.contains(Caps.CoreProfile)) { gl2.glEnable(GL2.GL_POINT_SPRITE); @@ -620,6 +622,7 @@ public void initialize() { } } + @Override public void invalidateState() { context.reset(); if (gl2 != null) { @@ -628,6 +631,7 @@ public void invalidateState() { } } + @Override public void resetGLObjects() { logger.log(Level.FINE, "Reseting objects and invalidating state"); objManager.resetObjects(); @@ -635,6 +639,7 @@ public void resetGLObjects() { invalidateState(); } + @Override public void cleanup() { logger.log(Level.FINE, "Deleting objects and invalidating state"); objManager.deleteAllObjects(this); @@ -646,10 +651,12 @@ public void cleanup() { /*********************************************************************\ |* Render State *| \*********************************************************************/ + @Override public void setDepthRange(float start, float end) { gl.glDepthRange(start, end); } + @Override public void clearBuffers(boolean color, boolean depth, boolean stencil) { int bits = 0; if (color) { @@ -681,6 +688,7 @@ public void clearBuffers(boolean color, boolean depth, boolean stencil) { } } + @Override public void setBackgroundColor(ColorRGBA color) { if (!context.clearColor.equals(color)) { gl.glClearColor(color.r, color.g, color.b, color.a); @@ -696,6 +704,7 @@ public void setDefaultAnisotropicFilter(int level) { this.defaultAnisotropicFilter = level; } + @Override public void setAlphaToCoverage(boolean value) { if (caps.contains(Caps.Multisample)) { if (value) { @@ -706,6 +715,7 @@ public void setAlphaToCoverage(boolean value) { } } + @Override public void applyRenderState(RenderState state) { if (gl2 != null) { if (state.isWireframe() && !context.wireframe) { @@ -1076,6 +1086,7 @@ private int convertTestFunction(TestFunction testFunc) { /*********************************************************************\ |* Camera and World transforms *| \*********************************************************************/ + @Override public void setViewPort(int x, int y, int w, int h) { if (x != vpX || vpY != y || vpW != w || vpH != h) { gl.glViewport(x, y, w, h); @@ -1086,6 +1097,7 @@ public void setViewPort(int x, int y, int w, int h) { } } + @Override public void setClipRect(int x, int y, int width, int height) { if (!context.clipRectEnabled) { gl.glEnable(GL.GL_SCISSOR_TEST); @@ -1100,6 +1112,7 @@ public void setClipRect(int x, int y, int width, int height) { } } + @Override public void clearClipRect() { if (context.clipRectEnabled) { gl.glDisable(GL.GL_SCISSOR_TEST); @@ -1559,6 +1572,7 @@ public void updateShaderData(Shader shader) { } } + @Override public void setShader(Shader shader) { if (shader == null) { throw new IllegalArgumentException("Shader cannot be null"); @@ -1578,6 +1592,7 @@ public void setShader(Shader shader) { } } + @Override public void deleteShaderSource(ShaderSource source) { if (source.getId() < 0) { logger.warning("Shader source is not uploaded to GPU, cannot delete."); @@ -1588,6 +1603,7 @@ public void deleteShaderSource(ShaderSource source) { source.resetObject(); } + @Override public void deleteShader(Shader shader) { if (shader.getId() == -1) { logger.warning("Shader is not uploaded to GPU, cannot delete."); @@ -1613,6 +1629,7 @@ public void copyFrameBuffer(FrameBuffer src, FrameBuffer dst) { copyFrameBuffer(src, dst, true); } + @Override public void copyFrameBuffer(FrameBuffer src, FrameBuffer dst, boolean copyDepth) { if (caps.contains(Caps.FrameBufferBlit)) { int srcX0 = 0; @@ -1891,6 +1908,7 @@ public Vector2f[] getFrameBufferSamplePositions(FrameBuffer fb) { return samplePositions; } + @Override public void setMainFrameBufferOverride(FrameBuffer fb) { mainFbOverride = null; if (context.boundFBO == 0) { @@ -1970,6 +1988,7 @@ public void setReadDrawBuffers(FrameBuffer fb) { } + @Override public void setFrameBuffer(FrameBuffer fb) { if (fb == null && mainFbOverride != null) { fb = mainFbOverride; @@ -2022,6 +2041,7 @@ public void setFrameBuffer(FrameBuffer fb) { } } + @Override public void readFrameBuffer(FrameBuffer fb, ByteBuffer byteBuf) { readFrameBufferWithGLFormat(fb, byteBuf, GL.GL_RGBA, GL.GL_UNSIGNED_BYTE); } @@ -2049,6 +2069,7 @@ private void readFrameBufferWithGLFormat(FrameBuffer fb, ByteBuffer byteBuf, int gl.glReadPixels(vpX, vpY, vpW, vpH, glFormat, dataType, byteBuf); } + @Override public void readFrameBufferWithFormat(FrameBuffer fb, ByteBuffer byteBuf, Image.Format format) { GLImageFormat glFormat = texUtil.getImageFormatWithError(format, false); readFrameBufferWithGLFormat(fb, byteBuf, glFormat.format, glFormat.dataType); @@ -2059,6 +2080,7 @@ private void deleteRenderBuffer(FrameBuffer fb, RenderBuffer rb) { glfbo.glDeleteRenderbuffersEXT(intBuf1); } + @Override public void deleteFrameBuffer(FrameBuffer fb) { if (fb.getId() != -1) { if (context.boundFBO == fb.getId()) { @@ -2547,8 +2569,12 @@ public void setTexture(int unit, Texture tex) { * @deprecated Use modifyTexture(Texture2D dest, Image src, int destX, int destY, int srcX, int srcY, int areaW, int areaH) */ @Deprecated + @Override public void modifyTexture(Texture tex, Image pixels, int x, int y) { setTexture(0, tex); + if(caps.contains(Caps.OpenGLES20) && pixels.getFormat()!=tex.getImage().getFormat() ) { + logger.log(Level.WARNING, "Incompatible texture subimage"); + } int target = convertTextureType(tex.getType(), pixels.getMultiSamples(), -1); texUtil.uploadSubTexture(target,pixels, 0, x, y,0,0,pixels.getWidth(),pixels.getHeight(), linearizeSrgbImages); } @@ -2566,10 +2592,14 @@ public void modifyTexture(Texture tex, Image pixels, int x, int y) { */ public void modifyTexture(Texture2D dest, Image src, int destX, int destY, int srcX, int srcY, int areaW, int areaH) { setTexture(0, dest); + if(caps.contains(Caps.OpenGLES20) && src.getFormat()!=dest.getImage().getFormat() ) { + logger.log(Level.WARNING, "Incompatible texture subimage"); + } int target = convertTextureType(dest.getType(), src.getMultiSamples(), -1); texUtil.uploadSubTexture(target, src, 0, destX, destY, srcX, srcY, areaW, areaH, linearizeSrgbImages); } + @Override public void deleteImage(Image image) { int texId = image.getId(); if (texId != -1) { @@ -2622,6 +2652,7 @@ private int convertFormat(Format format) { } } + @Override public void updateBufferData(VertexBuffer vb) { int bufId = vb.getId(); boolean created = false; @@ -2737,6 +2768,7 @@ public void updateBufferData(final BufferObject bo) { bo.clearUpdateNeeded(); } + @Override public void deleteBuffer(VertexBuffer vb) { int bufId = vb.getId(); if (bufId != -1) { @@ -3134,6 +3166,7 @@ private void renderMeshDefault(Mesh mesh, int lod, int count, VertexBuffer[] ins } } + @Override public void renderMesh(Mesh mesh, int lod, int count, VertexBuffer[] instanceData) { if (mesh.getVertexCount() == 0 || mesh.getTriangleCount() == 0 || count == 0) { return; @@ -3159,6 +3192,7 @@ public void renderMesh(Mesh mesh, int lod, int count, VertexBuffer[] instanceDat // } } + @Override public void setMainFrameBufferSrgb(boolean enableSrgb) { // Gamma correction if (!caps.contains(Caps.Srgb) && enableSrgb) { @@ -3185,6 +3219,7 @@ public void setMainFrameBufferSrgb(boolean enableSrgb) { } } + @Override public void setLinearizeSrgbImages(boolean linearize) { if (caps.contains(Caps.Srgb)) { linearizeSrgbImages = linearize; diff --git a/jme3-core/src/main/java/com/jme3/renderer/opengl/GLTracer.java b/jme3-core/src/main/java/com/jme3/renderer/opengl/GLTracer.java index ae3f17a8ca..204c962f4b 100644 --- a/jme3-core/src/main/java/com/jme3/renderer/opengl/GLTracer.java +++ b/jme3-core/src/main/java/com/jme3/renderer/opengl/GLTracer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2014 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -71,7 +71,7 @@ public final class GLTracer implements InvocationHandler { private static void noEnumArgs(String method, int... argSlots) { IntMap argSlotsMap = new IntMap(); for (int argSlot : argSlots) { - argSlotsMap.put(argSlot, (Void) null); + argSlotsMap.put(argSlot, null); } nonEnumArgMap.put(method, argSlotsMap); } diff --git a/jme3-core/src/main/java/com/jme3/renderer/queue/GeometryList.java b/jme3-core/src/main/java/com/jme3/renderer/queue/GeometryList.java index 09b43b9e84..796050d6a1 100644 --- a/jme3-core/src/main/java/com/jme3/renderer/queue/GeometryList.java +++ b/jme3-core/src/main/java/com/jme3/renderer/queue/GeometryList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -159,16 +159,19 @@ public void sort() { } } + @Override public Iterator iterator() { return new Iterator() { int index = 0; + @Override public boolean hasNext() { return index < size(); } + @Override public Geometry next() { if ( index >= size() ) { throw new NoSuchElementException("Geometry list has only " + size() + " elements"); @@ -176,6 +179,7 @@ public Geometry next() { return get(index++); } + @Override public void remove() { throw new UnsupportedOperationException("Geometry list doesn't support iterator removal"); } diff --git a/jme3-core/src/main/java/com/jme3/renderer/queue/GuiComparator.java b/jme3-core/src/main/java/com/jme3/renderer/queue/GuiComparator.java index 541b7eb127..7629afdf9d 100644 --- a/jme3-core/src/main/java/com/jme3/renderer/queue/GuiComparator.java +++ b/jme3-core/src/main/java/com/jme3/renderer/queue/GuiComparator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -42,6 +42,7 @@ */ public class GuiComparator implements GeometryComparator { + @Override public int compare(Geometry o1, Geometry o2) { float z1 = o1.getWorldTranslation().getZ(); float z2 = o2.getWorldTranslation().getZ(); @@ -53,6 +54,7 @@ else if (z1 < z2) return 0; } + @Override public void setCamera(Camera cam) { } diff --git a/jme3-core/src/main/java/com/jme3/renderer/queue/NullComparator.java b/jme3-core/src/main/java/com/jme3/renderer/queue/NullComparator.java index bd810ca81f..3fab4435c7 100644 --- a/jme3-core/src/main/java/com/jme3/renderer/queue/NullComparator.java +++ b/jme3-core/src/main/java/com/jme3/renderer/queue/NullComparator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -41,10 +41,12 @@ * @author Kirill Vainer */ public class NullComparator implements GeometryComparator { + @Override public int compare(Geometry o1, Geometry o2) { return 0; } + @Override public void setCamera(Camera cam) { } } diff --git a/jme3-core/src/main/java/com/jme3/renderer/queue/OpaqueComparator.java b/jme3-core/src/main/java/com/jme3/renderer/queue/OpaqueComparator.java index 4b1305c604..8eab520e77 100644 --- a/jme3-core/src/main/java/com/jme3/renderer/queue/OpaqueComparator.java +++ b/jme3-core/src/main/java/com/jme3/renderer/queue/OpaqueComparator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -42,6 +42,7 @@ public class OpaqueComparator implements GeometryComparator { private final Vector3f tempVec = new Vector3f(); private final Vector3f tempVec2 = new Vector3f(); + @Override public void setCamera(Camera cam){ this.cam = cam; } diff --git a/jme3-core/src/main/java/com/jme3/renderer/queue/TransparentComparator.java b/jme3-core/src/main/java/com/jme3/renderer/queue/TransparentComparator.java index c5c3fc79f2..9f1507daac 100644 --- a/jme3-core/src/main/java/com/jme3/renderer/queue/TransparentComparator.java +++ b/jme3-core/src/main/java/com/jme3/renderer/queue/TransparentComparator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -40,6 +40,7 @@ public class TransparentComparator implements GeometryComparator { private Camera cam; private final Vector3f tempVec = new Vector3f(); + @Override public void setCamera(Camera cam){ this.cam = cam; } @@ -87,6 +88,7 @@ private float distanceToCam(Geometry spat){ return spat.getWorldBound().distanceToEdge(cam.getLocation()); } + @Override public int compare(Geometry o1, Geometry o2) { float d1 = distanceToCam(o1); float d2 = distanceToCam(o2); diff --git a/jme3-core/src/main/java/com/jme3/scene/AssetLinkNode.java b/jme3-core/src/main/java/com/jme3/scene/AssetLinkNode.java index 82711ac6b2..fd6790f686 100644 --- a/jme3-core/src/main/java/com/jme3/scene/AssetLinkNode.java +++ b/jme3-core/src/main/java/com/jme3/scene/AssetLinkNode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -167,7 +167,7 @@ public void read(JmeImporter e) throws IOException { final InputCapsule capsule = e.getCapsule(this); final AssetManager assetManager = e.getAssetManager(); - assetLoaderKeys = (ArrayList) capsule.readSavableArrayList("assetLoaderKeyList", new ArrayList()); + assetLoaderKeys = capsule.readSavableArrayList("assetLoaderKeyList", new ArrayList<>()); for (final Iterator iterator = assetLoaderKeys.iterator(); iterator.hasNext(); ) { diff --git a/jme3-core/src/main/java/com/jme3/scene/CameraNode.java b/jme3-core/src/main/java/com/jme3/scene/CameraNode.java index 220686f568..ab8a16e544 100644 --- a/jme3-core/src/main/java/com/jme3/scene/CameraNode.java +++ b/jme3-core/src/main/java/com/jme3/scene/CameraNode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2019 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -52,7 +52,7 @@ public class CameraNode extends Node { /** * Serialization only. Do not use. */ - public CameraNode() { + protected CameraNode() { super(); } diff --git a/jme3-core/src/main/java/com/jme3/scene/Geometry.java b/jme3-core/src/main/java/com/jme3/scene/Geometry.java index adc1d51a55..8b302d434f 100644 --- a/jme3-core/src/main/java/com/jme3/scene/Geometry.java +++ b/jme3-core/src/main/java/com/jme3/scene/Geometry.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -98,7 +98,8 @@ public class Geometry extends Spatial { private int nbSimultaneousGPUMorph = -1; /** - * Serialization only. Do not use. + * Instantiate a Geometry with no name, no mesh, and no + * material. The mesh and material must be set prior to rendering. */ public Geometry() { this(null); @@ -205,6 +206,7 @@ public int getLodLevel() { * * @see Mesh#getVertexCount() */ + @Override public int getVertexCount() { return mesh.getVertexCount(); } @@ -216,6 +218,7 @@ public int getVertexCount() { * * @see Mesh#getTriangleCount() */ + @Override public int getTriangleCount() { return mesh.getTriangleCount(); } @@ -287,6 +290,7 @@ public BoundingVolume getModelBound() { * Updates the bounding volume of the mesh. Should be called when the * mesh has been modified. */ + @Override public void updateModelBound() { mesh.updateBound(); setBoundRefresh(); @@ -456,6 +460,7 @@ public void setModelBound(BoundingVolume modelBound) { //updateModelBound(); } + @Override public int collideWith(Collidable other, CollisionResults results) { // Force bound to update checkDoBoundUpdate(); diff --git a/jme3-core/src/main/java/com/jme3/scene/LightNode.java b/jme3-core/src/main/java/com/jme3/scene/LightNode.java index a64250c50c..d03304176e 100644 --- a/jme3-core/src/main/java/com/jme3/scene/LightNode.java +++ b/jme3-core/src/main/java/com/jme3/scene/LightNode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2019 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -52,7 +52,7 @@ public class LightNode extends Node { /** * Serialization only. Do not use. */ - public LightNode() { + protected LightNode() { } public LightNode(String name, Light light) { diff --git a/jme3-core/src/main/java/com/jme3/scene/Mesh.java b/jme3-core/src/main/java/com/jme3/scene/Mesh.java index 1e3195e003..326a6acc7d 100644 --- a/jme3-core/src/main/java/com/jme3/scene/Mesh.java +++ b/jme3-core/src/main/java/com/jme3/scene/Mesh.java @@ -1527,7 +1527,11 @@ public void addMorphTarget(MorphTarget target) { } public MorphTarget[] getMorphTargets() { - return morphTargets.getArray(); + if (morphTargets == null) { + return new MorphTarget[0]; + } else { + return morphTargets.getArray(); + } } /** diff --git a/jme3-core/src/main/java/com/jme3/scene/Node.java b/jme3-core/src/main/java/com/jme3/scene/Node.java index ef3ed34b88..290781ac4b 100644 --- a/jme3-core/src/main/java/com/jme3/scene/Node.java +++ b/jme3-core/src/main/java/com/jme3/scene/Node.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -83,7 +83,7 @@ public class Node extends Spatial { private boolean updateListValid = false; /** - * Serialization only. Do not use. + * Instantiate a Node with no name, no parent, and no children. */ public Node() { this(null); @@ -93,8 +93,7 @@ public Node() { * Constructor instantiates a new Node with a default empty * list for containing children. * - * @param name the name of the scene element. This is required for - * identification and comparison purposes. + * @param name the name of the scene element */ public Node(String name) { super(name); @@ -345,10 +344,13 @@ public int attachChild(Spatial child) { * @throws NullPointerException if child is null. */ public int attachChildAt(Spatial child, int index) { - if (child == null) - throw new NullPointerException(); - - if (child.getParent() != this && child != this) { + if (child == null) { + throw new IllegalArgumentException("child cannot be null"); + } + if (child == this) { + throw new IllegalArgumentException("Cannot add child to itself"); + } + if (child.getParent() != this) { if (child.getParent() != null) { child.getParent().detachChild(child); } @@ -572,6 +574,7 @@ public void setLodLevel(int lod){ } } + @Override public int collideWith(Collidable other, CollisionResults results){ int total = 0; // optimization: try collideWith BoundingVolume to avoid possibly redundant tests on children diff --git a/jme3-core/src/main/java/com/jme3/scene/Spatial.java b/jme3-core/src/main/java/com/jme3/scene/Spatial.java index 06bc63f7f6..ab3cf0d47b 100644 --- a/jme3-core/src/main/java/com/jme3/scene/Spatial.java +++ b/jme3-core/src/main/java/com/jme3/scene/Spatial.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -213,10 +213,12 @@ protected Spatial(String name) { refreshFlags |= RF_BOUND; } + @Override public void setKey(AssetKey key) { this.key = key; } + @Override public AssetKey getKey() { return key; } @@ -1103,6 +1105,7 @@ public void setLocalTranslation(float x, float y, float z) { * setLocalTransform sets the local transform of this * spatial. */ + @Override public void setLocalTransform(Transform t) { this.localTransform.set(t); setTransformRefresh(); @@ -1114,6 +1117,7 @@ public void setLocalTransform(Transform t) { * * @return the local transform of this spatial. */ + @Override public Transform getLocalTransform() { return localTransform; } @@ -1535,6 +1539,7 @@ public boolean matches(Class spatialSubclass, return true; } + @Override public void write(JmeExporter ex) throws IOException { OutputCapsule capsule = ex.getCapsule(this); capsule.write(name, "name", null); @@ -1552,6 +1557,7 @@ public void write(JmeExporter ex) throws IOException { capsule.writeStringSavableMap(userData, "user_data", null); } + @Override public void read(JmeImporter im) throws IOException { InputCapsule ic = im.getCapsule(this); diff --git a/jme3-core/src/main/java/com/jme3/scene/UserData.java b/jme3-core/src/main/java/com/jme3/scene/UserData.java index 0e94e2c0b2..d144ba4526 100644 --- a/jme3-core/src/main/java/com/jme3/scene/UserData.java +++ b/jme3-core/src/main/java/com/jme3/scene/UserData.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -134,6 +134,7 @@ public static byte getObjectType(Object type) { } } + @Override public void write(JmeExporter ex) throws IOException { OutputCapsule oc = ex.getCapsule(this); oc.write(type, "type", (byte) 0); @@ -191,6 +192,7 @@ public void write(JmeExporter ex) throws IOException { } } + @Override public void read(JmeImporter im) throws IOException { InputCapsule ic = im.getCapsule(this); type = ic.readByte("type", (byte) 0); diff --git a/jme3-core/src/main/java/com/jme3/scene/VertexBuffer.java b/jme3-core/src/main/java/com/jme3/scene/VertexBuffer.java index bb5d70afb1..7b0b4146c1 100644 --- a/jme3-core/src/main/java/com/jme3/scene/VertexBuffer.java +++ b/jme3-core/src/main/java/com/jme3/scene/VertexBuffer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2019 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -382,7 +382,7 @@ public VertexBuffer(Type type){ /** * Serialization only. Do not use. */ - public VertexBuffer(){ + protected VertexBuffer(){ super(); } diff --git a/jme3-core/src/main/java/com/jme3/scene/control/AbstractControl.java b/jme3-core/src/main/java/com/jme3/scene/control/AbstractControl.java index 4afbb437bc..ca0dd47370 100644 --- a/jme3-core/src/main/java/com/jme3/scene/control/AbstractControl.java +++ b/jme3-core/src/main/java/com/jme3/scene/control/AbstractControl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -55,6 +55,7 @@ public abstract class AbstractControl implements Control, JmeCloneable { public AbstractControl(){ } + @Override public void setSpatial(Spatial spatial) { if (this.spatial != null && spatial != null && spatial != this.spatial) { throw new IllegalStateException("This control has already been added to a Spatial"); @@ -104,6 +105,7 @@ public void cloneFields( Cloner cloner, Object original ) { this.spatial = cloner.clone(spatial); } + @Override public void update(float tpf) { if (!enabled) return; @@ -111,6 +113,7 @@ public void update(float tpf) { controlUpdate(tpf); } + @Override public void render(RenderManager rm, ViewPort vp) { if (!enabled) return; @@ -118,12 +121,14 @@ public void render(RenderManager rm, ViewPort vp) { controlRender(rm, vp); } + @Override public void write(JmeExporter ex) throws IOException { OutputCapsule oc = ex.getCapsule(this); oc.write(enabled, "enabled", true); oc.write(spatial, "spatial", null); } + @Override public void read(JmeImporter im) throws IOException { InputCapsule ic = im.getCapsule(this); enabled = ic.readBoolean("enabled", true); diff --git a/jme3-core/src/main/java/com/jme3/scene/control/LodControl.java b/jme3-core/src/main/java/com/jme3/scene/control/LodControl.java index fd74de5d17..fc03a584c8 100644 --- a/jme3-core/src/main/java/com/jme3/scene/control/LodControl.java +++ b/jme3-core/src/main/java/com/jme3/scene/control/LodControl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -153,6 +153,7 @@ public Object jmeClone() { protected void controlUpdate(float tpf) { } + @Override protected void controlRender(RenderManager rm, ViewPort vp) { BoundingVolume bv = spatial.getWorldBound(); diff --git a/jme3-core/src/main/java/com/jme3/scene/debug/Arrow.java b/jme3-core/src/main/java/com/jme3/scene/debug/Arrow.java index 5f6425823b..24efb597ec 100644 --- a/jme3-core/src/main/java/com/jme3/scene/debug/Arrow.java +++ b/jme3-core/src/main/java/com/jme3/scene/debug/Arrow.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2019 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -62,7 +62,7 @@ public class Arrow extends Mesh { /** * Serialization only. Do not use. */ - public Arrow() { + protected Arrow() { } /** diff --git a/jme3-core/src/main/java/com/jme3/scene/debug/WireSphere.java b/jme3-core/src/main/java/com/jme3/scene/debug/WireSphere.java index cf0244355b..3fa4f48637 100644 --- a/jme3-core/src/main/java/com/jme3/scene/debug/WireSphere.java +++ b/jme3-core/src/main/java/com/jme3/scene/debug/WireSphere.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2017 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -109,7 +109,7 @@ public void updatePositions(float radius) { /* * Update vertex positions for the great circle in the X-Y plane. */ - float rate = FastMath.TWO_PI / (float) samples; + float rate = FastMath.TWO_PI / samples; float angle = 0; for (int i = 0; i < samples; i++) { float x = radius * FastMath.cos(angle); @@ -130,7 +130,7 @@ public void updatePositions(float radius) { /* * Update vertex positions for 'zSamples' parallel circles. */ - float zRate = (radius * 2) / (float) (zSamples); + float zRate = (radius * 2) / zSamples; float zHeight = -radius + (zRate / 2f); float rb = 1f / zSamples; float b = rb / 2f; diff --git a/jme3-core/src/main/java/com/jme3/scene/debug/custom/ArmatureDebugAppState.java b/jme3-core/src/main/java/com/jme3/scene/debug/custom/ArmatureDebugAppState.java index a3618b4442..1afc844540 100644 --- a/jme3-core/src/main/java/com/jme3/scene/debug/custom/ArmatureDebugAppState.java +++ b/jme3-core/src/main/java/com/jme3/scene/debug/custom/ArmatureDebugAppState.java @@ -122,6 +122,7 @@ private void findGeoms(Node node, List geoms) { } private ActionListener actionListener = new ActionListener() { + @Override public void onAction(String name, boolean isPressed, float tpf) { if (name.equals("shoot") && isPressed) { clickDelay = 0; diff --git a/jme3-core/src/main/java/com/jme3/scene/debug/custom/JointShape.java b/jme3-core/src/main/java/com/jme3/scene/debug/custom/JointShape.java index b854095b9e..266607eb3d 100644 --- a/jme3-core/src/main/java/com/jme3/scene/debug/custom/JointShape.java +++ b/jme3-core/src/main/java/com/jme3/scene/debug/custom/JointShape.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2010 jMonkeyEngine + * Copyright (c) 2009-2019 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -42,7 +42,7 @@ public class JointShape extends Mesh { /** * Serialization only. Do not use. */ - public JointShape() { + protected JointShape() { float width = 1; float height = 1; setBuffer(Type.Position, 3, new float[]{-width * 0.5f, -width * 0.5f, 0, diff --git a/jme3-core/src/main/java/com/jme3/scene/instancing/InstancedGeometry.java b/jme3-core/src/main/java/com/jme3/scene/instancing/InstancedGeometry.java index 91522acbe3..b622ab6e30 100644 --- a/jme3-core/src/main/java/com/jme3/scene/instancing/InstancedGeometry.java +++ b/jme3-core/src/main/java/com/jme3/scene/instancing/InstancedGeometry.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2019 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -64,9 +64,6 @@ public class InstancedGeometry extends Geometry { private int firstUnusedIndex = 0; - /** - * Serialization only. Do not use. - */ public InstancedGeometry() { super(); setIgnoreTransform(true); diff --git a/jme3-core/src/main/java/com/jme3/scene/instancing/InstancedNode.java b/jme3-core/src/main/java/com/jme3/scene/instancing/InstancedNode.java index 2ddaa4cc1e..5c3808a151 100644 --- a/jme3-core/src/main/java/com/jme3/scene/instancing/InstancedNode.java +++ b/jme3-core/src/main/java/com/jme3/scene/instancing/InstancedNode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2018 jMonkeyEngine + * Copyright (c) 2014-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -151,19 +151,24 @@ public void cloneFields( Cloner cloner, Object original ) { this.node = cloner.clone(node); } + @Override public void setSpatial(Spatial spatial){ } + @Override public void update(float tpf){ } + @Override public void render(RenderManager rm, ViewPort vp) { node.renderFromControl(); } + @Override public void write(JmeExporter ex) throws IOException { } + @Override public void read(JmeImporter im) throws IOException { } } diff --git a/jme3-core/src/main/java/com/jme3/scene/shape/Box.java b/jme3-core/src/main/java/com/jme3/scene/shape/Box.java index 15b25d24b3..40be05df6a 100644 --- a/jme3-core/src/main/java/com/jme3/scene/shape/Box.java +++ b/jme3-core/src/main/java/com/jme3/scene/shape/Box.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -130,7 +130,7 @@ public Box(Vector3f min, Vector3f max) { /** * Empty constructor for serialization only. Do not use. */ - public Box(){ + protected Box(){ super(); } @@ -145,24 +145,28 @@ public Box clone() { return new Box(center.clone(), xExtent, yExtent, zExtent); } + @Override protected void doUpdateGeometryIndices() { if (getBuffer(Type.Index) == null){ setBuffer(Type.Index, 3, BufferUtils.createShortBuffer(GEOMETRY_INDICES_DATA)); } } + @Override protected void doUpdateGeometryNormals() { if (getBuffer(Type.Normal) == null){ setBuffer(Type.Normal, 3, BufferUtils.createFloatBuffer(GEOMETRY_NORMALS_DATA)); } } + @Override protected void doUpdateGeometryTextures() { if (getBuffer(Type.TexCoord) == null){ setBuffer(Type.TexCoord, 2, BufferUtils.createFloatBuffer(GEOMETRY_TEXTURE_DATA)); } } + @Override protected void doUpdateGeometryVertices() { FloatBuffer fpb = BufferUtils.createVector3Buffer(24); Vector3f[] v = computeVertices(); diff --git a/jme3-core/src/main/java/com/jme3/scene/shape/Curve.java b/jme3-core/src/main/java/com/jme3/scene/shape/Curve.java index d6eb8dc209..063bbab11f 100644 --- a/jme3-core/src/main/java/com/jme3/scene/shape/Curve.java +++ b/jme3-core/src/main/java/com/jme3/scene/shape/Curve.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2019 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -55,7 +55,7 @@ public class Curve extends Mesh { /** * Serialization only. Do not use. */ - public Curve() { + protected Curve() { } /** diff --git a/jme3-core/src/main/java/com/jme3/scene/shape/Cylinder.java b/jme3-core/src/main/java/com/jme3/scene/shape/Cylinder.java index a3dbadbf9a..01d38a4958 100644 --- a/jme3-core/src/main/java/com/jme3/scene/shape/Cylinder.java +++ b/jme3-core/src/main/java/com/jme3/scene/shape/Cylinder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2019 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -64,9 +64,9 @@ public class Cylinder extends Mesh { private boolean inverted; /** - * Default constructor for serialization only. Do not use. + * constructor for serialization only. Do not use. */ - public Cylinder() { + protected Cylinder() { } /** diff --git a/jme3-core/src/main/java/com/jme3/scene/shape/Dome.java b/jme3-core/src/main/java/com/jme3/scene/shape/Dome.java index c3c4583744..6c44409a81 100644 --- a/jme3-core/src/main/java/com/jme3/scene/shape/Dome.java +++ b/jme3-core/src/main/java/com/jme3/scene/shape/Dome.java @@ -66,7 +66,7 @@ public class Dome extends Mesh { /** * Serialization only. Do not use. */ - public Dome() { + protected Dome() { } /** diff --git a/jme3-core/src/main/java/com/jme3/scene/shape/Line.java b/jme3-core/src/main/java/com/jme3/scene/shape/Line.java index 93e667d7c5..c9c5f3c197 100644 --- a/jme3-core/src/main/java/com/jme3/scene/shape/Line.java +++ b/jme3-core/src/main/java/com/jme3/scene/shape/Line.java @@ -49,13 +49,13 @@ */ public class Line extends Mesh { - private Vector3f start; - private Vector3f end; + private Vector3f start = new Vector3f(); + private Vector3f end = new Vector3f(); /** * No-argument constructor needed by SavableClassUtil. */ - public Line() { // TODO protected + protected Line() { } public Line(Vector3f start, Vector3f end) { @@ -64,12 +64,11 @@ public Line(Vector3f start, Vector3f end) { } protected void updateGeometry(Vector3f start, Vector3f end) { - this.start = start; - this.end = end; + this.start.set(start); + this.end.set(end); setBuffer(Type.Position, 3, new float[]{start.x, start.y, start.z, end.x, end.y, end.z,}); - setBuffer(Type.TexCoord, 2, new float[]{0, 0, 1, 1}); @@ -126,7 +125,7 @@ public void read(JmeImporter im) throws IOException { super.read(im); InputCapsule in = im.getCapsule(this); - start = (Vector3f) in.readSavable("startVertex", null); - end = (Vector3f) in.readSavable("endVertex", null); + start = (Vector3f) in.readSavable("startVertex", start); + end = (Vector3f) in.readSavable("endVertex", end); } } diff --git a/jme3-core/src/main/java/com/jme3/scene/shape/PQTorus.java b/jme3-core/src/main/java/com/jme3/scene/shape/PQTorus.java index fad5f731cc..09f230ab00 100644 --- a/jme3-core/src/main/java/com/jme3/scene/shape/PQTorus.java +++ b/jme3-core/src/main/java/com/jme3/scene/shape/PQTorus.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -141,7 +141,7 @@ public void updateGeometry(float p, float q, float radius, float width, int step // Move along the length of the pq torus for (int i = 0; i < steps; i++) { theta += thetaStep; - float circleFraction = ((float) i) / (float) steps; + float circleFraction = i / (float) steps; // Find the point on the torus r = (0.5f * (2.0f + FastMath.sin(q * theta)) * radius); diff --git a/jme3-core/src/main/java/com/jme3/scene/shape/Quad.java b/jme3-core/src/main/java/com/jme3/scene/shape/Quad.java index 6abbb53b43..c5a4d0e139 100644 --- a/jme3-core/src/main/java/com/jme3/scene/shape/Quad.java +++ b/jme3-core/src/main/java/com/jme3/scene/shape/Quad.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2010 jMonkeyEngine + * Copyright (c) 2009-2019 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -56,7 +56,7 @@ public class Quad extends Mesh { /** * Serialization only. Do not use. */ - public Quad(){ + protected Quad(){ } /** diff --git a/jme3-core/src/main/java/com/jme3/scene/shape/Sphere.java b/jme3-core/src/main/java/com/jme3/scene/shape/Sphere.java index e02e7221b5..97d24eb901 100644 --- a/jme3-core/src/main/java/com/jme3/scene/shape/Sphere.java +++ b/jme3-core/src/main/java/com/jme3/scene/shape/Sphere.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -84,7 +84,7 @@ public enum TextureMode { /** * Serialization only. Do not use. */ - public Sphere() { + protected Sphere() { } /** @@ -402,6 +402,7 @@ public void updateGeometry(int zSamples, int radialSamples, float radius, boolea setStatic(); } + @Override public void read(JmeImporter e) throws IOException { super.read(e); InputCapsule capsule = e.getCapsule(this); @@ -413,6 +414,7 @@ public void read(JmeImporter e) throws IOException { interior = capsule.readBoolean("interior", false); } + @Override public void write(JmeExporter e) throws IOException { super.write(e); OutputCapsule capsule = e.getCapsule(this); diff --git a/jme3-core/src/main/java/com/jme3/scene/shape/StripBox.java b/jme3-core/src/main/java/com/jme3/scene/shape/StripBox.java index 5ac256e93a..16d1eb31d6 100644 --- a/jme3-core/src/main/java/com/jme3/scene/shape/StripBox.java +++ b/jme3-core/src/main/java/com/jme3/scene/shape/StripBox.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -124,7 +124,7 @@ public StripBox(Vector3f min, Vector3f max) { /** * Empty constructor for serialization only. Do not use. */ - public StripBox(){ + protected StripBox(){ super(); } @@ -139,12 +139,14 @@ public StripBox clone() { return new StripBox(center.clone(), xExtent, yExtent, zExtent); } + @Override protected void doUpdateGeometryIndices() { if (getBuffer(Type.Index) == null){ setBuffer(Type.Index, 3, BufferUtils.createShortBuffer(GEOMETRY_INDICES_DATA)); } } + @Override protected void doUpdateGeometryNormals() { if (getBuffer(Type.Normal) == null){ float[] normals = new float[8 * 3]; @@ -164,12 +166,14 @@ protected void doUpdateGeometryNormals() { } } + @Override protected void doUpdateGeometryTextures() { if (getBuffer(Type.TexCoord) == null){ setBuffer(Type.TexCoord, 2, BufferUtils.createFloatBuffer(GEOMETRY_TEXTURE_DATA)); } } + @Override protected void doUpdateGeometryVertices() { FloatBuffer fpb = BufferUtils.createVector3Buffer(8 * 3); Vector3f[] v = computeVertices(); diff --git a/jme3-core/src/main/java/com/jme3/shader/Shader.java b/jme3-core/src/main/java/com/jme3/shader/Shader.java index cd93ab9f37..214f0cc185 100644 --- a/jme3-core/src/main/java/com/jme3/shader/Shader.java +++ b/jme3-core/src/main/java/com/jme3/shader/Shader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -205,15 +205,18 @@ public String toString(){ + sourceType.name()+", language=" + language + "]"; } + @Override public void resetObject(){ id = -1; setUpdateNeeded(); } + @Override public void deleteObject(Object rendererObject){ ((Renderer)rendererObject).deleteShaderSource(ShaderSource.this); } + @Override public NativeObject createDestructableClone(){ return new ShaderSource(ShaderSource.this); } @@ -449,6 +452,7 @@ public void deleteObject(Object rendererObject) { ((Renderer)rendererObject).deleteShader(this); } + @Override public NativeObject createDestructableClone(){ return new Shader(this); } diff --git a/jme3-core/src/main/java/com/jme3/shader/ShaderNode.java b/jme3-core/src/main/java/com/jme3/shader/ShaderNode.java index 5ef500ffd0..a33ee1cf0d 100644 --- a/jme3-core/src/main/java/com/jme3/shader/ShaderNode.java +++ b/jme3-core/src/main/java/com/jme3/shader/ShaderNode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -199,8 +199,8 @@ public void read(JmeImporter im) throws IOException { name = ic.readString("name", ""); definition = (ShaderNodeDefinition) ic.readSavable("definition", null); condition = ic.readString("condition", null); - inputMapping = (List) ic.readSavableArrayList("inputMapping", new ArrayList()); - outputMapping = (List) ic.readSavableArrayList("outputMapping", new ArrayList()); + inputMapping = ic.readSavableArrayList("inputMapping", new ArrayList<>()); + outputMapping = ic.readSavableArrayList("outputMapping", new ArrayList<>()); } /** diff --git a/jme3-core/src/main/java/com/jme3/shader/ShaderNodeDefinition.java b/jme3-core/src/main/java/com/jme3/shader/ShaderNodeDefinition.java index 68a7b80d8f..6e46f0d7a1 100644 --- a/jme3-core/src/main/java/com/jme3/shader/ShaderNodeDefinition.java +++ b/jme3-core/src/main/java/com/jme3/shader/ShaderNodeDefinition.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -194,7 +194,7 @@ public void setPath(String path) { */ @Override public void write(JmeExporter ex) throws IOException { - OutputCapsule oc = (OutputCapsule) ex.getCapsule(this); + OutputCapsule oc = ex.getCapsule(this); oc.write(name, "name", ""); String[] str = new String[shadersLanguage.size()]; oc.write(shadersLanguage.toArray(str), "shadersLanguage", null); @@ -230,7 +230,7 @@ public void setNoOutput(boolean noOutput) { */ @Override public void read(JmeImporter im) throws IOException { - InputCapsule ic = (InputCapsule) im.getCapsule(this); + InputCapsule ic = im.getCapsule(this); name = ic.readString("name", ""); String[] str = ic.readStringArray("shadersLanguage", null); @@ -248,8 +248,8 @@ public void read(JmeImporter im) throws IOException { } type = ic.readEnum("type", Shader.ShaderType.class, null); - inputs = (List) ic.readSavableArrayList("inputs", new ArrayList()); - outputs = (List) ic.readSavableArrayList("outputs", new ArrayList()); + inputs = ic.readSavableArrayList("inputs", new ArrayList<>()); + outputs = ic.readSavableArrayList("outputs", new ArrayList<>()); } /** diff --git a/jme3-core/src/main/java/com/jme3/shadow/AbstractShadowRenderer.java b/jme3-core/src/main/java/com/jme3/shadow/AbstractShadowRenderer.java index 4c0df0bd66..de07fa1fd5 100644 --- a/jme3-core/src/main/java/com/jme3/shadow/AbstractShadowRenderer.java +++ b/jme3-core/src/main/java/com/jme3/shadow/AbstractShadowRenderer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -330,6 +330,7 @@ protected Geometry createFrustum(Vector3f[] pts, int i) { * @param rm the render manager * @param vp the viewport */ + @Override public void initialize(RenderManager rm, ViewPort vp) { renderManager = rm; viewPort = vp; @@ -349,6 +350,7 @@ public void initialize(RenderManager rm, ViewPort vp) { * * @return true if initialized, otherwise false */ + @Override public boolean isInitialized() { return viewPort != null; } @@ -390,6 +392,7 @@ protected void doDisplayFrustumDebug(int shadowMapIndex) { } @SuppressWarnings("fallthrough") + @Override public void postQueue(RenderQueue rq) { lightReceivers.clear(); skipPostPass = false; @@ -471,6 +474,7 @@ public void displayDebug() { protected abstract void getReceivers(GeometryList lightReceivers); + @Override public void postFrame(FrameBuffer out) { if (skipPostPass) { return; @@ -684,12 +688,15 @@ public float getShadowZFadeLength() { */ protected abstract boolean checkCulling(Camera viewCam); + @Override public void preFrame(float tpf) { } + @Override public void cleanup() { } + @Override public void reshape(ViewPort vp, int w, int h) { } @@ -824,6 +831,7 @@ public void cloneFields(final Cloner cloner, final Object original) { init(assetManager, nbShadowMaps, (int) shadowMapSize); } + @Override public void setProfiler(AppProfiler profiler) { this.prof = profiler; } @@ -833,6 +841,7 @@ public void setProfiler(AppProfiler profiler) { * * @param im importer (not null) */ + @Override public void read(JmeImporter im) throws IOException { InputCapsule ic = im.getCapsule(this); assetManager = im.getAssetManager(); @@ -852,6 +861,7 @@ public void read(JmeImporter im) throws IOException { * * @param ex exporter (not null) */ + @Override public void write(JmeExporter ex) throws IOException { OutputCapsule oc = ex.getCapsule(this); oc.write(nbShadowMaps, "nbShadowMaps", 1); diff --git a/jme3-core/src/main/java/com/jme3/shadow/BasicShadowRenderer.java b/jme3-core/src/main/java/com/jme3/shadow/BasicShadowRenderer.java index 54c1f3b4f2..aa8702fdf5 100644 --- a/jme3-core/src/main/java/com/jme3/shadow/BasicShadowRenderer.java +++ b/jme3-core/src/main/java/com/jme3/shadow/BasicShadowRenderer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -92,7 +92,7 @@ public BasicShadowRenderer(AssetManager manager, int size) { //DO NOT COMMENT THIS (it prevent the OSX incomplete read buffer crash) dummyTex = new Texture2D(size, size, Format.RGBA8); shadowFB.setColorTexture(dummyTex); - shadowMapSize = (float)size; + shadowMapSize = size; preshadowMat = new Material(manager, "Common/MatDefs/Shadow/PreShadow.j3md"); postshadowMat = new Material(manager, "Common/MatDefs/Shadow/BasicPostShadow.j3md"); postshadowMat.setTexture("ShadowMap", shadowMap); @@ -104,6 +104,7 @@ public BasicShadowRenderer(AssetManager manager, int size) { } } + @Override public void initialize(RenderManager rm, ViewPort vp) { renderManager = rm; viewPort = vp; @@ -111,6 +112,7 @@ public void initialize(RenderManager rm, ViewPort vp) { reshape(vp, vp.getCamera().getWidth(), vp.getCamera().getHeight()); } + @Override public boolean isInitialized() { return viewPort != null; } @@ -148,6 +150,7 @@ public Camera getShadowCamera() { return shadowCam; } + @Override public void postQueue(RenderQueue rq) { for (Spatial scene : viewPort.getScenes()) { ShadowUtil.getGeometriesInCamFrustum(scene, viewPort.getCamera(), ShadowMode.Receive, lightReceivers); @@ -208,6 +211,7 @@ public Picture getDisplayPicture() { return dispPic; } + @Override public void postFrame(FrameBuffer out) { if (!noOccluders) { postshadowMat.setMatrix4("LightViewProjectionMatrix", shadowCam.getViewProjectionMatrix()); @@ -217,9 +221,11 @@ public void postFrame(FrameBuffer out) { } } + @Override public void preFrame(float tpf) { } + @Override public void cleanup() { } @@ -228,6 +234,7 @@ public void setProfiler(AppProfiler profiler) { this.prof = profiler; } + @Override public void reshape(ViewPort vp, int w, int h) { dispPic.setPosition(w / 20f, h / 20f); dispPic.setWidth(w / 5f); diff --git a/jme3-core/src/main/java/com/jme3/shadow/DirectionalLightShadowRenderer.java b/jme3-core/src/main/java/com/jme3/shadow/DirectionalLightShadowRenderer.java index 2528911865..6e5da5dd3d 100644 --- a/jme3-core/src/main/java/com/jme3/shadow/DirectionalLightShadowRenderer.java +++ b/jme3-core/src/main/java/com/jme3/shadow/DirectionalLightShadowRenderer.java @@ -77,7 +77,7 @@ public class DirectionalLightShadowRenderer extends AbstractShadowRenderer { * DirectionalLightShadowRenderer#DirectionalLightShadowRenderer(AssetManager * assetManager, int shadowMapSize, int nbSplits) */ - public DirectionalLightShadowRenderer() { + protected DirectionalLightShadowRenderer() { super(); } diff --git a/jme3-core/src/main/java/com/jme3/shadow/PointLightShadowFilter.java b/jme3-core/src/main/java/com/jme3/shadow/PointLightShadowFilter.java index 1e26772dd1..a2adb2cf4e 100644 --- a/jme3-core/src/main/java/com/jme3/shadow/PointLightShadowFilter.java +++ b/jme3-core/src/main/java/com/jme3/shadow/PointLightShadowFilter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2019 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -62,7 +62,7 @@ public class PointLightShadowFilter extends AbstractShadowFilter { */ public static final String LWJGL_OPENGL2 = "LWJGL-OpenGL2"; + /** + * Use LWJGL as the display system and force using the core OpenGL3.2 renderer. + *

+ * If the underlying system does not support OpenGL3.2, then the context + * initialization will throw an exception. Note that currently jMonkeyEngine + * does not have any shaders that support OpenGL3.2 therefore this + * option is not useful. + *

+ * Note: OpenGL 3.2 is used to give 3.x support to Mac users. + * + * @deprecated Previously meant 3.2, use LWJGL_OPENGL32 or LWJGL_OPENGL30 + * @see AppSettings#setRenderer(java.lang.String) + */ + @Deprecated + public static final String LWJGL_OPENGL3 = "LWJGL-OpenGL3"; + + /** * Use LWJGL as the display system and force using the core OpenGL3.0 renderer. *

@@ -84,20 +101,17 @@ public final class AppSettings extends HashMap { public static final String LWJGL_OPENGL30 = "LWJGL-OpenGL30"; /** - * Use LWJGL as the display system and force using the core OpenGL3.2 renderer. + * Use LWJGL as the display system and force using the core OpenGL3.1 renderer. *

- * If the underlying system does not support OpenGL3.2, then the context + * If the underlying system does not support OpenGL3.1, then the context * initialization will throw an exception. Note that currently jMonkeyEngine - * does not have any shaders that support OpenGL3.2 therefore this + * does not have any shaders that support OpenGL3.0 therefore this * option is not useful. *

- * Note: OpenGL 3.2 is used to give 3.x support to Mac users. * - * @deprecated Previously meant 3.2, use LWJGL_OPENGL32 or LWJGL_OPENGL30 * @see AppSettings#setRenderer(java.lang.String) */ - @Deprecated - public static final String LWJGL_OPENGL3 = "LWJGL-OpenGL3"; + public static final String LWJGL_OPENGL31 = "LWJGL-OpenGL31"; /** * Use LWJGL as the display system and force using the core OpenGL3.2 renderer. @@ -404,16 +418,16 @@ public void load(String preferencesKey) throws BackingStoreException { // Try loading using new method switch (key.charAt(0)) { case 'I': - put(key.substring(2), prefs.getInt(key, (Integer) 0)); + put(key.substring(2), prefs.getInt(key, 0)); break; case 'F': - put(key.substring(2), prefs.getFloat(key, (Float) 0f)); + put(key.substring(2), prefs.getFloat(key, 0f)); break; case 'S': - put(key.substring(2), prefs.get(key, (String) null)); + put(key.substring(2), prefs.get(key, null)); break; case 'B': - put(key.substring(2), prefs.getBoolean(key, (Boolean) false)); + put(key.substring(2), prefs.getBoolean(key, false)); break; default: throw new UnsupportedOperationException("Undefined setting type: " + key.charAt(0)); @@ -1138,7 +1152,7 @@ public boolean isSwapBuffers() { /** * True to enable the creation of an OpenCL context. * - * @param support + * @param support whether to create the context or not */ public void setOpenCLSupport(boolean support) { putBoolean("OpenCL", support); @@ -1163,4 +1177,80 @@ public void setOpenCLPlatformChooser(Class chooser) { public String getOpenCLPlatformChooser() { return getString("OpenCLPlatformChooser"); } + + /** + * Determine if the renderer will be run in Graphics Debug mode, which means every openGL call is checked and + * if it returns an error code, throw a {@link com.jme3.renderer.RendererException}.
+ * Without this, many openGL calls might fail without notice, so turning it on is recommended for development. + * + * @return whether the context will be run in Graphics Debug Mode or not + * @see #setGraphicsDebug(boolean) + */ + public boolean isGraphicsDebug() { + return getBoolean("GraphicsDebug"); + } + + /** + * Set whether the renderer will be run in Graphics Debug mode, which means every openGL call is checked and + * if it returns an error code, throw a {@link com.jme3.renderer.RendererException}.
+ * Without this, many openGL calls might fail without notice, so turning it on is recommended for development. + * + * @param debug whether the context will be run in Graphics Debug Mode or not + * @see #isGraphicsDebug() + */ + public void setGraphicsDebug(boolean debug) { + putBoolean("GraphicsDebug", debug); + } + + /** + * Determine if the renderer will be run in Graphics Timing mode, which means every openGL call is checked and + * if it runs for longer than a millisecond, log it.
+ * It also keeps track of the time spent in GL Calls in general and displays them when + * {@link com.jme3.renderer.opengl.GL#resetStats()} is called.
+ * + * @return whether the context will be run in Graphics Timing Mode or not + * @see #setGraphicsTiming(boolean) + * @see com.jme3.renderer.opengl.GLTiming + */ + public boolean isGraphicsTiming() { + return getBoolean("GraphicsTiming"); + } + + /** + * Set whether the renderer will be run in Graphics Timing mode, which means every openGL call is checked and + * if it runs for longer than a millisecond, log it.
+ * It also keeps track of the time spent in GL Calls in general and displays them when + * {@link com.jme3.renderer.opengl.GL#resetStats()} is called.
+ * + * @param timing whether the context will be run in Graphics Timing Mode or not + * @see #isGraphicsTiming() + * @see com.jme3.renderer.opengl.GLTiming + */ + public void setGraphicsTiming(boolean timing) { + putBoolean("GraphicsTiming", timing); + } + + /** + * Determine if the renderer will be run in Graphics Trace mode, which means every openGL call is logged so one + * can trace what openGL commands where executed in which order by the engine.
+ * + * @return whether the context will be run in Graphics Trace Mode or not + * @see #setGraphicsTrace(boolean) + * @see com.jme3.renderer.opengl.GLTracer + */ + public boolean isGraphicsTrace() { + return getBoolean("GraphicsTrace"); + } + + /** + * Set whether the renderer will be run in Graphics Trace mode, which means every openGL call is logged so one + * can trace what openGL commands where executed in which order by the engine.
+ * + * @param trace whether the context will be run in Graphics Trace Mode or not + * @see #isGraphicsTrace() + * @see com.jme3.renderer.opengl.GLTracer + */ + public void setGraphicsTrace(boolean trace) { + putBoolean("GraphicsTrace", trace); + } } diff --git a/jme3-core/src/main/java/com/jme3/system/JmeSystemDelegate.java b/jme3-core/src/main/java/com/jme3/system/JmeSystemDelegate.java index 71c4176327..78d8eb40be 100644 --- a/jme3-core/src/main/java/com/jme3/system/JmeSystemDelegate.java +++ b/jme3-core/src/main/java/com/jme3/system/JmeSystemDelegate.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -171,7 +171,7 @@ public Platform getPlatform() { return is64 ? Platform.Windows64 : Platform.Windows32; } else if (os.contains("linux") || os.contains("freebsd") || os.contains("sunos") || os.contains("unix")) { - if (arch.startsWith("arm")) { + if (arch.startsWith("arm") || arch.startsWith("aarch")) { return is64 ? Platform.Linux_ARM64 : Platform.Linux_ARM32; } else { return is64 ? Platform.Linux64 : Platform.Linux32; diff --git a/jme3-core/src/main/java/com/jme3/system/JmeVersion.java b/jme3-core/src/main/java/com/jme3/system/JmeVersion.java index 0492df950d..04586034bb 100644 --- a/jme3-core/src/main/java/com/jme3/system/JmeVersion.java +++ b/jme3-core/src/main/java/com/jme3/system/JmeVersion.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2015 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -49,7 +49,7 @@ public class JmeVersion { static { try { props.load(JmeVersion.class.getResourceAsStream("version.properties")); - } catch (IOException ex) { + } catch (IOException | NullPointerException ex) { logger.log(Level.WARNING, "Unable to read version info!", ex); } } diff --git a/jme3-core/src/main/java/com/jme3/system/NanoTimer.java b/jme3-core/src/main/java/com/jme3/system/NanoTimer.java index e0a4d8b469..0964857416 100644 --- a/jme3-core/src/main/java/com/jme3/system/NanoTimer.java +++ b/jme3-core/src/main/java/com/jme3/system/NanoTimer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -62,28 +62,34 @@ public float getTimeInSeconds() { return getTime() * INVERSE_TIMER_RESOLUTION; } + @Override public long getTime() { return System.nanoTime() - startTime; } + @Override public long getResolution() { return TIMER_RESOLUTION; } + @Override public float getFrameRate() { return fps; } + @Override public float getTimePerFrame() { return tpf; } + @Override public void update() { tpf = (getTime() - previousTime) * (1.0f / TIMER_RESOLUTION); fps = 1.0f / tpf; previousTime = getTime(); } + @Override public void reset() { startTime = System.nanoTime(); previousTime = getTime(); diff --git a/jme3-core/src/main/java/com/jme3/system/NullContext.java b/jme3-core/src/main/java/com/jme3/system/NullContext.java index 205d0a2c05..984ba74d59 100644 --- a/jme3-core/src/main/java/com/jme3/system/NullContext.java +++ b/jme3-core/src/main/java/com/jme3/system/NullContext.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -59,10 +59,12 @@ public class NullContext implements JmeContext, Runnable { protected SystemListener listener; protected NullRenderer renderer; + @Override public Type getType() { return Type.Headless; } + @Override public void setSystemListener(SystemListener listener){ this.listener = listener; } @@ -72,6 +74,7 @@ protected void initInThread(){ logger.log(Level.FINE, "Running on thread: {0}", Thread.currentThread().getName()); Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() { + @Override public void uncaughtException(Thread thread, Throwable thrown) { listener.handleError("Uncaught exception thrown in "+thread.toString(), thrown); } @@ -126,6 +129,7 @@ public void sync(int fps) { timeThen = timeNow; } + @Override public void run(){ initInThread(); @@ -142,12 +146,14 @@ public void run(){ logger.fine("NullContext destroyed."); } + @Override public void destroy(boolean waitFor){ needClose.set(true); if (waitFor) waitFor(false); } + @Override public void create(boolean waitFor){ if (created.get()){ logger.warning("create() called when NullContext is already created!"); @@ -159,28 +165,35 @@ public void create(boolean waitFor){ waitFor(true); } + @Override public void restart() { } + @Override public void setAutoFlushFrames(boolean enabled){ } + @Override public MouseInput getMouseInput() { return new DummyMouseInput(); } + @Override public KeyInput getKeyInput() { return new DummyKeyInput(); } + @Override public JoyInput getJoyInput() { return null; } + @Override public TouchInput getTouchInput() { return null; } + @Override public void setTitle(String title) { } @@ -203,10 +216,12 @@ protected void waitFor(boolean createdVal){ } } + @Override public boolean isCreated(){ return created.get(); } + @Override public void setSettings(AppSettings settings) { this.settings.copyFrom(settings); frameRate = settings.getFrameRate(); @@ -214,18 +229,22 @@ public void setSettings(AppSettings settings) { frameRate = 60; // use default update rate. } + @Override public AppSettings getSettings(){ return settings; } + @Override public Renderer getRenderer() { return renderer; } + @Override public Timer getTimer() { return timer; } + @Override public boolean isRenderable() { return true; // Doesn't really matter if true or false. Either way // RenderManager won't render anything. diff --git a/jme3-core/src/main/java/com/jme3/system/NullRenderer.java b/jme3-core/src/main/java/com/jme3/system/NullRenderer.java index 76b3fa1463..156b2aabbe 100644 --- a/jme3-core/src/main/java/com/jme3/system/NullRenderer.java +++ b/jme3-core/src/main/java/com/jme3/system/NullRenderer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -58,6 +58,7 @@ public class NullRenderer implements Renderer { private final EnumMap limits = new EnumMap<>(Limits.class); private final Statistics stats = new Statistics(); + @Override public void initialize() { for (Limits limit : Limits.values()) { limits.put(limit, Integer.MAX_VALUE); @@ -69,29 +70,37 @@ public EnumMap getLimits() { return limits; } + @Override public EnumSet getCaps() { return caps; } + @Override public Statistics getStatistics() { return stats; } + @Override public void invalidateState(){ } + @Override public void clearBuffers(boolean color, boolean depth, boolean stencil) { } + @Override public void setBackgroundColor(ColorRGBA color) { } + @Override public void applyRenderState(RenderState state) { } + @Override public void setDepthRange(float start, float end) { } + @Override public void postFrame() { } @@ -101,57 +110,72 @@ public void setWorldMatrix(Matrix4f worldMatrix) { public void setViewProjectionMatrices(Matrix4f viewMatrix, Matrix4f projMatrix) { } + @Override public void setViewPort(int x, int y, int width, int height) { } + @Override public void setClipRect(int x, int y, int width, int height) { } + @Override public void clearClipRect() { } public void setLighting(LightList lights) { } + @Override public void setShader(Shader shader) { } + @Override public void deleteShader(Shader shader) { } + @Override public void deleteShaderSource(ShaderSource source) { } public void copyFrameBuffer(FrameBuffer src, FrameBuffer dst) { } + @Override public void copyFrameBuffer(FrameBuffer src, FrameBuffer dst, boolean copyDepth) { } + @Override public void setMainFrameBufferOverride(FrameBuffer fb) { } + @Override public void setFrameBuffer(FrameBuffer fb) { } + @Override public void readFrameBuffer(FrameBuffer fb, ByteBuffer byteBuf) { } + @Override public void deleteFrameBuffer(FrameBuffer fb) { } + @Override public void setTexture(int unit, Texture tex) { } + @Override public void modifyTexture(Texture tex, Image pixels, int x, int y) { } + @Override public void updateBufferData(VertexBuffer vb) { } @Override public void updateBufferData(BufferObject bo) { } + @Override public void deleteBuffer(VertexBuffer vb) { } @@ -160,24 +184,31 @@ public void deleteBuffer(BufferObject bo) { } + @Override public void renderMesh(Mesh mesh, int lod, int count, VertexBuffer[] instanceData) { } + @Override public void resetGLObjects() { } + @Override public void cleanup() { } + @Override public void deleteImage(Image image) { } + @Override public void setAlphaToCoverage(boolean value) { } + @Override public void setMainFrameBufferSrgb(boolean srgb) { } + @Override public void setLinearizeSrgbImages(boolean linearize) { } @@ -206,6 +237,7 @@ public boolean isTaskResultAvailable(int taskId) { return false; } + @Override public void readFrameBufferWithFormat(FrameBuffer fb, ByteBuffer byteBuf, Image.Format format) { } diff --git a/jme3-core/src/main/java/com/jme3/texture/FrameBuffer.java b/jme3-core/src/main/java/com/jme3/texture/FrameBuffer.java index d5684e8854..2626cee90b 100644 --- a/jme3-core/src/main/java/com/jme3/texture/FrameBuffer.java +++ b/jme3-core/src/main/java/com/jme3/texture/FrameBuffer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -587,6 +587,7 @@ public void deleteObject(Object rendererObject) { ((Renderer)rendererObject).deleteFrameBuffer(this); } + @Override public NativeObject createDestructableClone(){ return new FrameBuffer(this); } diff --git a/jme3-core/src/main/java/com/jme3/texture/Image.java b/jme3-core/src/main/java/com/jme3/texture/Image.java index f7cee1b55e..26375b7740 100644 --- a/jme3-core/src/main/java/com/jme3/texture/Image.java +++ b/jme3-core/src/main/java/com/jme3/texture/Image.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -1232,6 +1232,7 @@ public int hashCode() { return hash; } + @Override public void write(JmeExporter e) throws IOException { OutputCapsule capsule = e.getCapsule(this); capsule.write(format, "format", Format.RGBA8); @@ -1244,6 +1245,7 @@ public void write(JmeExporter e) throws IOException { capsule.write(colorSpace, "colorSpace", null); } + @Override public void read(JmeImporter e) throws IOException { InputCapsule capsule = e.getCapsule(this); format = capsule.readEnum("format", Format.class, Format.RGBA8); @@ -1252,7 +1254,7 @@ public void read(JmeImporter e) throws IOException { depth = capsule.readInt("depth", 0); mipMapSizes = capsule.readIntArray("mipMapSizes", null); multiSamples = capsule.readInt("multiSamples", 1); - data = (ArrayList) capsule.readByteBufferArrayList("data", null); + data = capsule.readByteBufferArrayList("data", null); colorSpace = capsule.readEnum("colorSpace", ColorSpace.class, null); if (mipMapSizes != null) { diff --git a/jme3-core/src/main/java/com/jme3/texture/Texture.java b/jme3-core/src/main/java/com/jme3/texture/Texture.java index 65563928f6..5def31ee18 100644 --- a/jme3-core/src/main/java/com/jme3/texture/Texture.java +++ b/jme3-core/src/main/java/com/jme3/texture/Texture.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -424,10 +424,12 @@ public void setImage(Image image) { /** * @param key The texture key that was used to load this texture */ + @Override public void setKey(AssetKey key){ this.key = (TextureKey) key; } + @Override public AssetKey getKey(){ return this.key; } @@ -587,6 +589,7 @@ public Texture createSimpleClone(Texture rVal) { @Deprecated public abstract Texture createSimpleClone(); + @Override public void write(JmeExporter e) throws IOException { OutputCapsule capsule = e.getCapsule(this); capsule.write(name, "name", null); @@ -605,6 +608,7 @@ public void write(JmeExporter e) throws IOException { MagFilter.Bilinear); } + @Override public void read(JmeImporter e) throws IOException { InputCapsule capsule = e.getCapsule(this); name = capsule.readString("name", null); diff --git a/jme3-core/src/main/java/com/jme3/texture/Texture2D.java b/jme3-core/src/main/java/com/jme3/texture/Texture2D.java index 441da13533..aca6125a10 100644 --- a/jme3-core/src/main/java/com/jme3/texture/Texture2D.java +++ b/jme3-core/src/main/java/com/jme3/texture/Texture2D.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -121,6 +121,7 @@ public Texture createSimpleClone(Texture rVal) { * @throws IllegalArgumentException * if axis or mode are null */ + @Override public void setWrap(WrapAxis axis, WrapMode mode) { if (mode == null) { throw new IllegalArgumentException("mode can not be null."); @@ -147,6 +148,7 @@ public void setWrap(WrapAxis axis, WrapMode mode) { * @throws IllegalArgumentException * if mode is null */ + @Override public void setWrap(WrapMode mode) { if (mode == null) { throw new IllegalArgumentException("mode can not be null."); @@ -165,6 +167,7 @@ public void setWrap(WrapMode mode) { * @throws IllegalArgumentException * if axis is null */ + @Override public WrapMode getWrap(WrapAxis axis) { switch (axis) { case S: diff --git a/jme3-core/src/main/java/com/jme3/texture/Texture3D.java b/jme3-core/src/main/java/com/jme3/texture/Texture3D.java index c94d7c3adb..d05e353c74 100644 --- a/jme3-core/src/main/java/com/jme3/texture/Texture3D.java +++ b/jme3-core/src/main/java/com/jme3/texture/Texture3D.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -124,6 +124,7 @@ public Texture createSimpleClone(Texture rVal) { * @throws IllegalArgumentException * if axis or mode are null */ + @Override public void setWrap(WrapAxis axis, WrapMode mode) { if (mode == null) { throw new IllegalArgumentException("mode can not be null."); @@ -151,6 +152,7 @@ public void setWrap(WrapAxis axis, WrapMode mode) { * @throws IllegalArgumentException * if mode is null */ + @Override public void setWrap(WrapMode mode) { if (mode == null) { throw new IllegalArgumentException("mode can not be null."); @@ -170,6 +172,7 @@ public void setWrap(WrapMode mode) { * @throws IllegalArgumentException * if axis is null */ + @Override public WrapMode getWrap(WrapAxis axis) { switch (axis) { case S: diff --git a/jme3-core/src/main/java/com/jme3/texture/TextureCubeMap.java b/jme3-core/src/main/java/com/jme3/texture/TextureCubeMap.java index f1a0f7d3bd..c4abcdbf02 100644 --- a/jme3-core/src/main/java/com/jme3/texture/TextureCubeMap.java +++ b/jme3-core/src/main/java/com/jme3/texture/TextureCubeMap.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -93,6 +93,7 @@ private static Image createEmptyLayeredImage(int width, int height, return image; } + @Override public Texture createSimpleClone() { return createSimpleClone(new TextureCubeMap()); } @@ -116,6 +117,7 @@ public Texture createSimpleClone(Texture rVal) { * @throws IllegalArgumentException * if axis or mode are null */ + @Override public void setWrap(WrapAxis axis, WrapMode mode) { if (mode == null) { throw new IllegalArgumentException("mode can not be null."); @@ -143,6 +145,7 @@ public void setWrap(WrapAxis axis, WrapMode mode) { * @throws IllegalArgumentException * if mode is null */ + @Override public void setWrap(WrapMode mode) { if (mode == null) { throw new IllegalArgumentException("mode can not be null."); @@ -162,6 +165,7 @@ public void setWrap(WrapMode mode) { * @throws IllegalArgumentException * if axis is null */ + @Override public WrapMode getWrap(WrapAxis axis) { switch (axis) { case S: diff --git a/jme3-core/src/main/java/com/jme3/texture/TextureProcessor.java b/jme3-core/src/main/java/com/jme3/texture/TextureProcessor.java index 78107836ef..c0dc0ad359 100644 --- a/jme3-core/src/main/java/com/jme3/texture/TextureProcessor.java +++ b/jme3-core/src/main/java/com/jme3/texture/TextureProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -73,6 +73,7 @@ public Object postProcess(AssetKey key, Object obj) { return tex; } + @Override public Object createClone(Object obj) { Texture tex = (Texture) obj; return tex.clone(); diff --git a/jme3-core/src/main/java/com/jme3/texture/image/BitMaskImageCodec.java b/jme3-core/src/main/java/com/jme3/texture/image/BitMaskImageCodec.java index 3240526044..2de903d96c 100644 --- a/jme3-core/src/main/java/com/jme3/texture/image/BitMaskImageCodec.java +++ b/jme3-core/src/main/java/com/jme3/texture/image/BitMaskImageCodec.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -103,6 +103,7 @@ public void readComponents(ByteBuffer buf, int x, int y, int width, int offset, components[3] = (inputPixel >> bs) & maxBlue; } + @Override public void writeComponents(ByteBuffer buf, int x, int y, int width, int offset, int[] components, byte[] tmp) { // Shift components then mask them // Map all components into a single bitspace diff --git a/jme3-core/src/main/java/com/jme3/texture/image/ByteAlignedImageCodec.java b/jme3-core/src/main/java/com/jme3/texture/image/ByteAlignedImageCodec.java index d00ab7e22f..c307d4b533 100644 --- a/jme3-core/src/main/java/com/jme3/texture/image/ByteAlignedImageCodec.java +++ b/jme3-core/src/main/java/com/jme3/texture/image/ByteAlignedImageCodec.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -109,6 +109,7 @@ private void writeComponent(int component, int position, int size, byte[] result // } } + @Override public void readComponents(ByteBuffer buf, int x, int y, int width, int offset, int[] components, byte[] tmp) { readPixelRaw(buf, (x + y * width ) * bpp + offset, bpp, tmp); components[0] = readComponent(tmp, ap, az); @@ -117,6 +118,7 @@ public void readComponents(ByteBuffer buf, int x, int y, int width, int offset, components[3] = readComponent(tmp, bp, bz); } + @Override public void writeComponents(ByteBuffer buf, int x, int y, int width, int offset, int[] components, byte[] tmp) { writeComponent(components[0], ap, az, tmp); writeComponent(components[1], rp, rz, tmp); diff --git a/jme3-core/src/main/java/com/jme3/texture/image/DefaultImageRaster.java b/jme3-core/src/main/java/com/jme3/texture/image/DefaultImageRaster.java index 2d70d53d72..1d6c68e25f 100644 --- a/jme3-core/src/main/java/com/jme3/texture/image/DefaultImageRaster.java +++ b/jme3-core/src/main/java/com/jme3/texture/image/DefaultImageRaster.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -130,16 +130,16 @@ public void setPixel(int x, int y, ColorRGBA color) { switch (codec.type) { case ImageCodec.FLAG_F16: - components[0] = (int) FastMath.convertFloatToHalf(color.a); - components[1] = (int) FastMath.convertFloatToHalf(color.r); - components[2] = (int) FastMath.convertFloatToHalf(color.g); - components[3] = (int) FastMath.convertFloatToHalf(color.b); + components[0] = FastMath.convertFloatToHalf(color.a); + components[1] = FastMath.convertFloatToHalf(color.r); + components[2] = FastMath.convertFloatToHalf(color.g); + components[3] = FastMath.convertFloatToHalf(color.b); break; case ImageCodec.FLAG_F32: - components[0] = (int) Float.floatToIntBits(color.a); - components[1] = (int) Float.floatToIntBits(color.r); - components[2] = (int) Float.floatToIntBits(color.g); - components[3] = (int) Float.floatToIntBits(color.b); + components[0] = Float.floatToIntBits(color.a); + components[1] = Float.floatToIntBits(color.r); + components[2] = Float.floatToIntBits(color.g); + components[3] = Float.floatToIntBits(color.b); break; case 0: // Convert color to bits by multiplying by size @@ -176,10 +176,10 @@ public ColorRGBA getPixel(int x, int y, ColorRGBA store) { FastMath.convertHalfToFloat((short)components[0])); break; case ImageCodec.FLAG_F32: - store.set(Float.intBitsToFloat((int)components[1]), - Float.intBitsToFloat((int)components[2]), - Float.intBitsToFloat((int)components[3]), - Float.intBitsToFloat((int)components[0])); + store.set(Float.intBitsToFloat(components[1]), + Float.intBitsToFloat(components[2]), + Float.intBitsToFloat(components[3]), + Float.intBitsToFloat(components[0])); break; case 0: // Convert to float and divide by bitsize to get into range 0.0 - 1.0. diff --git a/jme3-core/src/main/java/com/jme3/texture/image/MipMapImageRaster.java b/jme3-core/src/main/java/com/jme3/texture/image/MipMapImageRaster.java index 84ea1ea242..d37db00b67 100644 --- a/jme3-core/src/main/java/com/jme3/texture/image/MipMapImageRaster.java +++ b/jme3-core/src/main/java/com/jme3/texture/image/MipMapImageRaster.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -108,16 +108,16 @@ public void setPixel(int x, int y, ColorRGBA color) { switch (codec.type) { case ImageCodec.FLAG_F16: - components[0] = (int) FastMath.convertFloatToHalf(color.a); - components[1] = (int) FastMath.convertFloatToHalf(color.r); - components[2] = (int) FastMath.convertFloatToHalf(color.g); - components[3] = (int) FastMath.convertFloatToHalf(color.b); + components[0] = FastMath.convertFloatToHalf(color.a); + components[1] = FastMath.convertFloatToHalf(color.r); + components[2] = FastMath.convertFloatToHalf(color.g); + components[3] = FastMath.convertFloatToHalf(color.b); break; case ImageCodec.FLAG_F32: - components[0] = (int) Float.floatToIntBits(color.a); - components[1] = (int) Float.floatToIntBits(color.r); - components[2] = (int) Float.floatToIntBits(color.g); - components[3] = (int) Float.floatToIntBits(color.b); + components[0] = Float.floatToIntBits(color.a); + components[1] = Float.floatToIntBits(color.r); + components[2] = Float.floatToIntBits(color.g); + components[3] = Float.floatToIntBits(color.b); break; case 0: // Convert color to bits by multiplying by size @@ -154,10 +154,10 @@ public ColorRGBA getPixel(int x, int y, ColorRGBA store) { FastMath.convertHalfToFloat((short) components[0])); break; case ImageCodec.FLAG_F32: - store.set(Float.intBitsToFloat((int) components[1]), - Float.intBitsToFloat((int) components[2]), - Float.intBitsToFloat((int) components[3]), - Float.intBitsToFloat((int) components[0])); + store.set(Float.intBitsToFloat(components[1]), + Float.intBitsToFloat(components[2]), + Float.intBitsToFloat(components[3]), + Float.intBitsToFloat(components[0])); break; case 0: // Convert to float and divide by bitsize to get into range 0.0 - 1.0. diff --git a/jme3-core/src/main/java/com/jme3/ui/Picture.java b/jme3-core/src/main/java/com/jme3/ui/Picture.java index ad7bc87999..71ff7487db 100644 --- a/jme3-core/src/main/java/com/jme3/ui/Picture.java +++ b/jme3-core/src/main/java/com/jme3/ui/Picture.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2019 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -83,7 +83,7 @@ public Picture(String name){ /* * Serialization only. Do not use. */ - public Picture(){ + protected Picture(){ } /** diff --git a/jme3-core/src/main/java/com/jme3/util/BufferUtils.java b/jme3-core/src/main/java/com/jme3/util/BufferUtils.java index d4546b7e3f..180297096b 100644 --- a/jme3-core/src/main/java/com/jme3/util/BufferUtils.java +++ b/jme3-core/src/main/java/com/jme3/util/BufferUtils.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -1277,36 +1277,14 @@ public static void destroyDirectBuffer(Buffer toBeDestroyed) { allocator.destroyDirectBuffer(toBeDestroyed); } - /* - * FIXME when java 1.5 supprt is dropped - replace calls to this method with - * Buffer.isDirect - * - * Buffer.isDirect() is only java 6. Java 5 only have this method on Buffer - * subclasses : FloatBuffer, IntBuffer, ShortBuffer, - * ByteBuffer,DoubleBuffer, LongBuffer. CharBuffer has been excluded as we - * don't use it. - * + /** + * Test whether the specified buffer is direct. + * + * @param buf the buffer to test (not null, unaffected) + * @return true if direct, otherwise false */ private static boolean isDirect(Buffer buf) { - if (buf instanceof FloatBuffer) { - return ((FloatBuffer) buf).isDirect(); - } - if (buf instanceof IntBuffer) { - return ((IntBuffer) buf).isDirect(); - } - if (buf instanceof ShortBuffer) { - return ((ShortBuffer) buf).isDirect(); - } - if (buf instanceof ByteBuffer) { - return ((ByteBuffer) buf).isDirect(); - } - if (buf instanceof DoubleBuffer) { - return ((DoubleBuffer) buf).isDirect(); - } - if (buf instanceof LongBuffer) { - return ((LongBuffer) buf).isDirect(); - } - throw new UnsupportedOperationException(" BufferUtils.isDirect was called on " + buf.getClass().getName()); + return buf.isDirect(); } private static class BufferInfo extends PhantomReference { diff --git a/jme3-core/src/main/java/com/jme3/util/IntMap.java b/jme3-core/src/main/java/com/jme3/util/IntMap.java index b572fad224..c1c9b0abe3 100644 --- a/jme3-core/src/main/java/com/jme3/util/IntMap.java +++ b/jme3-core/src/main/java/com/jme3/util/IntMap.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -219,6 +219,7 @@ public void clear() { size = 0; } + @Override public Iterator> iterator() { IntMapIterator it = new IntMapIterator(); it.beginUse(); @@ -251,10 +252,12 @@ public void beginUse(){ el = 0; } + @Override public boolean hasNext() { return el < size; } + @Override public Entry next() { if (el >= size) throw new NoSuchElementException("No more elements!"); @@ -285,6 +288,7 @@ public Entry next() { return e; } + @Override public void remove() { } diff --git a/jme3-core/src/main/java/com/jme3/util/ListMap.java b/jme3-core/src/main/java/com/jme3/util/ListMap.java index 379fff7414..ea8b0f3638 100644 --- a/jme3-core/src/main/java/com/jme3/util/ListMap.java +++ b/jme3-core/src/main/java/com/jme3/util/ListMap.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -53,14 +53,17 @@ public ListMapEntry(K key, V value){ this.value = value; } + @Override public K getKey() { return key; } + @Override public V getValue() { return value; } + @Override public V setValue(V v) { throw new UnsupportedOperationException(); } @@ -155,7 +158,7 @@ private static boolean keyEq(Object keyA, Object keyB){ @Override public boolean containsKey(Object key) { - return backingMap.containsKey( (K) key); + return backingMap.containsKey(key); // if (key == null) // throw new IllegalArgumentException(); // @@ -169,7 +172,7 @@ public boolean containsKey(Object key) { @Override public boolean containsValue(Object value) { - return backingMap.containsValue( (V) value); + return backingMap.containsValue(value); // for (int i = 0; i < entries.size(); i++){ // if (valEq(entries.get(i).value, value)) // return true; @@ -179,7 +182,7 @@ public boolean containsValue(Object value) { @Override public V get(Object key) { - return backingMap.get( (K) key); + return backingMap.get(key); // if (key == null) // throw new IllegalArgumentException(); // @@ -234,7 +237,7 @@ public V put(K key, V value) { @Override public V remove(Object key) { - V element = backingMap.remove( (K) key); + V element = backingMap.remove(key); if (element != null){ // find removed element int size = size() + 1; // includes removed element @@ -322,6 +325,7 @@ public Collection values() { // return values; } + @Override public Set> entrySet() { return backingMap.entrySet(); // HashSet> entryset = new HashSet>(); diff --git a/jme3-core/src/main/java/com/jme3/util/ListSort.java b/jme3-core/src/main/java/com/jme3/util/ListSort.java index 517f2dd6b2..cbb038bca2 100644 --- a/jme3-core/src/main/java/com/jme3/util/ListSort.java +++ b/jme3-core/src/main/java/com/jme3/util/ListSort.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -1000,6 +1000,7 @@ public static void main(String[] argv) { ListSort ls = new ListSort(); ls.allocateStack(34); ls.sort(arr, new Comparator() { + @Override public int compare(Integer o1, Integer o2) { int x = o1 - o2; return (x == 0) ? 0 : (x > 0) ? 1 : -1; diff --git a/jme3-core/src/main/java/com/jme3/util/LittleEndien.java b/jme3-core/src/main/java/com/jme3/util/LittleEndien.java index abff3acca8..6cb1eeadac 100644 --- a/jme3-core/src/main/java/com/jme3/util/LittleEndien.java +++ b/jme3-core/src/main/java/com/jme3/util/LittleEndien.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -52,6 +52,7 @@ public LittleEndien(InputStream in) { this.in = new BufferedInputStream(in); } + @Override public int read() throws IOException { return in.read(); } @@ -66,6 +67,7 @@ public int read(byte[] buf, int off, int len) throws IOException { return in.read(buf, off, len); } + @Override public int readUnsignedShort() throws IOException { return (in.read() & 0xff) | ((in.read() & 0xff) << 8); } @@ -80,26 +82,32 @@ public long readUInt() throws IOException { | (((long) (in.read() & 0xff)) << 24)); } + @Override public boolean readBoolean() throws IOException { return (in.read() != 0); } + @Override public byte readByte() throws IOException { return (byte) in.read(); } + @Override public int readUnsignedByte() throws IOException { return in.read(); } + @Override public short readShort() throws IOException { return (short) this.readUnsignedShort(); } + @Override public char readChar() throws IOException { return (char) this.readUnsignedShort(); } + @Override public int readInt() throws IOException { return ((in.read() & 0xff) | ((in.read() & 0xff) << 8) @@ -107,6 +115,7 @@ public int readInt() throws IOException { | ((in.read() & 0xff) << 24)); } + @Override public long readLong() throws IOException { return ((in.read() & 0xff) | ((long) (in.read() & 0xff) << 8) @@ -118,30 +127,37 @@ public long readLong() throws IOException { | ((long) (in.read() & 0xff) << 56)); } + @Override public float readFloat() throws IOException { return Float.intBitsToFloat(readInt()); } + @Override public double readDouble() throws IOException { return Double.longBitsToDouble(readLong()); } + @Override public void readFully(byte b[]) throws IOException { in.read(b, 0, b.length); } + @Override public void readFully(byte b[], int off, int len) throws IOException { in.read(b, off, len); } + @Override public int skipBytes(int n) throws IOException { return (int) in.skip(n); } + @Override public String readLine() throws IOException { throw new IOException("Unsupported operation"); } + @Override public String readUTF() throws IOException { throw new IOException("Unsupported operation"); } diff --git a/jme3-core/src/main/java/com/jme3/util/MaterialDebugAppState.java b/jme3-core/src/main/java/com/jme3/util/MaterialDebugAppState.java index b0f3565e44..9aafe44ce8 100644 --- a/jme3-core/src/main/java/com/jme3/util/MaterialDebugAppState.java +++ b/jme3-core/src/main/java/com/jme3/util/MaterialDebugAppState.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2014 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -183,6 +183,7 @@ private void bind(final Binding binding) { } else { final String actionName = binding.getActionName(); inputManager.addListener(new ActionListener() { + @Override public void onAction(String name, boolean isPressed, float tpf) { if (actionName.equals(name) && isPressed) { //reloading the material @@ -265,6 +266,7 @@ public GeometryBinding(Trigger trigger, Geometry geom) { } + @Override public void reload() { Material reloadedMat = reloadMaterial(geom.getMaterial()); //if the reload is successful, we re setup the material with its params and reassign it to the box @@ -274,11 +276,13 @@ public void reload() { } } + @Override public String getActionName() { return geom.getName() + "Reload"; } + @Override public Trigger getTrigger() { return trigger; } @@ -294,6 +298,7 @@ public FilterBinding(Trigger trigger, Filter filter) { this.filter = filter; } + @Override public void reload() { Field[] fields1 = filter.getClass().getDeclaredFields(); Field[] fields2 = filter.getClass().getSuperclass().getDeclaredFields(); @@ -351,10 +356,12 @@ public void reload() { } + @Override public String getActionName() { return filter.getName() + "Reload"; } + @Override public Trigger getTrigger() { return trigger; } @@ -400,10 +407,12 @@ public boolean shouldFire() { return false; } + @Override public String getName() { return fileName; } + @Override public int triggerHashCode() { return 0; } diff --git a/jme3-core/src/main/java/com/jme3/util/SafeArrayList.java b/jme3-core/src/main/java/com/jme3/util/SafeArrayList.java index 0085b20d3d..73759f03c9 100644 --- a/jme3-core/src/main/java/com/jme3/util/SafeArrayList.java +++ b/jme3-core/src/main/java/com/jme3/util/SafeArrayList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -103,6 +103,7 @@ public SafeArrayList(final Class elementType, final Collection c this.size = buffer.size(); } + @Override public SafeArrayList clone() { try { SafeArrayList clone = (SafeArrayList)super.clone(); @@ -167,26 +168,32 @@ protected final List getBuffer() { return buffer; } + @Override public final int size() { return size; } + @Override public final boolean isEmpty() { return size == 0; } + @Override public boolean contains(Object o) { return indexOf(o) >= 0; } + @Override public Iterator iterator() { return listIterator(); } + @Override public Object[] toArray() { return getArray(); } + @Override public T[] toArray(T[] a) { E[] array = getArray(); @@ -203,51 +210,60 @@ public T[] toArray(T[] a) { return a; } + @Override public boolean add(E e) { boolean result = getBuffer().add(e); size = getBuffer().size(); return result; } + @Override public boolean remove(Object o) { boolean result = getBuffer().remove(o); size = getBuffer().size(); return result; } + @Override public boolean containsAll(Collection c) { return Arrays.asList(getArray()).containsAll(c); } + @Override public boolean addAll(Collection c) { boolean result = getBuffer().addAll(c); size = getBuffer().size(); return result; } + @Override public boolean addAll(int index, Collection c) { boolean result = getBuffer().addAll(index, c); size = getBuffer().size(); return result; } + @Override public boolean removeAll(Collection c) { boolean result = getBuffer().removeAll(c); size = getBuffer().size(); return result; } + @Override public boolean retainAll(Collection c) { boolean result = getBuffer().retainAll(c); size = getBuffer().size(); return result; } + @Override public void clear() { getBuffer().clear(); size = 0; } + @Override public boolean equals(Object o) { if (o == this) { @@ -276,6 +292,7 @@ public boolean equals(Object o) { return !(i1.hasNext() || i2.hasNext()); } + @Override public int hashCode() { // Exactly the hash code described in the List interface, basically E[] array = getArray(); @@ -286,6 +303,7 @@ public int hashCode() { return result; } + @Override public final E get(int index) { if( backingArray != null ) return backingArray[index]; @@ -294,21 +312,25 @@ public final E get(int index) { throw new IndexOutOfBoundsException( "Index:" + index + ", Size:0" ); } + @Override public E set(int index, E element) { return getBuffer().set(index, element); } + @Override public void add(int index, E element) { getBuffer().add(index, element); size = getBuffer().size(); } + @Override public E remove(int index) { E result = getBuffer().remove(index); size = getBuffer().size(); return result; } + @Override public int indexOf(Object o) { E[] array = getArray(); for( int i = 0; i < array.length; i++ ) { @@ -323,6 +345,7 @@ public int indexOf(Object o) { return -1; } + @Override public int lastIndexOf(Object o) { E[] array = getArray(); for( int i = array.length - 1; i >= 0; i-- ) { @@ -337,14 +360,17 @@ public int lastIndexOf(Object o) { return -1; } + @Override public ListIterator listIterator() { return new ArrayIterator(getArray(), 0); } + @Override public ListIterator listIterator(int index) { return new ArrayIterator(getArray(), index); } + @Override public List subList(int fromIndex, int toIndex) { // So far JME doesn't use subList that I can see so I'm nerfing it. @@ -352,6 +378,7 @@ public List subList(int fromIndex, int toIndex) { return Collections.unmodifiableList(raw); } + @Override public String toString() { E[] array = getArray(); @@ -382,10 +409,12 @@ protected ArrayIterator( E[] array, int index ) { this.lastReturned = -1; } + @Override public boolean hasNext() { return next != array.length; } + @Override public E next() { if( !hasNext() ) throw new NoSuchElementException(); @@ -393,10 +422,12 @@ public E next() { return array[lastReturned]; } + @Override public boolean hasPrevious() { return next != 0; } + @Override public E previous() { if( !hasPrevious() ) throw new NoSuchElementException(); @@ -404,14 +435,17 @@ public E previous() { return array[lastReturned]; } + @Override public int nextIndex() { return next; } + @Override public int previousIndex() { return next - 1; } + @Override public void remove() { // This operation is not so easy to do but we will fake it. // The issue is that the backing list could be completely @@ -423,10 +457,12 @@ public void remove() { SafeArrayList.this.remove( array[lastReturned] ); } + @Override public void set(E e) { throw new UnsupportedOperationException(); } + @Override public void add(E e) { throw new UnsupportedOperationException(); } diff --git a/jme3-core/src/main/java/com/jme3/util/SortUtil.java b/jme3-core/src/main/java/com/jme3/util/SortUtil.java index 7628495f5c..104e35a9e4 100644 --- a/jme3-core/src/main/java/com/jme3/util/SortUtil.java +++ b/jme3-core/src/main/java/com/jme3/util/SortUtil.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -155,6 +155,7 @@ private static void test(Float[] original, Float[] sorted, Comparator ic) public static void main(String[] args) { Comparator ic = new Comparator() { + @Override public int compare(Float o1, Float o2) { return (int) (o1 - o2); } diff --git a/jme3-core/src/main/java/com/jme3/util/clone/Cloner.java b/jme3-core/src/main/java/com/jme3/util/clone/Cloner.java index 1e10f33cfc..a64aff2656 100644 --- a/jme3-core/src/main/java/com/jme3/util/clone/Cloner.java +++ b/jme3-core/src/main/java/com/jme3/util/clone/Cloner.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2018 jMonkeyEngine + * Copyright (c) 2016-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -298,7 +298,7 @@ public void setCloneFunction( Class type, CloneFunction function ) { */ @SuppressWarnings("unchecked") public CloneFunction getCloneFunction( Class type ) { - CloneFunction result = (CloneFunction)functions.get(type); + CloneFunction result = functions.get(type); if( result == null ) { // Do a more exhaustive search for( Map.Entry e : functions.entrySet() ) { diff --git a/jme3-core/src/main/java/com/jme3/util/clone/IdentityCloneFunction.java b/jme3-core/src/main/java/com/jme3/util/clone/IdentityCloneFunction.java index ac3dce6eec..287fb3cb94 100644 --- a/jme3-core/src/main/java/com/jme3/util/clone/IdentityCloneFunction.java +++ b/jme3-core/src/main/java/com/jme3/util/clone/IdentityCloneFunction.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 jMonkeyEngine + * Copyright (c) 2016-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -46,6 +46,7 @@ public class IdentityCloneFunction implements CloneFunction { /** * Returns the object directly. */ + @Override public T cloneObject( Cloner cloner, T object ) { return object; } @@ -53,6 +54,7 @@ public T cloneObject( Cloner cloner, T object ) { /** * Does nothing. */ + @Override public void cloneFields( Cloner cloner, T clone, T object ) { } } diff --git a/jme3-core/src/main/java/com/jme3/util/clone/ListCloneFunction.java b/jme3-core/src/main/java/com/jme3/util/clone/ListCloneFunction.java index a1f269d673..b431729806 100644 --- a/jme3-core/src/main/java/com/jme3/util/clone/ListCloneFunction.java +++ b/jme3-core/src/main/java/com/jme3/util/clone/ListCloneFunction.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 jMonkeyEngine + * Copyright (c) 2016-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -42,6 +42,7 @@ */ public class ListCloneFunction implements CloneFunction { + @Override public T cloneObject( Cloner cloner, T object ) { try { T clone = cloner.javaClone(object); @@ -55,6 +56,7 @@ public T cloneObject( Cloner cloner, T object ) { * Clones the elements of the list. */ @SuppressWarnings("unchecked") + @Override public void cloneFields( Cloner cloner, T clone, T object ) { for( int i = 0; i < clone.size(); i++ ) { // Need to clone the clones... because T might diff --git a/jme3-core/src/main/java/com/jme3/util/mikktspace/MikktspaceTangentGenerator.java b/jme3-core/src/main/java/com/jme3/util/mikktspace/MikktspaceTangentGenerator.java index 48a13d6f4b..ea05321438 100644 --- a/jme3-core/src/main/java/com/jme3/util/mikktspace/MikktspaceTangentGenerator.java +++ b/jme3-core/src/main/java/com/jme3/util/mikktspace/MikktspaceTangentGenerator.java @@ -105,7 +105,7 @@ public static boolean genTangSpace(MikkTSpaceContext mikkTSpace, final float ang int iNrActiveGroups, index; final int iNrFaces = mikkTSpace.getNumFaces(); //boolean bRes = false; - final float fThresCos = (float) FastMath.cos((angularThreshold * (float) FastMath.PI) / 180.0f); + final float fThresCos = FastMath.cos((angularThreshold * FastMath.PI) / 180.0f); // count triangles on supported faces for (int f = 0; f < iNrFaces; f++) { diff --git a/jme3-core/src/main/resources/Common/MatDefs/Light/PBRLighting.j3md b/jme3-core/src/main/resources/Common/MatDefs/Light/PBRLighting.j3md index 40b4f9a6c7..7f0e970018 100644 --- a/jme3-core/src/main/resources/Common/MatDefs/Light/PBRLighting.j3md +++ b/jme3-core/src/main/resources/Common/MatDefs/Light/PBRLighting.j3md @@ -168,7 +168,7 @@ MaterialDef PBR Lighting { Technique PreShadow { VertexShader GLSL300 GLSL100 GLSL150 : Common/MatDefs/Shadow/PreShadow.vert - FragmentShader GLSL300 GLSL100 GLSL150 : Common/MatDefs/Shadow/PreShadow.frag + FragmentShader GLSL300 GLSL100 GLSL150 : Common/MatDefs/Shadow/PreShadowPBR.frag WorldParameters { WorldViewProjectionMatrix @@ -196,9 +196,9 @@ MaterialDef PBR Lighting { } - Technique PostShadow{ - VertexShader GLSL310 GLSL300 GLSL150: Common/MatDefs/Shadow/PostShadow.vert - FragmentShader GLSL310 GLSL300 GLSL150: Common/MatDefs/Shadow/PostShadow.frag + Technique PostShadow { + VertexShader GLSL310 GLSL300 GLSL100 GLSL150: Common/MatDefs/Shadow/PostShadow.vert + FragmentShader GLSL310 GLSL300 GLSL100 GLSL150: Common/MatDefs/Shadow/PostShadowPBR.frag WorldParameters { WorldViewProjectionMatrix @@ -213,7 +213,6 @@ MaterialDef PBR Lighting { PCFEDGE : PCFEdge DISCARD_ALPHA : AlphaDiscardThreshold SHADOWMAP_SIZE : ShadowMapSize - SHADOWMAP_SIZE : ShadowMapSize FADE : FadeInfo PSSM : Splits POINTLIGHT : LightViewProjectionMatrix5 @@ -231,40 +230,6 @@ MaterialDef PBR Lighting { } } - Technique PostShadow{ - VertexShader GLSL100: Common/MatDefs/Shadow/PostShadow.vert - FragmentShader GLSL100: Common/MatDefs/Shadow/PostShadow.frag - - WorldParameters { - WorldViewProjectionMatrix - WorldMatrix - ViewProjectionMatrix - ViewMatrix - } - - Defines { - HARDWARE_SHADOWS : HardwareShadows - FILTER_MODE : FilterMode - PCFEDGE : PCFEdge - DISCARD_ALPHA : AlphaDiscardThreshold - SHADOWMAP_SIZE : ShadowMapSize - FADE : FadeInfo - PSSM : Splits - POINTLIGHT : LightViewProjectionMatrix5 - NUM_BONES : NumberOfBones - INSTANCING : UseInstancing - BACKFACE_SHADOWS: BackfaceShadows - NUM_MORPH_TARGETS: NumberOfMorphTargets - NUM_TARGETS_BUFFERS: NumberOfTargetsBuffers - } - - ForcedRenderState { - Blend Modulate - DepthWrite Off - PolyOffset -0.1 0 - } - } - Technique PreNormalPass { VertexShader GLSL100 : Common/MatDefs/SSAO/normal.vert diff --git a/jme3-core/src/main/resources/Common/MatDefs/Shadow/PostShadowPBR.frag b/jme3-core/src/main/resources/Common/MatDefs/Shadow/PostShadowPBR.frag new file mode 100644 index 0000000000..8c779e4f86 --- /dev/null +++ b/jme3-core/src/main/resources/Common/MatDefs/Shadow/PostShadowPBR.frag @@ -0,0 +1,89 @@ + +#import "Common/ShaderLib/GLSLCompat.glsllib" +#import "Common/ShaderLib/Shadows.glsllib" +#if defined(PSSM) || defined(FADE) +varying float shadowPosition; +#endif + +varying vec4 projCoord0; +varying vec4 projCoord1; +varying vec4 projCoord2; +varying vec4 projCoord3; +#ifndef BACKFACE_SHADOWS + varying float nDotL; +#endif + +#ifdef POINTLIGHT + varying vec4 projCoord4; + varying vec4 projCoord5; + uniform vec3 m_LightPos; + varying vec4 worldPos; +#else + #ifndef PSSM + varying float lightDot; + #endif +#endif + +#ifdef DISCARD_ALPHA + #ifdef COLOR_MAP + uniform sampler2D m_ColorMap; + #else + uniform sampler2D m_BaseColorMap; + #endif + uniform float m_AlphaDiscardThreshold; + varying vec2 texCoord; +#endif + +#ifdef FADE +uniform vec2 m_FadeInfo; +#endif + +void main(){ + + #ifdef DISCARD_ALPHA + #ifdef COLOR_MAP + float alpha = texture2D(m_ColorMap,texCoord).a; + #else + float alpha = texture2D(m_BaseColorMap,texCoord).a; + #endif + if(alpha<=m_AlphaDiscardThreshold){ + discard; + } + #endif + + #ifndef BACKFACE_SHADOWS + if(nDotL > 0.0){ + discard; + } + #endif + + + float shadow = 1.0; + + #ifdef POINTLIGHT + shadow = getPointLightShadows(worldPos, m_LightPos, + m_ShadowMap0,m_ShadowMap1,m_ShadowMap2,m_ShadowMap3,m_ShadowMap4,m_ShadowMap5, + projCoord0, projCoord1, projCoord2, projCoord3, projCoord4, projCoord5); + #else + #ifdef PSSM + shadow = getDirectionalLightShadows(m_Splits, shadowPosition, + m_ShadowMap0,m_ShadowMap1,m_ShadowMap2,m_ShadowMap3, + projCoord0, projCoord1, projCoord2, projCoord3); + #else + //spotlight + if(lightDot < 0.0){ + gl_FragColor = vec4(1.0); + return; + } + shadow = getSpotLightShadows(m_ShadowMap0,projCoord0); + #endif + #endif + + #ifdef FADE + shadow = max(0.0, mix(shadow, 1.0, max(0.0, (shadowPosition - m_FadeInfo.x) * m_FadeInfo.y))); + #endif + + shadow = shadow * m_ShadowIntensity + (1.0 - m_ShadowIntensity); + gl_FragColor = vec4(shadow, shadow, shadow, 1.0); + +} diff --git a/jme3-core/src/main/resources/Common/MatDefs/Shadow/PreShadowPBR.frag b/jme3-core/src/main/resources/Common/MatDefs/Shadow/PreShadowPBR.frag new file mode 100644 index 0000000000..cf7f916696 --- /dev/null +++ b/jme3-core/src/main/resources/Common/MatDefs/Shadow/PreShadowPBR.frag @@ -0,0 +1,28 @@ +#import "Common/ShaderLib/GLSLCompat.glsllib" +varying vec2 texCoord; + +#ifdef DISCARD_ALPHA + #ifdef COLOR_MAP + uniform sampler2D m_ColorMap; + #else + uniform sampler2D m_BaseColorMap; + #endif + uniform float m_AlphaDiscardThreshold; +#endif + + +void main(){ + #ifdef DISCARD_ALPHA + #ifdef COLOR_MAP + if (texture2D(m_ColorMap, texCoord).a <= m_AlphaDiscardThreshold){ + discard; + } + #else + if (texture2D(m_BaseColorMap, texCoord).a <= m_AlphaDiscardThreshold){ + discard; + } + #endif + #endif + + gl_FragColor = vec4(1.0); +} diff --git a/jme3-core/src/main/resources/Common/ShaderLib/MorphAnim.glsllib b/jme3-core/src/main/resources/Common/ShaderLib/MorphAnim.glsllib index 68c26f4ae3..eea4100ba1 100644 --- a/jme3-core/src/main/resources/Common/ShaderLib/MorphAnim.glsllib +++ b/jme3-core/src/main/resources/Common/ShaderLib/MorphAnim.glsllib @@ -3,8 +3,6 @@ A glsllib that perform morph animation. Note that it only handles morphing position, normals and tangents. */ #ifdef NUM_MORPH_TARGETS - vec3 dummy_norm = vec3(0.0); - vec3 dummy_tan = vec3(0.0); #define NUM_BUFFERS NUM_MORPH_TARGETS * NUM_TARGETS_BUFFERS #if (NUM_BUFFERS > 0) uniform float m_MorphWeights[NUM_MORPH_TARGETS]; @@ -98,7 +96,7 @@ Note that it only handles morphing position, normals and tangents. } float Get_Inverse_Weights_Sum(){ - float sum = 0; + float sum = 0.0; for( int i = 0;i < NUM_MORPH_TARGETS; i++){ sum += m_MorphWeights[i]; } @@ -175,9 +173,12 @@ Note that it only handles morphing position, normals and tangents. void Morph_Compute(inout vec4 pos){ #if (NUM_TARGETS_BUFFERS == 2) - Morph_Compute_Pos_Norm(pos,dummy_norm); + vec3 dummy_norm = vec3(0.0); + Morph_Compute_Pos_Norm(pos, dummy_norm); return; #elif (NUM_TARGETS_BUFFERS == 3) + vec3 dummy_norm = vec3(0.0); + vec3 dummy_tan = vec3(0.0); Morph_Compute_Pos_Norm_Tan(pos, dummy_norm, dummy_tan); return; #endif @@ -189,6 +190,8 @@ Note that it only handles morphing position, normals and tangents. Morph_Compute_Pos(pos); return; #elif (NUM_TARGETS_BUFFERS == 3) + vec3 dummy_norm = vec3(0.0); + vec3 dummy_tan = vec3(0.0); Morph_Compute_Pos_Norm_Tan(pos, dummy_norm, dummy_tan); return; #elif (NUM_TARGETS_BUFFERS == 2) diff --git a/jme3-core/src/plugins/java/com/jme3/asset/plugins/ClasspathLocator.java b/jme3-core/src/plugins/java/com/jme3/asset/plugins/ClasspathLocator.java index 14e57790eb..ab96029709 100644 --- a/jme3-core/src/plugins/java/com/jme3/asset/plugins/ClasspathLocator.java +++ b/jme3-core/src/plugins/java/com/jme3/asset/plugins/ClasspathLocator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -62,6 +62,7 @@ public class ClasspathLocator implements AssetLocator { public ClasspathLocator(){ } + @Override public void setRootPath(String rootPath) { this.root = rootPath; if (root.equals("/")) @@ -75,6 +76,7 @@ else if (root.length() > 1){ } } + @Override public AssetInfo locate(AssetManager manager, AssetKey key) { URL url; String name = key.getName(); diff --git a/jme3-core/src/plugins/java/com/jme3/asset/plugins/FileLocator.java b/jme3-core/src/plugins/java/com/jme3/asset/plugins/FileLocator.java index f46a975165..b4b6ce5faf 100644 --- a/jme3-core/src/plugins/java/com/jme3/asset/plugins/FileLocator.java +++ b/jme3-core/src/plugins/java/com/jme3/asset/plugins/FileLocator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -44,6 +44,7 @@ public class FileLocator implements AssetLocator { private File root; + @Override public void setRootPath(String rootPath) { if (rootPath == null) throw new NullPointerException(); @@ -79,6 +80,7 @@ public InputStream openStream() { } } + @Override public AssetInfo locate(AssetManager manager, AssetKey key) { String name = key.getName(); File file = new File(root, name); diff --git a/jme3-core/src/plugins/java/com/jme3/asset/plugins/HttpZipLocator.java b/jme3-core/src/plugins/java/com/jme3/asset/plugins/HttpZipLocator.java index 7edda53e4a..d058a5c82b 100644 --- a/jme3-core/src/plugins/java/com/jme3/asset/plugins/HttpZipLocator.java +++ b/jme3-core/src/plugins/java/com/jme3/asset/plugins/HttpZipLocator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -339,6 +339,7 @@ public InputStream openStream(String name) throws IOException{ return openStream(entry); } + @Override public void setRootPath(String path){ if (!rootPath.equals(path)){ rootPath = path; @@ -350,6 +351,7 @@ public void setRootPath(String path){ } } + @Override public AssetInfo locate(AssetManager manager, AssetKey key){ final ZipEntry2 entry = entries.get(key.getName()); if (entry == null) diff --git a/jme3-core/src/plugins/java/com/jme3/asset/plugins/UrlLocator.java b/jme3-core/src/plugins/java/com/jme3/asset/plugins/UrlLocator.java index 31cfe0f2cb..846356ac43 100644 --- a/jme3-core/src/plugins/java/com/jme3/asset/plugins/UrlLocator.java +++ b/jme3-core/src/plugins/java/com/jme3/asset/plugins/UrlLocator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -57,6 +57,7 @@ public class UrlLocator implements AssetLocator { private static final Logger logger = Logger.getLogger(UrlLocator.class.getName()); private URL root; + @Override public void setRootPath(String rootPath) { try { this.root = new URL(rootPath); @@ -65,6 +66,7 @@ public void setRootPath(String rootPath) { } } + @Override public AssetInfo locate(AssetManager manager, AssetKey key) { String name = key.getName(); try{ diff --git a/jme3-core/src/plugins/java/com/jme3/asset/plugins/ZipLocator.java b/jme3-core/src/plugins/java/com/jme3/asset/plugins/ZipLocator.java index 22e7cc2442..26e48e9998 100644 --- a/jme3-core/src/plugins/java/com/jme3/asset/plugins/ZipLocator.java +++ b/jme3-core/src/plugins/java/com/jme3/asset/plugins/ZipLocator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -63,6 +63,7 @@ public JarAssetInfo(AssetManager manager, AssetKey key, ZipEntry entry){ this.entry = entry; } + @Override public InputStream openStream(){ try{ return zipfile.getInputStream(entry); @@ -72,6 +73,7 @@ public InputStream openStream(){ } } + @Override public void setRootPath(String rootPath) { try{ zipfile = new ZipFile(new File(rootPath), ZipFile.OPEN_READ); @@ -80,6 +82,7 @@ public void setRootPath(String rootPath) { } } + @Override public AssetInfo locate(AssetManager manager, AssetKey key) { String name = key.getName(); if(name.startsWith("/"))name=name.substring(1); diff --git a/jme3-core/src/plugins/java/com/jme3/audio/plugins/WAVLoader.java b/jme3-core/src/plugins/java/com/jme3/audio/plugins/WAVLoader.java index 997a8f4fb5..bcca3171cc 100644 --- a/jme3-core/src/plugins/java/com/jme3/audio/plugins/WAVLoader.java +++ b/jme3-core/src/plugins/java/com/jme3/audio/plugins/WAVLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -82,6 +82,7 @@ public void setResetOffset(int resetOffset) { this.resetOffset = resetOffset; } + @Override public void setTime(float time) { if (time != 0f) { throw new UnsupportedOperationException("Seeking WAV files not supported"); @@ -196,7 +197,7 @@ private AudioData load(AssetInfo info, InputStream inputStream, boolean stream) break; case i_data: // Compute duration based on data chunk size - duration = (float)(len / bytesPerSec); + duration = len / bytesPerSec; if (readStream) { readDataChunkForStream(inOffset, len); @@ -215,6 +216,7 @@ private AudioData load(AssetInfo info, InputStream inputStream, boolean stream) } } + @Override public Object load(AssetInfo info) throws IOException { AudioData data; InputStream inputStream = null; diff --git a/jme3-core/src/plugins/java/com/jme3/export/binary/BinaryExporter.java b/jme3-core/src/plugins/java/com/jme3/export/binary/BinaryExporter.java index 3ad1b8b228..2a4e13e6f3 100644 --- a/jme3-core/src/plugins/java/com/jme3/export/binary/BinaryExporter.java +++ b/jme3-core/src/plugins/java/com/jme3/export/binary/BinaryExporter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -194,6 +194,7 @@ public static T saveAndLoad(AssetManager assetManager, T obj } } + @Override public void save(Savable object, OutputStream os) throws IOException { // reset some vars aliasCount = 1; @@ -349,6 +350,7 @@ protected byte[] fixClassAlias(byte[] bytes, int width) { return bytes; } + @Override public void save(Savable object, File f) throws IOException { File parentDirectory = f.getParentFile(); if (parentDirectory != null && !parentDirectory.exists()) { @@ -363,6 +365,7 @@ public void save(Savable object, File f) throws IOException { } } + @Override public BinaryOutputCapsule getCapsule(Savable object) { return contentTable.get(object).getContent(); } diff --git a/jme3-core/src/plugins/java/com/jme3/export/binary/BinaryImporter.java b/jme3-core/src/plugins/java/com/jme3/export/binary/BinaryImporter.java index 93f082337b..24c22d4d1e 100644 --- a/jme3-core/src/plugins/java/com/jme3/export/binary/BinaryImporter.java +++ b/jme3-core/src/plugins/java/com/jme3/export/binary/BinaryImporter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -77,6 +77,7 @@ public final class BinaryImporter implements JmeImporter { public BinaryImporter() { } + @Override public int getFormatVersion(){ return formatVersion; } @@ -93,10 +94,12 @@ public void setAssetManager(AssetManager manager){ this.assetManager = manager; } + @Override public AssetManager getAssetManager(){ return assetManager; } + @Override public Object load(AssetInfo info){ // if (!(info.getKey() instanceof ModelKey)) // throw new IllegalArgumentException("Model assets must be loaded using a ModelKey"); diff --git a/jme3-core/src/plugins/java/com/jme3/export/binary/BinaryInputCapsule.java b/jme3-core/src/plugins/java/com/jme3/export/binary/BinaryInputCapsule.java index 1216887143..5240c6d91d 100644 --- a/jme3-core/src/plugins/java/com/jme3/export/binary/BinaryInputCapsule.java +++ b/jme3-core/src/plugins/java/com/jme3/export/binary/BinaryInputCapsule.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -257,11 +257,13 @@ public void setContent(byte[] content, int start, int limit) { } } + @Override public int getSavableVersion(Class desiredClass){ return SavableClassUtil.getSavedSavableVersion(savable, desiredClass, cObj.classHierarchyVersions, importer.getFormatVersion()); } + @Override public BitSet readBitSet(String name, BitSet defVal) throws IOException { BinaryClassField field = cObj.nameFields.get(name); if (field == null || !fieldData.containsKey(field.alias)) @@ -269,6 +271,7 @@ public BitSet readBitSet(String name, BitSet defVal) throws IOException { return (BitSet) fieldData.get(field.alias); } + @Override public boolean readBoolean(String name, boolean defVal) throws IOException { BinaryClassField field = cObj.nameFields.get(name); if (field == null || !fieldData.containsKey(field.alias)) @@ -276,6 +279,7 @@ public boolean readBoolean(String name, boolean defVal) throws IOException { return ((Boolean) fieldData.get(field.alias)).booleanValue(); } + @Override public boolean[] readBooleanArray(String name, boolean[] defVal) throws IOException { BinaryClassField field = cObj.nameFields.get(name); @@ -284,6 +288,7 @@ public boolean[] readBooleanArray(String name, boolean[] defVal) return (boolean[]) fieldData.get(field.alias); } + @Override public boolean[][] readBooleanArray2D(String name, boolean[][] defVal) throws IOException { BinaryClassField field = cObj.nameFields.get(name); @@ -292,6 +297,7 @@ public boolean[][] readBooleanArray2D(String name, boolean[][] defVal) return (boolean[][]) fieldData.get(field.alias); } + @Override public byte readByte(String name, byte defVal) throws IOException { BinaryClassField field = cObj.nameFields.get(name); if (field == null || !fieldData.containsKey(field.alias)) @@ -299,6 +305,7 @@ public byte readByte(String name, byte defVal) throws IOException { return ((Byte) fieldData.get(field.alias)).byteValue(); } + @Override public byte[] readByteArray(String name, byte[] defVal) throws IOException { BinaryClassField field = cObj.nameFields.get(name); if (field == null || !fieldData.containsKey(field.alias)) @@ -306,6 +313,7 @@ public byte[] readByteArray(String name, byte[] defVal) throws IOException { return (byte[]) fieldData.get(field.alias); } + @Override public byte[][] readByteArray2D(String name, byte[][] defVal) throws IOException { BinaryClassField field = cObj.nameFields.get(name); @@ -314,6 +322,7 @@ public byte[][] readByteArray2D(String name, byte[][] defVal) return (byte[][]) fieldData.get(field.alias); } + @Override public ByteBuffer readByteBuffer(String name, ByteBuffer defVal) throws IOException { BinaryClassField field = cObj.nameFields.get(name); @@ -323,6 +332,7 @@ public ByteBuffer readByteBuffer(String name, ByteBuffer defVal) } @SuppressWarnings("unchecked") + @Override public ArrayList readByteBufferArrayList(String name, ArrayList defVal) throws IOException { BinaryClassField field = cObj.nameFields.get(name); @@ -331,6 +341,7 @@ public ArrayList readByteBufferArrayList(String name, return (ArrayList) fieldData.get(field.alias); } + @Override public double readDouble(String name, double defVal) throws IOException { BinaryClassField field = cObj.nameFields.get(name); if (field == null || !fieldData.containsKey(field.alias)) @@ -338,6 +349,7 @@ public double readDouble(String name, double defVal) throws IOException { return ((Double) fieldData.get(field.alias)).doubleValue(); } + @Override public double[] readDoubleArray(String name, double[] defVal) throws IOException { BinaryClassField field = cObj.nameFields.get(name); @@ -346,6 +358,7 @@ public double[] readDoubleArray(String name, double[] defVal) return (double[]) fieldData.get(field.alias); } + @Override public double[][] readDoubleArray2D(String name, double[][] defVal) throws IOException { BinaryClassField field = cObj.nameFields.get(name); @@ -354,6 +367,7 @@ public double[][] readDoubleArray2D(String name, double[][] defVal) return (double[][]) fieldData.get(field.alias); } + @Override public float readFloat(String name, float defVal) throws IOException { BinaryClassField field = cObj.nameFields.get(name); if (field == null || !fieldData.containsKey(field.alias)) @@ -361,6 +375,7 @@ public float readFloat(String name, float defVal) throws IOException { return ((Float) fieldData.get(field.alias)).floatValue(); } + @Override public float[] readFloatArray(String name, float[] defVal) throws IOException { BinaryClassField field = cObj.nameFields.get(name); @@ -369,6 +384,7 @@ public float[] readFloatArray(String name, float[] defVal) return (float[]) fieldData.get(field.alias); } + @Override public float[][] readFloatArray2D(String name, float[][] defVal) throws IOException { BinaryClassField field = cObj.nameFields.get(name); @@ -377,6 +393,7 @@ public float[][] readFloatArray2D(String name, float[][] defVal) return (float[][]) fieldData.get(field.alias); } + @Override public FloatBuffer readFloatBuffer(String name, FloatBuffer defVal) throws IOException { BinaryClassField field = cObj.nameFields.get(name); @@ -386,6 +403,7 @@ public FloatBuffer readFloatBuffer(String name, FloatBuffer defVal) } @SuppressWarnings("unchecked") + @Override public ArrayList readFloatBufferArrayList(String name, ArrayList defVal) throws IOException { BinaryClassField field = cObj.nameFields.get(name); @@ -394,6 +412,7 @@ public ArrayList readFloatBufferArrayList(String name, return (ArrayList) fieldData.get(field.alias); } + @Override public int readInt(String name, int defVal) throws IOException { BinaryClassField field = cObj.nameFields.get(name); if (field == null || !fieldData.containsKey(field.alias)) @@ -401,6 +420,7 @@ public int readInt(String name, int defVal) throws IOException { return ((Integer) fieldData.get(field.alias)).intValue(); } + @Override public int[] readIntArray(String name, int[] defVal) throws IOException { BinaryClassField field = cObj.nameFields.get(name); if (field == null || !fieldData.containsKey(field.alias)) @@ -408,6 +428,7 @@ public int[] readIntArray(String name, int[] defVal) throws IOException { return (int[]) fieldData.get(field.alias); } + @Override public int[][] readIntArray2D(String name, int[][] defVal) throws IOException { BinaryClassField field = cObj.nameFields.get(name); @@ -416,6 +437,7 @@ public int[][] readIntArray2D(String name, int[][] defVal) return (int[][]) fieldData.get(field.alias); } + @Override public IntBuffer readIntBuffer(String name, IntBuffer defVal) throws IOException { BinaryClassField field = cObj.nameFields.get(name); @@ -424,6 +446,7 @@ public IntBuffer readIntBuffer(String name, IntBuffer defVal) return (IntBuffer) fieldData.get(field.alias); } + @Override public long readLong(String name, long defVal) throws IOException { BinaryClassField field = cObj.nameFields.get(name); if (field == null || !fieldData.containsKey(field.alias)) @@ -431,6 +454,7 @@ public long readLong(String name, long defVal) throws IOException { return ((Long) fieldData.get(field.alias)).longValue(); } + @Override public long[] readLongArray(String name, long[] defVal) throws IOException { BinaryClassField field = cObj.nameFields.get(name); if (field == null || !fieldData.containsKey(field.alias)) @@ -438,6 +462,7 @@ public long[] readLongArray(String name, long[] defVal) throws IOException { return (long[]) fieldData.get(field.alias); } + @Override public long[][] readLongArray2D(String name, long[][] defVal) throws IOException { BinaryClassField field = cObj.nameFields.get(name); @@ -446,6 +471,7 @@ public long[][] readLongArray2D(String name, long[][] defVal) return (long[][]) fieldData.get(field.alias); } + @Override public Savable readSavable(String name, Savable defVal) throws IOException { BinaryClassField field = cObj.nameFields.get(name); if (field == null || !fieldData.containsKey(field.alias)) @@ -461,6 +487,7 @@ else if (value instanceof ID) { return defVal; } + @Override public Savable[] readSavableArray(String name, Savable[] defVal) throws IOException { BinaryClassField field = cObj.nameFields.get(name); @@ -488,6 +515,7 @@ private Savable[] resolveIDs(Object[] values) { } } + @Override public Savable[][] readSavableArray2D(String name, Savable[][] defVal) throws IOException { BinaryClassField field = cObj.nameFields.get(name); @@ -576,6 +604,7 @@ private IntMap intSavableMapFromKV(int[] keys, Savable[] values) { return map; } + @Override public ArrayList readSavableArrayList(String name, ArrayList defVal) throws IOException { BinaryClassField field = cObj.nameFields.get(name); @@ -591,6 +620,7 @@ public ArrayList readSavableArrayList(String name, ArrayList defVal) return (ArrayList) value; } + @Override public ArrayList[] readSavableArrayListArray(String name, ArrayList[] defVal) throws IOException { BinaryClassField field = cObj.nameFields.get(name); @@ -613,6 +643,7 @@ public ArrayList[] readSavableArrayListArray(String name, ArrayList[] defVal) return (ArrayList[]) value; } + @Override public ArrayList[][] readSavableArrayListArray2D(String name, ArrayList[][] defVal) throws IOException { BinaryClassField field = cObj.nameFields.get(name); @@ -639,6 +670,7 @@ public ArrayList[][] readSavableArrayListArray2D(String name, } @SuppressWarnings("unchecked") + @Override public Map readSavableMap(String name, Map defVal) throws IOException { BinaryClassField field = cObj.nameFields.get(name); @@ -655,6 +687,7 @@ public ArrayList[][] readSavableArrayListArray2D(String name, } @SuppressWarnings("unchecked") + @Override public Map readStringSavableMap(String name, Map defVal) throws IOException { BinaryClassField field = cObj.nameFields.get(name); @@ -672,6 +705,7 @@ public ArrayList[][] readSavableArrayListArray2D(String name, } @SuppressWarnings("unchecked") + @Override public IntMap readIntSavableMap(String name, IntMap defVal) throws IOException { BinaryClassField field = cObj.nameFields.get(name); @@ -688,6 +722,7 @@ public IntMap readIntSavableMap(String name, IntMap) value; } + @Override public short readShort(String name, short defVal) throws IOException { BinaryClassField field = cObj.nameFields.get(name); if (field == null || !fieldData.containsKey(field.alias)) @@ -695,6 +730,7 @@ public short readShort(String name, short defVal) throws IOException { return ((Short) fieldData.get(field.alias)).shortValue(); } + @Override public short[] readShortArray(String name, short[] defVal) throws IOException { BinaryClassField field = cObj.nameFields.get(name); @@ -703,6 +739,7 @@ public short[] readShortArray(String name, short[] defVal) return (short[]) fieldData.get(field.alias); } + @Override public short[][] readShortArray2D(String name, short[][] defVal) throws IOException { BinaryClassField field = cObj.nameFields.get(name); @@ -711,6 +748,7 @@ public short[][] readShortArray2D(String name, short[][] defVal) return (short[][]) fieldData.get(field.alias); } + @Override public ShortBuffer readShortBuffer(String name, ShortBuffer defVal) throws IOException { BinaryClassField field = cObj.nameFields.get(name); @@ -719,6 +757,7 @@ public ShortBuffer readShortBuffer(String name, ShortBuffer defVal) return (ShortBuffer) fieldData.get(field.alias); } + @Override public String readString(String name, String defVal) throws IOException { BinaryClassField field = cObj.nameFields.get(name); if (field == null || !fieldData.containsKey(field.alias)) @@ -726,6 +765,7 @@ public String readString(String name, String defVal) throws IOException { return (String) fieldData.get(field.alias); } + @Override public String[] readStringArray(String name, String[] defVal) throws IOException { BinaryClassField field = cObj.nameFields.get(name); @@ -734,6 +774,7 @@ public String[] readStringArray(String name, String[] defVal) return (String[]) fieldData.get(field.alias); } + @Override public String[][] readStringArray2D(String name, String[][] defVal) throws IOException { BinaryClassField field = cObj.nameFields.get(name); @@ -1368,6 +1409,7 @@ static private class IntIDMap { public ID[] values; } + @Override public > T readEnum(String name, Class enumType, T defVal) throws IOException { String eVal = readString(name, defVal != null ? defVal.name() : null); if (eVal != null) { diff --git a/jme3-core/src/plugins/java/com/jme3/export/binary/BinaryOutputCapsule.java b/jme3-core/src/plugins/java/com/jme3/export/binary/BinaryOutputCapsule.java index 380772eaf7..7119bb78c2 100644 --- a/jme3-core/src/plugins/java/com/jme3/export/binary/BinaryOutputCapsule.java +++ b/jme3-core/src/plugins/java/com/jme3/export/binary/BinaryOutputCapsule.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -68,6 +68,7 @@ public BinaryOutputCapsule(BinaryExporter exporter, BinaryClassObject bco) { this.cObj = bco; } + @Override public void write(byte value, String name, byte defVal) throws IOException { if (value == defVal) return; @@ -75,6 +76,7 @@ public void write(byte value, String name, byte defVal) throws IOException { write(value); } + @Override public void write(byte[] value, String name, byte[] defVal) throws IOException { if (value == defVal) @@ -83,6 +85,7 @@ public void write(byte[] value, String name, byte[] defVal) write(value); } + @Override public void write(byte[][] value, String name, byte[][] defVal) throws IOException { if (value == defVal) @@ -91,6 +94,7 @@ public void write(byte[][] value, String name, byte[][] defVal) write(value); } + @Override public void write(int value, String name, int defVal) throws IOException { if (value == defVal) return; @@ -98,6 +102,7 @@ public void write(int value, String name, int defVal) throws IOException { write(value); } + @Override public void write(int[] value, String name, int[] defVal) throws IOException { if (value == defVal) @@ -106,6 +111,7 @@ public void write(int[] value, String name, int[] defVal) write(value); } + @Override public void write(int[][] value, String name, int[][] defVal) throws IOException { if (value == defVal) @@ -114,6 +120,7 @@ public void write(int[][] value, String name, int[][] defVal) write(value); } + @Override public void write(float value, String name, float defVal) throws IOException { if (value == defVal) @@ -122,6 +129,7 @@ public void write(float value, String name, float defVal) write(value); } + @Override public void write(float[] value, String name, float[] defVal) throws IOException { if (value == defVal) @@ -130,6 +138,7 @@ public void write(float[] value, String name, float[] defVal) write(value); } + @Override public void write(float[][] value, String name, float[][] defVal) throws IOException { if (value == defVal) @@ -138,6 +147,7 @@ public void write(float[][] value, String name, float[][] defVal) write(value); } + @Override public void write(double value, String name, double defVal) throws IOException { if (value == defVal) @@ -146,6 +156,7 @@ public void write(double value, String name, double defVal) write(value); } + @Override public void write(double[] value, String name, double[] defVal) throws IOException { if (value == defVal) @@ -154,6 +165,7 @@ public void write(double[] value, String name, double[] defVal) write(value); } + @Override public void write(double[][] value, String name, double[][] defVal) throws IOException { if (value == defVal) @@ -162,6 +174,7 @@ public void write(double[][] value, String name, double[][] defVal) write(value); } + @Override public void write(long value, String name, long defVal) throws IOException { if (value == defVal) return; @@ -169,6 +182,7 @@ public void write(long value, String name, long defVal) throws IOException { write(value); } + @Override public void write(long[] value, String name, long[] defVal) throws IOException { if (value == defVal) @@ -177,6 +191,7 @@ public void write(long[] value, String name, long[] defVal) write(value); } + @Override public void write(long[][] value, String name, long[][] defVal) throws IOException { if (value == defVal) @@ -185,6 +200,7 @@ public void write(long[][] value, String name, long[][] defVal) write(value); } + @Override public void write(short value, String name, short defVal) throws IOException { if (value == defVal) @@ -193,6 +209,7 @@ public void write(short value, String name, short defVal) write(value); } + @Override public void write(short[] value, String name, short[] defVal) throws IOException { if (value == defVal) @@ -201,6 +218,7 @@ public void write(short[] value, String name, short[] defVal) write(value); } + @Override public void write(short[][] value, String name, short[][] defVal) throws IOException { if (value == defVal) @@ -209,6 +227,7 @@ public void write(short[][] value, String name, short[][] defVal) write(value); } + @Override public void write(boolean value, String name, boolean defVal) throws IOException { if (value == defVal) @@ -217,6 +236,7 @@ public void write(boolean value, String name, boolean defVal) write(value); } + @Override public void write(boolean[] value, String name, boolean[] defVal) throws IOException { if (value == defVal) @@ -225,6 +245,7 @@ public void write(boolean[] value, String name, boolean[] defVal) write(value); } + @Override public void write(boolean[][] value, String name, boolean[][] defVal) throws IOException { if (value == defVal) @@ -233,6 +254,7 @@ public void write(boolean[][] value, String name, boolean[][] defVal) write(value); } + @Override public void write(String value, String name, String defVal) throws IOException { if (value == null ? defVal == null : value.equals(defVal)) @@ -241,6 +263,7 @@ public void write(String value, String name, String defVal) write(value); } + @Override public void write(String[] value, String name, String[] defVal) throws IOException { if (value == defVal) @@ -249,6 +272,7 @@ public void write(String[] value, String name, String[] defVal) write(value); } + @Override public void write(String[][] value, String name, String[][] defVal) throws IOException { if (value == defVal) @@ -257,6 +281,7 @@ public void write(String[][] value, String name, String[][] defVal) write(value); } + @Override public void write(BitSet value, String name, BitSet defVal) throws IOException { if (value == defVal) @@ -265,6 +290,7 @@ public void write(BitSet value, String name, BitSet defVal) write(value); } + @Override public void write(Savable object, String name, Savable defVal) throws IOException { if (object == defVal) @@ -273,6 +299,7 @@ public void write(Savable object, String name, Savable defVal) write(object); } + @Override public void write(Savable[] objects, String name, Savable[] defVal) throws IOException { if (objects == defVal) @@ -281,6 +308,7 @@ public void write(Savable[] objects, String name, Savable[] defVal) write(objects); } + @Override public void write(Savable[][] objects, String name, Savable[][] defVal) throws IOException { if (objects == defVal) @@ -289,6 +317,7 @@ public void write(Savable[][] objects, String name, Savable[][] defVal) write(objects); } + @Override public void write(FloatBuffer value, String name, FloatBuffer defVal) throws IOException { if (value == defVal) @@ -297,6 +326,7 @@ public void write(FloatBuffer value, String name, FloatBuffer defVal) write(value); } + @Override public void write(IntBuffer value, String name, IntBuffer defVal) throws IOException { if (value == defVal) @@ -305,6 +335,7 @@ public void write(IntBuffer value, String name, IntBuffer defVal) write(value); } + @Override public void write(ByteBuffer value, String name, ByteBuffer defVal) throws IOException { if (value == defVal) @@ -313,6 +344,7 @@ public void write(ByteBuffer value, String name, ByteBuffer defVal) write(value); } + @Override public void write(ShortBuffer value, String name, ShortBuffer defVal) throws IOException { if (value == defVal) @@ -321,6 +353,7 @@ public void write(ShortBuffer value, String name, ShortBuffer defVal) write(value); } + @Override public void writeFloatBufferArrayList(ArrayList array, String name, ArrayList defVal) throws IOException { if (array == defVal) @@ -329,6 +362,7 @@ public void writeFloatBufferArrayList(ArrayList array, writeFloatBufferArrayList(array); } + @Override public void writeByteBufferArrayList(ArrayList array, String name, ArrayList defVal) throws IOException { if (array == defVal) @@ -337,6 +371,7 @@ public void writeByteBufferArrayList(ArrayList array, writeByteBufferArrayList(array); } + @Override public void writeSavableArrayList(ArrayList array, String name, ArrayList defVal) throws IOException { if (array == defVal) @@ -345,6 +380,7 @@ public void writeSavableArrayList(ArrayList array, String name, writeSavableArrayList(array); } + @Override public void writeSavableArrayListArray(ArrayList[] array, String name, ArrayList[] defVal) throws IOException { if (array == defVal) @@ -353,6 +389,7 @@ public void writeSavableArrayListArray(ArrayList[] array, String name, writeSavableArrayListArray(array); } + @Override public void writeSavableArrayListArray2D(ArrayList[][] array, String name, ArrayList[][] defVal) throws IOException { if (array == defVal) @@ -361,6 +398,7 @@ public void writeSavableArrayListArray2D(ArrayList[][] array, String name, writeSavableArrayListArray2D(array); } + @Override public void writeSavableMap(Map map, String name, Map defVal) throws IOException { @@ -370,6 +408,7 @@ public void writeSavableMap(Map map, writeSavableMap(map); } + @Override public void writeStringSavableMap(Map map, String name, Map defVal) throws IOException { @@ -379,6 +418,7 @@ public void writeStringSavableMap(Map map, writeStringSavableMap(map); } + @Override public void writeIntSavableMap(IntMap map, String name, IntMap defVal) throws IOException { @@ -931,6 +971,7 @@ protected void write(ShortBuffer value) throws IOException { value.rewind(); } + @Override public void write(Enum value, String name, Enum defVal) throws IOException { if (value == defVal) return; diff --git a/jme3-core/src/plugins/java/com/jme3/font/plugins/BitmapFontLoader.java b/jme3-core/src/plugins/java/com/jme3/font/plugins/BitmapFontLoader.java index 07aa9813ee..082ab35445 100644 --- a/jme3-core/src/plugins/java/com/jme3/font/plugins/BitmapFontLoader.java +++ b/jme3-core/src/plugins/java/com/jme3/font/plugins/BitmapFontLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -162,6 +162,7 @@ private BitmapFont load(AssetManager assetManager, String folder, InputStream in return font; } + @Override public Object load(AssetInfo info) throws IOException { InputStream in = null; try { diff --git a/jme3-core/src/plugins/java/com/jme3/material/plugins/J3MLoader.java b/jme3-core/src/plugins/java/com/jme3/material/plugins/J3MLoader.java index 88674fdffd..fc8f883766 100644 --- a/jme3-core/src/plugins/java/com/jme3/material/plugins/J3MLoader.java +++ b/jme3-core/src/plugins/java/com/jme3/material/plugins/J3MLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -786,6 +786,7 @@ private void loadFromRoot(List roots) throws IOException{ } } + @Override public Object load(AssetInfo info) throws IOException { this.assetManager = info.getManager(); diff --git a/jme3-core/src/plugins/java/com/jme3/material/plugins/ShaderNodeLoaderDelegate.java b/jme3-core/src/plugins/java/com/jme3/material/plugins/ShaderNodeLoaderDelegate.java index 3e64d0d785..f79a77a90d 100644 --- a/jme3-core/src/plugins/java/com/jme3/material/plugins/ShaderNodeLoaderDelegate.java +++ b/jme3-core/src/plugins/java/com/jme3/material/plugins/ShaderNodeLoaderDelegate.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -152,7 +152,7 @@ public void readNodesDefinitions(List statements) throws IOException * @throws IOException */ protected void readShaderNodeDefinition(List statements, ShaderNodeDefinitionKey key) throws IOException { - boolean isLoadDoc = key instanceof ShaderNodeDefinitionKey && ((ShaderNodeDefinitionKey) key).isLoadDocumentation(); + boolean isLoadDoc = key instanceof ShaderNodeDefinitionKey && key.isLoadDocumentation(); for (Statement statement : statements) { try { String[] split = statement.getLine().split("[ \\{]"); diff --git a/jme3-core/src/plugins/java/com/jme3/scene/plugins/MTLLoader.java b/jme3-core/src/plugins/java/com/jme3/scene/plugins/MTLLoader.java index cdc3655d6e..63a1f30e9a 100644 --- a/jme3-core/src/plugins/java/com/jme3/scene/plugins/MTLLoader.java +++ b/jme3-core/src/plugins/java/com/jme3/scene/plugins/MTLLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -287,6 +287,7 @@ protected boolean readLine(){ } @SuppressWarnings("empty-statement") + @Override public Object load(AssetInfo info) throws IOException{ reset(); diff --git a/jme3-core/src/plugins/java/com/jme3/scene/plugins/OBJLoader.java b/jme3-core/src/plugins/java/com/jme3/scene/plugins/OBJLoader.java index 4d57567c48..8f3b9f98fc 100644 --- a/jme3-core/src/plugins/java/com/jme3/scene/plugins/OBJLoader.java +++ b/jme3-core/src/plugins/java/com/jme3/scene/plugins/OBJLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -549,6 +549,7 @@ protected Mesh constructMesh(ArrayList faceList){ } @SuppressWarnings("empty-statement") + @Override public Object load(AssetInfo info) throws IOException{ reset(); diff --git a/jme3-core/src/plugins/java/com/jme3/texture/plugins/DDSLoader.java b/jme3-core/src/plugins/java/com/jme3/texture/plugins/DDSLoader.java index 359fa979e5..7058c64bbc 100644 --- a/jme3-core/src/plugins/java/com/jme3/texture/plugins/DDSLoader.java +++ b/jme3-core/src/plugins/java/com/jme3/texture/plugins/DDSLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -117,6 +117,7 @@ public class DDSLoader implements AssetLoader { public DDSLoader() { } + @Override public Object load(AssetInfo info) throws IOException { if (!(info.getKey() instanceof TextureKey)) { throw new IllegalArgumentException("Texture assets must be loaded using a TextureKey"); diff --git a/jme3-core/src/plugins/java/com/jme3/texture/plugins/DXTFlipper.java b/jme3-core/src/plugins/java/com/jme3/texture/plugins/DXTFlipper.java index e460a75a63..3fe8cc633f 100644 --- a/jme3-core/src/plugins/java/com/jme3/texture/plugins/DXTFlipper.java +++ b/jme3-core/src/plugins/java/com/jme3/texture/plugins/DXTFlipper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -198,8 +198,8 @@ private static void flipDXT1orDXTA3Block(byte[] block, int h){ public static ByteBuffer flipDXT(ByteBuffer img, int w, int h, Format format){ int originalLimit = img.limit(); - int blocksX = (int) FastMath.ceil((float)w / 4f); - int blocksY = (int) FastMath.ceil((float)h / 4f); + int blocksX = (int) FastMath.ceil(w / 4f); + int blocksY = (int) FastMath.ceil(h / 4f); int type; switch (format){ diff --git a/jme3-core/src/plugins/java/com/jme3/texture/plugins/HDRLoader.java b/jme3-core/src/plugins/java/com/jme3/texture/plugins/HDRLoader.java index 50f7fe5c06..212aae52d8 100644 --- a/jme3-core/src/plugins/java/com/jme3/texture/plugins/HDRLoader.java +++ b/jme3-core/src/plugins/java/com/jme3/texture/plugins/HDRLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -313,6 +313,7 @@ public Image load(InputStream in, boolean flipY) throws IOException{ return new Image(pixelFormat, width, height, dataStore, ColorSpace.Linear); } + @Override public Object load(AssetInfo info) throws IOException { if (!(info.getKey() instanceof TextureKey)) throw new IllegalArgumentException("Texture assets must be loaded using a TextureKey"); diff --git a/jme3-core/src/plugins/java/com/jme3/texture/plugins/PFMLoader.java b/jme3-core/src/plugins/java/com/jme3/texture/plugins/PFMLoader.java index a94641f7eb..0ea456af61 100644 --- a/jme3-core/src/plugins/java/com/jme3/texture/plugins/PFMLoader.java +++ b/jme3-core/src/plugins/java/com/jme3/texture/plugins/PFMLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -133,6 +133,7 @@ private Image load(InputStream in, boolean needYFlip) throws IOException{ return new Image(format, width, height, imageData, null, ColorSpace.Linear); } + @Override public Object load(AssetInfo info) throws IOException { if (!(info.getKey() instanceof TextureKey)) throw new IllegalArgumentException("Texture assets must be loaded using a TextureKey"); diff --git a/jme3-core/src/plugins/java/com/jme3/texture/plugins/TGALoader.java b/jme3-core/src/plugins/java/com/jme3/texture/plugins/TGALoader.java index 4ecb60b8ff..10c6e30f21 100644 --- a/jme3-core/src/plugins/java/com/jme3/texture/plugins/TGALoader.java +++ b/jme3-core/src/plugins/java/com/jme3/texture/plugins/TGALoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -71,6 +71,7 @@ public final class TGALoader implements AssetLoader { // 11 - run-length encoded, black and white image public static final int TYPE_BLACKANDWHITE_RLE = 11; + @Override public Object load(AssetInfo info) throws IOException { if (!(info.getKey() instanceof TextureKey)) { throw new IllegalArgumentException("Texture assets must be loaded using a TextureKey"); diff --git a/jme3-core/src/test/java/com/jme3/scene/TestUserData.java b/jme3-core/src/test/java/com/jme3/scene/TestUserData.java index c228af8926..afd9d70e2b 100644 --- a/jme3-core/src/test/java/com/jme3/scene/TestUserData.java +++ b/jme3-core/src/test/java/com/jme3/scene/TestUserData.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -46,36 +46,36 @@ public static void userDataTest(Spatial sp, Object v) { @Test public void testLong() throws Exception { Spatial sp = new Node("TestSpatial"); - userDataTest(sp, (Long) (long) (Math.random() * Long.MAX_VALUE)); + userDataTest(sp, Math.random() * Long.MAX_VALUE); } @Test public void testInt() throws Exception { Spatial sp = new Node("TestSpatial"); - userDataTest(sp, (Integer) (int) (Math.random() * Integer.MAX_VALUE)); + userDataTest(sp, Math.random() * Integer.MAX_VALUE); } @Test public void testShort() throws Exception { Spatial sp = new Node("TestSpatial"); - userDataTest(sp, (Short) (short) (Math.random() * Short.MAX_VALUE)); + userDataTest(sp, Math.random() * Short.MAX_VALUE); } @Test public void testByte() throws Exception { Spatial sp = new Node("TestSpatial"); - userDataTest(sp, (Byte) (byte) (Math.random() * Byte.MAX_VALUE)); + userDataTest(sp, Math.random() * Byte.MAX_VALUE); } @Test public void testDouble() throws Exception { Spatial sp = new Node("TestSpatial"); - userDataTest(sp, (Double) (double) (Math.random() * Double.MAX_VALUE)); + userDataTest(sp, Math.random() * Double.MAX_VALUE); } @Test public void testFloat() throws Exception { Spatial sp = new Node("TestSpatial"); - userDataTest(sp, (Float) (float) (Math.random() * Float.MAX_VALUE)); + userDataTest(sp, Math.random() * Float.MAX_VALUE); } } diff --git a/jme3-core/src/tools/java/jme3tools/optimize/LodGenerator.java b/jme3-core/src/tools/java/jme3tools/optimize/LodGenerator.java index 5b2ee6fd8b..4509e8c675 100644 --- a/jme3-core/src/tools/java/jme3tools/optimize/LodGenerator.java +++ b/jme3-core/src/tools/java/jme3tools/optimize/LodGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2013 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -243,6 +243,7 @@ public String toString() { * Comparator used to sort vertices according to their collapse cost */ private Comparator collapseComparator = new Comparator() { + @Override public int compare(Vertex o1, Vertex o2) { if (Float.compare(o1.collapseCost, o2.collapseCost) == 0) { return 0; diff --git a/jme3-core/src/tools/java/jme3tools/optimize/TextureAtlas.java b/jme3-core/src/tools/java/jme3tools/optimize/TextureAtlas.java index 9ca7390149..c254580b26 100644 --- a/jme3-core/src/tools/java/jme3tools/optimize/TextureAtlas.java +++ b/jme3-core/src/tools/java/jme3tools/optimize/TextureAtlas.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -637,10 +637,10 @@ public TextureAtlasTile(int x, int y, int width, int height) { * @return The new texture coordinate inside the atlas. */ public Vector2f getLocation(Vector2f previousLocation) { - float x = (float) getX() / (float) atlasWidth; - float y = (float) getY() / (float) atlasHeight; - float w = (float) getWidth() / (float) atlasWidth; - float h = (float) getHeight() / (float) atlasHeight; + float x = getX() / (float) atlasWidth; + float y = getY() / (float) atlasHeight; + float w = getWidth() / (float) atlasWidth; + float h = getHeight() / (float) atlasHeight; Vector2f location = new Vector2f(x, y); float prevX = previousLocation.x; float prevY = previousLocation.y; diff --git a/jme3-core/src/tools/java/jme3tools/shadercheck/CgcValidator.java b/jme3-core/src/tools/java/jme3tools/shadercheck/CgcValidator.java index c5f314711f..7710b5ddb8 100644 --- a/jme3-core/src/tools/java/jme3tools/shadercheck/CgcValidator.java +++ b/jme3-core/src/tools/java/jme3tools/shadercheck/CgcValidator.java @@ -33,14 +33,17 @@ private static String checkCgCompilerVersion(){ return null; } + @Override public String getName() { return "NVIDIA Cg Toolkit"; } + @Override public boolean isInstalled() { return getInstalledVersion() != null; } + @Override public String getInstalledVersion() { if (version == null){ version = checkCgCompilerVersion(); @@ -94,6 +97,7 @@ private static void executeCg(String sourceCode, String language, String defines } } + @Override public void validate(Shader shader, StringBuilder results) { for (ShaderSource source : shader.getSources()){ results.append("Checking: ").append(source.getName()); diff --git a/jme3-core/src/tools/java/jme3tools/shadercheck/GpuAnalyzerValidator.java b/jme3-core/src/tools/java/jme3tools/shadercheck/GpuAnalyzerValidator.java index d06f26c88c..2064c5ced8 100644 --- a/jme3-core/src/tools/java/jme3tools/shadercheck/GpuAnalyzerValidator.java +++ b/jme3-core/src/tools/java/jme3tools/shadercheck/GpuAnalyzerValidator.java @@ -37,14 +37,17 @@ private static String checkGpuAnalyzerVersion(){ return null; } + @Override public String getName() { return "AMD GPU Shader Analyzer"; } + @Override public boolean isInstalled() { return getInstalledVersion() != null; } + @Override public String getInstalledVersion() { if (version == null){ version = checkGpuAnalyzerVersion(); @@ -104,6 +107,7 @@ private static void executeAnalyzer(String sourceCode, String language, String d } } + @Override public void validate(Shader shader, StringBuilder results) { for (ShaderSource source : shader.getSources()){ results.append("Checking: ").append(source.getName()); diff --git a/jme3-desktop/src/main/java/com/jme3/app/AppletHarness.java b/jme3-desktop/src/main/java/com/jme3/app/AppletHarness.java index 3765c1f809..3dee23bec0 100644 --- a/jme3-desktop/src/main/java/com/jme3/app/AppletHarness.java +++ b/jme3-desktop/src/main/java/com/jme3/app/AppletHarness.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -170,6 +170,7 @@ public void stop(){ public void destroy(){ System.out.println("applet:destroyStart"); SwingUtilities.invokeLater(new Runnable(){ + @Override public void run(){ removeAll(); System.out.println("applet:destroyRemoved"); diff --git a/jme3-desktop/src/main/java/com/jme3/app/SettingsDialog.java b/jme3-desktop/src/main/java/com/jme3/app/SettingsDialog.java index 15e7aa76c2..c076798895 100644 --- a/jme3-desktop/src/main/java/com/jme3/app/SettingsDialog.java +++ b/jme3-desktop/src/main/java/com/jme3/app/SettingsDialog.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -312,7 +312,7 @@ public void windowClosing(WindowEvent e) { }); if (source.getIcons() != null) { - safeSetIconImages( (List) Arrays.asList((BufferedImage[]) source.getIcons()) ); + safeSetIconImages( Arrays.asList((BufferedImage[]) source.getIcons()) ); } setTitle(MessageFormat.format(resourceBundle.getString("frame.title"), source.getTitle())); @@ -352,6 +352,7 @@ else if (e.getKeyCode() == KeyEvent.VK_ESCAPE) { fullscreenBox.setSelected(source.isFullscreen()); fullscreenBox.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { updateResolutionChoices(); } @@ -438,6 +439,7 @@ public void actionPerformed(ActionEvent e) { // saves. ok.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { if (verifyAndSaveCurrentSelection()) { setUserSelection(APPROVE_SELECTION); @@ -454,6 +456,7 @@ public void actionPerformed(ActionEvent e) { cancel.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { setUserSelection(CANCEL_SELECTION); dispose(); @@ -487,6 +490,7 @@ public void actionPerformed(ActionEvent e) { mainPanel.getRootPane().setDefaultButton(ok); SwingUtilities.invokeLater(new Runnable() { + @Override public void run() { // Fill in the combos once the window has opened so that the insets can be read. // The assumption is made that the settings window and the display window will have the @@ -629,6 +633,7 @@ private JComboBox setUpResolutionChooser() { resolutionBox.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { updateDisplayChoices(); } @@ -880,6 +885,7 @@ private class DisplayModeSorter implements Comparator { /** * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object) */ + @Override public int compare(DisplayMode a, DisplayMode b) { // Width if (a.getWidth() != b.getWidth()) { diff --git a/jme3-desktop/src/main/java/com/jme3/app/state/MjpegFileWriter.java b/jme3-desktop/src/main/java/com/jme3/app/state/MjpegFileWriter.java index b3d7514653..aa162e9f1a 100644 --- a/jme3-desktop/src/main/java/com/jme3/app/state/MjpegFileWriter.java +++ b/jme3-desktop/src/main/java/com/jme3/app/state/MjpegFileWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -470,7 +470,7 @@ public byte[] toBytes() throws Exception { baos.write(fcc); baos.write(intBytes(swapInt(cb))); for (int i = 0; i < ind.size(); i++) { - AVIIndex in = (AVIIndex) ind.get(i); + AVIIndex in = ind.get(i); baos.write(in.toBytes()); } diff --git a/jme3-desktop/src/main/java/com/jme3/app/state/VideoRecorderAppState.java b/jme3-desktop/src/main/java/com/jme3/app/state/VideoRecorderAppState.java index eb4abe4cdc..a85374abc5 100644 --- a/jme3-desktop/src/main/java/com/jme3/app/state/VideoRecorderAppState.java +++ b/jme3-desktop/src/main/java/com/jme3/app/state/VideoRecorderAppState.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -70,6 +70,7 @@ public class VideoRecorderAppState extends AbstractAppState { private Application app; private ExecutorService executor = Executors.newCachedThreadPool(new ThreadFactory() { + @Override public Thread newThread(Runnable r) { Thread th = new Thread(r); th.setName("jME3 Video Processor"); @@ -233,6 +234,7 @@ public void addImage(Renderer renderer, FrameBuffer out) { renderer.readFrameBufferWithFormat(out, item.buffer, Image.Format.BGRA8); executor.submit(new Callable() { + @Override public Void call() throws Exception { Screenshots.convertScreenShot(item.buffer, item.image); item.data = writer.writeImageToBytes(item.image, quality); @@ -250,6 +252,7 @@ public Void call() throws Exception { } } + @Override public void initialize(RenderManager rm, ViewPort viewPort) { this.camera = viewPort.getCamera(); this.width = camera.getWidth(); @@ -264,13 +267,16 @@ public void initialize(RenderManager rm, ViewPort viewPort) { } } + @Override public void reshape(ViewPort vp, int w, int h) { } + @Override public boolean isInitialized() { return this.isInitilized; } + @Override public void preFrame(float tpf) { if (null == writer) { try { @@ -281,13 +287,16 @@ public void preFrame(float tpf) { } } + @Override public void postQueue(RenderQueue rq) { } + @Override public void postFrame(FrameBuffer out) { addImage(renderManager.getRenderer(), out); } + @Override public void cleanup() { try { while (freeItems.size() < numCpus) { @@ -317,22 +326,27 @@ public IsoTimer(float framerate) { this.ticks = 0; } + @Override public long getTime() { return (long) (this.ticks * (1.0f / this.framerate) * 1000f); } + @Override public long getResolution() { return 1000L; } + @Override public float getFrameRate() { return this.framerate; } + @Override public float getTimePerFrame() { - return (float) (1.0f / this.framerate); + return 1.0f / this.framerate; } + @Override public void update() { long time = System.currentTimeMillis(); long difference = time - lastTime; @@ -346,6 +360,7 @@ public void update() { this.ticks++; } + @Override public void reset() { this.ticks = 0; } diff --git a/jme3-desktop/src/main/java/com/jme3/cursors/plugins/CursorLoader.java b/jme3-desktop/src/main/java/com/jme3/cursors/plugins/CursorLoader.java index 037927ac61..1abb802855 100644 --- a/jme3-desktop/src/main/java/com/jme3/cursors/plugins/CursorLoader.java +++ b/jme3-desktop/src/main/java/com/jme3/cursors/plugins/CursorLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -67,17 +67,18 @@ public class CursorLoader implements AssetLoader { * @return A JmeCursor representation of the LWJGL's Cursor. * @throws IOException if the file is not found. */ + @Override public JmeCursor load(AssetInfo info) throws IOException { isIco = false; isAni = false; isCur = false; - isIco = ((AssetKey) info.getKey()).getExtension().equals("ico"); + isIco = info.getKey().getExtension().equals("ico"); if (!isIco) { - isCur = ((AssetKey) info.getKey()).getExtension().equals("cur"); + isCur = info.getKey().getExtension().equals("cur"); if (!isCur) { - isAni = ((AssetKey) info.getKey()).getExtension().equals("ani"); + isAni = info.getKey().getExtension().equals("ani"); } } if (!isAni && !isIco && !isCur) { diff --git a/jme3-desktop/src/main/java/com/jme3/input/awt/AwtKeyInput.java b/jme3-desktop/src/main/java/com/jme3/input/awt/AwtKeyInput.java index b27e290359..7a1d49b620 100644 --- a/jme3-desktop/src/main/java/com/jme3/input/awt/AwtKeyInput.java +++ b/jme3-desktop/src/main/java/com/jme3/input/awt/AwtKeyInput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -61,9 +61,11 @@ public class AwtKeyInput implements KeyInput, KeyListener { public AwtKeyInput(){ } + @Override public void initialize() { } + @Override public void destroy() { } @@ -79,6 +81,7 @@ public void setInputSource(Component comp){ } } + @Override public long getInputTimeNanos() { return System.nanoTime(); } @@ -87,6 +90,7 @@ public int getKeyCount() { return KeyEvent.KEY_LAST+1; } + @Override public void update() { synchronized (eventQueue){ // flush events to listener @@ -97,18 +101,22 @@ public void update() { } } + @Override public boolean isInitialized() { return true; } + @Override public void setInputListener(RawInputListener listener) { this.listener = listener; } + @Override public void keyTyped(KeyEvent evt) { // key code is zero for typed events } + @Override public void keyPressed(KeyEvent evt) { int code = convertAwtKey(evt.getKeyCode()); @@ -123,6 +131,7 @@ public void keyPressed(KeyEvent evt) { } } + @Override public void keyReleased(KeyEvent evt) { int code = convertAwtKey(evt.getKeyCode()); diff --git a/jme3-desktop/src/main/java/com/jme3/input/awt/AwtMouseInput.java b/jme3-desktop/src/main/java/com/jme3/input/awt/AwtMouseInput.java index f53a3b003e..2ebe9b18fe 100644 --- a/jme3-desktop/src/main/java/com/jme3/input/awt/AwtMouseInput.java +++ b/jme3-desktop/src/main/java/com/jme3/input/awt/AwtMouseInput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -122,24 +122,30 @@ public void setInputSource(Component comp) { component.addMouseWheelListener(this); } + @Override public void initialize() { } + @Override public void destroy() { } + @Override public boolean isInitialized() { return true; } + @Override public void setInputListener(RawInputListener listener) { this.listener = listener; } + @Override public long getInputTimeNanos() { return System.nanoTime(); } + @Override public void setCursorVisible(boolean visible) { // if(JmeSystem.getPlatform() != Platform.MacOSX32 && // JmeSystem.getPlatform() != Platform.MacOSX64 && @@ -151,6 +157,7 @@ public void setCursorVisible(boolean visible) { this.visible = visible; final boolean newVisible = visible; SwingUtilities.invokeLater(new Runnable() { + @Override public void run() { component.setCursor(newVisible ? null : getTransparentCursor()); if (!newVisible) { @@ -162,6 +169,7 @@ public void run() { } } + @Override public void update() { if (cursorMoved) { int newX = location.x; @@ -215,15 +223,18 @@ private Cursor getTransparentCursor() { // } + @Override public int getButtonCount() { return 3; } + @Override public void mouseClicked(MouseEvent awtEvt) { // MouseButtonEvent evt = new MouseButtonEvent(getJMEButtonIndex(arg0), false); // listener.onMouseButtonEvent(evt); } + @Override public void mousePressed(MouseEvent awtEvt) { // Must flip Y! int y = component.getHeight() - awtEvt.getY(); @@ -234,6 +245,7 @@ public void mousePressed(MouseEvent awtEvt) { } } + @Override public void mouseReleased(MouseEvent awtEvt) { int y = component.getHeight() - awtEvt.getY(); MouseButtonEvent evt = new MouseButtonEvent(getJMEButtonIndex(awtEvt), false, awtEvt.getX(), y); @@ -243,28 +255,33 @@ public void mouseReleased(MouseEvent awtEvt) { } } + @Override public void mouseEntered(MouseEvent awtEvt) { if (!visible) { recenterMouse(awtEvt.getComponent()); } } + @Override public void mouseExited(MouseEvent awtEvt) { if (!visible) { recenterMouse(awtEvt.getComponent()); } } + @Override public void mouseWheelMoved(MouseWheelEvent awtEvt) { int dwheel = awtEvt.getUnitsToScroll(); wheelPos += dwheel * WHEEL_AMP; cursorMoved = true; } + @Override public void mouseDragged(MouseEvent awtEvt) { mouseMoved(awtEvt); } + @Override public void mouseMoved(MouseEvent awtEvt) { if (isRecentering) { // MHenze (cylab) Fix Issue 35: @@ -321,6 +338,7 @@ private int getJMEButtonIndex(MouseEvent awtEvt) { return index; } + @Override public void setNativeCursor(JmeCursor cursor) { } } diff --git a/jme3-desktop/src/main/java/com/jme3/system/JmeDesktopSystem.java b/jme3-desktop/src/main/java/com/jme3/system/JmeDesktopSystem.java index d02b5d21cd..b489eaa9af 100644 --- a/jme3-desktop/src/main/java/com/jme3/system/JmeDesktopSystem.java +++ b/jme3-desktop/src/main/java/com/jme3/system/JmeDesktopSystem.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -120,6 +120,7 @@ public void showErrorDialog(String message) { if (!GraphicsEnvironment.isHeadless()) { final String msg = message; EventQueue.invokeLater(new Runnable() { + @Override public void run() { ErrorDialog.showDialog(msg); } @@ -155,6 +156,7 @@ public boolean showSettingsDialog(AppSettings sourceSettings, final boolean load final SelectionListener selectionListener = new SelectionListener() { + @Override public void onSelection(int selection) { synchronized (lock) { done.set(true); @@ -165,6 +167,7 @@ public void onSelection(int selection) { }; SwingUtilities.invokeLater(new Runnable() { + @Override public void run() { synchronized (lock) { SettingsDialog dialog = new SettingsDialog(settings, iconUrl, loadFromRegistry); diff --git a/jme3-desktop/src/main/java/com/jme3/system/awt/AwtPanelsContext.java b/jme3-desktop/src/main/java/com/jme3/system/awt/AwtPanelsContext.java index ee41ea569d..52cbcb3ff5 100644 --- a/jme3-desktop/src/main/java/com/jme3/system/awt/AwtPanelsContext.java +++ b/jme3-desktop/src/main/java/com/jme3/system/awt/AwtPanelsContext.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -57,37 +57,45 @@ public class AwtPanelsContext implements JmeContext { private class AwtPanelsListener implements SystemListener { + @Override public void initialize() { initInThread(); } + @Override public void reshape(int width, int height) { throw new IllegalStateException(); } + @Override public void update() { updateInThread(); } + @Override public void requestClose(boolean esc) { // shouldn't happen throw new IllegalStateException(); } + @Override public void gainFocus() { // shouldn't happen throw new IllegalStateException(); } + @Override public void loseFocus() { // shouldn't happen throw new IllegalStateException(); } + @Override public void handleError(String errorMsg, Throwable t) { listener.handleError(errorMsg, t); } + @Override public void destroy() { destroyInThread(); } @@ -102,46 +110,57 @@ public void setInputSource(AwtPanel panel){ keyInput.setInputSource(panel); } + @Override public Type getType() { return Type.OffscreenSurface; } + @Override public void setSystemListener(SystemListener listener) { this.listener = listener; } + @Override public AppSettings getSettings() { return settings; } + @Override public Renderer getRenderer() { return actualContext.getRenderer(); } + @Override public MouseInput getMouseInput() { return mouseInput; } + @Override public KeyInput getKeyInput() { return keyInput; } + @Override public JoyInput getJoyInput() { return null; } + @Override public TouchInput getTouchInput() { return null; } + @Override public Timer getTimer() { return actualContext.getTimer(); } + @Override public boolean isCreated() { return actualContext != null && actualContext.isCreated(); } + @Override public boolean isRenderable() { return actualContext != null && actualContext.isRenderable(); } @@ -208,6 +227,7 @@ private void destroyInThread(){ listener.destroy(); } + @Override public void setSettings(AppSettings settings) { this.settings.copyFrom(settings); this.settings.setRenderer(AppSettings.LWJGL_OPENGL2); @@ -216,6 +236,7 @@ public void setSettings(AppSettings settings) { } } + @Override public void create(boolean waitFor) { if (actualContext != null){ throw new IllegalStateException("Already created"); @@ -226,6 +247,7 @@ public void create(boolean waitFor) { actualContext.create(waitFor); } + @Override public void destroy(boolean waitFor) { if (actualContext == null) throw new IllegalStateException("Not created"); @@ -234,14 +256,17 @@ public void destroy(boolean waitFor) { actualContext.destroy(waitFor); } + @Override public void setTitle(String title) { // not relevant, ignore } + @Override public void setAutoFlushFrames(boolean enabled) { // not relevant, ignore } + @Override public void restart() { // only relevant if changing pixel format. } diff --git a/jme3-desktop/src/main/java/com/jme3/texture/plugins/AWTLoader.java b/jme3-desktop/src/main/java/com/jme3/texture/plugins/AWTLoader.java index 952b3a6fdf..cf0ffe0e7b 100644 --- a/jme3-desktop/src/main/java/com/jme3/texture/plugins/AWTLoader.java +++ b/jme3-desktop/src/main/java/com/jme3/texture/plugins/AWTLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -183,6 +183,7 @@ public Image load(InputStream in, boolean flipY) throws IOException{ return load(img, flipY); } + @Override public Object load(AssetInfo info) throws IOException { if (ImageIO.getImageReadersBySuffix(info.getKey().getExtension()) != null){ boolean flip = ((TextureKey) info.getKey()).isFlipY(); diff --git a/jme3-desktop/src/main/java/jme3tools/navigation/MapModel2D.java b/jme3-desktop/src/main/java/jme3tools/navigation/MapModel2D.java index f3094071a3..2cd683a36d 100644 --- a/jme3-desktop/src/main/java/jme3tools/navigation/MapModel2D.java +++ b/jme3-desktop/src/main/java/jme3tools/navigation/MapModel2D.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -114,7 +114,7 @@ public int getViewportPixelHeight() { * @since 1.0 */ public void calculateMinutesPerPixel(double mapWidthInLongitude) { - minutesPerPixel = (mapWidthInLongitude * 60) / (double) viewportWidth; + minutesPerPixel = (mapWidthInLongitude * 60) / viewportWidth; } /** diff --git a/jme3-desktop/src/main/java/jme3tools/navigation/MapModel3D.java b/jme3-desktop/src/main/java/jme3tools/navigation/MapModel3D.java index 633d88bfcd..3450da797b 100644 --- a/jme3-desktop/src/main/java/jme3tools/navigation/MapModel3D.java +++ b/jme3-desktop/src/main/java/jme3tools/navigation/MapModel3D.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -120,7 +120,7 @@ public int getWorldHeight() { */ public void calculateMinutesPerWorldUnit(double mapWidthInLongitude) { // Multiply mapWidthInLongitude by 60 to convert it to minutes. - minutesPerWorldUnit = (mapWidthInLongitude * 60) / (double) worldWidth; + minutesPerWorldUnit = (mapWidthInLongitude * 60) / worldWidth; } /** diff --git a/jme3-desktop/src/main/java/jme3tools/navigation/NumUtil.java b/jme3-desktop/src/main/java/jme3tools/navigation/NumUtil.java index 4110f50963..40f5ce0c35 100644 --- a/jme3-desktop/src/main/java/jme3tools/navigation/NumUtil.java +++ b/jme3-desktop/src/main/java/jme3tools/navigation/NumUtil.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -52,6 +52,6 @@ public float Round(float Rval, int Rpl) { float p = (float) Math.pow(10, Rpl); Rval = Rval * p; float tmp = Math.round(Rval); - return (float) tmp / p; + return tmp / p; } } diff --git a/jme3-effects/src/main/java/com/jme3/post/ssao/SSAOFilter.java b/jme3-effects/src/main/java/com/jme3/post/ssao/SSAOFilter.java index 611f9954f0..1e4aa3410f 100644 --- a/jme3-effects/src/main/java/com/jme3/post/ssao/SSAOFilter.java +++ b/jme3-effects/src/main/java/com/jme3/post/ssao/SSAOFilter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -140,7 +140,7 @@ protected void initFilter(AssetManager manager, RenderManager renderManager, Vie frustumNearFar = new Vector2f(); float farY = (vp.getCamera().getFrustumTop() / vp.getCamera().getFrustumNear()) * vp.getCamera().getFrustumFar(); - float farX = farY * ((float) screenWidth / (float) screenHeight); + float farX = farY * (screenWidth / (float) screenHeight); frustumCorner = new Vector3f(farX, farY, vp.getCamera().getFrustumFar()); frustumNearFar.x = vp.getCamera().getFrustumNear(); frustumNearFar.y = vp.getCamera().getFrustumFar(); diff --git a/jme3-effects/src/main/java/com/jme3/water/ReflectionProcessor.java b/jme3-effects/src/main/java/com/jme3/water/ReflectionProcessor.java index f310f5313a..c2406d4217 100644 --- a/jme3-effects/src/main/java/com/jme3/water/ReflectionProcessor.java +++ b/jme3-effects/src/main/java/com/jme3/water/ReflectionProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -65,21 +65,26 @@ public ReflectionProcessor(Camera reflectionCam, FrameBuffer reflectionBuffer, P this.reflectionClipPlane = reflectionClipPlane; } + @Override public void initialize(RenderManager rm, ViewPort vp) { this.rm = rm; this.vp = vp; } + @Override public void reshape(ViewPort vp, int w, int h) { } + @Override public boolean isInitialized() { return rm != null; } + @Override public void preFrame(float tpf) { } + @Override public void postQueue(RenderQueue rq) { //we need special treatement for the sky because it must not be clipped rm.getRenderer().setFrameBuffer(reflectionBuffer); @@ -96,9 +101,11 @@ public void postQueue(RenderQueue rq) { } + @Override public void postFrame(FrameBuffer out) { } + @Override public void cleanup() { } diff --git a/jme3-effects/src/main/java/com/jme3/water/SimpleWaterProcessor.java b/jme3-effects/src/main/java/com/jme3/water/SimpleWaterProcessor.java index 677cc6d20a..14f0791dae 100644 --- a/jme3-effects/src/main/java/com/jme3/water/SimpleWaterProcessor.java +++ b/jme3-effects/src/main/java/com/jme3/water/SimpleWaterProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -142,6 +142,7 @@ public SimpleWaterProcessor(AssetManager manager) { } + @Override public void initialize(RenderManager rm, ViewPort vp) { this.rm = rm; this.vp = vp; @@ -164,15 +165,18 @@ public void initialize(RenderManager rm, ViewPort vp) { } } + @Override public void reshape(ViewPort vp, int w, int h) { } + @Override public boolean isInitialized() { return rm != null; } float time = 0; float savedTpf = 0; + @Override public void preFrame(float tpf) { time = time + (tpf * speed); if (time > 1f) { @@ -182,6 +186,7 @@ public void preFrame(float tpf) { savedTpf = tpf; } + @Override public void postQueue(RenderQueue rq) { Camera sceneCam = rm.getCurrentCamera(); @@ -207,6 +212,7 @@ public void postQueue(RenderQueue rq) { } + @Override public void postFrame(FrameBuffer out) { if (debug) { displayMap(rm.getRenderer(), dispRefraction, 64); @@ -215,6 +221,7 @@ public void postFrame(FrameBuffer out) { } } + @Override public void cleanup() { } @@ -588,29 +595,36 @@ public class RefractionProcessor implements SceneProcessor { ViewPort vp; private AppProfiler prof; + @Override public void initialize(RenderManager rm, ViewPort vp) { this.rm = rm; this.vp = vp; } + @Override public void reshape(ViewPort vp, int w, int h) { } + @Override public boolean isInitialized() { return rm != null; } + @Override public void preFrame(float tpf) { refractionCam.setClipPlane(refractionClipPlane, Plane.Side.Negative);//,-1 } + @Override public void postQueue(RenderQueue rq) { } + @Override public void postFrame(FrameBuffer out) { } + @Override public void cleanup() { } diff --git a/jme3-examples/src/main/java/jme3test/TestChooser.java b/jme3-examples/src/main/java/jme3test/TestChooser.java index c47196035e..a4d9afc490 100644 --- a/jme3-examples/src/main/java/jme3test/TestChooser.java +++ b/jme3-examples/src/main/java/jme3test/TestChooser.java @@ -237,6 +237,7 @@ private void addAllFilesInDirectory(File directory, */ private FileFilter getFileFilter() { return new FileFilter() { + @Override public boolean accept(File pathname) { return (pathname.isDirectory() && !pathname.getName().startsWith(".")) || (pathname.getName().endsWith(".class") @@ -256,6 +257,7 @@ private void startApp(final java.util.List appClass){ } new Thread(new Runnable(){ + @Override public void run(){ for (int i = 0; i < appClass.size(); i++) { Class clazz = (Class)appClass.get(i); @@ -332,11 +334,13 @@ private void setup(Vector classes) { list.getSelectionModel().addListSelectionListener( new ListSelectionListener() { + @Override public void valueChanged(ListSelectionEvent e) { selectedClass = list.getSelectedValuesList(); } }); list.addMouseListener(new MouseAdapter() { + @Override public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 2 && selectedClass != null) { startApp(selectedClass); @@ -362,6 +366,7 @@ public void keyTyped(KeyEvent e) { buttonPanel.add(okButton); getRootPane().setDefaultButton(okButton); okButton.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { startApp(selectedClass); } @@ -371,6 +376,7 @@ public void actionPerformed(ActionEvent e) { cancelButton.setMnemonic('C'); buttonPanel.add(cancelButton); cancelButton.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { dispose(); } @@ -386,6 +392,7 @@ private class FilteredJList extends JList { private String filter; private ListModel originalModel; + @Override public void setModel(ListModel m) { originalModel = m; super.setModel(m); @@ -471,19 +478,23 @@ private JPanel createSearchPanel(final FilteredJList classes) { BorderLayout.WEST); final javax.swing.JTextField jtf = new javax.swing.JTextField(); jtf.getDocument().addDocumentListener(new DocumentListener() { + @Override public void removeUpdate(DocumentEvent e) { classes.setFilter(jtf.getText()); } + @Override public void insertUpdate(DocumentEvent e) { classes.setFilter(jtf.getText()); } + @Override public void changedUpdate(DocumentEvent e) { classes.setFilter(jtf.getText()); } }); jtf.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { selectedClass = classes.getSelectedValuesList(); startApp(selectedClass); @@ -492,6 +503,7 @@ public void actionPerformed(ActionEvent e) { final JCheckBox showSettingCheck = new JCheckBox("Show Setting"); showSettingCheck.setSelected(true); showSettingCheck.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { showSetting = showSettingCheck.isSelected(); } diff --git a/jme3-examples/src/main/java/jme3test/animation/TestCameraMotionPath.java b/jme3-examples/src/main/java/jme3test/animation/TestCameraMotionPath.java index 392792ac2c..24292ea96c 100644 --- a/jme3-examples/src/main/java/jme3test/animation/TestCameraMotionPath.java +++ b/jme3-examples/src/main/java/jme3test/animation/TestCameraMotionPath.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -99,6 +99,7 @@ public void simpleInitApp() { path.addListener(new MotionPathListener() { + @Override public void onWayPointReach(MotionEvent control, int wayPointIndex) { if (path.getNbWayPoints() == wayPointIndex + 1) { wayPointsText.setText(control.getSpatial().getName() + " Finish!!! "); @@ -156,6 +157,7 @@ private void initInputs() { inputManager.addMapping("play_stop", new KeyTrigger(KeyInput.KEY_SPACE)); ActionListener acl = new ActionListener() { + @Override public void onAction(String name, boolean keyPressed, float tpf) { if (name.equals("display_hidePath") && keyPressed) { if (active) { diff --git a/jme3-examples/src/main/java/jme3test/animation/TestCinematic.java b/jme3-examples/src/main/java/jme3test/animation/TestCinematic.java index 8332ffafe2..ab4bd3bd77 100644 --- a/jme3-examples/src/main/java/jme3test/animation/TestCinematic.java +++ b/jme3-examples/src/main/java/jme3test/animation/TestCinematic.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -148,15 +148,18 @@ public void simpleInitApp() { cinematic.addListener(new CinematicEventListener() { + @Override public void onPlay(CinematicEvent cinematic) { chaseCam.setEnabled(false); System.out.println("play"); } + @Override public void onPause(CinematicEvent cinematic) { System.out.println("pause"); } + @Override public void onStop(CinematicEvent cinematic) { chaseCam.setEnabled(true); fade.setValue(1); @@ -244,6 +247,7 @@ private void initInputs() { inputManager.addMapping("navBack", new KeyTrigger(keyInput.KEY_LEFT)); ActionListener acl = new ActionListener() { + @Override public void onAction(String name, boolean keyPressed, float tpf) { if (name.equals("togglePause") && keyPressed) { if (cinematic.getPlayState() == PlayState.Playing) { diff --git a/jme3-examples/src/main/java/jme3test/animation/TestJaime.java b/jme3-examples/src/main/java/jme3test/animation/TestJaime.java index 330788d089..68de198d11 100644 --- a/jme3-examples/src/main/java/jme3test/animation/TestJaime.java +++ b/jme3-examples/src/main/java/jme3test/animation/TestJaime.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -212,6 +212,7 @@ public void setupInput() { inputManager.addMapping("start", new KeyTrigger(KeyInput.KEY_PAUSE)); inputManager.addListener(new ActionListener() { + @Override public void onAction(String name, boolean isPressed, float tpf) { if(name.equals("start") && isPressed){ if(cinematic.getPlayState() != PlayState.Playing){ diff --git a/jme3-examples/src/main/java/jme3test/animation/TestMotionPath.java b/jme3-examples/src/main/java/jme3test/animation/TestMotionPath.java index 02bc5335c9..79453cafc7 100644 --- a/jme3-examples/src/main/java/jme3test/animation/TestMotionPath.java +++ b/jme3-examples/src/main/java/jme3test/animation/TestMotionPath.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -92,6 +92,7 @@ public void simpleInitApp() { path.addListener(new MotionPathListener() { + @Override public void onWayPointReach(MotionEvent control, int wayPointIndex) { if (path.getNbWayPoints() == wayPointIndex + 1) { wayPointsText.setText(control.getSpatial().getName() + "Finished!!! "); @@ -153,6 +154,7 @@ private void initInputs() { inputManager.addMapping("play_stop", new KeyTrigger(KeyInput.KEY_SPACE)); ActionListener acl = new ActionListener() { + @Override public void onAction(String name, boolean keyPressed, float tpf) { if (name.equals("display_hidePath") && keyPressed) { if (active) { diff --git a/jme3-examples/src/main/java/jme3test/app/TestCloner.java b/jme3-examples/src/main/java/jme3test/app/TestCloner.java index 4ae105603b..7c5f6fe384 100644 --- a/jme3-examples/src/main/java/jme3test/app/TestCloner.java +++ b/jme3-examples/src/main/java/jme3test/app/TestCloner.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 jMonkeyEngine + * Copyright (c) 2016-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -125,6 +125,7 @@ public RegularObject( int i ) { this.i = i; } + @Override public RegularObject clone() { try { return (RegularObject)super.clone(); @@ -133,6 +134,7 @@ public RegularObject clone() { } } + @Override public String toString() { return getClass().getSimpleName() + "@" + System.identityHashCode(this) + "[i=" + i + "]"; @@ -147,6 +149,7 @@ public RegularSubclass( int i, String name ) { this.name = name; } + @Override public String toString() { return getClass().getSimpleName() + "@" + System.identityHashCode(this) + "[i=" + i + ", name=" + name + "]"; @@ -163,6 +166,7 @@ public Parent( String name, int age ) { this.rsc = new RegularSubclass(age, name); } + @Override public Parent clone() { try { return (Parent)super.clone(); @@ -171,17 +175,20 @@ public Parent clone() { } } + @Override public Parent jmeClone() { // Ok to delegate to clone() in this case because no deep // cloning is done there. return clone(); } + @Override public void cloneFields( Cloner cloner, Object original ) { this.ro = cloner.clone(ro); this.rsc = cloner.clone(rsc); } + @Override public String toString() { return getClass().getSimpleName() + "@" + System.identityHashCode(this) + "[ro=" + ro + ", rsc=" + rsc + "]"; @@ -230,6 +237,7 @@ public List getLinks() { return links; } + @Override public GraphNode jmeClone() { try { return (GraphNode)super.clone(); @@ -238,10 +246,12 @@ public GraphNode jmeClone() { } } + @Override public void cloneFields( Cloner cloner, Object original ) { this.links = cloner.clone(links); } + @Override public String toString() { return getClass().getSimpleName() + "@" + System.identityHashCode(this) + "[name=" + name + "]"; @@ -273,6 +283,7 @@ public ArrayHolder( int... values ) { } } + @Override public ArrayHolder jmeClone() { try { return (ArrayHolder)super.clone(); @@ -281,6 +292,7 @@ public ArrayHolder jmeClone() { } } + @Override public void cloneFields( Cloner cloner, Object original ) { intArray = cloner.clone(intArray); intArray2D = cloner.clone(intArray2D); @@ -294,6 +306,7 @@ public void cloneFields( Cloner cloner, Object original ) { //strings = cloner.clone(strings); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("intArray=" + intArray); diff --git a/jme3-examples/src/main/java/jme3test/app/TestEnqueueRunnable.java b/jme3-examples/src/main/java/jme3test/app/TestEnqueueRunnable.java index 88ce27732d..c790d860da 100644 --- a/jme3-examples/src/main/java/jme3test/app/TestEnqueueRunnable.java +++ b/jme3-examples/src/main/java/jme3test/app/TestEnqueueRunnable.java @@ -48,9 +48,11 @@ public Thread getThread(){ return thread; } + @Override public void run(){ while(running){ enqueue(new Runnable(){ //primary usage of this in real applications would use lambda expressions which are unavailable at java 6 + @Override public void run(){ material.setColor("Color", ColorRGBA.randomColor()); } diff --git a/jme3-examples/src/main/java/jme3test/app/TestResizableApp.java b/jme3-examples/src/main/java/jme3test/app/TestResizableApp.java index d2314b989d..f0d410352d 100644 --- a/jme3-examples/src/main/java/jme3test/app/TestResizableApp.java +++ b/jme3-examples/src/main/java/jme3test/app/TestResizableApp.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2015 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -56,6 +56,7 @@ public static void main(String[] args){ app.start(); } + @Override public void reshape(int width, int height) { super.reshape(width, height); @@ -65,6 +66,7 @@ public void reshape(int width, int height) { "Current Size: " + settings.getWidth() + "x" + settings.getHeight()); } + @Override public void simpleInitApp() { flyCam.setDragToRotate(true); diff --git a/jme3-examples/src/main/java/jme3test/asset/TestAssetCache.java b/jme3-examples/src/main/java/jme3test/asset/TestAssetCache.java index 2f86e9abf8..da7114ba65 100644 --- a/jme3-examples/src/main/java/jme3test/asset/TestAssetCache.java +++ b/jme3-examples/src/main/java/jme3test/asset/TestAssetCache.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -73,10 +73,12 @@ public byte[] getData(){ return data; } + @Override public AssetKey getKey() { return key; } + @Override public void setKey(AssetKey key) { this.key = key; } diff --git a/jme3-examples/src/main/java/jme3test/asset/TextLoader.java b/jme3-examples/src/main/java/jme3test/asset/TextLoader.java index 27cf33995f..f9d0481c4b 100644 --- a/jme3-examples/src/main/java/jme3test/asset/TextLoader.java +++ b/jme3-examples/src/main/java/jme3test/asset/TextLoader.java @@ -10,6 +10,7 @@ * files as strings. */ public class TextLoader implements AssetLoader { + @Override public Object load(AssetInfo assetInfo) throws IOException { Scanner scan = new Scanner(assetInfo.openStream()); StringBuilder sb = new StringBuilder(); diff --git a/jme3-examples/src/main/java/jme3test/audio/TestMusicPlayer.java b/jme3-examples/src/main/java/jme3test/audio/TestMusicPlayer.java index 50fe7456a6..265e1ab74a 100644 --- a/jme3-examples/src/main/java/jme3test/audio/TestMusicPlayer.java +++ b/jme3-examples/src/main/java/jme3test/audio/TestMusicPlayer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -90,6 +90,7 @@ private void initComponents() { setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); addWindowListener(new java.awt.event.WindowAdapter() { + @Override public void windowClosing(java.awt.event.WindowEvent evt) { formWindowClosing(evt); } @@ -102,6 +103,7 @@ public void windowClosing(java.awt.event.WindowEvent evt) { sldVolume.setPaintTicks(true); sldVolume.setValue(100); sldVolume.addChangeListener(new javax.swing.event.ChangeListener() { + @Override public void stateChanged(javax.swing.event.ChangeEvent evt) { sldVolumeStateChanged(evt); } @@ -113,6 +115,7 @@ public void stateChanged(javax.swing.event.ChangeEvent evt) { btnStop.setText("[ ]"); btnStop.addActionListener(new java.awt.event.ActionListener() { + @Override public void actionPerformed(java.awt.event.ActionEvent evt) { btnStopActionPerformed(evt); } @@ -121,6 +124,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { btnPlay.setText("II / >"); btnPlay.addActionListener(new java.awt.event.ActionListener() { + @Override public void actionPerformed(java.awt.event.ActionEvent evt) { btnPlayActionPerformed(evt); } @@ -129,6 +133,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { btnFF.setText(">>"); btnFF.addActionListener(new java.awt.event.ActionListener() { + @Override public void actionPerformed(java.awt.event.ActionEvent evt) { btnFFActionPerformed(evt); } @@ -137,6 +142,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { btnOpen.setText("Open ..."); btnOpen.addActionListener(new java.awt.event.ActionListener() { + @Override public void actionPerformed(java.awt.event.ActionEvent evt) { btnOpenActionPerformed(evt); } @@ -153,6 +159,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { sldBar.setValue(0); sldBar.addChangeListener(new javax.swing.event.ChangeListener() { + @Override public void stateChanged(javax.swing.event.ChangeEvent evt) { sldBarStateChanged(evt); } @@ -239,7 +246,7 @@ private void formWindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:even }//GEN-LAST:event_formWindowClosing private void sldVolumeStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_sldVolumeStateChanged - listener.setVolume( (float) sldVolume.getValue() / 100f); + listener.setVolume(sldVolume.getValue() / 100f); ar.setListener(listener); }//GEN-LAST:event_sldVolumeStateChanged @@ -276,6 +283,7 @@ private void sldBarStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST: */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { + @Override public void run() { new TestMusicPlayer().setVisible(true); } diff --git a/jme3-examples/src/main/java/jme3test/awt/AppHarness.java b/jme3-examples/src/main/java/jme3test/awt/AppHarness.java index 77e8d7092c..34d6c05226 100644 --- a/jme3-examples/src/main/java/jme3test/awt/AppHarness.java +++ b/jme3-examples/src/main/java/jme3test/awt/AppHarness.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -138,6 +138,7 @@ public void stop(){ public void destroy(){ System.out.println("applet:destroyStart"); SwingUtilities.invokeLater(new Runnable(){ + @Override public void run(){ removeAll(); System.out.println("applet:destroyRemoved"); diff --git a/jme3-examples/src/main/java/jme3test/awt/TestApplet.java b/jme3-examples/src/main/java/jme3test/awt/TestApplet.java index 8ac4b7f0a9..9f052fc50d 100644 --- a/jme3-examples/src/main/java/jme3test/awt/TestApplet.java +++ b/jme3-examples/src/main/java/jme3test/awt/TestApplet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -85,6 +85,7 @@ public static void startApp(){ app.startCanvas(); app.enqueue(new Callable(){ + @Override public Void call(){ if (app instanceof SimpleApplication){ SimpleApplication simpleApp = (SimpleApplication) app; @@ -133,6 +134,7 @@ public void stop(){ @Override public void destroy(){ SwingUtilities.invokeLater(new Runnable(){ + @Override public void run(){ removeAll(); System.out.println("applet:destroyStart"); diff --git a/jme3-examples/src/main/java/jme3test/awt/TestAwtPanels.java b/jme3-examples/src/main/java/jme3test/awt/TestAwtPanels.java index 55d74e1197..d8c6aa8c92 100644 --- a/jme3-examples/src/main/java/jme3test/awt/TestAwtPanels.java +++ b/jme3-examples/src/main/java/jme3test/awt/TestAwtPanels.java @@ -56,6 +56,7 @@ public static void main(String[] args){ app.start(); SwingUtilities.invokeLater(new Runnable(){ + @Override public void run(){ /* * Sleep 2 seconds to ensure there's no race condition. diff --git a/jme3-examples/src/main/java/jme3test/awt/TestCanvas.java b/jme3-examples/src/main/java/jme3test/awt/TestCanvas.java index be4e5e8f6f..019fee4062 100644 --- a/jme3-examples/src/main/java/jme3test/awt/TestCanvas.java +++ b/jme3-examples/src/main/java/jme3test/awt/TestCanvas.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -88,6 +88,7 @@ private static void createMenu(){ final JMenuItem itemRemoveCanvas = new JMenuItem("Remove Canvas"); menuTortureMethods.add(itemRemoveCanvas); itemRemoveCanvas.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { if (itemRemoveCanvas.getText().equals("Remove Canvas")){ currentPanel.remove(canvas); @@ -104,6 +105,7 @@ public void actionPerformed(ActionEvent e) { final JMenuItem itemHideCanvas = new JMenuItem("Hide Canvas"); menuTortureMethods.add(itemHideCanvas); itemHideCanvas.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { if (itemHideCanvas.getText().equals("Hide Canvas")){ canvas.setVisible(false); @@ -118,6 +120,7 @@ public void actionPerformed(ActionEvent e) { final JMenuItem itemSwitchTab = new JMenuItem("Switch to tab #2"); menuTortureMethods.add(itemSwitchTab); itemSwitchTab.addActionListener(new ActionListener(){ + @Override public void actionPerformed(ActionEvent e){ if (itemSwitchTab.getText().equals("Switch to tab #2")){ canvasPanel1.remove(canvas); @@ -136,6 +139,7 @@ public void actionPerformed(ActionEvent e){ JMenuItem itemSwitchLaf = new JMenuItem("Switch Look and Feel"); menuTortureMethods.add(itemSwitchLaf); itemSwitchLaf.addActionListener(new ActionListener(){ + @Override public void actionPerformed(ActionEvent e){ try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); @@ -150,6 +154,7 @@ public void actionPerformed(ActionEvent e){ JMenuItem itemSmallSize = new JMenuItem("Set size to (0, 0)"); menuTortureMethods.add(itemSmallSize); itemSmallSize.addActionListener(new ActionListener(){ + @Override public void actionPerformed(ActionEvent e){ Dimension preferred = frame.getPreferredSize(); frame.setPreferredSize(new Dimension(0, 0)); @@ -161,6 +166,7 @@ public void actionPerformed(ActionEvent e){ JMenuItem itemKillCanvas = new JMenuItem("Stop/Start Canvas"); menuTortureMethods.add(itemKillCanvas); itemKillCanvas.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { currentPanel.remove(canvas); app.stop(true); @@ -175,6 +181,7 @@ public void actionPerformed(ActionEvent e) { JMenuItem itemExit = new JMenuItem("Exit"); menuTortureMethods.add(itemExit); itemExit.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent ae) { frame.dispose(); app.stop(); @@ -225,6 +232,7 @@ public static void createCanvas(String appClass){ public static void startApp(){ app.startCanvas(); app.enqueue(new Callable(){ + @Override public Void call(){ if (app instanceof SimpleApplication){ SimpleApplication simpleApp = (SimpleApplication) app; @@ -253,6 +261,7 @@ public static void main(String[] args){ } SwingUtilities.invokeLater(new Runnable(){ + @Override public void run(){ JPopupMenu.setDefaultLightWeightPopupEnabled(false); diff --git a/jme3-examples/src/main/java/jme3test/batching/TestBatchNodeCluster.java b/jme3-examples/src/main/java/jme3test/batching/TestBatchNodeCluster.java index 9430aa368a..5f9f65777e 100644 --- a/jme3-examples/src/main/java/jme3test/batching/TestBatchNodeCluster.java +++ b/jme3-examples/src/main/java/jme3test/batching/TestBatchNodeCluster.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -65,6 +65,7 @@ public static void main(String[] args) { } private ActionListener al = new ActionListener() { + @Override public void onAction(String name, boolean isPressed, float tpf) { if (name.equals("Start Game")) { // randomGenerator(); diff --git a/jme3-examples/src/main/java/jme3test/batching/TestBatchNodeTower.java b/jme3-examples/src/main/java/jme3test/batching/TestBatchNodeTower.java index a13dc6168f..655bd79793 100644 --- a/jme3-examples/src/main/java/jme3test/batching/TestBatchNodeTower.java +++ b/jme3-examples/src/main/java/jme3test/batching/TestBatchNodeTower.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -141,6 +141,7 @@ private PhysicsSpace getPhysicsSpace() { } private ActionListener actionListener = new ActionListener() { + @Override public void onAction(String name, boolean keyPressed, float tpf) { if (name.equals("shoot") && !keyPressed) { Geometry bulletg = new Geometry("bullet", bullet); diff --git a/jme3-examples/src/main/java/jme3test/bullet/BombControl.java b/jme3-examples/src/main/java/jme3test/bullet/BombControl.java index 4d9af6a456..83cecdd77b 100644 --- a/jme3-examples/src/main/java/jme3test/bullet/BombControl.java +++ b/jme3-examples/src/main/java/jme3test/bullet/BombControl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -81,6 +81,7 @@ public BombControl(AssetManager manager, CollisionShape shape, float mass) { prepareEffect(manager); } + @Override public void setPhysicsSpace(PhysicsSpace space) { super.setPhysicsSpace(space); if (space != null) { @@ -93,7 +94,7 @@ private void prepareEffect(AssetManager assetManager) { float COUNT_FACTOR_F = 1f; effect = new ParticleEmitter("Flame", Type.Triangle, 32 * COUNT_FACTOR); effect.setSelectRandomImage(true); - effect.setStartColor(new ColorRGBA(1f, 0.4f, 0.05f, (float) (1f / COUNT_FACTOR_F))); + effect.setStartColor(new ColorRGBA(1f, 0.4f, 0.05f, (1f / COUNT_FACTOR_F))); effect.setEndColor(new ColorRGBA(.4f, .22f, .12f, 0f)); effect.setStartSize(1.3f); effect.setEndSize(2f); @@ -116,6 +117,7 @@ protected void createGhostObject() { ghostObject = new PhysicsGhostObject(new SphereCollisionShape(explosionRadius)); } + @Override public void collision(PhysicsCollisionEvent event) { if (space == null) { return; @@ -135,10 +137,12 @@ public void collision(PhysicsCollisionEvent event) { } } + @Override public void prePhysicsTick(PhysicsSpace space, float f) { space.removeCollisionListener(this); } + @Override public void physicsTick(PhysicsSpace space, float f) { //get all overlapping objects and apply impulse to them for (Iterator it = ghostObject.getOverlappingObjects().iterator(); it.hasNext();) { diff --git a/jme3-examples/src/main/java/jme3test/bullet/PhysicsHoverControl.java b/jme3-examples/src/main/java/jme3test/bullet/PhysicsHoverControl.java index 901b3433c3..f1a5139bfc 100644 --- a/jme3-examples/src/main/java/jme3test/bullet/PhysicsHoverControl.java +++ b/jme3-examples/src/main/java/jme3test/bullet/PhysicsHoverControl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -112,6 +112,7 @@ public void cloneFields( Cloner cloner, Object original ) { throw new UnsupportedOperationException("Not yet implemented."); } + @Override public void setSpatial(Spatial spatial) { this.spatial = spatial; setUserObject(spatial); @@ -122,10 +123,12 @@ public void setSpatial(Spatial spatial) { setPhysicsRotation(spatial.getWorldRotation().toRotationMatrix()); } + @Override public void setEnabled(boolean enabled) { this.enabled = enabled; } + @Override public boolean isEnabled() { return enabled; } @@ -140,6 +143,7 @@ private void createWheels() { } } + @Override public void prePhysicsTick(PhysicsSpace space, float f) { Vector3f angVel = getAngularVelocity(); float rotationVelocity = angVel.getY(); @@ -183,18 +187,22 @@ public void prePhysicsTick(PhysicsSpace space, float f) { } } + @Override public void physicsTick(PhysicsSpace space, float f) { } + @Override public void update(float tpf) { if (enabled && spatial != null) { getMotionState().applyTransform(spatial); } } + @Override public void render(RenderManager rm, ViewPort vp) { } + @Override public void setPhysicsSpace(PhysicsSpace space) { createVehicle(space); if (space == null) { @@ -210,6 +218,7 @@ public void setPhysicsSpace(PhysicsSpace space) { this.space = space; } + @Override public PhysicsSpace getPhysicsSpace() { return space; } diff --git a/jme3-examples/src/main/java/jme3test/bullet/PhysicsTestHelper.java b/jme3-examples/src/main/java/jme3test/bullet/PhysicsTestHelper.java index 4d8a5a92f9..610e230495 100644 --- a/jme3-examples/src/main/java/jme3test/bullet/PhysicsTestHelper.java +++ b/jme3-examples/src/main/java/jme3test/bullet/PhysicsTestHelper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -225,6 +225,7 @@ public static Node createPhysicsTestNode(AssetManager manager, CollisionShape sh public static void createBallShooter(final Application app, final Node rootNode, final PhysicsSpace space) { ActionListener actionListener = new ActionListener() { + @Override public void onAction(String name, boolean keyPressed, float tpf) { Sphere bullet = new Sphere(32, 32, 0.4f, true, false); bullet.setTextureMode(TextureMode.Projected); diff --git a/jme3-examples/src/main/java/jme3test/bullet/TestAttachDriver.java b/jme3-examples/src/main/java/jme3test/bullet/TestAttachDriver.java index 1de5b01189..af6c272de5 100644 --- a/jme3-examples/src/main/java/jme3test/bullet/TestAttachDriver.java +++ b/jme3-examples/src/main/java/jme3test/bullet/TestAttachDriver.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -244,6 +244,7 @@ public void simpleUpdate(float tpf) { cam.lookAt(vehicle.getPhysicsLocation(), Vector3f.UNIT_Y); } + @Override public void onAction(String binding, boolean value, float tpf) { if (binding.equals("Lefts")) { if (value) { diff --git a/jme3-examples/src/main/java/jme3test/bullet/TestAttachGhostObject.java b/jme3-examples/src/main/java/jme3test/bullet/TestAttachGhostObject.java index 5fac3fc5f2..0f3f2f1e5c 100644 --- a/jme3-examples/src/main/java/jme3test/bullet/TestAttachGhostObject.java +++ b/jme3-examples/src/main/java/jme3test/bullet/TestAttachGhostObject.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -71,6 +71,7 @@ private void setupKeys() { inputManager.addListener(this, "Lefts", "Rights", "Space"); } + @Override public void onAnalog(String binding, float value, float tpf) { if (binding.equals("Lefts")) { joint.enableMotor(true, 1, .1f); diff --git a/jme3-examples/src/main/java/jme3test/bullet/TestBetterCharacter.java b/jme3-examples/src/main/java/jme3test/bullet/TestBetterCharacter.java index 4a86f8219d..e4eb5f25ef 100644 --- a/jme3-examples/src/main/java/jme3test/bullet/TestBetterCharacter.java +++ b/jme3-examples/src/main/java/jme3test/bullet/TestBetterCharacter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -198,6 +198,7 @@ private PhysicsSpace getPhysicsSpace() { return bulletAppState.getPhysicsSpace(); } + @Override public void onAction(String binding, boolean value, float tpf) { if (binding.equals("Strafe Left")) { if (value) { diff --git a/jme3-examples/src/main/java/jme3test/bullet/TestBrickTower.java b/jme3-examples/src/main/java/jme3test/bullet/TestBrickTower.java index feffac8e6e..136fb51897 100644 --- a/jme3-examples/src/main/java/jme3test/bullet/TestBrickTower.java +++ b/jme3-examples/src/main/java/jme3test/bullet/TestBrickTower.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -142,6 +142,7 @@ private PhysicsSpace getPhysicsSpace() { } private ActionListener actionListener = new ActionListener() { + @Override public void onAction(String name, boolean keyPressed, float tpf) { if (name.equals("shoot") && !keyPressed) { Geometry bulletg = new Geometry("bullet", bullet); diff --git a/jme3-examples/src/main/java/jme3test/bullet/TestBrickWall.java b/jme3-examples/src/main/java/jme3test/bullet/TestBrickWall.java index ce61e355e6..9b36c8f966 100644 --- a/jme3-examples/src/main/java/jme3test/bullet/TestBrickWall.java +++ b/jme3-examples/src/main/java/jme3test/bullet/TestBrickWall.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -111,6 +111,7 @@ private PhysicsSpace getPhysicsSpace() { } private ActionListener actionListener = new ActionListener() { + @Override public void onAction(String name, boolean keyPressed, float tpf) { if (name.equals("shoot") && !keyPressed) { Geometry bulletg = new Geometry("bullet", bullet); diff --git a/jme3-examples/src/main/java/jme3test/bullet/TestCcd.java b/jme3-examples/src/main/java/jme3test/bullet/TestCcd.java index 58cb77c650..b20752f296 100644 --- a/jme3-examples/src/main/java/jme3test/bullet/TestCcd.java +++ b/jme3-examples/src/main/java/jme3test/bullet/TestCcd.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -125,6 +125,7 @@ public void simpleRender(RenderManager rm) { //TODO: add render code } + @Override public void onAction(String binding, boolean value, float tpf) { if (binding.equals("shoot") && !value) { Geometry bulletg = new Geometry("bullet", bullet); diff --git a/jme3-examples/src/main/java/jme3test/bullet/TestCollisionListener.java b/jme3-examples/src/main/java/jme3test/bullet/TestCollisionListener.java index 3c9450f3d2..04b5039d4d 100644 --- a/jme3-examples/src/main/java/jme3test/bullet/TestCollisionListener.java +++ b/jme3-examples/src/main/java/jme3test/bullet/TestCollisionListener.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -87,6 +87,7 @@ public void simpleRender(RenderManager rm) { //TODO: add render code } + @Override public void collision(PhysicsCollisionEvent event) { if ("Box".equals(event.getNodeA().getName()) || "Box".equals(event.getNodeB().getName())) { if ("bullet".equals(event.getNodeA().getName()) || "bullet".equals(event.getNodeB().getName())) { diff --git a/jme3-examples/src/main/java/jme3test/bullet/TestFancyCar.java b/jme3-examples/src/main/java/jme3test/bullet/TestFancyCar.java index 3803c4c5d4..8f56e91196 100644 --- a/jme3-examples/src/main/java/jme3test/bullet/TestFancyCar.java +++ b/jme3-examples/src/main/java/jme3test/bullet/TestFancyCar.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -209,6 +209,7 @@ private void buildPlayer() { getPhysicsSpace().add(player); } + @Override public void onAction(String binding, boolean value, float tpf) { if (binding.equals("Lefts")) { if (value) { diff --git a/jme3-examples/src/main/java/jme3test/bullet/TestHoveringTank.java b/jme3-examples/src/main/java/jme3test/bullet/TestHoveringTank.java index 922ce973b2..06137cbb48 100644 --- a/jme3-examples/src/main/java/jme3test/bullet/TestHoveringTank.java +++ b/jme3-examples/src/main/java/jme3test/bullet/TestHoveringTank.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -200,9 +200,11 @@ public void makeMissile() { getPhysicsSpace().add(missile); } + @Override public void onAnalog(String binding, float value, float tpf) { } + @Override public void onAction(String binding, boolean value, float tpf) { if (binding.equals("Lefts")) { hoverControl.steer(value ? 50f : 0); diff --git a/jme3-examples/src/main/java/jme3test/bullet/TestPhysicsCar.java b/jme3-examples/src/main/java/jme3test/bullet/TestPhysicsCar.java index 4ba4e060be..39164e962f 100644 --- a/jme3-examples/src/main/java/jme3test/bullet/TestPhysicsCar.java +++ b/jme3-examples/src/main/java/jme3test/bullet/TestPhysicsCar.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -177,6 +177,7 @@ public void simpleUpdate(float tpf) { cam.lookAt(vehicle.getPhysicsLocation(), Vector3f.UNIT_Y); } + @Override public void onAction(String binding, boolean value, float tpf) { if (binding.equals("Lefts")) { if (value) { diff --git a/jme3-examples/src/main/java/jme3test/bullet/TestPhysicsCharacter.java b/jme3-examples/src/main/java/jme3test/bullet/TestPhysicsCharacter.java index 3a75ad5120..4dea7438db 100644 --- a/jme3-examples/src/main/java/jme3test/bullet/TestPhysicsCharacter.java +++ b/jme3-examples/src/main/java/jme3test/bullet/TestPhysicsCharacter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine All rights reserved.

+ * Copyright (c) 2009-2020 jMonkeyEngine All rights reserved.

* Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * @@ -154,6 +154,7 @@ public void simpleUpdate(float tpf) { physicsCharacter.setViewDirection(viewDirection); } + @Override public void onAction(String binding, boolean value, float tpf) { if (binding.equals("Strafe Left")) { if (value) { diff --git a/jme3-examples/src/main/java/jme3test/bullet/TestPhysicsHingeJoint.java b/jme3-examples/src/main/java/jme3test/bullet/TestPhysicsHingeJoint.java index 029892ad96..12b18af865 100644 --- a/jme3-examples/src/main/java/jme3test/bullet/TestPhysicsHingeJoint.java +++ b/jme3-examples/src/main/java/jme3test/bullet/TestPhysicsHingeJoint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -60,6 +60,7 @@ private void setupKeys() { inputManager.addListener(this, "Left", "Right", "Swing"); } + @Override public void onAnalog(String binding, float value, float tpf) { if(binding.equals("Left")){ joint.enableMotor(true, 1, .1f); diff --git a/jme3-examples/src/main/java/jme3test/bullet/TestQ3.java b/jme3-examples/src/main/java/jme3test/bullet/TestQ3.java index 01d0c9ade9..c38b89b9f6 100644 --- a/jme3-examples/src/main/java/jme3test/bullet/TestQ3.java +++ b/jme3-examples/src/main/java/jme3test/bullet/TestQ3.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -70,6 +70,7 @@ public static void main(String[] args) { app.start(); } + @Override public void simpleInitApp() { bulletAppState = new BulletAppState(); stateManager.attach(bulletAppState); @@ -152,6 +153,7 @@ private void setupKeys() { inputManager.addListener(this,"Space"); } + @Override public void onAction(String binding, boolean value, float tpf) { if (binding.equals("Lefts")) { diff --git a/jme3-examples/src/main/java/jme3test/bullet/TestRagDoll.java b/jme3-examples/src/main/java/jme3test/bullet/TestRagDoll.java index 2752ce5a89..bc7001b661 100644 --- a/jme3-examples/src/main/java/jme3test/bullet/TestRagDoll.java +++ b/jme3-examples/src/main/java/jme3test/bullet/TestRagDoll.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -131,6 +131,7 @@ private PhysicsJoint join(Node A, Node B, Vector3f connectionPoint) { return joint; } + @Override public void onAction(String string, boolean bln, float tpf) { if ("Pull ragdoll up".equals(string)) { if (bln) { diff --git a/jme3-examples/src/main/java/jme3test/bullet/TestWalkingChar.java b/jme3-examples/src/main/java/jme3test/bullet/TestWalkingChar.java index 532052da07..503f0bd519 100644 --- a/jme3-examples/src/main/java/jme3test/bullet/TestWalkingChar.java +++ b/jme3-examples/src/main/java/jme3test/bullet/TestWalkingChar.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -202,7 +202,7 @@ private void prepareEffect() { float COUNT_FACTOR_F = 1f; effect = new ParticleEmitter("Flame", Type.Triangle, 32 * COUNT_FACTOR); effect.setSelectRandomImage(true); - effect.setStartColor(new ColorRGBA(1f, 0.4f, 0.05f, (float) (1f / COUNT_FACTOR_F))); + effect.setStartColor(new ColorRGBA(1f, 0.4f, 0.05f, (1f / COUNT_FACTOR_F))); effect.setEndColor(new ColorRGBA(.4f, .22f, .12f, 0f)); effect.setStartSize(1.3f); effect.setEndSize(2f); @@ -355,6 +355,7 @@ public void simpleUpdate(float tpf) { character.setWalkDirection(walkDirection); } + @Override public void onAction(String binding, boolean value, float tpf) { if (binding.equals("CharLeft")) { if (value) { @@ -402,6 +403,7 @@ private void bulletControl() { getPhysicsSpace().add(bulletControl); } + @Override public void collision(PhysicsCollisionEvent event) { if (event.getObjectA() instanceof BombControl) { final Spatial node = event.getNodeA(); @@ -416,12 +418,14 @@ public void collision(PhysicsCollisionEvent event) { } } + @Override public void onAnimCycleDone(AnimControl control, AnimChannel channel, String animName) { if (channel == shootingChannel) { channel.setAnim("stand"); } } + @Override public void onAnimChange(AnimControl control, AnimChannel channel, String animName) { } } diff --git a/jme3-examples/src/main/java/jme3test/collision/TestRayCasting.java b/jme3-examples/src/main/java/jme3test/collision/TestRayCasting.java index 06b07e87b8..e3c1ba136b 100644 --- a/jme3-examples/src/main/java/jme3test/collision/TestRayCasting.java +++ b/jme3-examples/src/main/java/jme3test/collision/TestRayCasting.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -56,7 +56,7 @@ public void simpleInitApp() { // flyCam.setEnabled(false); // load material - Material mat = (Material) assetManager.loadMaterial("Interface/Logo/Logo.j3m"); + Material mat = assetManager.loadMaterial("Interface/Logo/Logo.j3m"); Mesh q = new Mesh(); q.setBuffer(Type.Position, 3, new float[] diff --git a/jme3-examples/src/main/java/jme3test/collision/TestTriangleCollision.java b/jme3-examples/src/main/java/jme3test/collision/TestTriangleCollision.java index e28d7c7685..cf1885673c 100644 --- a/jme3-examples/src/main/java/jme3test/collision/TestTriangleCollision.java +++ b/jme3-examples/src/main/java/jme3test/collision/TestTriangleCollision.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -92,6 +92,7 @@ public void simpleInitApp() { } private AnalogListener analogListener = new AnalogListener() { + @Override public void onAnalog(String name, float value, float tpf) { if (name.equals("MoveRight")) { geom1.move(2 * tpf, 0, 0); diff --git a/jme3-examples/src/main/java/jme3test/effect/TestExplosionEffect.java b/jme3-examples/src/main/java/jme3test/effect/TestExplosionEffect.java index ff5100ffed..04e5d23ab8 100644 --- a/jme3-examples/src/main/java/jme3test/effect/TestExplosionEffect.java +++ b/jme3-examples/src/main/java/jme3test/effect/TestExplosionEffect.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -66,7 +66,7 @@ public static void main(String[] args){ private void createFlame(){ flame = new ParticleEmitter("Flame", EMITTER_TYPE, 32 * COUNT_FACTOR); flame.setSelectRandomImage(true); - flame.setStartColor(new ColorRGBA(1f, 0.4f, 0.05f, (float) (1f / COUNT_FACTOR_F))); + flame.setStartColor(new ColorRGBA(1f, 0.4f, 0.05f, (1f / COUNT_FACTOR_F))); flame.setEndColor(new ColorRGBA(.4f, .22f, .12f, 0f)); flame.setStartSize(1.3f); flame.setEndSize(2f); @@ -89,7 +89,7 @@ private void createFlame(){ private void createFlash(){ flash = new ParticleEmitter("Flash", EMITTER_TYPE, 24 * COUNT_FACTOR); flash.setSelectRandomImage(true); - flash.setStartColor(new ColorRGBA(1f, 0.8f, 0.36f, (float) (1f / COUNT_FACTOR_F))); + flash.setStartColor(new ColorRGBA(1f, 0.8f, 0.36f, 1f / COUNT_FACTOR_F)); flash.setEndColor(new ColorRGBA(1f, 0.8f, 0.36f, 0f)); flash.setStartSize(.1f); flash.setEndSize(3.0f); @@ -113,7 +113,7 @@ private void createFlash(){ private void createRoundSpark(){ roundspark = new ParticleEmitter("RoundSpark", EMITTER_TYPE, 20 * COUNT_FACTOR); roundspark.setStartColor(new ColorRGBA(1f, 0.29f, 0.34f, (float) (1.0 / COUNT_FACTOR_F))); - roundspark.setEndColor(new ColorRGBA(0, 0, 0, (float) (0.5f / COUNT_FACTOR_F))); + roundspark.setEndColor(new ColorRGBA(0, 0, 0, 0.5f / COUNT_FACTOR_F)); roundspark.setStartSize(1.2f); roundspark.setEndSize(1.8f); roundspark.setShape(new EmitterSphereShape(Vector3f.ZERO, 2f)); @@ -135,7 +135,7 @@ private void createRoundSpark(){ private void createSpark(){ spark = new ParticleEmitter("Spark", Type.Triangle, 30 * COUNT_FACTOR); - spark.setStartColor(new ColorRGBA(1f, 0.8f, 0.36f, (float) (1.0f / COUNT_FACTOR_F))); + spark.setStartColor(new ColorRGBA(1f, 0.8f, 0.36f, 1.0f / COUNT_FACTOR_F)); spark.setEndColor(new ColorRGBA(1f, 0.8f, 0.36f, 0f)); spark.setStartSize(.5f); spark.setEndSize(.5f); @@ -156,7 +156,7 @@ private void createSpark(){ private void createSmokeTrail(){ smoketrail = new ParticleEmitter("SmokeTrail", Type.Triangle, 22 * COUNT_FACTOR); - smoketrail.setStartColor(new ColorRGBA(1f, 0.8f, 0.36f, (float) (1.0f / COUNT_FACTOR_F))); + smoketrail.setStartColor(new ColorRGBA(1f, 0.8f, 0.36f, 1.0f / COUNT_FACTOR_F)); smoketrail.setEndColor(new ColorRGBA(1f, 0.8f, 0.36f, 0f)); smoketrail.setStartSize(.2f); smoketrail.setEndSize(1f); @@ -183,7 +183,7 @@ private void createDebris(){ debris.setSelectRandomImage(true); debris.setRandomAngle(true); debris.setRotateSpeed(FastMath.TWO_PI * 4); - debris.setStartColor(new ColorRGBA(1f, 0.59f, 0.28f, (float) (1.0f / COUNT_FACTOR_F))); + debris.setStartColor(new ColorRGBA(1f, 0.59f, 0.28f, 1.0f / COUNT_FACTOR_F)); debris.setEndColor(new ColorRGBA(.5f, 0.5f, 0.5f, 0f)); debris.setStartSize(.2f); debris.setEndSize(.2f); @@ -208,7 +208,7 @@ private void createShockwave(){ shockwave = new ParticleEmitter("Shockwave", Type.Triangle, 1 * COUNT_FACTOR); // shockwave.setRandomAngle(true); shockwave.setFaceNormal(Vector3f.UNIT_Y); - shockwave.setStartColor(new ColorRGBA(.48f, 0.17f, 0.01f, (float) (.8f / COUNT_FACTOR_F))); + shockwave.setStartColor(new ColorRGBA(.48f, 0.17f, 0.01f, .8f / COUNT_FACTOR_F)); shockwave.setEndColor(new ColorRGBA(.48f, 0.17f, 0.01f, 0f)); shockwave.setStartSize(0f); diff --git a/jme3-examples/src/main/java/jme3test/effect/TestMovingParticle.java b/jme3-examples/src/main/java/jme3test/effect/TestMovingParticle.java index b38eed97a2..7aee885075 100644 --- a/jme3-examples/src/main/java/jme3test/effect/TestMovingParticle.java +++ b/jme3-examples/src/main/java/jme3test/effect/TestMovingParticle.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -74,6 +74,7 @@ public void simpleInitApp() { inputManager.addListener(new ActionListener() { + @Override public void onAction(String name, boolean isPressed, float tpf) { if ("setNum".equals(name) && isPressed) { emit.setNumParticles(1000); diff --git a/jme3-examples/src/main/java/jme3test/effect/TestPointSprite.java b/jme3-examples/src/main/java/jme3test/effect/TestPointSprite.java index 1a3e89092b..8543eba0e1 100644 --- a/jme3-examples/src/main/java/jme3test/effect/TestPointSprite.java +++ b/jme3-examples/src/main/java/jme3test/effect/TestPointSprite.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -75,6 +75,7 @@ public void simpleInitApp() { rootNode.attachChild(emit); inputManager.addListener(new ActionListener() { + @Override public void onAction(String name, boolean isPressed, float tpf) { if ("setNum".equals(name) && isPressed) { emit.setNumParticles(5000); diff --git a/jme3-examples/src/main/java/jme3test/effect/TestSoftParticles.java b/jme3-examples/src/main/java/jme3test/effect/TestSoftParticles.java index 84189e1e9f..ecc9d68f4d 100644 --- a/jme3-examples/src/main/java/jme3test/effect/TestSoftParticles.java +++ b/jme3-examples/src/main/java/jme3test/effect/TestSoftParticles.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -109,6 +109,7 @@ public void simpleInitApp() { inputManager.addListener(new ActionListener() { + @Override public void onAction(String name, boolean isPressed, float tpf) { if(isPressed && name.equals("toggle")){ // tbf.setEnabled(!tbf.isEnabled()); @@ -125,6 +126,7 @@ public void onAction(String name, boolean isPressed, float tpf) { // emit again inputManager.addListener(new ActionListener() { + @Override public void onAction(String name, boolean isPressed, float tpf) { if(isPressed && name.equals("refire")) { //fpp.removeFilter(tbf); // <-- add back in to fix diff --git a/jme3-examples/src/main/java/jme3test/export/TestAssetLinkNode.java b/jme3-examples/src/main/java/jme3test/export/TestAssetLinkNode.java index 0710a6843e..3e973bf2d6 100644 --- a/jme3-examples/src/main/java/jme3test/export/TestAssetLinkNode.java +++ b/jme3-examples/src/main/java/jme3test/export/TestAssetLinkNode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -93,7 +93,7 @@ public void simpleInitApp() { rootNode.attachChild(loaderNode); lightMdl = new Geometry("Light", new Sphere(10, 10, 0.1f)); - lightMdl.setMaterial( (Material) assetManager.loadAsset(new MaterialKey("Common/Materials/RedColor.j3m"))); + lightMdl.setMaterial(assetManager.loadAsset(new MaterialKey("Common/Materials/RedColor.j3m"))); rootNode.attachChild(lightMdl); // flourescent main light diff --git a/jme3-examples/src/main/java/jme3test/games/CubeField.java b/jme3-examples/src/main/java/jme3test/games/CubeField.java index ec4f07f504..228e97f4f2 100644 --- a/jme3-examples/src/main/java/jme3test/games/CubeField.java +++ b/jme3-examples/src/main/java/jme3test/games/CubeField.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -311,6 +311,7 @@ private void Keys() { inputManager.addListener(this, "START", "Left", "Right"); } + @Override public void onAnalog(String binding, float value, float tpf) { if (binding.equals("START") && !START){ START = true; diff --git a/jme3-examples/src/main/java/jme3test/games/WorldOfInception.java b/jme3-examples/src/main/java/jme3test/games/WorldOfInception.java index 080b3d00b3..8d784fa816 100644 --- a/jme3-examples/src/main/java/jme3test/games/WorldOfInception.java +++ b/jme3-examples/src/main/java/jme3test/games/WorldOfInception.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -164,6 +164,7 @@ private void setupFog() { viewPort.addProcessor(fpp); } + @Override public void onAnalog(String name, float value, float tpf) { Vector3f left = rootNode.getLocalRotation().mult(Vector3f.UNIT_X.negate()); Vector3f forward = rootNode.getLocalRotation().mult(Vector3f.UNIT_Z.negate()); diff --git a/jme3-examples/src/main/java/jme3test/gui/TestBitmapFontLayout.java b/jme3-examples/src/main/java/jme3test/gui/TestBitmapFontLayout.java index d2ac0e8bec..834e8062e9 100644 --- a/jme3-examples/src/main/java/jme3test/gui/TestBitmapFontLayout.java +++ b/jme3-examples/src/main/java/jme3test/gui/TestBitmapFontLayout.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 20018 jMonkeyEngine + * Copyright (c) 2018-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -240,8 +240,8 @@ protected Node createVisual( TestConfig test ) { float y1 = bb.getCenter().y - bb.getYExtent(); float y2 = bb.getCenter().y + bb.getYExtent(); System.out.println("xy1:" + x1 + ", " + y1 + " xy2:" + x2 + ", " + y2); - int width = (int)Math.round(x2 - Math.min(0, x1)); - int height = (int)Math.round(y2 - Math.min(0, y1)); + int width = Math.round(x2 - Math.min(0, x1)); + int height = Math.round(y2 - Math.min(0, y1)); Texture awtText = renderAwtFont(test, width, height, bitmapFont); Quad quad = new Quad(width, height); @@ -454,6 +454,7 @@ protected void setupUserInput() { ZOOM_IN, ZOOM_OUT); } + @Override public void simpleUpdate( float tpf ) { if( scroll.lengthSquared() != 0 ) { scrollRoot.move(scroll.mult(tpf)); @@ -465,6 +466,7 @@ public void simpleUpdate( float tpf ) { } private class KeyStateListener implements ActionListener { + @Override public void onAction(String name, boolean value, float tpf) { switch( name ) { case RESET_VIEW: diff --git a/jme3-examples/src/main/java/jme3test/gui/TestOrtho.java b/jme3-examples/src/main/java/jme3test/gui/TestOrtho.java index 2e252aad33..dc61e9e2c5 100644 --- a/jme3-examples/src/main/java/jme3test/gui/TestOrtho.java +++ b/jme3-examples/src/main/java/jme3test/gui/TestOrtho.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -42,6 +42,7 @@ public static void main(String[] args){ app.start(); } + @Override public void simpleInitApp() { Picture p = new Picture("Picture"); p.move(0, 0, -1); // make it appear behind stats view diff --git a/jme3-examples/src/main/java/jme3test/gui/TestSoftwareMouse.java b/jme3-examples/src/main/java/jme3test/gui/TestSoftwareMouse.java index 44bee2882f..cf6e01359a 100644 --- a/jme3-examples/src/main/java/jme3test/gui/TestSoftwareMouse.java +++ b/jme3-examples/src/main/java/jme3test/gui/TestSoftwareMouse.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -49,14 +49,19 @@ public class TestSoftwareMouse extends SimpleApplication { private float x = 0, y = 0; + @Override public void beginInput() { } + @Override public void endInput() { } + @Override public void onJoyAxisEvent(JoyAxisEvent evt) { } + @Override public void onJoyButtonEvent(JoyButtonEvent evt) { } + @Override public void onMouseMotionEvent(MouseMotionEvent evt) { x += evt.getDX(); y += evt.getDY(); @@ -69,10 +74,13 @@ public void onMouseMotionEvent(MouseMotionEvent evt) { // adjust for hotspot cursor.setPosition(x, y - 64); } + @Override public void onMouseButtonEvent(MouseButtonEvent evt) { } + @Override public void onKeyEvent(KeyInputEvent evt) { } + @Override public void onTouchEvent(TouchEvent evt) { } }; diff --git a/jme3-examples/src/main/java/jme3test/gui/TestZOrder.java b/jme3-examples/src/main/java/jme3test/gui/TestZOrder.java index 5a5683f683..6d9ed9768d 100644 --- a/jme3-examples/src/main/java/jme3test/gui/TestZOrder.java +++ b/jme3-examples/src/main/java/jme3test/gui/TestZOrder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -42,6 +42,7 @@ public static void main(String[] args){ app.start(); } + @Override public void simpleInitApp() { Picture p = new Picture("Picture1"); p.move(0,0,-1); diff --git a/jme3-examples/src/main/java/jme3test/helloworld/HelloAnimation.java b/jme3-examples/src/main/java/jme3test/helloworld/HelloAnimation.java index db9c700c87..ad8d82fe80 100644 --- a/jme3-examples/src/main/java/jme3test/helloworld/HelloAnimation.java +++ b/jme3-examples/src/main/java/jme3test/helloworld/HelloAnimation.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -79,6 +79,7 @@ public void simpleInitApp() { } /** Use this listener to trigger something after an animation is done. */ + @Override public void onAnimCycleDone(AnimControl control, AnimChannel channel, String animName) { if (animName.equals("Walk")) { /** After "walk", reset to "stand". */ @@ -89,6 +90,7 @@ public void onAnimCycleDone(AnimControl control, AnimChannel channel, String ani } /** Use this listener to trigger something between two animations. */ + @Override public void onAnimChange(AnimControl control, AnimChannel channel, String animName) { // unused } @@ -101,6 +103,7 @@ private void initKeys() { /** Definining the named action that can be triggered by key inputs. */ private ActionListener actionListener = new ActionListener() { + @Override public void onAction(String name, boolean keyPressed, float tpf) { if (name.equals("Walk") && !keyPressed) { if (!channel.getAnimationName().equals("Walk")) { diff --git a/jme3-examples/src/main/java/jme3test/helloworld/HelloCollision.java b/jme3-examples/src/main/java/jme3test/helloworld/HelloCollision.java index 7d96f9744f..2ab4bba45e 100644 --- a/jme3-examples/src/main/java/jme3test/helloworld/HelloCollision.java +++ b/jme3-examples/src/main/java/jme3test/helloworld/HelloCollision.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -75,6 +75,7 @@ public static void main(String[] args) { app.start(); } + @Override public void simpleInitApp() { /** Set up Physics */ bulletAppState = new BulletAppState(); @@ -97,7 +98,7 @@ public void simpleInitApp() { // We set up collision detection for the scene by creating a // compound collision shape and a static RigidBodyControl with mass zero. CollisionShape sceneShape = - CollisionShapeFactory.createMeshShape((Node) sceneModel); + CollisionShapeFactory.createMeshShape(sceneModel); landscape = new RigidBodyControl(sceneShape, 0); sceneModel.addControl(landscape); @@ -149,6 +150,7 @@ private void setUpKeys() { /** These are our custom actions triggered by key presses. * We do not walk yet, we just keep track of the direction the user pressed. */ + @Override public void onAction(String binding, boolean value, float tpf) { if (binding.equals("Left")) { if (value) { left = true; } else { left = false; } diff --git a/jme3-examples/src/main/java/jme3test/helloworld/HelloInput.java b/jme3-examples/src/main/java/jme3test/helloworld/HelloInput.java index c01bfb31c1..cecb08b02f 100644 --- a/jme3-examples/src/main/java/jme3test/helloworld/HelloInput.java +++ b/jme3-examples/src/main/java/jme3test/helloworld/HelloInput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -81,6 +81,7 @@ private void initKeys() { /** Use this listener for KeyDown/KeyUp events */ private ActionListener actionListener = new ActionListener() { + @Override public void onAction(String name, boolean keyPressed, float tpf) { if (name.equals("Pause") && !keyPressed) { isRunning = !isRunning; @@ -90,6 +91,7 @@ public void onAction(String name, boolean keyPressed, float tpf) { /** Use this listener for continuous events */ private AnalogListener analogListener = new AnalogListener() { + @Override public void onAnalog(String name, float value, float tpf) { if (isRunning) { if (name.equals("Rotate")) { diff --git a/jme3-examples/src/main/java/jme3test/helloworld/HelloPhysics.java b/jme3-examples/src/main/java/jme3test/helloworld/HelloPhysics.java index 0da38215da..086bf0b6a2 100644 --- a/jme3-examples/src/main/java/jme3test/helloworld/HelloPhysics.java +++ b/jme3-examples/src/main/java/jme3test/helloworld/HelloPhysics.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -123,6 +123,7 @@ private void initInputs() { * The ball is set up to fly from the camera position in the camera direction. */ private ActionListener actionListener = new ActionListener() { + @Override public void onAction(String name, boolean keyPressed, float tpf) { if (name.equals("shoot") && !keyPressed) { makeCannonBall(); diff --git a/jme3-examples/src/main/java/jme3test/helloworld/HelloPicking.java b/jme3-examples/src/main/java/jme3test/helloworld/HelloPicking.java index 4c74b90127..502e31cfe2 100644 --- a/jme3-examples/src/main/java/jme3test/helloworld/HelloPicking.java +++ b/jme3-examples/src/main/java/jme3test/helloworld/HelloPicking.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -90,6 +90,7 @@ private void initKeys() { /** Defining the "Shoot" action: Determine what was hit and how to respond. */ private ActionListener actionListener = new ActionListener() { + @Override public void onAction(String name, boolean keyPressed, float tpf) { if (name.equals("Shoot") && !keyPressed) { // 1. Reset results list. diff --git a/jme3-examples/src/main/java/jme3test/helloworld/HelloTerrainCollision.java b/jme3-examples/src/main/java/jme3test/helloworld/HelloTerrainCollision.java index d7ea68f63d..16c80b3e90 100644 --- a/jme3-examples/src/main/java/jme3test/helloworld/HelloTerrainCollision.java +++ b/jme3-examples/src/main/java/jme3test/helloworld/HelloTerrainCollision.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -185,6 +185,7 @@ private void setUpKeys() { /** These are our custom actions triggered by key presses. * We do not walk yet, we just keep track of the direction the user pressed. */ + @Override public void onAction(String binding, boolean value, float tpf) { if (binding.equals("Left")) { if (value) { left = true; } else { left = false; } diff --git a/jme3-examples/src/main/java/jme3test/input/TestCameraNode.java b/jme3-examples/src/main/java/jme3test/input/TestCameraNode.java index c1ebfeb8f7..f1ecfe68ce 100644 --- a/jme3-examples/src/main/java/jme3test/input/TestCameraNode.java +++ b/jme3-examples/src/main/java/jme3test/input/TestCameraNode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine All rights reserved. + * Copyright (c) 2009-2020 jMonkeyEngine All rights reserved. *

* Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -63,6 +63,7 @@ public static void main(String[] args) { app.start(); } + @Override public void simpleInitApp() { // load a teapot model teaGeom = (Geometry) assetManager.loadModel("Models/Teapot/Teapot.obj"); @@ -110,6 +111,7 @@ public void registerInput() { inputManager.addListener(this, "rotateRight", "rotateLeft", "toggleRotate"); } + @Override public void onAnalog(String name, float value, float tpf) { //computing the normalized direction of the cam to move the teaNode direction.set(cam.getDirection()).normalizeLocal(); @@ -138,6 +140,7 @@ public void onAnalog(String name, float value, float tpf) { } + @Override public void onAction(String name, boolean keyPressed, float tpf) { //toggling rotation on or off if (name.equals("toggleRotate") && keyPressed) { diff --git a/jme3-examples/src/main/java/jme3test/input/TestChaseCamera.java b/jme3-examples/src/main/java/jme3test/input/TestChaseCamera.java index d933f96382..126f3eef0c 100644 --- a/jme3-examples/src/main/java/jme3test/input/TestChaseCamera.java +++ b/jme3-examples/src/main/java/jme3test/input/TestChaseCamera.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -55,6 +55,7 @@ public static void main(String[] args) { app.start(); } + @Override public void simpleInitApp() { // Load a teapot model teaGeom = (Geometry) assetManager.loadModel("Models/Teapot/Teapot.obj"); @@ -116,6 +117,7 @@ public void registerInput() { inputManager.addListener(this, "displayPosition"); } + @Override public void onAnalog(String name, float value, float tpf) { if (name.equals("moveForward")) { teaGeom.move(0, 0, -5 * tpf); @@ -133,6 +135,7 @@ public void onAnalog(String name, float value, float tpf) { } + @Override public void onAction(String name, boolean keyPressed, float tpf) { if (name.equals("displayPosition") && keyPressed) { teaGeom.move(10, 10, 10); diff --git a/jme3-examples/src/main/java/jme3test/input/TestChaseCameraAppState.java b/jme3-examples/src/main/java/jme3test/input/TestChaseCameraAppState.java index 00d6dd81a5..94c99da1d7 100644 --- a/jme3-examples/src/main/java/jme3test/input/TestChaseCameraAppState.java +++ b/jme3-examples/src/main/java/jme3test/input/TestChaseCameraAppState.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -56,6 +56,7 @@ public static void main(String[] args) { app.start(); } + @Override public void simpleInitApp() { // Load a teapot model teaGeom = (Geometry) assetManager.loadModel("Models/Teapot/Teapot.obj"); @@ -109,6 +110,7 @@ public void registerInput() { inputManager.addListener(this, "displayPosition"); } + @Override public void onAnalog(String name, float value, float tpf) { if (name.equals("moveForward")) { teaGeom.move(0, 0, -5 * tpf); @@ -126,6 +128,7 @@ public void onAnalog(String name, float value, float tpf) { } + @Override public void onAction(String name, boolean keyPressed, float tpf) { if (name.equals("displayPosition") && keyPressed) { teaGeom.move(10, 10, 10); diff --git a/jme3-examples/src/main/java/jme3test/input/TestControls.java b/jme3-examples/src/main/java/jme3test/input/TestControls.java index 07568b2b59..50ac11ea31 100644 --- a/jme3-examples/src/main/java/jme3test/input/TestControls.java +++ b/jme3-examples/src/main/java/jme3test/input/TestControls.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -43,11 +43,13 @@ public class TestControls extends SimpleApplication { private ActionListener actionListener = new ActionListener(){ + @Override public void onAction(String name, boolean pressed, float tpf){ System.out.println(name + " = " + pressed); } }; public AnalogListener analogListener = new AnalogListener() { + @Override public void onAnalog(String name, float value, float tpf) { System.out.println(name + " = " + value); } diff --git a/jme3-examples/src/main/java/jme3test/input/TestJoystick.java b/jme3-examples/src/main/java/jme3test/input/TestJoystick.java index fbc8ea1989..d3d1df31f6 100644 --- a/jme3-examples/src/main/java/jme3test/input/TestJoystick.java +++ b/jme3-examples/src/main/java/jme3test/input/TestJoystick.java @@ -165,6 +165,7 @@ protected class JoystickEventListener implements RawInputListener { private Map lastValues = new HashMap<>(); + @Override public void onJoyAxisEvent(JoyAxisEvent evt) { Float last = lastValues.remove(evt.getAxis()); float value = evt.getValue(); @@ -188,16 +189,23 @@ public void onJoyAxisEvent(JoyAxisEvent evt) { } } + @Override public void onJoyButtonEvent(JoyButtonEvent evt) { setViewedJoystick( evt.getButton().getJoystick() ); gamepad.setButtonValue( evt.getButton(), evt.isPressed() ); } + @Override public void beginInput() {} + @Override public void endInput() {} + @Override public void onMouseMotionEvent(MouseMotionEvent evt) {} + @Override public void onMouseButtonEvent(MouseButtonEvent evt) {} + @Override public void onKeyEvent(KeyInputEvent evt) {} + @Override public void onTouchEvent(TouchEvent evt) {} } @@ -463,7 +471,7 @@ private void pickGamePad(Vector2f mouseLoc){ for (CollisionResult cr : cresults) { Node n = cr.getGeometry().getParent(); if (n != null && (n instanceof ButtonView)) { - String b = ((ButtonView) n).getName().substring("Button:".length()); + String b = n.getName().substring("Button:".length()); String name = lastButton.getJoystick().getName().replaceAll(" ", "\\\\ "); String id = lastButton.getLogicalId().replaceAll(" ", "\\\\ "); System.out.println(name + "." + id + "=" + b); diff --git a/jme3-examples/src/main/java/jme3test/input/combomoves/TestComboMoves.java b/jme3-examples/src/main/java/jme3test/input/combomoves/TestComboMoves.java index 3ca46dbd31..24d1130879 100644 --- a/jme3-examples/src/main/java/jme3test/input/combomoves/TestComboMoves.java +++ b/jme3-examples/src/main/java/jme3test/input/combomoves/TestComboMoves.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -168,6 +168,7 @@ public void simpleUpdate(float tpf){ } } + @Override public void onAction(String name, boolean isPressed, float tpf) { if (isPressed){ pressedMappings.add(name); diff --git a/jme3-examples/src/main/java/jme3test/light/ShadowTestUIManager.java b/jme3-examples/src/main/java/jme3test/light/ShadowTestUIManager.java index 4c8ae5ff94..c8c978c261 100644 --- a/jme3-examples/src/main/java/jme3test/light/ShadowTestUIManager.java +++ b/jme3-examples/src/main/java/jme3test/light/ShadowTestUIManager.java @@ -80,6 +80,7 @@ public ShadowTestUIManager(AssetManager assetManager,AbstractShadowRenderer plsr } + @Override public void onAction(String name, boolean keyPressed, float tpf) { if (name.equals("toggle") && keyPressed) { renderModeIndex += 1; diff --git a/jme3-examples/src/main/java/jme3test/light/TestConeVSFrustum.java b/jme3-examples/src/main/java/jme3test/light/TestConeVSFrustum.java index d96edf7063..119fac8caa 100644 --- a/jme3-examples/src/main/java/jme3test/light/TestConeVSFrustum.java +++ b/jme3-examples/src/main/java/jme3test/light/TestConeVSFrustum.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -140,6 +140,7 @@ public void simpleInitApp() { flyCam.setEnabled(false); inputManager.addListener(new AnalogListener() { + @Override public void onAnalog(String name, float value, float tpf) { Spatial s = null; float mult = 1; @@ -184,6 +185,7 @@ public void onAnalog(String name, float value, float tpf) { }, "up", "down", "left", "right"); inputManager.addListener(new ActionListener() { + @Override public void onAction(String name, boolean isPressed, float tpf) { if (name.equals("click")) { if (isPressed) { diff --git a/jme3-examples/src/main/java/jme3test/light/TestDirectionalLightShadow.java b/jme3-examples/src/main/java/jme3test/light/TestDirectionalLightShadow.java index 3f3ac9127e..96e61de29f 100644 --- a/jme3-examples/src/main/java/jme3test/light/TestDirectionalLightShadow.java +++ b/jme3-examples/src/main/java/jme3test/light/TestDirectionalLightShadow.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -78,6 +78,7 @@ public static void main(String[] args) { } private float frustumSize = 100; + @Override public void onAnalog(String name, float value, float tpf) { if (cam.isParallelProjection()) { // Instead of moving closer/farther to object, we zoom in/out. @@ -245,6 +246,7 @@ private void initInputs() { private BitmapText shadowStabilizationText; private BitmapText shadowZfarText; + @Override public void onAction(String name, boolean keyPressed, float tpf) { diff --git a/jme3-examples/src/main/java/jme3test/light/TestManyLightsSingle.java b/jme3-examples/src/main/java/jme3test/light/TestManyLightsSingle.java index 005634bcd1..bc28ffd262 100644 --- a/jme3-examples/src/main/java/jme3test/light/TestManyLightsSingle.java +++ b/jme3-examples/src/main/java/jme3test/light/TestManyLightsSingle.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -157,6 +157,7 @@ public void simpleInitApp() { stateManager.attach(debug); inputManager.addListener(new ActionListener() { + @Override public void onAction(String name, boolean isPressed, float tpf) { if (name.equals("toggle") && isPressed) { if (lm == TechniqueDef.LightMode.SinglePass) { diff --git a/jme3-examples/src/main/java/jme3test/light/TestObbVsBounds.java b/jme3-examples/src/main/java/jme3test/light/TestObbVsBounds.java index 9e5db8948b..fc38fc6d8a 100644 --- a/jme3-examples/src/main/java/jme3test/light/TestObbVsBounds.java +++ b/jme3-examples/src/main/java/jme3test/light/TestObbVsBounds.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -134,6 +134,7 @@ public void simpleInitApp() { flyCam.setEnabled(false); inputManager.addListener(new AnalogListener() { + @Override public void onAnalog(String name, float value, float tpf) { Spatial s = null; float mult = 1; @@ -178,6 +179,7 @@ public void onAnalog(String name, float value, float tpf) { }, "up", "down", "left", "right"); inputManager.addListener(new ActionListener() { + @Override public void onAction(String name, boolean isPressed, float tpf) { if (name.equals("click")) { if (isPressed) { @@ -224,7 +226,7 @@ public void makeAreaGeom() { points[7].set(1, -1, -1); Mesh box = WireFrustum.makeFrustum(points); - areaGeom = new Geometry("light", (Mesh)box); + areaGeom = new Geometry("light", box); areaGeom.setMaterial(new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md")); areaGeom.getMaterial().setColor("Color", ColorRGBA.White); } diff --git a/jme3-examples/src/main/java/jme3test/light/TestPointDirectionalAndSpotLightShadows.java b/jme3-examples/src/main/java/jme3test/light/TestPointDirectionalAndSpotLightShadows.java index 473ba8dfe8..fe52e3c68b 100644 --- a/jme3-examples/src/main/java/jme3test/light/TestPointDirectionalAndSpotLightShadows.java +++ b/jme3-examples/src/main/java/jme3test/light/TestPointDirectionalAndSpotLightShadows.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -98,7 +98,7 @@ public void simpleInitApp() { rootNode.attachChild(box); box.setLocalTranslation(-1f, 0.5f, -2); - ((PointLight) scene.getLocalLightList().get(0)).setColor(ColorRGBA.Red); + scene.getLocalLightList().get(0).setColor(ColorRGBA.Red); plsr = new PointLightShadowRenderer(assetManager, SHADOWMAP_SIZE); plsr.setLight((PointLight) scene.getLocalLightList().get(0)); diff --git a/jme3-examples/src/main/java/jme3test/light/TestShadowsPerf.java b/jme3-examples/src/main/java/jme3test/light/TestShadowsPerf.java index a631f9eac8..8cd2eb5aae 100644 --- a/jme3-examples/src/main/java/jme3test/light/TestShadowsPerf.java +++ b/jme3-examples/src/main/java/jme3test/light/TestShadowsPerf.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -130,6 +130,7 @@ public void simpleInitApp() { inputManager.addListener(new ActionListener() { + @Override public void onAction(String name, boolean isPressed, float tpf) { if (name.equals("display") && isPressed) { //pssmRenderer.debugFrustrums(); diff --git a/jme3-examples/src/main/java/jme3test/light/TestSpotLightShadows.java b/jme3-examples/src/main/java/jme3test/light/TestSpotLightShadows.java index 254bfb0284..610f08eb66 100644 --- a/jme3-examples/src/main/java/jme3test/light/TestSpotLightShadows.java +++ b/jme3-examples/src/main/java/jme3test/light/TestSpotLightShadows.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -120,6 +120,7 @@ public void setupLighting() { ShadowTestUIManager uiMan = new ShadowTestUIManager(assetManager, slsr, slsf, guiNode, inputManager, viewPort); inputManager.addListener(new ActionListener() { + @Override public void onAction(String name, boolean isPressed, float tpf) { if (name.equals("stop") && isPressed) { stop = !stop; diff --git a/jme3-examples/src/main/java/jme3test/light/TestTangentGenBadModels.java b/jme3-examples/src/main/java/jme3test/light/TestTangentGenBadModels.java index 21817e7c83..63f2c23aa8 100644 --- a/jme3-examples/src/main/java/jme3test/light/TestTangentGenBadModels.java +++ b/jme3-examples/src/main/java/jme3test/light/TestTangentGenBadModels.java @@ -105,6 +105,7 @@ public void visit(Geometry g){ private boolean isLit = true; + @Override public void onAction(String name, boolean isPressed, float tpf) { if (isPressed) return; Material mat; diff --git a/jme3-examples/src/main/java/jme3test/light/TestTransparentShadow.java b/jme3-examples/src/main/java/jme3test/light/TestTransparentShadow.java index 23fe73c12e..ce632604ba 100644 --- a/jme3-examples/src/main/java/jme3test/light/TestTransparentShadow.java +++ b/jme3-examples/src/main/java/jme3test/light/TestTransparentShadow.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -59,6 +59,7 @@ public static void main(String[] args){ app.start(); } + @Override public void simpleInitApp() { cam.setLocation(new Vector3f(5.700248f, 6.161693f, 5.1404157f)); cam.setRotation(new Quaternion(-0.09441641f, 0.8993388f, -0.24089815f, -0.35248178f)); diff --git a/jme3-examples/src/main/java/jme3test/light/pbr/ConsoleProgressReporter.java b/jme3-examples/src/main/java/jme3test/light/pbr/ConsoleProgressReporter.java index f0d100ee23..52d2f0dd5e 100644 --- a/jme3-examples/src/main/java/jme3test/light/pbr/ConsoleProgressReporter.java +++ b/jme3-examples/src/main/java/jme3test/light/pbr/ConsoleProgressReporter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2015 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -65,7 +65,7 @@ public void step(String message) { @Override public void done(LightProbe result) { long end = System.currentTimeMillis(); - logger.log(Level.INFO, "Generation done in {0}", ((float)(end - time) / 1000f)); + logger.log(Level.INFO, "Generation done in {0}", (end - time) / 1000f); } } diff --git a/jme3-examples/src/main/java/jme3test/light/pbr/RefEnv.java b/jme3-examples/src/main/java/jme3test/light/pbr/RefEnv.java index 051202cdac..40bb183beb 100644 --- a/jme3-examples/src/main/java/jme3test/light/pbr/RefEnv.java +++ b/jme3-examples/src/main/java/jme3test/light/pbr/RefEnv.java @@ -127,7 +127,7 @@ public void done(LightProbe result) { rootNode.getChild(0).setCullHint(Spatial.CullHint.Dynamic); } }); - ((SphereProbeArea) probe.getArea()).setRadius(100); + probe.getArea().setRadius(100); rootNode.addLight(probe); } diff --git a/jme3-examples/src/main/java/jme3test/light/pbr/TestPBRLighting.java b/jme3-examples/src/main/java/jme3test/light/pbr/TestPBRLighting.java index d08f57fb6f..7de1e456c7 100644 --- a/jme3-examples/src/main/java/jme3test/light/pbr/TestPBRLighting.java +++ b/jme3-examples/src/main/java/jme3test/light/pbr/TestPBRLighting.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2015 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -79,7 +79,7 @@ public void simpleInitApp() { assetManager.registerLoader(KTXLoader.class, "ktx"); viewPort.setBackgroundColor(ColorRGBA.White); - modelNode = (Node) new Node("modelNode"); + modelNode = new Node("modelNode"); model = (Geometry) assetManager.loadModel("Models/Tank/tank.j3o"); MikktspaceTangentGenerator.generate(model); modelNode.attachChild(model); @@ -90,8 +90,12 @@ public void simpleInitApp() { dl.setColor(ColorRGBA.White); rootNode.attachChild(modelNode); - FilterPostProcessor fpp = new FilterPostProcessor(assetManager); + int numSamples = context.getSettings().getSamples(); + if (numSamples > 0) { + fpp.setNumSamples(numSamples); + } + // fpp.addFilter(new FXAAFilter()); fpp.addFilter(new ToneMapFilter(Vector3f.UNIT_XYZ.mult(4.0f))); // fpp.addFilter(new SSAOFilter(0.5f, 3, 0.2f, 0.2f)); @@ -203,7 +207,7 @@ public void done(LightProbe result) { tex = EnvMapUtils.getCubeMapCrossDebugViewWithMipMaps(result.getPrefilteredEnvMap(), assetManager); } }); - ((SphereProbeArea) probe.getArea()).setRadius(100); + probe.getArea().setRadius(100); rootNode.addLight(probe); //getStateManager().getState(EnvironmentManager.class).addEnvProbe(probe); diff --git a/jme3-examples/src/main/java/jme3test/material/TestBumpModel.java b/jme3-examples/src/main/java/jme3test/material/TestBumpModel.java index 49028ba7ed..ba7ced2ab6 100644 --- a/jme3-examples/src/main/java/jme3test/material/TestBumpModel.java +++ b/jme3-examples/src/main/java/jme3test/material/TestBumpModel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -58,13 +58,13 @@ public static void main(String[] args){ @Override public void simpleInitApp() { - Spatial signpost = (Spatial) assetManager.loadAsset(new OgreMeshKey("Models/Sign Post/Sign Post.mesh.xml")); - signpost.setMaterial( (Material) assetManager.loadMaterial("Models/Sign Post/Sign Post.j3m")); + Spatial signpost = assetManager.loadAsset(new OgreMeshKey("Models/Sign Post/Sign Post.mesh.xml")); + signpost.setMaterial(assetManager.loadMaterial("Models/Sign Post/Sign Post.j3m")); TangentBinormalGenerator.generate(signpost); rootNode.attachChild(signpost); lightMdl = new Geometry("Light", new Sphere(10, 10, 0.1f)); - lightMdl.setMaterial( (Material) assetManager.loadMaterial("Common/Materials/RedColor.j3m")); + lightMdl.setMaterial(assetManager.loadMaterial("Common/Materials/RedColor.j3m")); rootNode.attachChild(lightMdl); // flourescent main light diff --git a/jme3-examples/src/main/java/jme3test/material/TestParallaxPBR.java b/jme3-examples/src/main/java/jme3test/material/TestParallaxPBR.java index 2a97a7054a..013bea20b6 100644 --- a/jme3-examples/src/main/java/jme3test/material/TestParallaxPBR.java +++ b/jme3-examples/src/main/java/jme3test/material/TestParallaxPBR.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -116,6 +116,7 @@ public void simpleInitApp() { inputManager.addListener(new AnalogListener() { + @Override public void onAnalog(String name, float value, float tpf) { if ("heightUP".equals(name)) { parallaxHeigh += 0.01; @@ -134,6 +135,7 @@ public void onAnalog(String name, float value, float tpf) { inputManager.addListener(new ActionListener() { + @Override public void onAction(String name, boolean isPressed, float tpf) { if (isPressed && "toggleSteep".equals(name)) { steep = !steep; diff --git a/jme3-examples/src/main/java/jme3test/model/TestMonkeyHead.java b/jme3-examples/src/main/java/jme3test/model/TestMonkeyHead.java index c75e221f0f..adeee2e285 100644 --- a/jme3-examples/src/main/java/jme3test/model/TestMonkeyHead.java +++ b/jme3-examples/src/main/java/jme3test/model/TestMonkeyHead.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -57,7 +57,7 @@ public static void main(String[] args){ public void simpleInitApp() { viewPort.setBackgroundColor(ColorRGBA.DarkGray); - Spatial bumpy = (Spatial) assetManager.loadModel("Models/MonkeyHead/MonkeyHead.mesh.xml"); + Spatial bumpy = assetManager.loadModel("Models/MonkeyHead/MonkeyHead.mesh.xml"); rootNode.attachChild(bumpy); lightMdl = new Geometry("Light", new Sphere(10, 10, 0.1f)); diff --git a/jme3-examples/src/main/java/jme3test/model/TestObjLoading.java b/jme3-examples/src/main/java/jme3test/model/TestObjLoading.java index 2546fdd79c..2788f12891 100644 --- a/jme3-examples/src/main/java/jme3test/model/TestObjLoading.java +++ b/jme3-examples/src/main/java/jme3test/model/TestObjLoading.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -46,6 +46,7 @@ public static void main(String[] args){ app.start(); } + @Override public void simpleInitApp() { // create the geometry and attach it Geometry teaGeom = (Geometry) assetManager.loadModel("Models/Teapot/Teapot.obj"); diff --git a/jme3-examples/src/main/java/jme3test/model/TestOgreLoading.java b/jme3-examples/src/main/java/jme3test/model/TestOgreLoading.java index f8d1e85f12..b553a062f0 100644 --- a/jme3-examples/src/main/java/jme3test/model/TestOgreLoading.java +++ b/jme3-examples/src/main/java/jme3test/model/TestOgreLoading.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -55,6 +55,7 @@ public static void main(String[] args) { app.start(); } + @Override public void simpleInitApp() { // PointLight pl = new PointLight(); // pl.setPosition(new Vector3f(10, 10, -10)); @@ -89,7 +90,7 @@ public void simpleInitApp() { // create the geometry and attach it - Spatial elephant = (Spatial) assetManager.loadModel("Models/Elephant/Elephant.mesh.xml"); + Spatial elephant = assetManager.loadModel("Models/Elephant/Elephant.mesh.xml"); float scale = 0.05f; elephant.scale(scale, scale, scale); rootNode.attachChild(elephant); diff --git a/jme3-examples/src/main/java/jme3test/model/anim/EraseTimer.java b/jme3-examples/src/main/java/jme3test/model/anim/EraseTimer.java index ba61891954..c20b729be8 100644 --- a/jme3-examples/src/main/java/jme3test/model/anim/EraseTimer.java +++ b/jme3-examples/src/main/java/jme3test/model/anim/EraseTimer.java @@ -38,23 +38,28 @@ public float getTimeInSeconds() { return getTime() * INVERSE_TIMER_RESOLUTION; } + @Override public long getTime() { //return System.currentTimeMillis() - startTime; return System.nanoTime() - startTime; } + @Override public long getResolution() { return TIMER_RESOLUTION; } + @Override public float getFrameRate() { return fps; } + @Override public float getTimePerFrame() { return tpf; } + @Override public void update() { tpf = (getTime() - previousTime) * (1.0f / TIMER_RESOLUTION); if (tpf >= 0.2) { @@ -66,6 +71,7 @@ public void update() { previousTime = getTime(); } + @Override public void reset() { //startTime = System.currentTimeMillis(); startTime = System.nanoTime(); diff --git a/jme3-examples/src/main/java/jme3test/model/anim/TestBlenderAnim.java b/jme3-examples/src/main/java/jme3test/model/anim/TestBlenderAnim.java index 0fea65ae99..e2c4e725c0 100644 --- a/jme3-examples/src/main/java/jme3test/model/anim/TestBlenderAnim.java +++ b/jme3-examples/src/main/java/jme3test/model/anim/TestBlenderAnim.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -66,7 +66,7 @@ public void simpleInitApp() { BlenderKey blenderKey = new BlenderKey("Blender/2.4x/BaseMesh_249.blend"); - Spatial scene = (Spatial) assetManager.loadModel(blenderKey); + Spatial scene = assetManager.loadModel(blenderKey); rootNode.attachChild(scene); Spatial model = this.findNode(rootNode, "BaseMesh_01"); diff --git a/jme3-examples/src/main/java/jme3test/model/anim/TestBlenderObjectAnim.java b/jme3-examples/src/main/java/jme3test/model/anim/TestBlenderObjectAnim.java index 68855176a0..0b90805448 100644 --- a/jme3-examples/src/main/java/jme3test/model/anim/TestBlenderObjectAnim.java +++ b/jme3-examples/src/main/java/jme3test/model/anim/TestBlenderObjectAnim.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -66,7 +66,7 @@ public void simpleInitApp() { BlenderKey blenderKey = new BlenderKey("Blender/2.4x/animtest.blend"); - Spatial scene = (Spatial) assetManager.loadModel(blenderKey); + Spatial scene = assetManager.loadModel(blenderKey); rootNode.attachChild(scene); Spatial model = this.findNode(rootNode, "Cube"); diff --git a/jme3-examples/src/main/java/jme3test/model/anim/TestHWSkinning.java b/jme3-examples/src/main/java/jme3test/model/anim/TestHWSkinning.java index 6eca8a9a2a..29b63ba4f1 100644 --- a/jme3-examples/src/main/java/jme3test/model/anim/TestHWSkinning.java +++ b/jme3-examples/src/main/java/jme3test/model/anim/TestHWSkinning.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -86,8 +86,8 @@ public void simpleInitApp() { Node model = (Node)models[(i + j) % 4]; Spatial s = model.getChild(0).clone(); model.attachChild(s); - float x = (float)(i - SIZE / 2) / 0.1f; - float z = (float)(j - SIZE / 2) / 0.1f; + float x = (i - SIZE / 2) / 0.1f; + float z = (j - SIZE / 2) / 0.1f; s.setLocalTranslation(x, 0, z); } } diff --git a/jme3-examples/src/main/java/jme3test/model/anim/TestHWSkinningOld.java b/jme3-examples/src/main/java/jme3test/model/anim/TestHWSkinningOld.java index f0fa27d8fe..2063c2e663 100644 --- a/jme3-examples/src/main/java/jme3test/model/anim/TestHWSkinningOld.java +++ b/jme3-examples/src/main/java/jme3test/model/anim/TestHWSkinningOld.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -75,7 +75,7 @@ public void simpleInitApp() { for (int i = 0; i < SIZE; i++) { for (int j = 0; j < SIZE; j++) { - Spatial model = (Spatial) assetManager.loadModel("Models/Oto/OtoOldAnim.j3o"); + Spatial model = assetManager.loadModel("Models/Oto/OtoOldAnim.j3o"); model.setLocalScale(0.1f); model.setLocalTranslation(i - SIZE / 2, 0, j - SIZE / 2); control = model.getControl(AnimControl.class); diff --git a/jme3-examples/src/main/java/jme3test/model/anim/TestOgreAnim.java b/jme3-examples/src/main/java/jme3test/model/anim/TestOgreAnim.java index a7616f7b54..0c6010beae 100644 --- a/jme3-examples/src/main/java/jme3test/model/anim/TestOgreAnim.java +++ b/jme3-examples/src/main/java/jme3test/model/anim/TestOgreAnim.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -66,7 +66,7 @@ public void simpleInitApp() { dl.setColor(new ColorRGBA(1f, 1f, 1f, 1.0f)); rootNode.addLight(dl); - Spatial model = (Spatial) assetManager.loadModel("Models/Oto/OtoOldAnim.j3o"); + Spatial model = assetManager.loadModel("Models/Oto/OtoOldAnim.j3o"); model.center(); control = model.getControl(AnimControl.class); @@ -101,6 +101,7 @@ public void simpleUpdate(float tpf) { } + @Override public void onAnimCycleDone(AnimControl control, AnimChannel channel, String animName) { if (animName.equals("Dodge")){ channel.setAnim("stand", 0.50f); @@ -109,9 +110,11 @@ public void onAnimCycleDone(AnimControl control, AnimChannel channel, String ani } } + @Override public void onAnimChange(AnimControl control, AnimChannel channel, String animName) { } + @Override public void onAction(String binding, boolean value, float tpf) { if (binding.equals("Attack") && value){ if (!channel.getAnimationName().equals("Dodge")){ diff --git a/jme3-examples/src/main/java/jme3test/model/anim/TestSkeletonControlRefresh.java b/jme3-examples/src/main/java/jme3test/model/anim/TestSkeletonControlRefresh.java index bbc727af39..3b30c0417e 100644 --- a/jme3-examples/src/main/java/jme3test/model/anim/TestSkeletonControlRefresh.java +++ b/jme3-examples/src/main/java/jme3test/model/anim/TestSkeletonControlRefresh.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -92,7 +92,7 @@ public void simpleInitApp() { for (int i = 0; i < SIZE; i++) { for (int j = 0; j < SIZE; j++) { - Spatial model = (Spatial) assetManager.loadModel("Models/Oto/OtoOldAnim.j3o"); + Spatial model = assetManager.loadModel("Models/Oto/OtoOldAnim.j3o"); //setting a different material model.setMaterial(m.clone()); model.setLocalScale(0.1f); diff --git a/jme3-examples/src/main/java/jme3test/model/shape/TestBillboard.java b/jme3-examples/src/main/java/jme3test/model/shape/TestBillboard.java index 8fa8a66f14..e105d58f77 100644 --- a/jme3-examples/src/main/java/jme3test/model/shape/TestBillboard.java +++ b/jme3-examples/src/main/java/jme3test/model/shape/TestBillboard.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -48,6 +48,7 @@ */ public class TestBillboard extends SimpleApplication { + @Override public void simpleInitApp() { flyCam.setMoveSpeed(10); diff --git a/jme3-examples/src/main/java/jme3test/network/MovingAverage.java b/jme3-examples/src/main/java/jme3test/network/MovingAverage.java index 991b5e5f61..1544f244cb 100644 --- a/jme3-examples/src/main/java/jme3test/network/MovingAverage.java +++ b/jme3-examples/src/main/java/jme3test/network/MovingAverage.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -57,7 +57,7 @@ public long getAverage(){ if (count == 0) return 0; else - return (long) ((float) sum / (float) count); + return (long) (sum / (float) count); } } \ No newline at end of file diff --git a/jme3-examples/src/main/java/jme3test/network/TestLatency.java b/jme3-examples/src/main/java/jme3test/network/TestLatency.java index c47ae05562..5f33f49c1f 100644 --- a/jme3-examples/src/main/java/jme3test/network/TestLatency.java +++ b/jme3-examples/src/main/java/jme3test/network/TestLatency.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -79,6 +79,7 @@ public static void main(String[] args) throws IOException, InterruptedException{ client.start(); client.addMessageListener(new MessageListener(){ + @Override public void messageReceived(Client source, Message m) { TimestampMessage timeMsg = (TimestampMessage) m; @@ -103,6 +104,7 @@ public void messageReceived(Client source, Message m) { }, TimestampMessage.class); server.addMessageListener(new MessageListener(){ + @Override public void messageReceived(HostedConnection source, Message m) { TimestampMessage timeMsg = (TimestampMessage) m; TimestampMessage outMsg = new TimestampMessage(timeMsg.timeSent, getTime()); diff --git a/jme3-examples/src/main/java/jme3test/network/TestMessages.java b/jme3-examples/src/main/java/jme3test/network/TestMessages.java index 361f097ecd..b67476ae1d 100644 --- a/jme3-examples/src/main/java/jme3test/network/TestMessages.java +++ b/jme3-examples/src/main/java/jme3test/network/TestMessages.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -48,6 +48,7 @@ public static class PongMessage extends AbstractMessage { } private static class ServerPingResponder implements MessageListener { + @Override public void messageReceived(HostedConnection source, com.jme3.network.Message message) { if (message instanceof PingMessage){ System.out.println("Server: Received ping message!"); @@ -57,6 +58,7 @@ public void messageReceived(HostedConnection source, com.jme3.network.Message me } private static class ClientPingResponder implements MessageListener { + @Override public void messageReceived(Client source, com.jme3.network.Message message) { if (message instanceof PongMessage){ System.out.println("Client: Received pong message!"); diff --git a/jme3-examples/src/main/java/jme3test/network/TestNetworkStress.java b/jme3-examples/src/main/java/jme3test/network/TestNetworkStress.java index dab33c5976..13bf63c8e2 100644 --- a/jme3-examples/src/main/java/jme3test/network/TestNetworkStress.java +++ b/jme3-examples/src/main/java/jme3test/network/TestNetworkStress.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -39,11 +39,13 @@ public class TestNetworkStress implements ConnectionListener { + @Override public void connectionAdded(Server server, HostedConnection conn) { System.out.println("Client Connected: "+conn.getId()); //conn.close("goodbye"); } + @Override public void connectionRemoved(Server server, HostedConnection conn) { } diff --git a/jme3-examples/src/main/java/jme3test/network/TestRemoteCall.java b/jme3-examples/src/main/java/jme3test/network/TestRemoteCall.java index 4335bb3253..208af7b682 100644 --- a/jme3-examples/src/main/java/jme3test/network/TestRemoteCall.java +++ b/jme3-examples/src/main/java/jme3test/network/TestRemoteCall.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -66,12 +66,14 @@ public static interface ServerAccess { } public static class ServerAccessImpl implements ServerAccess { + @Override public boolean attachChild(String model) { if (model == null) throw new RuntimeException("Cannot be null. .. etc"); final String finalModel = model; serverApp.enqueue(new Callable() { + @Override public Void call() throws Exception { Spatial spatial = serverApp.getAssetManager().loadModel(finalModel); serverApp.getRootNode().attachChild(spatial); diff --git a/jme3-examples/src/main/java/jme3test/network/TestSerialization.java b/jme3-examples/src/main/java/jme3test/network/TestSerialization.java index cbdeb6697c..8e7ef59dad 100644 --- a/jme3-examples/src/main/java/jme3test/network/TestSerialization.java +++ b/jme3-examples/src/main/java/jme3test/network/TestSerialization.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -121,6 +121,7 @@ public TestSerializationMessage(boolean initIt){ } } + @Override public void messageReceived(HostedConnection source, Message m) { TestSerializationMessage cm = (TestSerializationMessage) m; System.out.println(cm.z); diff --git a/jme3-examples/src/main/java/jme3test/network/TestThroughput.java b/jme3-examples/src/main/java/jme3test/network/TestThroughput.java index c261ec0b9e..c87064f47f 100644 --- a/jme3-examples/src/main/java/jme3test/network/TestThroughput.java +++ b/jme3-examples/src/main/java/jme3test/network/TestThroughput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 jMonkeyEngine + * Copyright (c) 2011-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -83,7 +83,7 @@ public void messageReceived(MessageConnection source, Message msg) { //System.out.println( "sending:" + msg + " back to client:" + source ); // The 'reliable' flag is transient and the server doesn't // (yet) reset this value for us. - ((com.jme3.network.Message) msg).setReliable(testReliable); + msg.setReliable(testReliable); source.send(msg); } } diff --git a/jme3-examples/src/main/java/jme3test/niftygui/TestIssue1013.java b/jme3-examples/src/main/java/jme3test/niftygui/TestIssue1013.java new file mode 100644 index 0000000000..b40311f62c --- /dev/null +++ b/jme3-examples/src/main/java/jme3test/niftygui/TestIssue1013.java @@ -0,0 +1,127 @@ +/* + * Copyright (c) 2009-2020 jMonkeyEngine + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of 'jMonkeyEngine' nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package jme3test.niftygui; + +import com.jme3.app.SimpleApplication; +import com.jme3.material.Material; +import com.jme3.niftygui.NiftyJmeDisplay; +import com.jme3.scene.Geometry; +import com.jme3.scene.shape.Box; +import de.lessvoid.nifty.Nifty; +import de.lessvoid.nifty.builder.LayerBuilder; +import de.lessvoid.nifty.builder.PanelBuilder; +import de.lessvoid.nifty.builder.ScreenBuilder; +import de.lessvoid.nifty.controls.button.builder.ButtonBuilder; +import de.lessvoid.nifty.screen.Screen; +import de.lessvoid.nifty.screen.ScreenController; + +public class TestIssue1013 extends SimpleApplication implements ScreenController { + + public static void main(String[] args) { + new TestIssue1013().start(); + } + + private NiftyJmeDisplay niftyDisplay; + + @Override + public void simpleInitApp() { + + // this box here always renders + Box b = new Box(1, 1, 1); + Geometry geom = new Geometry("Box", b); + Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md"); + mat.setTexture("ColorMap", assetManager.loadTexture("/com/jme3/app/Monkey.png")); + geom.setMaterial(mat); + rootNode.attachChild(geom); + + niftyDisplay = NiftyJmeDisplay.newNiftyJmeDisplay(assetManager, inputManager, audioRenderer, guiViewPort); + + Nifty nifty = niftyDisplay.getNifty(); + nifty.loadStyleFile("nifty-default-styles.xml"); + nifty.loadControlFile("nifty-default-controls.xml"); + + ScreenController ctrl = this; + + new ScreenBuilder("start") { + { + controller(ctrl); + layer(new LayerBuilder() { + { + childLayoutVertical(); + panel(new PanelBuilder() { + { + childLayoutCenter(); + width("100%"); + height("50%"); + backgroundColor("#ff0000"); + } + }); + control(new ButtonBuilder("RestartButton", "Restart Context") { + { + alignCenter(); + valignCenter(); + height("32px"); + width("480px"); + interactOnClick("restartContext()"); + } + }); + } + }); + } + }.build(nifty); + + guiViewPort.addProcessor(niftyDisplay); + nifty.gotoScreen("start"); + + flyCam.setDragToRotate(true); + } + + @Override + public void bind(Nifty nifty, Screen screen) { + } + + @Override + public void onStartScreen() { + } + + @Override + public void onEndScreen() { + } + + public void restartContext() { + // even without changing settings, stuff breaks! + restart(); + // ...and re-adding the processor doesn't help at all + guiViewPort.addProcessor(niftyDisplay); + } + +} diff --git a/jme3-examples/src/main/java/jme3test/niftygui/TestNiftyExamples.java b/jme3-examples/src/main/java/jme3test/niftygui/TestNiftyExamples.java index 19246e4f5e..9d7019b29d 100644 --- a/jme3-examples/src/main/java/jme3test/niftygui/TestNiftyExamples.java +++ b/jme3-examples/src/main/java/jme3test/niftygui/TestNiftyExamples.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -46,6 +46,7 @@ public static void main(String[] args){ app.start(); } + @Override public void simpleInitApp() { NiftyJmeDisplay niftyDisplay = new NiftyJmeDisplay(assetManager, inputManager, diff --git a/jme3-examples/src/main/java/jme3test/niftygui/TestNiftyToMesh.java b/jme3-examples/src/main/java/jme3test/niftygui/TestNiftyToMesh.java index 9ec915f532..bac441214b 100644 --- a/jme3-examples/src/main/java/jme3test/niftygui/TestNiftyToMesh.java +++ b/jme3-examples/src/main/java/jme3test/niftygui/TestNiftyToMesh.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -55,6 +55,7 @@ public static void main(String[] args){ app.start(); } + @Override public void simpleInitApp() { ViewPort niftyView = renderManager.createPreView("NiftyView", new Camera(1024, 768)); niftyView.setClearFlags(true, true, true); diff --git a/jme3-examples/src/main/java/jme3test/opencl/TestMultipleApplications.java b/jme3-examples/src/main/java/jme3test/opencl/TestMultipleApplications.java index d0045ff203..d5ddf9e4b8 100644 --- a/jme3-examples/src/main/java/jme3test/opencl/TestMultipleApplications.java +++ b/jme3-examples/src/main/java/jme3test/opencl/TestMultipleApplications.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2016 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -74,6 +74,7 @@ public static void main(String[] args) { settings.setRenderer(AppSettings.JOGL_OPENGL_FORWARD_COMPATIBLE); for (int i=0; i<2; ++i) { new Thread() { + @Override public void run() { if (currentDeviceIndex == -1) { return; diff --git a/jme3-examples/src/main/java/jme3test/post/BloomUI.java b/jme3-examples/src/main/java/jme3test/post/BloomUI.java index f4878c1976..a4da8b12f2 100644 --- a/jme3-examples/src/main/java/jme3test/post/BloomUI.java +++ b/jme3-examples/src/main/java/jme3test/post/BloomUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -64,6 +64,7 @@ public BloomUI(InputManager inputManager, final BloomFilter filter) { AnalogListener anl = new AnalogListener() { + @Override public void onAnalog(String name, float value, float tpf) { if (name.equals("blurScaleUp")) { filter.setBlurScale(filter.getBlurScale() + 0.01f); diff --git a/jme3-examples/src/main/java/jme3test/post/LightScatteringUI.java b/jme3-examples/src/main/java/jme3test/post/LightScatteringUI.java index 4cf2527165..10545be03b 100644 --- a/jme3-examples/src/main/java/jme3test/post/LightScatteringUI.java +++ b/jme3-examples/src/main/java/jme3test/post/LightScatteringUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -71,6 +71,7 @@ public LightScatteringUI(InputManager inputManager, LightScatteringFilter proc) ActionListener acl = new ActionListener() { + @Override public void onAction(String name, boolean keyPressed, float tpf) { if (name.equals("sampleUp")) { @@ -97,6 +98,7 @@ public void onAction(String name, boolean keyPressed, float tpf) { AnalogListener anl = new AnalogListener() { + @Override public void onAnalog(String name, float value, float tpf) { if (name.equals("blurStartUp")) { diff --git a/jme3-examples/src/main/java/jme3test/post/SSAOUI.java b/jme3-examples/src/main/java/jme3test/post/SSAOUI.java index c736b2598a..7948a2840e 100644 --- a/jme3-examples/src/main/java/jme3test/post/SSAOUI.java +++ b/jme3-examples/src/main/java/jme3test/post/SSAOUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -77,6 +77,7 @@ private void init(InputManager inputManager) { ActionListener acl = new ActionListener() { + @Override public void onAction(String name, boolean keyPressed, float tpf) { if (name.equals("toggleUseAO") && keyPressed) { @@ -102,6 +103,7 @@ public void onAction(String name, boolean keyPressed, float tpf) { AnalogListener anl = new AnalogListener() { + @Override public void onAnalog(String name, float value, float tpf) { if (name.equals("sampleRadiusUp")) { filter.setSampleRadius(filter.getSampleRadius() + 0.01f); diff --git a/jme3-examples/src/main/java/jme3test/post/TestBloom.java b/jme3-examples/src/main/java/jme3test/post/TestBloom.java index 9572568ea2..ba39437567 100644 --- a/jme3-examples/src/main/java/jme3test/post/TestBloom.java +++ b/jme3-examples/src/main/java/jme3test/post/TestBloom.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -148,6 +148,7 @@ private void initInputs() { ActionListener acl = new ActionListener() { + @Override public void onAction(String name, boolean keyPressed, float tpf) { if (name.equals("toggle") && keyPressed) { if(active){ diff --git a/jme3-examples/src/main/java/jme3test/post/TestCrossHatch.java b/jme3-examples/src/main/java/jme3test/post/TestCrossHatch.java index 5cc3669aea..4dc5761790 100644 --- a/jme3-examples/src/main/java/jme3test/post/TestCrossHatch.java +++ b/jme3-examples/src/main/java/jme3test/post/TestCrossHatch.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -143,6 +143,7 @@ private void initInputs() { ActionListener acl = new ActionListener() { + @Override public void onAction(String name, boolean keyPressed, float tpf) { if (name.equals("toggle") && keyPressed) { if(active){ diff --git a/jme3-examples/src/main/java/jme3test/post/TestDepthOfField.java b/jme3-examples/src/main/java/jme3test/post/TestDepthOfField.java index 6fee9e404b..71fc093b97 100644 --- a/jme3-examples/src/main/java/jme3test/post/TestDepthOfField.java +++ b/jme3-examples/src/main/java/jme3test/post/TestDepthOfField.java @@ -89,6 +89,7 @@ public void simpleInitApp() { inputManager.addListener(new ActionListener() { + @Override public void onAction(String name, boolean isPressed, float tpf) { if (isPressed) { if (name.equals("toggle")) { @@ -101,6 +102,7 @@ public void onAction(String name, boolean isPressed, float tpf) { }, "toggle"); inputManager.addListener(new AnalogListener() { + @Override public void onAnalog(String name, float value, float tpf) { if (name.equals("blurScaleUp")) { dofFilter.setBlurScale(dofFilter.getBlurScale() + 0.01f); diff --git a/jme3-examples/src/main/java/jme3test/post/TestFog.java b/jme3-examples/src/main/java/jme3test/post/TestFog.java index 3ecac03a0d..d52ba5533a 100644 --- a/jme3-examples/src/main/java/jme3test/post/TestFog.java +++ b/jme3-examples/src/main/java/jme3test/post/TestFog.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -66,6 +66,7 @@ public static void main(String[] args) { app.start(); } + @Override public void simpleInitApp() { this.flyCam.setMoveSpeed(50); Node mainScene=new Node(); @@ -113,6 +114,7 @@ private void initInputs() { ActionListener acl = new ActionListener() { + @Override public void onAction(String name, boolean keyPressed, float tpf) { if (name.equals("toggle") && keyPressed) { if(enabled){ @@ -129,6 +131,7 @@ public void onAction(String name, boolean keyPressed, float tpf) { AnalogListener anl=new AnalogListener() { + @Override public void onAnalog(String name, float isPressed, float tpf) { if(name.equals("DensityUp")){ fog.setFogDensity(fog.getFogDensity()+0.001f); diff --git a/jme3-examples/src/main/java/jme3test/post/TestMultiRenderTarget.java b/jme3-examples/src/main/java/jme3test/post/TestMultiRenderTarget.java index ccb073a334..96b6fbefb8 100644 --- a/jme3-examples/src/main/java/jme3test/post/TestMultiRenderTarget.java +++ b/jme3-examples/src/main/java/jme3test/post/TestMultiRenderTarget.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -121,6 +121,7 @@ public void simpleUpdate(float tpf) { FastMath.sin(angle)*3f)); } } + @Override public void initialize(RenderManager rm, ViewPort vp) { reshape(vp, vp.getCamera().getWidth(), vp.getCamera().getHeight()); viewPort.setOutputFrameBuffer(fb); @@ -133,6 +134,7 @@ public void initialize(RenderManager rm, ViewPort vp) { guiNode.updateGeometricState(); } + @Override public void reshape(ViewPort vp, int w, int h) { diffuseData = new Texture2D(w, h, Format.RGBA8); normalData = new Texture2D(w, h, Format.RGBA8); @@ -211,10 +213,12 @@ public void reshape(ViewPort vp, int w, int h) { */ } + @Override public boolean isInitialized() { return diffuseData != null; } + @Override public void preFrame(float tpf) { Matrix4f inverseViewProj = cam.getViewProjectionMatrix().invert(); mat.setMatrix4("ViewProjectionMatrixInverse", inverseViewProj); @@ -222,13 +226,16 @@ public void preFrame(float tpf) { renderManager.setForcedTechnique("GBuf"); } + @Override public void postQueue(RenderQueue rq) { } + @Override public void postFrame(FrameBuffer out) { renderManager.setForcedTechnique(techOrig); } + @Override public void cleanup() { } diff --git a/jme3-examples/src/main/java/jme3test/post/TestMultiViewsFilters.java b/jme3-examples/src/main/java/jme3test/post/TestMultiViewsFilters.java index adbc036c7f..cd5bffc4d1 100644 --- a/jme3-examples/src/main/java/jme3test/post/TestMultiViewsFilters.java +++ b/jme3-examples/src/main/java/jme3test/post/TestMultiViewsFilters.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -55,6 +55,7 @@ public static void main(String[] args) { } private boolean filterEnabled = true; + @Override public void simpleInitApp() { // create the geometry and attach it Geometry teaGeom = (Geometry) assetManager.loadModel("Models/Teapot/Teapot.obj"); @@ -165,6 +166,7 @@ public void simpleInitApp() { inputManager.addListener(new ActionListener() { + @Override public void onAction(String name, boolean isPressed, float tpf) { if (name.equals("press") && isPressed) { if (filterEnabled) { diff --git a/jme3-examples/src/main/java/jme3test/post/TestMultiplesFilters.java b/jme3-examples/src/main/java/jme3test/post/TestMultiplesFilters.java index f2aa6032e3..c83ecdf848 100644 --- a/jme3-examples/src/main/java/jme3test/post/TestMultiplesFilters.java +++ b/jme3-examples/src/main/java/jme3test/post/TestMultiplesFilters.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -66,6 +66,7 @@ public static void main(String[] args) { FilterPostProcessor fpp; boolean en = true; + @Override public void simpleInitApp() { this.flyCam.setMoveSpeed(10); cam.setLocation(new Vector3f(6.0344796f, 1.5054002f, 55.572033f)); @@ -117,6 +118,7 @@ public void simpleInitApp() { inputManager.addListener(new ActionListener() { + @Override public void onAction(String name, boolean isPressed, float tpf) { if ("toggleSSAO".equals(name) && isPressed) { if (ssaoFilter.isEnabled()) { diff --git a/jme3-examples/src/main/java/jme3test/post/TestPostFilters.java b/jme3-examples/src/main/java/jme3test/post/TestPostFilters.java index 7bd807073f..128258b7f7 100644 --- a/jme3-examples/src/main/java/jme3test/post/TestPostFilters.java +++ b/jme3-examples/src/main/java/jme3test/post/TestPostFilters.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -159,6 +159,7 @@ protected void initInput() { } + @Override public void onAction(String name, boolean value, float tpf) { if (name.equals("fadein") && value) { fade.fadeIn(); diff --git a/jme3-examples/src/main/java/jme3test/post/TestPostFiltersCompositing.java b/jme3-examples/src/main/java/jme3test/post/TestPostFiltersCompositing.java index 5a2353e38d..b26b8fd66a 100644 --- a/jme3-examples/src/main/java/jme3test/post/TestPostFiltersCompositing.java +++ b/jme3-examples/src/main/java/jme3test/post/TestPostFiltersCompositing.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -61,6 +61,7 @@ public static void main(String[] args) { } + @Override public void simpleInitApp() { this.flyCam.setMoveSpeed(10); cam.setLocation(new Vector3f(0.028406568f, 2.015769f, 7.386517f)); diff --git a/jme3-examples/src/main/java/jme3test/post/TestPosterization.java b/jme3-examples/src/main/java/jme3test/post/TestPosterization.java index c35236bc28..8e6fb6a6ec 100644 --- a/jme3-examples/src/main/java/jme3test/post/TestPosterization.java +++ b/jme3-examples/src/main/java/jme3test/post/TestPosterization.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -121,6 +121,7 @@ private void initInputs() { ActionListener acl = new ActionListener() { + @Override public void onAction(String name, boolean keyPressed, float tpf) { if (name.equals("toggle") && keyPressed) { pf.setEnabled(!pf.isEnabled()); diff --git a/jme3-examples/src/main/java/jme3test/post/TestRenderToMemory.java b/jme3-examples/src/main/java/jme3test/post/TestRenderToMemory.java index c46448efbe..f370698972 100644 --- a/jme3-examples/src/main/java/jme3test/post/TestRenderToMemory.java +++ b/jme3-examples/src/main/java/jme3test/post/TestRenderToMemory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -138,6 +138,7 @@ public static void main(String[] args){ public void createDisplayFrame(){ SwingUtilities.invokeLater(new Runnable(){ + @Override public void run(){ JFrame frame = new JFrame("Render Display"); display = new ImageDisplay(); @@ -145,6 +146,7 @@ public void run(){ frame.getContentPane().add(display); frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); frame.addWindowListener(new WindowAdapter(){ + @Override public void windowClosed(WindowEvent e){ stop(); } @@ -229,19 +231,24 @@ public void simpleUpdate(float tpf){ offBox.updateGeometricState(); } + @Override public void initialize(RenderManager rm, ViewPort vp) { } + @Override public void reshape(ViewPort vp, int w, int h) { } + @Override public boolean isInitialized() { return true; } + @Override public void preFrame(float tpf) { } + @Override public void postQueue(RenderQueue rq) { } @@ -249,10 +256,12 @@ public void postQueue(RenderQueue rq) { * Update the CPU image's contents after the scene has * been rendered to the framebuffer. */ + @Override public void postFrame(FrameBuffer out) { updateImageContents(); } + @Override public void cleanup() { } diff --git a/jme3-examples/src/main/java/jme3test/post/TestToneMapFilter.java b/jme3-examples/src/main/java/jme3test/post/TestToneMapFilter.java index 2d12958000..b886829650 100644 --- a/jme3-examples/src/main/java/jme3test/post/TestToneMapFilter.java +++ b/jme3-examples/src/main/java/jme3test/post/TestToneMapFilter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -99,6 +99,7 @@ private void initInputs() { ActionListener acl = new ActionListener() { + @Override public void onAction(String name, boolean keyPressed, float tpf) { if (name.equals("toggle") && keyPressed) { if (enabled) { @@ -116,6 +117,7 @@ public void onAction(String name, boolean keyPressed, float tpf) { AnalogListener anl = new AnalogListener() { + @Override public void onAnalog(String name, float isPressed, float tpf) { if (name.equals("WhitePointUp")) { whitePointLog += tpf * 1.0; diff --git a/jme3-examples/src/main/java/jme3test/post/TestTransparentCartoonEdge.java b/jme3-examples/src/main/java/jme3test/post/TestTransparentCartoonEdge.java index 46ba0ac49a..a5f0c82651 100644 --- a/jme3-examples/src/main/java/jme3test/post/TestTransparentCartoonEdge.java +++ b/jme3-examples/src/main/java/jme3test/post/TestTransparentCartoonEdge.java @@ -22,6 +22,7 @@ public static void main(String[] args){ app.start(); } + @Override public void simpleInitApp() { renderManager.setAlphaToCoverage(true); cam.setLocation(new Vector3f(0.14914267f, 0.58147097f, 4.7686534f)); diff --git a/jme3-examples/src/main/java/jme3test/post/TestTransparentSSAO.java b/jme3-examples/src/main/java/jme3test/post/TestTransparentSSAO.java index 310cc2de1a..20a805fc87 100644 --- a/jme3-examples/src/main/java/jme3test/post/TestTransparentSSAO.java +++ b/jme3-examples/src/main/java/jme3test/post/TestTransparentSSAO.java @@ -21,6 +21,7 @@ public static void main(String[] args) { app.start(); } + @Override public void simpleInitApp() { renderManager.setAlphaToCoverage(true); cam.setLocation(new Vector3f(0.14914267f, 0.58147097f, 4.7686534f)); diff --git a/jme3-examples/src/main/java/jme3test/renderer/TestBlendEquations.java b/jme3-examples/src/main/java/jme3test/renderer/TestBlendEquations.java index 04eded427b..4af730a203 100644 --- a/jme3-examples/src/main/java/jme3test/renderer/TestBlendEquations.java +++ b/jme3-examples/src/main/java/jme3test/renderer/TestBlendEquations.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -61,6 +61,7 @@ public static void main(String[] args) { app.start(); } + @Override public void simpleInitApp() { cam.setLocation(new Vector3f(0f, 0.5f, 3f)); viewPort.setBackgroundColor(ColorRGBA.LightGray); diff --git a/jme3-examples/src/main/java/jme3test/renderer/TestDepthFuncChange.java b/jme3-examples/src/main/java/jme3test/renderer/TestDepthFuncChange.java index 9f4f4cef8d..3c00f40ad8 100644 --- a/jme3-examples/src/main/java/jme3test/renderer/TestDepthFuncChange.java +++ b/jme3-examples/src/main/java/jme3test/renderer/TestDepthFuncChange.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -46,6 +46,7 @@ public static void main(String[] args) { app.start(); } + @Override public void simpleInitApp() { viewPort.setBackgroundColor(ColorRGBA.DarkGray); flyCam.setMoveSpeed(20); diff --git a/jme3-examples/src/main/java/jme3test/renderer/TestDepthStencil.java b/jme3-examples/src/main/java/jme3test/renderer/TestDepthStencil.java index 77528893a2..29c76631b9 100644 --- a/jme3-examples/src/main/java/jme3test/renderer/TestDepthStencil.java +++ b/jme3-examples/src/main/java/jme3test/renderer/TestDepthStencil.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2014 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -110,6 +110,7 @@ protected void controlRender(RenderManager rm, ViewPort vp) { inputManager.addMapping("toggle", new KeyTrigger(KeyInput.KEY_SPACE)); ActionListener acl = new ActionListener() { + @Override public void onAction(String name, boolean keyPressed, float tpf) { if (name.equals("toggle") && keyPressed) { if (enableStencil) { diff --git a/jme3-examples/src/main/java/jme3test/renderer/TestInconsistentCompareDetection.java b/jme3-examples/src/main/java/jme3test/renderer/TestInconsistentCompareDetection.java index c1f99b35dc..dbb2eaad8d 100644 --- a/jme3-examples/src/main/java/jme3test/renderer/TestInconsistentCompareDetection.java +++ b/jme3-examples/src/main/java/jme3test/renderer/TestInconsistentCompareDetection.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2014 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -92,6 +92,7 @@ public void simpleInitApp() { } Thread evilThread = new Thread(new Runnable() { + @Override public void run() { try { Thread.sleep(1000); diff --git a/jme3-examples/src/main/java/jme3test/renderer/TestIssue801.java b/jme3-examples/src/main/java/jme3test/renderer/TestIssue801.java new file mode 100644 index 0000000000..0f1893c43b --- /dev/null +++ b/jme3-examples/src/main/java/jme3test/renderer/TestIssue801.java @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2009-2020 jMonkeyEngine + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of 'jMonkeyEngine' nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package jme3test.renderer; + +import com.jme3.app.SimpleApplication; +import com.jme3.input.KeyInput; +import com.jme3.input.controls.ActionListener; +import com.jme3.input.controls.KeyTrigger; +import com.jme3.material.Material; +import com.jme3.math.ColorRGBA; +import com.jme3.scene.Geometry; +import com.jme3.scene.shape.Box; +import com.jme3.system.AppSettings; + +public class TestIssue801 extends SimpleApplication { + + public static void main(String[] args) { + AppSettings initialSettings = new AppSettings(true); + initialSettings.setBitsPerPixel(24); + + TestIssue801 app = new TestIssue801(); + app.setSettings(initialSettings); + app.start(); + } + + @Override + public void simpleInitApp() { + viewPort.setBackgroundColor(new ColorRGBA(0.3f, 0.3f, 0.3f, 1f)); + + Box b = new Box(1, 1, 1); + Geometry geom = new Geometry("Box", b); + + Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md"); + mat.setColor("Color", ColorRGBA.Blue); + geom.setMaterial(mat); + + rootNode.attachChild(geom); + inputManager.addMapping("changeBpp", new KeyTrigger(KeyInput.KEY_P)); + ActionListener listener = new ActionListener() { + @Override + public void onAction(String name, boolean keyPressed, float tpf) { + if (name.equals("changeBpp") && keyPressed) { + goWindowed(); + } + } + }; + inputManager.addListener(listener, "changeBpp"); + } + + void goWindowed() { + AppSettings newSettings = new AppSettings(false); + newSettings.copyFrom(settings); + newSettings.setBitsPerPixel(16); + + setSettings(newSettings); + restart(); + } +} diff --git a/jme3-examples/src/main/java/jme3test/renderer/TestMultiViews.java b/jme3-examples/src/main/java/jme3test/renderer/TestMultiViews.java index b098eaddd4..ae8e51dca5 100644 --- a/jme3-examples/src/main/java/jme3test/renderer/TestMultiViews.java +++ b/jme3-examples/src/main/java/jme3test/renderer/TestMultiViews.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -47,6 +47,7 @@ public static void main(String[] args) { app.start(); } + @Override public void simpleInitApp() { // create the geometry and attach it Geometry teaGeom = (Geometry) assetManager.loadModel("Models/Teapot/Teapot.obj"); diff --git a/jme3-examples/src/main/java/jme3test/renderer/TestParallelProjection.java b/jme3-examples/src/main/java/jme3test/renderer/TestParallelProjection.java index 5fc7ab0990..990da80158 100644 --- a/jme3-examples/src/main/java/jme3test/renderer/TestParallelProjection.java +++ b/jme3-examples/src/main/java/jme3test/renderer/TestParallelProjection.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -50,6 +50,7 @@ public static void main(String[] args){ app.start(); } + @Override public void simpleInitApp() { Geometry teaGeom = (Geometry) assetManager.loadModel("Models/Teapot/Teapot.obj"); @@ -70,6 +71,7 @@ public void simpleInitApp() { inputManager.addMapping("Size-", new KeyTrigger(KeyInput.KEY_S)); } + @Override public void onAnalog(String name, float value, float tpf) { // Instead of moving closer/farther to object, we zoom in/out. if (name.equals("Size-")) diff --git a/jme3-examples/src/main/java/jme3test/scene/TestSceneLoading.java b/jme3-examples/src/main/java/jme3test/scene/TestSceneLoading.java index 2567d94fa1..b3bc05d905 100644 --- a/jme3-examples/src/main/java/jme3test/scene/TestSceneLoading.java +++ b/jme3-examples/src/main/java/jme3test/scene/TestSceneLoading.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -62,6 +62,7 @@ public void simpleUpdate(float tpf){ sphere.setLocalTranslation(cam.getLocation()); } + @Override public void simpleInitApp() { this.flyCam.setMoveSpeed(10); diff --git a/jme3-examples/src/main/java/jme3test/scene/TestUserData.java b/jme3-examples/src/main/java/jme3test/scene/TestUserData.java index 59cf6d3741..b482f1906e 100644 --- a/jme3-examples/src/main/java/jme3test/scene/TestUserData.java +++ b/jme3-examples/src/main/java/jme3test/scene/TestUserData.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -43,6 +43,7 @@ public static void main(String[] args) { app.start(); } + @Override public void simpleInitApp() { Node scene = (Node) assetManager.loadModel("Scenes/DotScene/DotScene.scene"); System.out.println("Scene: " + scene); diff --git a/jme3-examples/src/main/java/jme3test/stress/TestBatchLod.java b/jme3-examples/src/main/java/jme3test/stress/TestBatchLod.java index 08ef772a3b..cdf193c0ba 100644 --- a/jme3-examples/src/main/java/jme3test/stress/TestBatchLod.java +++ b/jme3-examples/src/main/java/jme3test/stress/TestBatchLod.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -50,6 +50,7 @@ public static void main(String[] args) { app.start(); } + @Override public void simpleInitApp() { // inputManager.registerKeyBinding("USELOD", KeyInput.KEY_L); diff --git a/jme3-examples/src/main/java/jme3test/stress/TestLeakingGL.java b/jme3-examples/src/main/java/jme3test/stress/TestLeakingGL.java index bd2bd485b4..24861464ad 100644 --- a/jme3-examples/src/main/java/jme3test/stress/TestLeakingGL.java +++ b/jme3-examples/src/main/java/jme3test/stress/TestLeakingGL.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -59,6 +59,7 @@ public static void main(String[] args){ app.start(); } + @Override public void simpleInitApp() { original = new Sphere(4, 4, 1); original.setStatic(); diff --git a/jme3-examples/src/main/java/jme3test/stress/TestLodGeneration.java b/jme3-examples/src/main/java/jme3test/stress/TestLodGeneration.java index 5400e98d8e..10094dfcb4 100644 --- a/jme3-examples/src/main/java/jme3test/stress/TestLodGeneration.java +++ b/jme3-examples/src/main/java/jme3test/stress/TestLodGeneration.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -66,6 +66,7 @@ public static void main(String[] args) { private ScheduledThreadPoolExecutor exec = new ScheduledThreadPoolExecutor(5); private AnimChannel ch; + @Override public void simpleInitApp() { DirectionalLight dl = new DirectionalLight(); @@ -124,6 +125,7 @@ public void simpleInitApp() { guiNode.attachChild(hudText); inputManager.addListener(new ActionListener() { + @Override public void onAction(String name, boolean isPressed, float tpf) { if (isPressed) { if (name.equals("plus")) { @@ -211,12 +213,14 @@ public void destroy() { private void makeLod(final LodGenerator.TriangleReductionMethod method, final float value, final int ll) { exec.execute(new Runnable() { + @Override public void run() { for (final Geometry geometry : listGeoms) { LodGenerator lODGenerator = new LodGenerator(geometry); final VertexBuffer[] lods = lODGenerator.computeLods(method, value); enqueue(new Callable() { + @Override public Void call() throws Exception { geometry.getMesh().setLodLevels(lods); lodLevel = 0; diff --git a/jme3-examples/src/main/java/jme3test/stress/TestLodStress.java b/jme3-examples/src/main/java/jme3test/stress/TestLodStress.java index 21b8e9d539..8fa033a5e0 100644 --- a/jme3-examples/src/main/java/jme3test/stress/TestLodStress.java +++ b/jme3-examples/src/main/java/jme3test/stress/TestLodStress.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -50,6 +50,7 @@ public static void main(String[] args){ app.start(); } + @Override public void simpleInitApp() { DirectionalLight dl = new DirectionalLight(); dl.setDirection(new Vector3f(-1,-1,-1).normalizeLocal()); diff --git a/jme3-examples/src/main/java/jme3test/stress/TestShaderNodesStress.java b/jme3-examples/src/main/java/jme3test/stress/TestShaderNodesStress.java index 0635c2b16a..34ab16f550 100644 --- a/jme3-examples/src/main/java/jme3test/stress/TestShaderNodesStress.java +++ b/jme3-examples/src/main/java/jme3test/stress/TestShaderNodesStress.java @@ -82,7 +82,7 @@ public void appStep(AppStep step) { renderTime = System.nanoTime(); sum += renderTime - updateTime; System.err.println("render time : " + (renderTime - updateTime)); - System.err.println("Average render time : " + ((float)sum / (float)(nbFrames-150))); + System.err.println("Average render time : " + (sum / (float)(nbFrames-150))); } break; diff --git a/jme3-examples/src/main/java/jme3test/terrain/TerrainGridAlphaMapTest.java b/jme3-examples/src/main/java/jme3test/terrain/TerrainGridAlphaMapTest.java index cf5e9d75c1..737fe33fda 100644 --- a/jme3-examples/src/main/java/jme3test/terrain/TerrainGridAlphaMapTest.java +++ b/jme3-examples/src/main/java/jme3test/terrain/TerrainGridAlphaMapTest.java @@ -182,9 +182,11 @@ public float value(float... in) { } terrain.addListener(new TerrainGridListener() { + @Override public void gridMoved(Vector3f newCenter) { } + @Override public void tileAttached(Vector3f cell, TerrainQuad quad) { Texture alpha = null; try { @@ -200,6 +202,7 @@ public void tileAttached(Vector3f cell, TerrainQuad quad) { updateMarkerElevations(); } + @Override public void tileDetached(Vector3f cell, TerrainQuad quad) { if (usePhysics) { if (quad.getControl(RigidBodyControl.class) != null) { diff --git a/jme3-examples/src/main/java/jme3test/terrain/TerrainGridSerializationTest.java b/jme3-examples/src/main/java/jme3test/terrain/TerrainGridSerializationTest.java index b20357ded7..8cf5a92d0b 100644 --- a/jme3-examples/src/main/java/jme3test/terrain/TerrainGridSerializationTest.java +++ b/jme3-examples/src/main/java/jme3test/terrain/TerrainGridSerializationTest.java @@ -74,9 +74,11 @@ public void simpleInitApp() { terrain.addListener(new TerrainGridListener() { + @Override public void gridMoved(Vector3f newCenter) { } + @Override public void tileAttached(Vector3f cell, TerrainQuad quad) { //workaround for bugged test j3o's while(quad.getControl(RigidBodyControl.class)!=null){ @@ -86,6 +88,7 @@ public void tileAttached(Vector3f cell, TerrainQuad quad) { bulletAppState.getPhysicsSpace().add(quad); } + @Override public void tileDetached(Vector3f cell, TerrainQuad quad) { if (quad.getControl(RigidBodyControl.class) != null) { bulletAppState.getPhysicsSpace().remove(quad); diff --git a/jme3-examples/src/main/java/jme3test/terrain/TerrainGridTest.java b/jme3-examples/src/main/java/jme3test/terrain/TerrainGridTest.java index 1781b71060..425190d1d8 100644 --- a/jme3-examples/src/main/java/jme3test/terrain/TerrainGridTest.java +++ b/jme3-examples/src/main/java/jme3test/terrain/TerrainGridTest.java @@ -91,6 +91,7 @@ public void simpleInitApp() { this.terrain = new TerrainGrid("terrain", 65, 257, new ImageTileLoader(assetManager, new Namer() { + @Override public String getName(int x, int y) { return "Scenes/TerrainMountains/terrain_" + x + "_" + y + ".png"; } @@ -130,9 +131,11 @@ public String getName(int x, int y) { terrain.addListener(new TerrainGridListener() { + @Override public void gridMoved(Vector3f newCenter) { } + @Override public void tileAttached(Vector3f cell, TerrainQuad quad) { while(quad.getControl(RigidBodyControl.class)!=null){ quad.removeControl(RigidBodyControl.class); @@ -141,6 +144,7 @@ public void tileAttached(Vector3f cell, TerrainQuad quad) { bulletAppState.getPhysicsSpace().add(quad); } + @Override public void tileDetached(Vector3f cell, TerrainQuad quad) { if (quad.getControl(RigidBodyControl.class) != null) { bulletAppState.getPhysicsSpace().remove(quad); diff --git a/jme3-examples/src/main/java/jme3test/terrain/TerrainGridTileLoaderTest.java b/jme3-examples/src/main/java/jme3test/terrain/TerrainGridTileLoaderTest.java index 3485e4dc84..114b1068ed 100644 --- a/jme3-examples/src/main/java/jme3test/terrain/TerrainGridTileLoaderTest.java +++ b/jme3-examples/src/main/java/jme3test/terrain/TerrainGridTileLoaderTest.java @@ -136,9 +136,11 @@ public void simpleInitApp() { terrain.addListener(new TerrainGridListener() { + @Override public void gridMoved(Vector3f newCenter) { } + @Override public void tileAttached(Vector3f cell, TerrainQuad quad) { while(quad.getControl(RigidBodyControl.class)!=null){ quad.removeControl(RigidBodyControl.class); @@ -147,6 +149,7 @@ public void tileAttached(Vector3f cell, TerrainQuad quad) { bulletAppState.getPhysicsSpace().add(quad); } + @Override public void tileDetached(Vector3f cell, TerrainQuad quad) { if (quad.getControl(RigidBodyControl.class) != null) { bulletAppState.getPhysicsSpace().remove(quad); diff --git a/jme3-examples/src/main/java/jme3test/terrain/TerrainTest.java b/jme3-examples/src/main/java/jme3test/terrain/TerrainTest.java index 5da9d9d2bc..4903401090 100644 --- a/jme3-examples/src/main/java/jme3test/terrain/TerrainTest.java +++ b/jme3-examples/src/main/java/jme3test/terrain/TerrainTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -189,6 +189,7 @@ private void setupKeys() { } private ActionListener actionListener = new ActionListener() { + @Override public void onAction(String name, boolean pressed, float tpf) { if (name.equals("wireframe") && !pressed) { wireframe = !wireframe; @@ -204,9 +205,9 @@ public void onAction(String name, boolean pressed, float tpf) { // planar textures don't use the mesh's texture coordinates but real world coordinates, // so we need to convert these texture coordinate scales into real world scales so it looks // the same when we switch to/from tri-planar mode - matRock.setFloat("Tex1Scale", 1f / (float) (512f / grassScale)); - matRock.setFloat("Tex2Scale", 1f / (float) (512f / dirtScale)); - matRock.setFloat("Tex3Scale", 1f / (float) (512f / rockScale)); + matRock.setFloat("Tex1Scale", 1f / (512f / grassScale)); + matRock.setFloat("Tex2Scale", 1f / (512f / dirtScale)); + matRock.setFloat("Tex3Scale", 1f / (512f / rockScale)); } else { matRock.setBoolean("useTriPlanarMapping", false); matRock.setFloat("Tex1Scale", grassScale); diff --git a/jme3-examples/src/main/java/jme3test/terrain/TerrainTestAdvanced.java b/jme3-examples/src/main/java/jme3test/terrain/TerrainTestAdvanced.java index afd83ac31f..e6ece01d8b 100644 --- a/jme3-examples/src/main/java/jme3test/terrain/TerrainTestAdvanced.java +++ b/jme3-examples/src/main/java/jme3test/terrain/TerrainTestAdvanced.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -251,6 +251,7 @@ private void setupKeys() { } private ActionListener actionListener = new ActionListener() { + @Override public void onAction(String name, boolean pressed, float tpf) { if (name.equals("wireframe") && !pressed) { wireframe = !wireframe; @@ -266,13 +267,13 @@ public void onAction(String name, boolean pressed, float tpf) { // planar textures don't use the mesh's texture coordinates but real world coordinates, // so we need to convert these texture coordinate scales into real world scales so it looks // the same when we switch to/from tr-planar mode (1024f is the alphamap size) - matTerrain.setFloat("DiffuseMap_0_scale", 1f / (float) (1024f / dirtScale)); - matTerrain.setFloat("DiffuseMap_1_scale", 1f / (float) (1024f / darkRockScale)); - matTerrain.setFloat("DiffuseMap_2_scale", 1f / (float) (1024f / pinkRockScale)); - matTerrain.setFloat("DiffuseMap_3_scale", 1f / (float) (1024f / riverRockScale)); - matTerrain.setFloat("DiffuseMap_4_scale", 1f / (float) (1024f / grassScale)); - matTerrain.setFloat("DiffuseMap_5_scale", 1f / (float) (1024f / brickScale)); - matTerrain.setFloat("DiffuseMap_6_scale", 1f / (float) (1024f / roadScale)); + matTerrain.setFloat("DiffuseMap_0_scale", 1f / (1024f / dirtScale)); + matTerrain.setFloat("DiffuseMap_1_scale", 1f / (1024f / darkRockScale)); + matTerrain.setFloat("DiffuseMap_2_scale", 1f / (1024f / pinkRockScale)); + matTerrain.setFloat("DiffuseMap_3_scale", 1f / (1024f / riverRockScale)); + matTerrain.setFloat("DiffuseMap_4_scale", 1f / (1024f / grassScale)); + matTerrain.setFloat("DiffuseMap_5_scale", 1f / (1024f / brickScale)); + matTerrain.setFloat("DiffuseMap_6_scale", 1f / (1024f / roadScale)); } else { matTerrain.setBoolean("useTriPlanarMapping", false); diff --git a/jme3-examples/src/main/java/jme3test/terrain/TerrainTestAndroid.java b/jme3-examples/src/main/java/jme3test/terrain/TerrainTestAndroid.java index d5b74b2914..2ce1ba9275 100644 --- a/jme3-examples/src/main/java/jme3test/terrain/TerrainTestAndroid.java +++ b/jme3-examples/src/main/java/jme3test/terrain/TerrainTestAndroid.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -170,6 +170,7 @@ private void setupKeys() { } private ActionListener actionListener = new ActionListener() { + @Override public void onAction(String name, boolean pressed, float tpf) { if (name.equals("wireframe") && !pressed) { wireframe = !wireframe; @@ -185,9 +186,9 @@ public void onAction(String name, boolean pressed, float tpf) { // planar textures don't use the mesh's texture coordinates but real world coordinates, // so we need to convert these texture coordinate scales into real world scales so it looks // the same when we switch to/from tr-planar mode - matRock.setFloat("Tex1Scale", 1f / (float) (512f / grassScale)); - matRock.setFloat("Tex2Scale", 1f / (float) (512f / dirtScale)); - matRock.setFloat("Tex3Scale", 1f / (float) (512f / rockScale)); + matRock.setFloat("Tex1Scale", 1f / (512f / grassScale)); + matRock.setFloat("Tex2Scale", 1f / (512f / dirtScale)); + matRock.setFloat("Tex3Scale", 1f / (512f / rockScale)); } else { matRock.setBoolean("useTriPlanarMapping", false); matRock.setFloat("Tex1Scale", grassScale); diff --git a/jme3-examples/src/main/java/jme3test/terrain/TerrainTestCollision.java b/jme3-examples/src/main/java/jme3test/terrain/TerrainTestCollision.java index faa67fd137..6b6fe8cdab 100644 --- a/jme3-examples/src/main/java/jme3test/terrain/TerrainTestCollision.java +++ b/jme3-examples/src/main/java/jme3test/terrain/TerrainTestCollision.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -248,6 +248,7 @@ private void createCollisionMarkers(int num) { private ActionListener actionListener = new ActionListener() { + @Override public void onAction(String binding, boolean keyPressed, float tpf) { if (binding.equals("wireframe") && !keyPressed) { wireframe = !wireframe; diff --git a/jme3-examples/src/main/java/jme3test/terrain/TerrainTestModifyHeight.java b/jme3-examples/src/main/java/jme3test/terrain/TerrainTestModifyHeight.java index b68761593e..de371ccb9a 100644 --- a/jme3-examples/src/main/java/jme3test/terrain/TerrainTestModifyHeight.java +++ b/jme3-examples/src/main/java/jme3test/terrain/TerrainTestModifyHeight.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -193,6 +193,7 @@ private void setupKeys() { } private ActionListener actionListener = new ActionListener() { + @Override public void onAction(String name, boolean pressed, float tpf) { if (name.equals("wireframe") && !pressed) { wireframe = !wireframe; diff --git a/jme3-examples/src/main/java/jme3test/terrain/TerrainTestReadWrite.java b/jme3-examples/src/main/java/jme3test/terrain/TerrainTestReadWrite.java index 8610962985..313188e600 100644 --- a/jme3-examples/src/main/java/jme3test/terrain/TerrainTestReadWrite.java +++ b/jme3-examples/src/main/java/jme3test/terrain/TerrainTestReadWrite.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -195,6 +195,7 @@ public void loadHintText() { } private ActionListener saveActionListener = new ActionListener() { + @Override public void onAction(String name, boolean pressed, float tpf) { if (name.equals("save") && !pressed) { @@ -267,6 +268,7 @@ private void loadTerrain() { } private ActionListener loadActionListener = new ActionListener() { + @Override public void onAction(String name, boolean pressed, float tpf) { if (name.equals("load") && !pressed) { loadTerrain(); @@ -275,6 +277,7 @@ public void onAction(String name, boolean pressed, float tpf) { }; private ActionListener cloneActionListener = new ActionListener() { + @Override public void onAction(String name, boolean pressed, float tpf) { if (name.equals("clone") && !pressed) { diff --git a/jme3-examples/src/main/java/jme3test/terrain/TerrainTestTile.java b/jme3-examples/src/main/java/jme3test/terrain/TerrainTestTile.java index 454846b8c5..20f279fa15 100644 --- a/jme3-examples/src/main/java/jme3test/terrain/TerrainTestTile.java +++ b/jme3-examples/src/main/java/jme3test/terrain/TerrainTestTile.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -147,6 +147,7 @@ private void setupKeys() { } private ActionListener actionListener = new ActionListener() { + @Override public void onAction(String name, boolean pressed, float tpf) { if (name.equals("wireframe") && !pressed) { wireframe = !wireframe; @@ -231,6 +232,7 @@ private class TiledTerrain extends Node implements Terrain, NeighbourFinder { * 1 3 * 2 4 */ + @Override public TerrainQuad getRightQuad(TerrainQuad center) { //System.out.println("lookup neighbour"); if (center == terrain1) @@ -245,6 +247,7 @@ public TerrainQuad getRightQuad(TerrainQuad center) { * 1 3 * 2 4 */ + @Override public TerrainQuad getLeftQuad(TerrainQuad center) { //System.out.println("lookup neighbour"); if (center == terrain3) @@ -259,6 +262,7 @@ public TerrainQuad getLeftQuad(TerrainQuad center) { * 1 3 * 2 4 */ + @Override public TerrainQuad getTopQuad(TerrainQuad center) { //System.out.println("lookup neighbour"); if (center == terrain2) @@ -273,6 +277,7 @@ public TerrainQuad getTopQuad(TerrainQuad center) { * 1 3 * 2 4 */ + @Override public TerrainQuad getDownQuad(TerrainQuad center) { //System.out.println("lookup neighbour"); if (center == terrain1) @@ -283,69 +288,84 @@ public TerrainQuad getDownQuad(TerrainQuad center) { return null; } + @Override public float getHeight(Vector2f xz) { // you will have to offset the coordinate for each terrain, to center on it throw new UnsupportedOperationException("Not supported yet."); } + @Override public Vector3f getNormal(Vector2f xz) { // you will have to offset the coordinate for each terrain, to center on it throw new UnsupportedOperationException("Not supported yet."); } + @Override public float getHeightmapHeight(Vector2f xz) { // you will have to offset the coordinate for each terrain, to center on it throw new UnsupportedOperationException("Not supported yet."); } + @Override public void setHeight(Vector2f xzCoordinate, float height) { // you will have to offset the coordinate for each terrain, to center on it throw new UnsupportedOperationException("Not supported yet."); } + @Override public void setHeight(List xz, List height) { // you will have to offset the coordinate for each terrain, to center on it throw new UnsupportedOperationException("Not supported yet."); } + @Override public void adjustHeight(Vector2f xzCoordinate, float delta) { // you will have to offset the coordinate for each terrain, to center on it throw new UnsupportedOperationException("Not supported yet."); } + @Override public void adjustHeight(List xz, List height) { // you will have to offset the coordinate for each terrain, to center on it throw new UnsupportedOperationException("Not supported yet."); } + @Override public float[] getHeightMap() { throw new UnsupportedOperationException("Not supported yet."); } + @Override public int getMaxLod() { throw new UnsupportedOperationException("Not supported yet."); } + @Override public void setLocked(boolean locked) { throw new UnsupportedOperationException("Not supported yet."); } + @Override public void generateEntropy(ProgressMonitor monitor) { throw new UnsupportedOperationException("Not supported yet."); } + @Override public Material getMaterial() { throw new UnsupportedOperationException("Not supported yet."); } + @Override public Material getMaterial(Vector3f worldLocation) { throw new UnsupportedOperationException("Not supported yet."); } + @Override public int getTerrainSize() { throw new UnsupportedOperationException("Not supported yet."); } + @Override public int getNumMajorSubdivisions() { throw new UnsupportedOperationException("Not supported yet."); } diff --git a/jme3-examples/src/main/java/jme3test/texture/TestSkyLoading.java b/jme3-examples/src/main/java/jme3test/texture/TestSkyLoading.java index 7991bd067f..21c1b590b9 100644 --- a/jme3-examples/src/main/java/jme3test/texture/TestSkyLoading.java +++ b/jme3-examples/src/main/java/jme3test/texture/TestSkyLoading.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -44,6 +44,7 @@ public static void main(String[] args){ app.start(); } + @Override public void simpleInitApp() { Texture west = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_west.jpg"); Texture east = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_east.jpg"); diff --git a/jme3-examples/src/main/java/jme3test/tools/TestSaveGame.java b/jme3-examples/src/main/java/jme3test/tools/TestSaveGame.java index 8e90d181a5..69d937868d 100644 --- a/jme3-examples/src/main/java/jme3test/tools/TestSaveGame.java +++ b/jme3-examples/src/main/java/jme3test/tools/TestSaveGame.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -49,6 +49,7 @@ public static void main(String[] args) { public void simpleUpdate(float tpf) { } + @Override public void simpleInitApp() { //node that is used to store player data @@ -59,7 +60,7 @@ public void simpleInitApp() { myPlayer.setUserData("points", 0); //the actual model would be attached to this node - Spatial model = (Spatial) assetManager.loadModel("Models/Oto/Oto.mesh.xml"); + Spatial model = assetManager.loadModel("Models/Oto/Oto.mesh.xml"); myPlayer.attachChild(model); //before saving the game, the model should be detached so it's not saved along with the node diff --git a/jme3-examples/src/main/java/jme3test/water/TestPostWater.java b/jme3-examples/src/main/java/jme3test/water/TestPostWater.java index 3d650c170b..0f3531dbbd 100644 --- a/jme3-examples/src/main/java/jme3test/water/TestPostWater.java +++ b/jme3-examples/src/main/java/jme3test/water/TestPostWater.java @@ -166,6 +166,7 @@ public void simpleInitApp() { viewPort.addProcessor(fpp); inputManager.addListener(new ActionListener() { + @Override public void onAction(String name, boolean isPressed, float tpf) { if (isPressed) { if (name.equals("foam1")) { diff --git a/jme3-examples/src/main/java/jme3test/water/TestPostWaterLake.java b/jme3-examples/src/main/java/jme3test/water/TestPostWaterLake.java index d5a6df5f22..8437290e5d 100644 --- a/jme3-examples/src/main/java/jme3test/water/TestPostWaterLake.java +++ b/jme3-examples/src/main/java/jme3test/water/TestPostWaterLake.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -58,6 +58,7 @@ public static void main(String[] args) { app.start(); } + @Override public void simpleInitApp() { this.flyCam.setMoveSpeed(10); cam.setLocation(new Vector3f(-27.0f, 1.0f, 75.0f)); @@ -112,6 +113,7 @@ public void simpleInitApp() { inputManager.addListener(new ActionListener() { + @Override public void onAction(String name, boolean isPressed, float tpf) { if(isPressed){ if(water.isUseHQShoreline()){ diff --git a/jme3-examples/src/main/java/jme3test/water/TestSceneWater.java b/jme3-examples/src/main/java/jme3test/water/TestSceneWater.java index 4e0d8d6fc5..62584e5456 100644 --- a/jme3-examples/src/main/java/jme3test/water/TestSceneWater.java +++ b/jme3-examples/src/main/java/jme3test/water/TestSceneWater.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -59,6 +59,7 @@ public static void main(String[] args) { app.start(); } + @Override public void simpleInitApp() { this.flyCam.setMoveSpeed(10); Node mainScene=new Node(); diff --git a/jme3-examples/src/main/java/jme3test/water/TestSimpleWater.java b/jme3-examples/src/main/java/jme3test/water/TestSimpleWater.java index c8ba06fed0..4380ced037 100644 --- a/jme3-examples/src/main/java/jme3test/water/TestSimpleWater.java +++ b/jme3-examples/src/main/java/jme3test/water/TestSimpleWater.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -81,7 +81,7 @@ public void simpleInitApp() { //create water quad //waterPlane = waterProcessor.createWaterGeometry(100, 100); - waterPlane=(Spatial) assetManager.loadModel("Models/WaterTest/WaterTest.mesh.xml"); + waterPlane = assetManager.loadModel("Models/WaterTest/WaterTest.mesh.xml"); waterPlane.setMaterial(waterProcessor.getMaterial()); waterPlane.setLocalScale(40); waterPlane.setLocalTranslation(-5, 0, 5); @@ -142,6 +142,7 @@ public void simpleUpdate(float tpf) { waterProcessor.setLightPosition(lightPos); } + @Override public void onAction(String name, boolean value, float tpf) { if (name.equals("use_water") && value) { if (!useWater) { diff --git a/jme3-examples/src/main/java/jme3test/water/WaterUI.java b/jme3-examples/src/main/java/jme3test/water/WaterUI.java index c09732089c..cd2d0dfc51 100644 --- a/jme3-examples/src/main/java/jme3test/water/WaterUI.java +++ b/jme3-examples/src/main/java/jme3test/water/WaterUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -92,6 +92,7 @@ public WaterUI(InputManager inputManager, SimpleWaterProcessor proc) { AnalogListener anl = new AnalogListener() { + @Override public void onAnalog(String name, float value, float tpf) { if (name.equals("transparencyUp")) { processor.setWaterTransparency(processor.getWaterTransparency()+0.001f); diff --git a/jme3-ios/src/main/java/com/jme3/audio/ios/IosAL.java b/jme3-ios/src/main/java/com/jme3/audio/ios/IosAL.java index 7812dc7482..0b807f5d98 100644 --- a/jme3-ios/src/main/java/com/jme3/audio/ios/IosAL.java +++ b/jme3-ios/src/main/java/com/jme3/audio/ios/IosAL.java @@ -10,44 +10,64 @@ public final class IosAL implements AL { public IosAL() { } + @Override public native String alGetString(int parameter); + @Override public native int alGenSources(); + @Override public native int alGetError(); + @Override public native void alDeleteSources(int numSources, IntBuffer sources); + @Override public native void alGenBuffers(int numBuffers, IntBuffer buffers); + @Override public native void alDeleteBuffers(int numBuffers, IntBuffer buffers); + @Override public native void alSourceStop(int source); + @Override public native void alSourcei(int source, int param, int value); + @Override public native void alBufferData(int buffer, int format, ByteBuffer data, int size, int frequency); + @Override public native void alSourcePlay(int source); + @Override public native void alSourcePause(int source); + @Override public native void alSourcef(int source, int param, float value); + @Override public native void alSource3f(int source, int param, float value1, float value2, float value3); + @Override public native int alGetSourcei(int source, int param); + @Override public native void alSourceUnqueueBuffers(int source, int numBuffers, IntBuffer buffers); + @Override public native void alSourceQueueBuffers(int source, int numBuffers, IntBuffer buffers); + @Override public native void alListener(int param, FloatBuffer data); + @Override public native void alListenerf(int param, float value); + @Override public native void alListener3f(int param, float value1, float value2, float value3); + @Override public native void alSource3i(int source, int param, int value1, int value2, int value3); } diff --git a/jme3-ios/src/main/java/com/jme3/audio/ios/IosALC.java b/jme3-ios/src/main/java/com/jme3/audio/ios/IosALC.java index f1579c9e53..775fd55813 100644 --- a/jme3-ios/src/main/java/com/jme3/audio/ios/IosALC.java +++ b/jme3-ios/src/main/java/com/jme3/audio/ios/IosALC.java @@ -8,19 +8,27 @@ public final class IosALC implements ALC { public IosALC() { } + @Override public native void createALC(); + @Override public native void destroyALC(); + @Override public native boolean isCreated(); + @Override public native String alcGetString(int parameter); + @Override public native boolean alcIsExtensionPresent(String extension); + @Override public native void alcGetInteger(int param, IntBuffer buffer, int size); + @Override public native void alcDevicePauseSOFT(); + @Override public native void alcDeviceResumeSOFT(); } diff --git a/jme3-ios/src/main/java/com/jme3/audio/ios/IosEFX.java b/jme3-ios/src/main/java/com/jme3/audio/ios/IosEFX.java index d7a569c1fd..e050626cec 100644 --- a/jme3-ios/src/main/java/com/jme3/audio/ios/IosEFX.java +++ b/jme3-ios/src/main/java/com/jme3/audio/ios/IosEFX.java @@ -8,25 +8,36 @@ public class IosEFX implements EFX { public IosEFX() { } + @Override public native void alGenAuxiliaryEffectSlots(int numSlots, IntBuffer buffers); + @Override public native void alGenEffects(int numEffects, IntBuffer buffers); + @Override public native void alEffecti(int effect, int param, int value); + @Override public native void alAuxiliaryEffectSloti(int effectSlot, int param, int value); + @Override public native void alDeleteEffects(int numEffects, IntBuffer buffers); + @Override public native void alDeleteAuxiliaryEffectSlots(int numEffectSlots, IntBuffer buffers); + @Override public native void alGenFilters(int numFilters, IntBuffer buffers); + @Override public native void alFilteri(int filter, int param, int value); + @Override public native void alFilterf(int filter, int param, float value); + @Override public native void alDeleteFilters(int numFilters, IntBuffer buffers); + @Override public native void alEffectf(int effect, int param, float value); } diff --git a/jme3-ios/src/main/java/com/jme3/input/ios/IosInputHandler.java b/jme3-ios/src/main/java/com/jme3/input/ios/IosInputHandler.java index 725fe14541..f7c0733411 100644 --- a/jme3-ios/src/main/java/com/jme3/input/ios/IosInputHandler.java +++ b/jme3-ios/src/main/java/com/jme3/input/ios/IosInputHandler.java @@ -107,6 +107,7 @@ public void setSimulateKeyboard(boolean simulate) { this.keyboardEventsEnabled = simulate; } + @Override public boolean isSimulateKeyboard() { return keyboardEventsEnabled; } diff --git a/jme3-ios/src/main/java/com/jme3/input/ios/TouchEventPool.java b/jme3-ios/src/main/java/com/jme3/input/ios/TouchEventPool.java index f986db1551..5ef260a24c 100644 --- a/jme3-ios/src/main/java/com/jme3/input/ios/TouchEventPool.java +++ b/jme3-ios/src/main/java/com/jme3/input/ios/TouchEventPool.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -87,7 +87,7 @@ public TouchEvent getNextFreeEvent() { TouchEvent evt = null; int curSize = eventPool.size(); while (curSize > 0) { - evt = (TouchEvent)eventPool.pop(); + evt = eventPool.pop(); if (evt.isConsumed()) { break; } else { diff --git a/jme3-ios/src/main/java/com/jme3/renderer/ios/IosGL.java b/jme3-ios/src/main/java/com/jme3/renderer/ios/IosGL.java index 826ce82a2d..39f20a41a0 100644 --- a/jme3-ios/src/main/java/com/jme3/renderer/ios/IosGL.java +++ b/jme3-ios/src/main/java/com/jme3/renderer/ios/IosGL.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2015 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -51,6 +51,7 @@ public class IosGL implements GL, GLExt, GLFbo { private final int[] temp_array = new int[16]; + @Override public void resetStats() { } @@ -116,10 +117,12 @@ private static void checkLimit(Buffer buffer) { } } + @Override public void glActiveTexture(int texture) { JmeIosGLES.glActiveTexture(texture); } + @Override public void glAttachShader(int program, int shader) { JmeIosGLES.glAttachShader(program, shader); } @@ -129,147 +132,182 @@ public void glBeginQuery(int target, int query) { throw new UnsupportedOperationException("Today is not a good day for this"); } + @Override public void glBindBuffer(int target, int buffer) { JmeIosGLES.glBindBuffer(target, buffer); } + @Override public void glBindTexture(int target, int texture) { JmeIosGLES.glBindTexture(target, texture); } + @Override public void glBlendFunc(int sfactor, int dfactor) { JmeIosGLES.glBlendFunc(sfactor, dfactor); } + @Override public void glBlendFuncSeparate(int sfactorRGB, int dfactorRGB, int sfactorAlpha, int dfactorAlpha) { JmeIosGLES.glBlendFuncSeparate(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha); } + @Override public void glBufferData(int target, FloatBuffer data, int usage) { JmeIosGLES.glBufferData(target, getLimitBytes(data), data, usage); } + @Override public void glBufferData(int target, ShortBuffer data, int usage) { JmeIosGLES.glBufferData(target, getLimitBytes(data), data, usage); } + @Override public void glBufferData(int target, ByteBuffer data, int usage) { JmeIosGLES.glBufferData(target, getLimitBytes(data), data, usage); } + @Override public void glBufferData(int target, long data_size, int usage) { JmeIosGLES.glBufferData(target, (int) data_size, null, usage); } + @Override public void glBufferSubData(int target, long offset, FloatBuffer data) { JmeIosGLES.glBufferSubData(target, (int) offset, getLimitBytes(data), data); } + @Override public void glBufferSubData(int target, long offset, ShortBuffer data) { JmeIosGLES.glBufferSubData(target, (int) offset, getLimitBytes(data), data); } + @Override public void glBufferSubData(int target, long offset, ByteBuffer data) { JmeIosGLES.glBufferSubData(target, (int) offset, getLimitBytes(data), data); } + @Override public void glGetBufferSubData(int target, long offset, ByteBuffer data) { throw new UnsupportedOperationException("OpenGL ES 2 does not support glGetBufferSubData"); } + @Override public void glClear(int mask) { JmeIosGLES.glClear(mask); } + @Override public void glClearColor(float red, float green, float blue, float alpha) { JmeIosGLES.glClearColor(red, green, blue, alpha); } + @Override public void glColorMask(boolean red, boolean green, boolean blue, boolean alpha) { JmeIosGLES.glColorMask(red, green, blue, alpha); } + @Override public void glCompileShader(int shader) { JmeIosGLES.glCompileShader(shader); } + @Override public void glCompressedTexImage2D(int target, int level, int internalformat, int width, int height, int border, ByteBuffer data) { JmeIosGLES.glCompressedTexImage2D(target, level, internalformat, width, height, 0, getLimitBytes(data), data); } + @Override public void glCompressedTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, ByteBuffer data) { JmeIosGLES.glCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, getLimitBytes(data), data); } + @Override public int glCreateProgram() { return JmeIosGLES.glCreateProgram(); } + @Override public int glCreateShader(int shaderType) { return JmeIosGLES.glCreateShader(shaderType); } + @Override public void glCullFace(int mode) { JmeIosGLES.glCullFace(mode); } + @Override public void glDeleteBuffers(IntBuffer buffers) { checkLimit(buffers); int n = toArray(buffers); JmeIosGLES.glDeleteBuffers(n, temp_array, 0); } + @Override public void glDeleteProgram(int program) { JmeIosGLES.glDeleteProgram(program); } + @Override public void glDeleteShader(int shader) { JmeIosGLES.glDeleteShader(shader); } + @Override public void glDeleteTextures(IntBuffer textures) { checkLimit(textures); int n = toArray(textures); JmeIosGLES.glDeleteTextures(n, temp_array, 0); } + @Override public void glDepthFunc(int func) { JmeIosGLES.glDepthFunc(func); } + @Override public void glDepthMask(boolean flag) { JmeIosGLES.glDepthMask(flag); } + @Override public void glDepthRange(double nearVal, double farVal) { JmeIosGLES.glDepthRangef((float)nearVal, (float)farVal); } + @Override public void glDetachShader(int program, int shader) { JmeIosGLES.glDetachShader(program, shader); } + @Override public void glDisable(int cap) { JmeIosGLES.glDisable(cap); } + @Override public void glDisableVertexAttribArray(int index) { JmeIosGLES.glDisableVertexAttribArray(index); } + @Override public void glDrawArrays(int mode, int first, int count) { JmeIosGLES.glDrawArrays(mode, first, count); } + @Override public void glDrawRangeElements(int mode, int start, int end, int count, int type, long indices) { JmeIosGLES.glDrawElementsIndex(mode, count, type, (int)indices); } + @Override public void glEnable(int cap) { JmeIosGLES.glEnable(cap); } + @Override public void glEnableVertexAttribArray(int index) { JmeIosGLES.glEnableVertexAttribArray(index); } @@ -279,12 +317,14 @@ public void glEndQuery(int target) { throw new UnsupportedOperationException("Today is not a good day for this"); } + @Override public void glGenBuffers(IntBuffer buffers) { checkLimit(buffers); JmeIosGLES.glGenBuffers(buffers.remaining(), temp_array, 0); fromArray(buffers.remaining(), temp_array, buffers); } + @Override public void glGenTextures(IntBuffer textures) { checkLimit(textures); JmeIosGLES.glGenTextures(textures.remaining(), temp_array, 0); @@ -296,32 +336,38 @@ public void glGenQueries(int num, IntBuffer buff) { throw new UnsupportedOperationException("Today is not a good day for this"); } + @Override public int glGetAttribLocation(int program, String name) { return JmeIosGLES.glGetAttribLocation(program, name); } + @Override public void glGetBoolean(int pname, ByteBuffer params) { // TODO: fix me!!! // JmeIosGLES.glGetBoolean(pname, params); throw new UnsupportedOperationException("Today is not a good day for this"); } + @Override public int glGetError() { return JmeIosGLES.glGetError(); } + @Override public void glGetInteger(int pname, IntBuffer params) { checkLimit(params); JmeIosGLES.glGetIntegerv(pname, temp_array, 0); fromArray(params.remaining(), temp_array, params); } + @Override public void glGetProgram(int program, int pname, IntBuffer params) { checkLimit(params); JmeIosGLES.glGetProgramiv(program, pname, temp_array, 0); fromArray(params.remaining(), temp_array, params); } + @Override public String glGetProgramInfoLog(int program, int maxLength) { return JmeIosGLES.glGetProgramInfoLog(program); } @@ -336,24 +382,29 @@ public int glGetQueryObjectiv(int query, int pname) { throw new UnsupportedOperationException("Today is not a good day for this"); } + @Override public void glGetShader(int shader, int pname, IntBuffer params) { checkLimit(params); JmeIosGLES.glGetShaderiv(shader, pname, temp_array, 0); fromArray(params.remaining(), temp_array, params); } + @Override public String glGetShaderInfoLog(int shader, int maxLength) { return JmeIosGLES.glGetShaderInfoLog(shader); } + @Override public String glGetString(int name) { return JmeIosGLES.glGetString(name); } + @Override public int glGetUniformLocation(int program, String name) { return JmeIosGLES.glGetUniformLocation(program, name); } + @Override public boolean glIsEnabled(int cap) { // TODO: fix me!!! if (cap == GLExt.GL_MULTISAMPLE_ARB) { @@ -363,30 +414,37 @@ public boolean glIsEnabled(int cap) { } } + @Override public void glLineWidth(float width) { JmeIosGLES.glLineWidth(width); } + @Override public void glLinkProgram(int program) { JmeIosGLES.glLinkProgram(program); } + @Override public void glPixelStorei(int pname, int param) { JmeIosGLES.glPixelStorei(pname, param); } + @Override public void glPolygonOffset(float factor, float units) { JmeIosGLES.glPolygonOffset(factor, units); } + @Override public void glReadPixels(int x, int y, int width, int height, int format, int type, ByteBuffer data) { JmeIosGLES.glReadPixels(x, y, width, height, format, type, data); } + @Override public void glScissor(int x, int y, int width, int height) { JmeIosGLES.glScissor(x, y, width, height); } + @Override public void glShaderSource(int shader, String[] string, IntBuffer length) { if (string.length != 1) { throw new UnsupportedOperationException("Today is not a good day"); @@ -394,199 +452,244 @@ public void glShaderSource(int shader, String[] string, IntBuffer length) { JmeIosGLES.glShaderSource(shader, string[0]); } + @Override public void glStencilFuncSeparate(int face, int func, int ref, int mask) { // TODO: fix me!!! // JmeIosGLES.glStencilFuncSeparate(face, func, ref, mask); } + @Override public void glStencilOpSeparate(int face, int sfail, int dpfail, int dppass) { // TODO: fix me!!! // JmeIosGLES.glStencilOpSeparate(face, sfail, dpfail, dppass); } + @Override public void glTexImage2D(int target, int level, int internalFormat, int width, int height, int border, int format, int type, ByteBuffer data) { JmeIosGLES.glTexImage2D(target, level, format, width, height, 0, format, type, data); } + @Override public void glTexParameterf(int target, int pname, float param) { // TODO: fix me!!! // JmeIosGLES.glTexParameterf(target, pname, param); } + @Override public void glTexParameteri(int target, int pname, int param) { JmeIosGLES.glTexParameteri(target, pname, param); } + @Override public void glTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int type, ByteBuffer data) { JmeIosGLES.glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, data); } + @Override public void glUniform1(int location, FloatBuffer value) { JmeIosGLES.glUniform1fv(location, getLimitCount(value, 1), value); } + @Override public void glUniform1(int location, IntBuffer value) { JmeIosGLES.glUniform1iv(location, getLimitCount(value, 1), value); } + @Override public void glUniform1f(int location, float v0) { JmeIosGLES.glUniform1f(location, v0); } + @Override public void glUniform1i(int location, int v0) { JmeIosGLES.glUniform1i(location, v0); } + @Override public void glUniform2(int location, IntBuffer value) { // TODO: fix me!!! // JmeIosGLES.glUniform2iv(location, getLimitCount(value, 2), value); throw new UnsupportedOperationException(); } + @Override public void glUniform2(int location, FloatBuffer value) { JmeIosGLES.glUniform2fv(location, getLimitCount(value, 2), value); } + @Override public void glUniform2f(int location, float v0, float v1) { JmeIosGLES.glUniform2f(location, v0, v1); } + @Override public void glUniform3(int location, IntBuffer value) { // TODO: fix me!!! // JmeIosGLES.glUniform3iv(location, getLimitCount(value, 3), value); throw new UnsupportedOperationException(); } + @Override public void glUniform3(int location, FloatBuffer value) { JmeIosGLES.glUniform3fv(location, getLimitCount(value, 3), value); } + @Override public void glUniform3f(int location, float v0, float v1, float v2) { JmeIosGLES.glUniform3f(location, v0, v1, v2); } + @Override public void glUniform4(int location, FloatBuffer value) { JmeIosGLES.glUniform4fv(location, getLimitCount(value, 4), value); } + @Override public void glUniform4(int location, IntBuffer value) { // TODO: fix me!!! // JmeIosGLES.glUniform4iv(location, getLimitCount(value, 4), value); throw new UnsupportedOperationException(); } + @Override public void glUniform4f(int location, float v0, float v1, float v2, float v3) { JmeIosGLES.glUniform4f(location, v0, v1, v2, v3); } + @Override public void glUniformMatrix3(int location, boolean transpose, FloatBuffer value) { JmeIosGLES.glUniformMatrix3fv(location, getLimitCount(value, 3 * 3), transpose, value); } + @Override public void glUniformMatrix4(int location, boolean transpose, FloatBuffer value) { JmeIosGLES.glUniformMatrix4fv(location, getLimitCount(value, 4 * 4), transpose, value); } + @Override public void glUseProgram(int program) { JmeIosGLES.glUseProgram(program); } + @Override public void glVertexAttribPointer(int index, int size, int type, boolean normalized, int stride, long pointer) { JmeIosGLES.glVertexAttribPointer2(index, size, type, normalized, stride, (int)pointer); } + @Override public void glViewport(int x, int y, int width, int height) { JmeIosGLES.glViewport(x, y, width, height); } + @Override public void glBlitFramebufferEXT(int srcX0, int srcY0, int srcX1, int srcY1, int dstX0, int dstY0, int dstX1, int dstY1, int mask, int filter) { throw new UnsupportedOperationException("FBO blit not available on iOS"); } + @Override public void glBufferData(int target, IntBuffer data, int usage) { JmeIosGLES.glBufferData(target, getLimitBytes(data), data, usage); } + @Override public void glBufferSubData(int target, long offset, IntBuffer data) { JmeIosGLES.glBufferSubData(target, (int)offset, getLimitBytes(data), data); } + @Override public void glDrawArraysInstancedARB(int mode, int first, int count, int primcount) { throw new UnsupportedOperationException("Instancing not available on iOS"); } + @Override public void glDrawBuffers(IntBuffer bufs) { throw new UnsupportedOperationException("MRT not available on iOS"); } + @Override public void glDrawElementsInstancedARB(int mode, int indices_count, int type, long indices_buffer_offset, int primcount) { throw new UnsupportedOperationException("Instancing not available on iOS"); } + @Override public void glGetMultisample(int pname, int index, FloatBuffer val) { throw new UnsupportedOperationException("Multisample renderbuffers not available on iOS"); } + @Override public void glRenderbufferStorageMultisampleEXT(int target, int samples, int internalformat, int width, int height) { throw new UnsupportedOperationException("Multisample renderbuffers not available on iOS"); } + @Override public void glTexImage2DMultisample(int target, int samples, int internalformat, int width, int height, boolean fixedsamplelocations) { throw new UnsupportedOperationException("Multisample textures not available on iOS"); } + @Override public void glVertexAttribDivisorARB(int index, int divisor) { throw new UnsupportedOperationException("Instancing not available on iOS"); } + @Override public void glBindFramebufferEXT(int param1, int param2) { JmeIosGLES.glBindFramebuffer(param1, param2); } + @Override public void glBindRenderbufferEXT(int param1, int param2) { JmeIosGLES.glBindRenderbuffer(param1, param2); } + @Override public int glCheckFramebufferStatusEXT(int param1) { return JmeIosGLES.glCheckFramebufferStatus(param1); } + @Override public void glDeleteFramebuffersEXT(IntBuffer param1) { checkLimit(param1); int n = toArray(param1); JmeIosGLES.glDeleteFramebuffers(n, temp_array, 0); } + @Override public void glDeleteRenderbuffersEXT(IntBuffer param1) { checkLimit(param1); int n = toArray(param1); JmeIosGLES.glDeleteRenderbuffers(n, temp_array, 0); } + @Override public void glFramebufferRenderbufferEXT(int param1, int param2, int param3, int param4) { JmeIosGLES.glFramebufferRenderbuffer(param1, param2, param3, param4); } + @Override public void glFramebufferTexture2DEXT(int param1, int param2, int param3, int param4, int param5) { JmeIosGLES.glFramebufferTexture2D(param1, param2, param3, param4, param5); } + @Override public void glGenFramebuffersEXT(IntBuffer param1) { checkLimit(param1); JmeIosGLES.glGenFramebuffers(param1.remaining(), temp_array, 0); fromArray(param1.remaining(), temp_array, param1); } + @Override public void glGenRenderbuffersEXT(IntBuffer param1) { checkLimit(param1); JmeIosGLES.glGenRenderbuffers(param1.remaining(), temp_array, 0); fromArray(param1.remaining(), temp_array, param1); } + @Override public void glGenerateMipmapEXT(int param1) { JmeIosGLES.glGenerateMipmap(param1); } + @Override public void glRenderbufferStorageEXT(int param1, int param2, int param3, int param4) { JmeIosGLES.glRenderbufferStorage(param1, param2, param3, param4); } diff --git a/jme3-ios/src/main/java/com/jme3/system/ios/IosImageLoader.java b/jme3-ios/src/main/java/com/jme3/system/ios/IosImageLoader.java index e47de3a503..cef2cfdd23 100644 --- a/jme3-ios/src/main/java/com/jme3/system/ios/IosImageLoader.java +++ b/jme3-ios/src/main/java/com/jme3/system/ios/IosImageLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -45,6 +45,7 @@ */ public class IosImageLoader implements AssetLoader { + @Override public Object load(AssetInfo info) throws IOException { boolean flip = ((TextureKey) info.getKey()).isFlipY(); Image img = null; diff --git a/jme3-ios/src/main/java/com/jme3/util/RingBuffer.java b/jme3-ios/src/main/java/com/jme3/util/RingBuffer.java index 1d3c22d7e5..f4b50c24d5 100644 --- a/jme3-ios/src/main/java/com/jme3/util/RingBuffer.java +++ b/jme3-ios/src/main/java/com/jme3/util/RingBuffer.java @@ -49,6 +49,7 @@ public T pop() { return item; } + @Override public Iterator iterator() { return new RingBufferIterator(); } @@ -58,14 +59,17 @@ private class RingBufferIterator implements Iterator { private int i = 0; + @Override public boolean hasNext() { return i < count; } + @Override public void remove() { throw new UnsupportedOperationException(); } + @Override public T next() { if (!hasNext()) { throw new NoSuchElementException(); diff --git a/jme3-jbullet/src/main/java/com/jme3/bullet/PhysicsSpace.java b/jme3-jbullet/src/main/java/com/jme3/bullet/PhysicsSpace.java index 42ac5040a5..dc97db8c10 100644 --- a/jme3-jbullet/src/main/java/com/jme3/bullet/PhysicsSpace.java +++ b/jme3-jbullet/src/main/java/com/jme3/bullet/PhysicsSpace.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -259,6 +259,7 @@ public void create() { private void setOverlapFilterCallback() { OverlapFilterCallback callback = new OverlapFilterCallback() { + @Override public boolean needBroadphaseCollision(BroadphaseProxy bp, BroadphaseProxy bp1) { boolean collides = (bp.collisionFilterGroup & bp1.collisionFilterMask) != 0; if (collides) { @@ -334,6 +335,7 @@ public void internalTick(DynamicsWorld dw, float f) { private void setContactCallbacks() { BulletGlobals.setContactAddedCallback(new ContactAddedCallback() { + @Override public boolean contactAdded(ManifoldPoint cp, com.bulletphysics.collision.dispatch.CollisionObject colObj0, int partId0, int index0, com.bulletphysics.collision.dispatch.CollisionObject colObj1, int partId1, int index1) { @@ -344,6 +346,7 @@ public boolean contactAdded(ManifoldPoint cp, com.bulletphysics.collision.dispat BulletGlobals.setContactProcessedCallback(new ContactProcessedCallback() { + @Override public boolean contactProcessed(ManifoldPoint cp, Object body0, Object body1) { if (body0 instanceof CollisionObject && body1 instanceof CollisionObject) { PhysicsCollisionObject node = null, node1 = null; @@ -359,6 +362,7 @@ public boolean contactProcessed(ManifoldPoint cp, Object body0, Object body1) { BulletGlobals.setContactDestroyedCallback(new ContactDestroyedCallback() { + @Override public boolean contactDestroyed(Object userPersistentData) { System.out.println("contact destroyed"); return true; @@ -431,7 +435,7 @@ public void add(Object obj) { Spatial node = (Spatial) obj; for (int i = 0; i < node.getNumControls(); i++) { if (node.getControl(i) instanceof PhysicsControl) { - add(((PhysicsControl) node.getControl(i))); + add(node.getControl(i)); } } } else if (obj instanceof PhysicsCollisionObject) { @@ -468,7 +472,7 @@ public void remove(Object obj) { Spatial node = (Spatial) obj; for (int i = 0; i < node.getNumControls(); i++) { if (node.getControl(i) instanceof PhysicsControl) { - remove(((PhysicsControl) node.getControl(i))); + remove(node.getControl(i)); } } } else if (obj instanceof PhysicsCollisionObject) { diff --git a/jme3-jbullet/src/main/java/com/jme3/bullet/collision/shapes/BoxCollisionShape.java b/jme3-jbullet/src/main/java/com/jme3/bullet/collision/shapes/BoxCollisionShape.java index e26193c4ff..a8c47006fb 100644 --- a/jme3-jbullet/src/main/java/com/jme3/bullet/collision/shapes/BoxCollisionShape.java +++ b/jme3-jbullet/src/main/java/com/jme3/bullet/collision/shapes/BoxCollisionShape.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -48,7 +48,7 @@ public class BoxCollisionShape extends CollisionShape { private Vector3f halfExtents; - public BoxCollisionShape() { + protected BoxCollisionShape() { } /** @@ -64,12 +64,14 @@ public final Vector3f getHalfExtents() { return halfExtents; } + @Override public void write(JmeExporter ex) throws IOException { super.write(ex); OutputCapsule capsule = ex.getCapsule(this); capsule.write(halfExtents, "halfExtents", new Vector3f(1, 1, 1)); } + @Override public void read(JmeImporter im) throws IOException { super.read(im); InputCapsule capsule = im.getCapsule(this); diff --git a/jme3-jbullet/src/main/java/com/jme3/bullet/collision/shapes/CapsuleCollisionShape.java b/jme3-jbullet/src/main/java/com/jme3/bullet/collision/shapes/CapsuleCollisionShape.java index 09dceee17b..a1a3742a09 100644 --- a/jme3-jbullet/src/main/java/com/jme3/bullet/collision/shapes/CapsuleCollisionShape.java +++ b/jme3-jbullet/src/main/java/com/jme3/bullet/collision/shapes/CapsuleCollisionShape.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -49,7 +49,7 @@ public class CapsuleCollisionShape extends CollisionShape{ protected float radius,height; protected int axis; - public CapsuleCollisionShape() { + protected CapsuleCollisionShape() { } /** @@ -91,6 +91,7 @@ public int getAxis() { return axis; } + @Override public void write(JmeExporter ex) throws IOException { super.write(ex); OutputCapsule capsule = ex.getCapsule(this); @@ -99,6 +100,7 @@ public void write(JmeExporter ex) throws IOException { capsule.write(axis, "axis", 1); } + @Override public void read(JmeImporter im) throws IOException { super.read(im); InputCapsule capsule = im.getCapsule(this); diff --git a/jme3-jbullet/src/main/java/com/jme3/bullet/collision/shapes/CollisionShape.java b/jme3-jbullet/src/main/java/com/jme3/bullet/collision/shapes/CollisionShape.java index b251e0ea6a..9cb8ea8644 100644 --- a/jme3-jbullet/src/main/java/com/jme3/bullet/collision/shapes/CollisionShape.java +++ b/jme3-jbullet/src/main/java/com/jme3/bullet/collision/shapes/CollisionShape.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -56,7 +56,7 @@ public abstract class CollisionShape implements Savable { */ protected float margin = defaultMargin; - public CollisionShape() { + protected CollisionShape() { } /** @@ -125,12 +125,14 @@ public Vector3f getScale() { return scale; } + @Override public void write(JmeExporter ex) throws IOException { OutputCapsule capsule = ex.getCapsule(this); capsule.write(scale, "scale", new Vector3f(1, 1, 1)); capsule.write(getMargin(), "margin", 0.0f); } + @Override public void read(JmeImporter im) throws IOException { InputCapsule capsule = im.getCapsule(this); this.scale = (Vector3f) capsule.readSavable("scale", new Vector3f(1, 1, 1)); diff --git a/jme3-jbullet/src/main/java/com/jme3/bullet/collision/shapes/CompoundCollisionShape.java b/jme3-jbullet/src/main/java/com/jme3/bullet/collision/shapes/CompoundCollisionShape.java index 5cbc208d4d..7dffb52939 100644 --- a/jme3-jbullet/src/main/java/com/jme3/bullet/collision/shapes/CompoundCollisionShape.java +++ b/jme3-jbullet/src/main/java/com/jme3/bullet/collision/shapes/CompoundCollisionShape.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -125,12 +125,14 @@ public void setScale(Vector3f scale) { Logger.getLogger(this.getClass().getName()).log(Level.WARNING, "CompoundCollisionShape cannot be scaled"); } + @Override public void write(JmeExporter ex) throws IOException { super.write(ex); OutputCapsule capsule = ex.getCapsule(this); capsule.writeSavableArrayList(children, "children", new ArrayList()); } + @Override public void read(JmeImporter im) throws IOException { super.read(im); InputCapsule capsule = im.getCapsule(this); diff --git a/jme3-jbullet/src/main/java/com/jme3/bullet/collision/shapes/ConeCollisionShape.java b/jme3-jbullet/src/main/java/com/jme3/bullet/collision/shapes/ConeCollisionShape.java index cdcee46e4a..f82ce96ea1 100644 --- a/jme3-jbullet/src/main/java/com/jme3/bullet/collision/shapes/ConeCollisionShape.java +++ b/jme3-jbullet/src/main/java/com/jme3/bullet/collision/shapes/ConeCollisionShape.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -56,7 +56,7 @@ public class ConeCollisionShape extends CollisionShape { /** * Serialization only, do not use. */ - public ConeCollisionShape() { + protected ConeCollisionShape() { } /** @@ -101,6 +101,7 @@ public int getAxis() { return axis; } + @Override public void write(JmeExporter ex) throws IOException { super.write(ex); OutputCapsule capsule = ex.getCapsule(this); @@ -109,6 +110,7 @@ public void write(JmeExporter ex) throws IOException { capsule.write(axis, "axis", PhysicsSpace.AXIS_Y); } + @Override public void read(JmeImporter im) throws IOException { super.read(im); InputCapsule capsule = im.getCapsule(this); diff --git a/jme3-jbullet/src/main/java/com/jme3/bullet/collision/shapes/CylinderCollisionShape.java b/jme3-jbullet/src/main/java/com/jme3/bullet/collision/shapes/CylinderCollisionShape.java index a41974d00c..8425da79d5 100644 --- a/jme3-jbullet/src/main/java/com/jme3/bullet/collision/shapes/CylinderCollisionShape.java +++ b/jme3-jbullet/src/main/java/com/jme3/bullet/collision/shapes/CylinderCollisionShape.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -53,7 +53,7 @@ public class CylinderCollisionShape extends CollisionShape { protected Vector3f halfExtents; protected int axis; - public CylinderCollisionShape() { + protected CylinderCollisionShape() { } /** @@ -95,6 +95,7 @@ public void setScale(Vector3f scale) { } } + @Override public void write(JmeExporter ex) throws IOException { super.write(ex); OutputCapsule capsule = ex.getCapsule(this); @@ -102,6 +103,7 @@ public void write(JmeExporter ex) throws IOException { capsule.write(axis, "axis", 1); } + @Override public void read(JmeImporter im) throws IOException { super.read(im); InputCapsule capsule = im.getCapsule(this); diff --git a/jme3-jbullet/src/main/java/com/jme3/bullet/collision/shapes/GImpactCollisionShape.java b/jme3-jbullet/src/main/java/com/jme3/bullet/collision/shapes/GImpactCollisionShape.java index 8dfe2b2f63..6f6f7ed425 100644 --- a/jme3-jbullet/src/main/java/com/jme3/bullet/collision/shapes/GImpactCollisionShape.java +++ b/jme3-jbullet/src/main/java/com/jme3/bullet/collision/shapes/GImpactCollisionShape.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -55,7 +55,7 @@ public class GImpactCollisionShape extends CollisionShape{ protected ByteBuffer triangleIndexBase, vertexBase; protected IndexedMesh bulletMesh; - public GImpactCollisionShape() { + protected GImpactCollisionShape() { } /** @@ -86,6 +86,7 @@ public Mesh createJmeMesh(){ return Converter.convert(bulletMesh); } + @Override public void write(JmeExporter ex) throws IOException { super.write(ex); OutputCapsule capsule = ex.getCapsule(this); @@ -99,6 +100,7 @@ public void write(JmeExporter ex) throws IOException { capsule.write(vertexBase.array(), "vertexBase", new byte[0]); } + @Override public void read(JmeImporter im) throws IOException { super.read(im); InputCapsule capsule = im.getCapsule(this); diff --git a/jme3-jbullet/src/main/java/com/jme3/bullet/collision/shapes/HeightfieldCollisionShape.java b/jme3-jbullet/src/main/java/com/jme3/bullet/collision/shapes/HeightfieldCollisionShape.java index c4665823eb..85e7c2cafb 100644 --- a/jme3-jbullet/src/main/java/com/jme3/bullet/collision/shapes/HeightfieldCollisionShape.java +++ b/jme3-jbullet/src/main/java/com/jme3/bullet/collision/shapes/HeightfieldCollisionShape.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -65,7 +65,7 @@ public class HeightfieldCollisionShape extends CollisionShape { protected int upAxis; protected boolean flipQuadEdges; - public HeightfieldCollisionShape() { + protected HeightfieldCollisionShape() { } @@ -129,6 +129,7 @@ public Mesh createJmeMesh(){ return null; } + @Override public void write(JmeExporter ex) throws IOException { super.write(ex); OutputCapsule capsule = ex.getCapsule(this); @@ -142,6 +143,7 @@ public void write(JmeExporter ex) throws IOException { capsule.write(flipQuadEdges, "flipQuadEdges", false); } + @Override public void read(JmeImporter im) throws IOException { super.read(im); InputCapsule capsule = im.getCapsule(this); diff --git a/jme3-jbullet/src/main/java/com/jme3/bullet/collision/shapes/HullCollisionShape.java b/jme3-jbullet/src/main/java/com/jme3/bullet/collision/shapes/HullCollisionShape.java index edce384090..ebf7d79cd9 100644 --- a/jme3-jbullet/src/main/java/com/jme3/bullet/collision/shapes/HullCollisionShape.java +++ b/jme3-jbullet/src/main/java/com/jme3/bullet/collision/shapes/HullCollisionShape.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2019 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -48,7 +48,7 @@ public class HullCollisionShape extends CollisionShape { private float[] points; - public HullCollisionShape() { + protected HullCollisionShape() { } public HullCollisionShape(Mesh mesh) { diff --git a/jme3-jbullet/src/main/java/com/jme3/bullet/collision/shapes/MeshCollisionShape.java b/jme3-jbullet/src/main/java/com/jme3/bullet/collision/shapes/MeshCollisionShape.java index 0feb4753e9..dfd35ccd5f 100644 --- a/jme3-jbullet/src/main/java/com/jme3/bullet/collision/shapes/MeshCollisionShape.java +++ b/jme3-jbullet/src/main/java/com/jme3/bullet/collision/shapes/MeshCollisionShape.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -54,7 +54,7 @@ public class MeshCollisionShape extends CollisionShape { protected ByteBuffer triangleIndexBase, vertexBase; protected IndexedMesh bulletMesh; - public MeshCollisionShape() { + protected MeshCollisionShape() { } /** @@ -96,6 +96,7 @@ public Mesh createJmeMesh(){ return Converter.convert(bulletMesh); } + @Override public void write(JmeExporter ex) throws IOException { super.write(ex); OutputCapsule capsule = ex.getCapsule(this); @@ -108,6 +109,7 @@ public void write(JmeExporter ex) throws IOException { capsule.write(vertexBase.array(), "vertexBase", new byte[0]); } + @Override public void read(JmeImporter im) throws IOException { super.read(im); InputCapsule capsule = im.getCapsule(this); diff --git a/jme3-jbullet/src/main/java/com/jme3/bullet/collision/shapes/PlaneCollisionShape.java b/jme3-jbullet/src/main/java/com/jme3/bullet/collision/shapes/PlaneCollisionShape.java index 5c91e10e12..e5f6b304d1 100644 --- a/jme3-jbullet/src/main/java/com/jme3/bullet/collision/shapes/PlaneCollisionShape.java +++ b/jme3-jbullet/src/main/java/com/jme3/bullet/collision/shapes/PlaneCollisionShape.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -47,7 +47,7 @@ public class PlaneCollisionShape extends CollisionShape{ private Plane plane; - public PlaneCollisionShape() { + protected PlaneCollisionShape() { } /** @@ -63,12 +63,14 @@ public final Plane getPlane() { return plane; } + @Override public void write(JmeExporter ex) throws IOException { super.write(ex); OutputCapsule capsule = ex.getCapsule(this); capsule.write(plane, "collisionPlane", new Plane()); } + @Override public void read(JmeImporter im) throws IOException { super.read(im); InputCapsule capsule = im.getCapsule(this); diff --git a/jme3-jbullet/src/main/java/com/jme3/bullet/collision/shapes/SimplexCollisionShape.java b/jme3-jbullet/src/main/java/com/jme3/bullet/collision/shapes/SimplexCollisionShape.java index 4f8a352a05..2ae60bceee 100644 --- a/jme3-jbullet/src/main/java/com/jme3/bullet/collision/shapes/SimplexCollisionShape.java +++ b/jme3-jbullet/src/main/java/com/jme3/bullet/collision/shapes/SimplexCollisionShape.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -77,6 +77,7 @@ public SimplexCollisionShape(Vector3f point1) { createShape(); } + @Override public void write(JmeExporter ex) throws IOException { super.write(ex); OutputCapsule capsule = ex.getCapsule(this); @@ -86,6 +87,7 @@ public void write(JmeExporter ex) throws IOException { capsule.write(vector4, "simplexPoint4", null); } + @Override public void read(JmeImporter im) throws IOException { super.read(im); InputCapsule capsule = im.getCapsule(this); diff --git a/jme3-jbullet/src/main/java/com/jme3/bullet/collision/shapes/SphereCollisionShape.java b/jme3-jbullet/src/main/java/com/jme3/bullet/collision/shapes/SphereCollisionShape.java index 1a568ddf41..0310c1362a 100644 --- a/jme3-jbullet/src/main/java/com/jme3/bullet/collision/shapes/SphereCollisionShape.java +++ b/jme3-jbullet/src/main/java/com/jme3/bullet/collision/shapes/SphereCollisionShape.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -47,7 +47,7 @@ public class SphereCollisionShape extends CollisionShape { protected float radius; - public SphereCollisionShape() { + protected SphereCollisionShape() { } /** @@ -63,12 +63,14 @@ public float getRadius() { return radius; } + @Override public void write(JmeExporter ex) throws IOException { super.write(ex); OutputCapsule capsule = ex.getCapsule(this); capsule.write(radius, "radius", 0.5f); } + @Override public void read(JmeImporter im) throws IOException { super.read(im); InputCapsule capsule = im.getCapsule(this); diff --git a/jme3-jbullet/src/main/java/com/jme3/bullet/joints/ConeJoint.java b/jme3-jbullet/src/main/java/com/jme3/bullet/joints/ConeJoint.java index d5c13dc660..cd25721d87 100644 --- a/jme3-jbullet/src/main/java/com/jme3/bullet/joints/ConeJoint.java +++ b/jme3-jbullet/src/main/java/com/jme3/bullet/joints/ConeJoint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2019 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -58,7 +58,7 @@ public class ConeJoint extends PhysicsJoint { protected float twistSpan = 1e30f; protected boolean angularOnly = false; - public ConeJoint() { + protected ConeJoint() { } /** diff --git a/jme3-jbullet/src/main/java/com/jme3/bullet/joints/HingeJoint.java b/jme3-jbullet/src/main/java/com/jme3/bullet/joints/HingeJoint.java index f32f0193a9..ed5fd11196 100644 --- a/jme3-jbullet/src/main/java/com/jme3/bullet/joints/HingeJoint.java +++ b/jme3-jbullet/src/main/java/com/jme3/bullet/joints/HingeJoint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -58,7 +58,7 @@ public class HingeJoint extends PhysicsJoint { protected float relaxationFactor = 1.0f; protected float limitSoftness = 0.9f; - public HingeJoint() { + protected HingeJoint() { } /** @@ -125,6 +125,7 @@ public float getHingeAngle() { return ((HingeConstraint) constraint).getHingeAngle(); } + @Override public void write(JmeExporter ex) throws IOException { super.write(ex); OutputCapsule capsule = ex.getCapsule(this); @@ -145,6 +146,7 @@ public void write(JmeExporter ex) throws IOException { capsule.write(((HingeConstraint) constraint).getMaxMotorImpulse(), "maxMotorImpulse", 0.0f); } + @Override public void read(JmeImporter im) throws IOException { super.read(im); InputCapsule capsule = im.getCapsule(this); diff --git a/jme3-jbullet/src/main/java/com/jme3/bullet/joints/PhysicsJoint.java b/jme3-jbullet/src/main/java/com/jme3/bullet/joints/PhysicsJoint.java index 543209a0e2..2bf7ecee81 100644 --- a/jme3-jbullet/src/main/java/com/jme3/bullet/joints/PhysicsJoint.java +++ b/jme3-jbullet/src/main/java/com/jme3/bullet/joints/PhysicsJoint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -50,7 +50,7 @@ public abstract class PhysicsJoint implements Savable { protected Vector3f pivotB; protected boolean collisionBetweenLinkedBodys = true; - public PhysicsJoint() { + protected PhysicsJoint() { } /** @@ -117,6 +117,7 @@ public void destroy() { getBodyB().removeJoint(this); } + @Override public void write(JmeExporter ex) throws IOException { OutputCapsule capsule = ex.getCapsule(this); capsule.write(nodeA, "nodeA", null); @@ -125,10 +126,11 @@ public void write(JmeExporter ex) throws IOException { capsule.write(pivotB, "pivotB", null); } + @Override public void read(JmeImporter im) throws IOException { InputCapsule capsule = im.getCapsule(this); - this.nodeA = ((PhysicsRigidBody) capsule.readSavable("nodeA", new PhysicsRigidBody())); - this.nodeB = (PhysicsRigidBody) capsule.readSavable("nodeB", new PhysicsRigidBody()); + this.nodeA = ((PhysicsRigidBody) capsule.readSavable("nodeA", null)); + this.nodeB = (PhysicsRigidBody) capsule.readSavable("nodeB", null); this.pivotA = (Vector3f) capsule.readSavable("pivotA", new Vector3f()); this.pivotB = (Vector3f) capsule.readSavable("pivotB", new Vector3f()); } diff --git a/jme3-jbullet/src/main/java/com/jme3/bullet/joints/Point2PointJoint.java b/jme3-jbullet/src/main/java/com/jme3/bullet/joints/Point2PointJoint.java index 894d1c8f67..58652ab915 100644 --- a/jme3-jbullet/src/main/java/com/jme3/bullet/joints/Point2PointJoint.java +++ b/jme3-jbullet/src/main/java/com/jme3/bullet/joints/Point2PointJoint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2019 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -50,7 +50,7 @@ */ public class Point2PointJoint extends PhysicsJoint { - public Point2PointJoint() { + protected Point2PointJoint() { } /** diff --git a/jme3-jbullet/src/main/java/com/jme3/bullet/joints/SixDofJoint.java b/jme3-jbullet/src/main/java/com/jme3/bullet/joints/SixDofJoint.java index afb45b4874..d72f7e2aac 100644 --- a/jme3-jbullet/src/main/java/com/jme3/bullet/joints/SixDofJoint.java +++ b/jme3-jbullet/src/main/java/com/jme3/bullet/joints/SixDofJoint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2019 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -68,7 +68,7 @@ public class SixDofJoint extends PhysicsJoint { private Vector3f linearUpperLimit = new Vector3f(Vector3f.POSITIVE_INFINITY); private Vector3f linearLowerLimit = new Vector3f(Vector3f.NEGATIVE_INFINITY); - public SixDofJoint() { + protected SixDofJoint() { } /** diff --git a/jme3-jbullet/src/main/java/com/jme3/bullet/joints/SliderJoint.java b/jme3-jbullet/src/main/java/com/jme3/bullet/joints/SliderJoint.java index 5adf0b8b26..9b7ade3bf4 100644 --- a/jme3-jbullet/src/main/java/com/jme3/bullet/joints/SliderJoint.java +++ b/jme3-jbullet/src/main/java/com/jme3/bullet/joints/SliderJoint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2019 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -52,7 +52,7 @@ public class SliderJoint extends PhysicsJoint { protected Matrix3f rotA, rotB; protected boolean useLinearReferenceFrameA; - public SliderJoint() { + protected SliderJoint() { } /** diff --git a/jme3-jbullet/src/main/java/com/jme3/bullet/objects/PhysicsCharacter.java b/jme3-jbullet/src/main/java/com/jme3/bullet/objects/PhysicsCharacter.java index 1d7f540387..12643fcc77 100644 --- a/jme3-jbullet/src/main/java/com/jme3/bullet/objects/PhysicsCharacter.java +++ b/jme3-jbullet/src/main/java/com/jme3/bullet/objects/PhysicsCharacter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2019 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -68,7 +68,7 @@ public class PhysicsCharacter extends PhysicsCollisionObject { private com.jme3.math.Transform physicsLocation = new com.jme3.math.Transform(); private javax.vecmath.Vector3f tempVec = new javax.vecmath.Vector3f(); - public PhysicsCharacter() { + protected PhysicsCharacter() { } /** diff --git a/jme3-jbullet/src/main/java/com/jme3/bullet/objects/PhysicsGhostObject.java b/jme3-jbullet/src/main/java/com/jme3/bullet/objects/PhysicsGhostObject.java index 19c08ddd2e..4613e696a7 100644 --- a/jme3-jbullet/src/main/java/com/jme3/bullet/objects/PhysicsGhostObject.java +++ b/jme3-jbullet/src/main/java/com/jme3/bullet/objects/PhysicsGhostObject.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2019 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -68,7 +68,7 @@ public class PhysicsGhostObject extends PhysicsCollisionObject { protected javax.vecmath.Quat4f tempRot = new javax.vecmath.Quat4f(); private List overlappingObjects = new LinkedList(); - public PhysicsGhostObject() { + protected PhysicsGhostObject() { } public PhysicsGhostObject(CollisionShape shape) { diff --git a/jme3-jbullet/src/main/java/com/jme3/bullet/objects/PhysicsRigidBody.java b/jme3-jbullet/src/main/java/com/jme3/bullet/objects/PhysicsRigidBody.java index d585c2001f..f69a36d4e3 100644 --- a/jme3-jbullet/src/main/java/com/jme3/bullet/objects/PhysicsRigidBody.java +++ b/jme3-jbullet/src/main/java/com/jme3/bullet/objects/PhysicsRigidBody.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -72,7 +72,7 @@ public class PhysicsRigidBody extends PhysicsCollisionObject { protected javax.vecmath.Vector3f localInertia = new javax.vecmath.Vector3f(); protected ArrayList joints = new ArrayList(); - public PhysicsRigidBody() { + protected PhysicsRigidBody() { } /** @@ -539,6 +539,7 @@ public void clearForces() { rBody.clearForces(); } + @Override public void setCollisionShape(CollisionShape collisionShape) { super.setCollisionShape(collisionShape); if(collisionShape instanceof MeshCollisionShape && mass!=0){ diff --git a/jme3-jbullet/src/main/java/com/jme3/bullet/objects/PhysicsVehicle.java b/jme3-jbullet/src/main/java/com/jme3/bullet/objects/PhysicsVehicle.java index b0bccaa4b3..8b53342b79 100644 --- a/jme3-jbullet/src/main/java/com/jme3/bullet/objects/PhysicsVehicle.java +++ b/jme3-jbullet/src/main/java/com/jme3/bullet/objects/PhysicsVehicle.java @@ -67,7 +67,7 @@ public class PhysicsVehicle extends PhysicsRigidBody { protected ArrayList wheels = new ArrayList(); protected PhysicsSpace physicsSpace; - public PhysicsVehicle() { + protected PhysicsVehicle() { } public PhysicsVehicle(CollisionShape shape) { diff --git a/jme3-jbullet/src/main/java/com/jme3/bullet/objects/VehicleWheel.java b/jme3-jbullet/src/main/java/com/jme3/bullet/objects/VehicleWheel.java index 0490626a96..b2f0db305e 100644 --- a/jme3-jbullet/src/main/java/com/jme3/bullet/objects/VehicleWheel.java +++ b/jme3-jbullet/src/main/java/com/jme3/bullet/objects/VehicleWheel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2019 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -67,7 +67,7 @@ public class VehicleWheel implements Savable { protected final Quaternion tmp_inverseWorldRotation = new Quaternion(); private boolean applyLocal = false; - public VehicleWheel() { + protected VehicleWheel() { } public VehicleWheel(Spatial spat, Vector3f location, Vector3f direction, Vector3f axle, diff --git a/jme3-jbullet/src/main/java/com/jme3/bullet/objects/infos/RigidBodyMotionState.java b/jme3-jbullet/src/main/java/com/jme3/bullet/objects/infos/RigidBodyMotionState.java index 3249e96074..43f95abe55 100644 --- a/jme3-jbullet/src/main/java/com/jme3/bullet/objects/infos/RigidBodyMotionState.java +++ b/jme3-jbullet/src/main/java/com/jme3/bullet/objects/infos/RigidBodyMotionState.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -71,6 +71,7 @@ public RigidBodyMotionState() { * @param t caller-provided storage for the Transform * @return t */ + @Override public Transform getWorldTransform(Transform t) { t.set(motionStateTrans); return t; @@ -80,6 +81,7 @@ public Transform getWorldTransform(Transform t) { * called from bullet when the transform of the rigidbody changes * @param worldTrans */ + @Override public void setWorldTransform(Transform worldTrans) { if (jmeLocationDirty) { return; diff --git a/jme3-jogg/src/main/java/com/jme3/audio/plugins/CachedOggStream.java b/jme3-jogg/src/main/java/com/jme3/audio/plugins/CachedOggStream.java index 9ac18a6029..76b119847c 100644 --- a/jme3-jogg/src/main/java/com/jme3/audio/plugins/CachedOggStream.java +++ b/jme3-jogg/src/main/java/com/jme3/audio/plugins/CachedOggStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -84,23 +84,28 @@ private LogicalOggStream getLogicalStream(int serialNumber) { return logicalStreams.get(Integer.valueOf(serialNumber)); } + @Override public Collection getLogicalStreams() { return logicalStreams.values(); } + @Override public boolean isOpen() { return !closed; } + @Override public void close() throws IOException { closed = true; sourceStream.close(); } + @Override public OggPage getOggPage(int index) throws IOException { return oggPages.get(index); } + @Override public void setTime(long granulePosition) throws IOException { for (LogicalOggStream los : getLogicalStreams()){ los.setTime(granulePosition); @@ -150,6 +155,7 @@ private int readOggNextPage() throws IOException { return pageNumber-1; } + @Override public boolean isSeekable() { return true; } diff --git a/jme3-jogg/src/main/java/com/jme3/audio/plugins/OGGLoader.java b/jme3-jogg/src/main/java/com/jme3/audio/plugins/OGGLoader.java index 2302c5f4e4..5250362d99 100644 --- a/jme3-jogg/src/main/java/com/jme3/audio/plugins/OGGLoader.java +++ b/jme3-jogg/src/main/java/com/jme3/audio/plugins/OGGLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -143,6 +143,7 @@ public SeekableJOggInputStream(PhysicalOggStream ps, LogicalOggStream ls, Vorbis super(ps, ls, vs, maximum); } + @Override public void setTime(float time) { if (time != 0.0) { throw new UnsupportedOperationException("OGG/Vorbis seeking only supported for time = 0"); @@ -294,6 +295,7 @@ private AudioData load(InputStream in, boolean readStream, boolean streamCache) } } + @Override public Object load(AssetInfo info) throws IOException { if (!(info.getKey() instanceof AudioKey)){ throw new IllegalArgumentException("Audio assets must be loaded using an AudioKey"); diff --git a/jme3-jogg/src/main/java/com/jme3/audio/plugins/UncachedOggStream.java b/jme3-jogg/src/main/java/com/jme3/audio/plugins/UncachedOggStream.java index 7c3e7ced96..b221c1c8e6 100644 --- a/jme3-jogg/src/main/java/com/jme3/audio/plugins/UncachedOggStream.java +++ b/jme3-jogg/src/main/java/com/jme3/audio/plugins/UncachedOggStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -91,6 +91,7 @@ private void readNextOggPage() throws IOException { pageCache.add(op); } + @Override public OggPage getOggPage(int index) throws IOException { if (eos){ return null; @@ -117,21 +118,26 @@ private LogicalOggStream getLogicalStream(int serialNumber) { return logicalStreams.get(Integer.valueOf(serialNumber)); } + @Override public Collection getLogicalStreams() { return logicalStreams.values(); } + @Override public void setTime(long granulePosition) throws IOException { } + @Override public boolean isSeekable() { return false; } + @Override public boolean isOpen() { return !closed; } + @Override public void close() throws IOException { closed = true; sourceStream.close(); diff --git a/jme3-jogl/src/main/java/com/jme3/audio/joal/JoalAL.java b/jme3-jogl/src/main/java/com/jme3/audio/joal/JoalAL.java index cde0e01d7d..a487c3bfeb 100644 --- a/jme3-jogl/src/main/java/com/jme3/audio/joal/JoalAL.java +++ b/jme3-jogl/src/main/java/com/jme3/audio/joal/JoalAL.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2014 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -52,86 +52,106 @@ public JoalAL() { this.joalAl = ALFactory.getAL(); } + @Override public String alGetString(int parameter) { return joalAl.alGetString(parameter); } + @Override public int alGenSources() { IntBuffer ib = BufferUtils.createIntBuffer(1); joalAl.alGenSources(1, ib); return ib.get(0); } + @Override public int alGetError() { return joalAl.alGetError(); } + @Override public void alDeleteSources(int numSources, IntBuffer sources) { joalAl.alDeleteSources(numSources, sources); } + @Override public void alGenBuffers(int numBuffers, IntBuffer buffers) { joalAl.alGenBuffers(numBuffers, buffers); } + @Override public void alDeleteBuffers(int numBuffers, IntBuffer buffers) { joalAl.alDeleteBuffers(numBuffers, buffers); } + @Override public void alSourceStop(int source) { joalAl.alSourceStop(source); } + @Override public void alSourcei(int source, int param, int value) { joalAl.alSourcei(source, param, value); } + @Override public void alBufferData(int buffer, int format, ByteBuffer data, int size, int frequency) { joalAl.alBufferData(buffer, format, data, size, frequency); } + @Override public void alSourcePlay(int source) { joalAl.alSourcePlay(source); } + @Override public void alSourcePause(int source) { joalAl.alSourcePause(source); } + @Override public void alSourcef(int source, int param, float value) { joalAl.alSourcef(source, param, value); } + @Override public void alSource3f(int source, int param, float value1, float value2, float value3) { joalAl.alSource3f(source, param, value1, value2, value3); } + @Override public int alGetSourcei(int source, int param) { IntBuffer ib = BufferUtils.createIntBuffer(1); joalAl.alGetSourcei(source, param, ib); return ib.get(0); } + @Override public void alSourceUnqueueBuffers(int source, int numBuffers, IntBuffer buffers) { joalAl.alSourceUnqueueBuffers(source, numBuffers, buffers); } + @Override public void alSourceQueueBuffers(int source, int numBuffers, IntBuffer buffers) { joalAl.alSourceQueueBuffers(source, numBuffers, buffers); } + @Override public void alListener(int param, FloatBuffer data) { joalAl.alListenerfv(param, data); } + @Override public void alListenerf(int param, float value) { joalAl.alListenerf(param, value); } + @Override public void alListener3f(int param, float value1, float value2, float value3) { joalAl.alListener3f(param, value1, value2, value3); } + @Override public void alSource3i(int source, int param, int value1, int value2, int value3) { joalAl.alSource3i(source, param, value1, value2, value3); } diff --git a/jme3-jogl/src/main/java/com/jme3/audio/joal/JoalALC.java b/jme3-jogl/src/main/java/com/jme3/audio/joal/JoalALC.java index 3d6c69e2d2..4e1e05bb19 100644 --- a/jme3-jogl/src/main/java/com/jme3/audio/joal/JoalALC.java +++ b/jme3-jogl/src/main/java/com/jme3/audio/joal/JoalALC.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2014 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -67,6 +67,7 @@ private ALCdevice getALCDevice() { return device; } + @Override public void createALC() { ALut.alutInit(); @@ -95,6 +96,7 @@ public void createALC() { */ } + @Override public void destroyALC() { /* ALCcontext ctx = joalAlc.alcGetCurrentContext(); @@ -120,25 +122,31 @@ public void destroyALC() { ALut.alutExit(); } + @Override public boolean isCreated() { return getALCDevice() != null; } + @Override public String alcGetString(int parameter) { return joalAlc.alcGetString(getALCDevice(), parameter); } + @Override public boolean alcIsExtensionPresent(String extension) { return joalAlc.alcIsExtensionPresent(getALCDevice(), extension); } + @Override public void alcGetInteger(int param, IntBuffer buffer, int size) { joalAlc.alcGetIntegerv(getALCDevice(), param, size, buffer); } + @Override public void alcDevicePauseSOFT() { } + @Override public void alcDeviceResumeSOFT() { } } diff --git a/jme3-jogl/src/main/java/com/jme3/audio/joal/JoalEFX.java b/jme3-jogl/src/main/java/com/jme3/audio/joal/JoalEFX.java index d7271fc3ba..dbaf2c4d76 100644 --- a/jme3-jogl/src/main/java/com/jme3/audio/joal/JoalEFX.java +++ b/jme3-jogl/src/main/java/com/jme3/audio/joal/JoalEFX.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2014 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -50,46 +50,57 @@ public JoalEFX() { joalAlext = ALFactory.getALExt(); } + @Override public void alGenAuxiliaryEffectSlots(int numSlots, IntBuffer buffers) { joalAlext.alGenAuxiliaryEffectSlots(numSlots, buffers); } + @Override public void alGenEffects(int numEffects, IntBuffer buffers) { joalAlext.alGenEffects(numEffects, buffers); } + @Override public void alEffecti(int effect, int param, int value) { joalAlext.alEffecti(effect, param, value); } + @Override public void alAuxiliaryEffectSloti(int effectSlot, int param, int value) { joalAlext.alAuxiliaryEffectSloti(effectSlot, param, value); } + @Override public void alDeleteEffects(int numEffects, IntBuffer buffers) { joalAlext.alDeleteEffects(numEffects, buffers); } + @Override public void alDeleteAuxiliaryEffectSlots(int numEffectSlots, IntBuffer buffers) { joalAlext.alDeleteAuxiliaryEffectSlots(numEffectSlots, buffers); } + @Override public void alGenFilters(int numFilters, IntBuffer buffers) { joalAlext.alGenFilters(numFilters, buffers); } + @Override public void alFilteri(int filter, int param, int value) { joalAlext.alFilteri(filter, param, value); } + @Override public void alFilterf(int filter, int param, float value) { joalAlext.alFilterf(filter, param, value); } + @Override public void alDeleteFilters(int numFilters, IntBuffer buffers) { joalAlext.alDeleteFilters(numFilters, buffers); } + @Override public void alEffectf(int effect, int param, float value) { joalAlext.alEffectf(effect, param, value); } diff --git a/jme3-jogl/src/main/java/com/jme3/input/jogl/NewtKeyInput.java b/jme3-jogl/src/main/java/com/jme3/input/jogl/NewtKeyInput.java index 8ae4270742..9f6e91fe0f 100644 --- a/jme3-jogl/src/main/java/com/jme3/input/jogl/NewtKeyInput.java +++ b/jme3-jogl/src/main/java/com/jme3/input/jogl/NewtKeyInput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -53,9 +53,11 @@ public class NewtKeyInput implements KeyInput, KeyListener { public NewtKeyInput() { } + @Override public void initialize() { } + @Override public void destroy() { } @@ -70,10 +72,12 @@ public void setInputSource(GLWindow comp){ } } + @Override public long getInputTimeNanos() { return System.nanoTime(); } + @Override public void update() { synchronized (eventQueue){ // flush events to listener @@ -84,10 +88,12 @@ public void update() { } } + @Override public boolean isInitialized() { return true; } + @Override public void setInputListener(RawInputListener listener) { this.listener = listener; } @@ -95,6 +101,7 @@ public void setInputListener(RawInputListener listener) { public void keyTyped(KeyEvent evt) { } + @Override public void keyPressed(KeyEvent evt) { int code = convertNewtKey(evt.getKeySymbol()); KeyInputEvent keyEvent = new KeyInputEvent(code, evt.getKeyChar(), true, evt.isAutoRepeat()); @@ -104,6 +111,7 @@ public void keyPressed(KeyEvent evt) { } } + @Override public void keyReleased(KeyEvent evt) { int code = convertNewtKey(evt.getKeySymbol()); KeyInputEvent keyEvent = new KeyInputEvent(code, evt.getKeyChar(), false, evt.isAutoRepeat()); diff --git a/jme3-jogl/src/main/java/com/jme3/system/jogl/JoglAbstractDisplay.java b/jme3-jogl/src/main/java/com/jme3/system/jogl/JoglAbstractDisplay.java index c4f38f970d..976ba85158 100644 --- a/jme3-jogl/src/main/java/com/jme3/system/jogl/JoglAbstractDisplay.java +++ b/jme3-jogl/src/main/java/com/jme3/system/jogl/JoglAbstractDisplay.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -110,6 +110,7 @@ public void removeNotify() { } }; canvas.invoke(false, new GLRunnable() { + @Override public boolean run(GLAutoDrawable glad) { canvas.getGL().setSwapInterval(settings.isVSync() ? 1 : 0); return true; @@ -163,10 +164,12 @@ public MouseInput getMouseInput() { return mouseInput; } + @Override public TouchInput getTouchInput() { return null; } + @Override public void setAutoFlushFrames(boolean enabled) { autoFlush.set(enabled); } @@ -174,6 +177,7 @@ public void setAutoFlushFrames(boolean enabled) { /** * Callback. */ + @Override public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { listener.reshape(width, height); } @@ -187,6 +191,7 @@ public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean /** * Callback */ + @Override public void dispose(GLAutoDrawable drawable) { } diff --git a/jme3-jogl/src/main/java/com/jme3/system/jogl/JoglDisplay.java b/jme3-jogl/src/main/java/com/jme3/system/jogl/JoglDisplay.java index 3bac0ab53a..c6ebcc809d 100644 --- a/jme3-jogl/src/main/java/com/jme3/system/jogl/JoglDisplay.java +++ b/jme3-jogl/src/main/java/com/jme3/system/jogl/JoglDisplay.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -59,6 +59,7 @@ public class JoglDisplay extends JoglAbstractDisplay { protected volatile boolean wasInited = false; protected Frame frame; + @Override public Type getType() { return Type.Display; } @@ -238,6 +239,7 @@ private void initInEDT(){ startGLCanvas(); } + @Override public void init(GLAutoDrawable drawable){ // prevent initializing twice on restart if (!wasInited){ @@ -253,6 +255,7 @@ public void init(GLAutoDrawable drawable){ } } + @Override public void create(boolean waitFor){ if (SwingUtilities.isEventDispatchThread()) { initInEDT(); @@ -261,6 +264,7 @@ public void create(boolean waitFor){ if (waitFor) { try { SwingUtilities.invokeAndWait(new Runnable() { + @Override public void run() { initInEDT(); } @@ -270,6 +274,7 @@ public void run() { } } else { SwingUtilities.invokeLater(new Runnable() { + @Override public void run() { initInEDT(); } @@ -281,6 +286,7 @@ public void run() { } } + @Override public void destroy(boolean waitFor){ needClose.set(true); if (waitFor){ @@ -288,6 +294,7 @@ public void destroy(boolean waitFor){ } } + @Override public void restart() { if (created.get()){ needRestart.set(true); @@ -296,6 +303,7 @@ public void restart() { } } + @Override public void setTitle(String title){ if (frame != null) frame.setTitle(title); @@ -304,6 +312,7 @@ public void setTitle(String title){ /** * Callback. */ + @Override public void display(GLAutoDrawable drawable) { if (needClose.get()) { listener.destroy(); diff --git a/jme3-jogl/src/main/java/com/jme3/system/jogl/JoglNewtAbstractDisplay.java b/jme3-jogl/src/main/java/com/jme3/system/jogl/JoglNewtAbstractDisplay.java index 48f191cb3a..7f103be176 100644 --- a/jme3-jogl/src/main/java/com/jme3/system/jogl/JoglNewtAbstractDisplay.java +++ b/jme3-jogl/src/main/java/com/jme3/system/jogl/JoglNewtAbstractDisplay.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -90,6 +90,7 @@ protected void initGLCanvas() { } canvas = GLWindow.create(caps); canvas.invoke(false, new GLRunnable() { + @Override public boolean run(GLAutoDrawable glad) { canvas.getGL().setSwapInterval(settings.isVSync() ? 1 : 0); return true; @@ -141,10 +142,12 @@ public MouseInput getMouseInput() { return mouseInput; } + @Override public TouchInput getTouchInput() { return null; } + @Override public void setAutoFlushFrames(boolean enabled) { autoFlush.set(enabled); } @@ -152,6 +155,7 @@ public void setAutoFlushFrames(boolean enabled) { /** * Callback. */ + @Override public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { listener.reshape(width, height); } @@ -165,6 +169,7 @@ public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean /** * Callback */ + @Override public void dispose(GLAutoDrawable drawable) { } diff --git a/jme3-jogl/src/main/java/com/jme3/system/jogl/JoglNewtDisplay.java b/jme3-jogl/src/main/java/com/jme3/system/jogl/JoglNewtDisplay.java index 56eab406a3..87b0019144 100644 --- a/jme3-jogl/src/main/java/com/jme3/system/jogl/JoglNewtDisplay.java +++ b/jme3-jogl/src/main/java/com/jme3/system/jogl/JoglNewtDisplay.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -54,6 +54,7 @@ public class JoglNewtDisplay extends JoglNewtAbstractDisplay { protected AtomicBoolean needRestart = new AtomicBoolean(false); protected volatile boolean wasInited = false; + @Override public Type getType() { return Type.Display; } @@ -149,6 +150,7 @@ private void privateInit(){ startGLCanvas(); } + @Override public void init(GLAutoDrawable drawable){ // prevent initializing twice on restart if (!wasInited){ @@ -164,10 +166,12 @@ public void init(GLAutoDrawable drawable){ } } + @Override public void create(boolean waitFor){ privateInit(); } + @Override public void destroy(boolean waitFor){ needClose.set(true); if (waitFor){ @@ -177,6 +181,7 @@ public void destroy(boolean waitFor){ animator.stop(); } + @Override public void restart() { if (created.get()){ needRestart.set(true); @@ -185,6 +190,7 @@ public void restart() { } } + @Override public void setTitle(String title){ if (canvas != null) { canvas.setTitle(title); @@ -194,6 +200,7 @@ public void setTitle(String title){ /** * Callback. */ + @Override public void display(GLAutoDrawable drawable) { if (needClose.get()) { listener.destroy(); diff --git a/jme3-lwjgl/src/main/java/com/jme3/audio/lwjgl/LwjglAL.java b/jme3-lwjgl/src/main/java/com/jme3/audio/lwjgl/LwjglAL.java index 9cb52c688c..247f5b6da9 100644 --- a/jme3-lwjgl/src/main/java/com/jme3/audio/lwjgl/LwjglAL.java +++ b/jme3-lwjgl/src/main/java/com/jme3/audio/lwjgl/LwjglAL.java @@ -12,94 +12,114 @@ public final class LwjglAL implements AL { public LwjglAL() { } + @Override public String alGetString(int parameter) { return AL10.alGetString(parameter); } + @Override public int alGenSources() { return AL10.alGenSources(); } + @Override public int alGetError() { return AL10.alGetError(); } + @Override public void alDeleteSources(int numSources, IntBuffer sources) { if (sources.position() != 0) throw new AssertionError(); if (sources.limit() != numSources) throw new AssertionError(); AL10.alDeleteSources(sources); } + @Override public void alGenBuffers(int numBuffers, IntBuffer buffers) { if (buffers.position() != 0) throw new AssertionError(); if (buffers.limit() != numBuffers) throw new AssertionError(); AL10.alGenBuffers(buffers); } + @Override public void alDeleteBuffers(int numBuffers, IntBuffer buffers) { if (buffers.position() != 0) throw new AssertionError(); if (buffers.limit() != numBuffers) throw new AssertionError(); AL10.alDeleteBuffers(buffers); } + @Override public void alSourceStop(int source) { AL10.alSourceStop(source); } + @Override public void alSourcei(int source, int param, int value) { AL10.alSourcei(source, param, value); } + @Override public void alBufferData(int buffer, int format, ByteBuffer data, int size, int frequency) { if (data.position() != 0) throw new AssertionError(); if (data.limit() != size) throw new AssertionError(); AL10.alBufferData(buffer, format, data, frequency); } + @Override public void alSourcePlay(int source) { AL10.alSourcePlay(source); } + @Override public void alSourcePause(int source) { AL10.alSourcePause(source); } + @Override public void alSourcef(int source, int param, float value) { AL10.alSourcef(source, param, value); } + @Override public void alSource3f(int source, int param, float value1, float value2, float value3) { AL10.alSource3f(source, param, value1, value2, value3); } + @Override public int alGetSourcei(int source, int param) { return AL10.alGetSourcei(source, param); } + @Override public void alSourceUnqueueBuffers(int source, int numBuffers, IntBuffer buffers) { if (buffers.position() != 0) throw new AssertionError(); if (buffers.limit() != numBuffers) throw new AssertionError(); AL10.alSourceUnqueueBuffers(source, buffers); } + @Override public void alSourceQueueBuffers(int source, int numBuffers, IntBuffer buffers) { if (buffers.position() != 0) throw new AssertionError(); if (buffers.limit() != numBuffers) throw new AssertionError(); AL10.alSourceQueueBuffers(source, buffers); } + @Override public void alListener(int param, FloatBuffer data) { AL10.alListener(param, data); } + @Override public void alListenerf(int param, float value) { AL10.alListenerf(param, value); } + @Override public void alListener3f(int param, float value1, float value2, float value3) { AL10.alListener3f(param, value1, value2, value3); } + @Override public void alSource3i(int source, int param, int value1, int value2, int value3) { AL11.alSource3i(source, param, value1, value2, value3); } diff --git a/jme3-lwjgl/src/main/java/com/jme3/audio/lwjgl/LwjglALC.java b/jme3-lwjgl/src/main/java/com/jme3/audio/lwjgl/LwjglALC.java index ffce940b09..f0e3bfef6b 100644 --- a/jme3-lwjgl/src/main/java/com/jme3/audio/lwjgl/LwjglALC.java +++ b/jme3-lwjgl/src/main/java/com/jme3/audio/lwjgl/LwjglALC.java @@ -10,6 +10,7 @@ public class LwjglALC implements ALC { + @Override public void createALC() { try { AL.create(); @@ -18,26 +19,31 @@ public void createALC() { } } + @Override public void destroyALC() { AL.destroy(); } + @Override public boolean isCreated() { return AL.isCreated(); } + @Override public String alcGetString(int parameter) { ALCcontext context = ALC10.alcGetCurrentContext(); ALCdevice device = ALC10.alcGetContextsDevice(context); return ALC10.alcGetString(device, parameter); } + @Override public boolean alcIsExtensionPresent(String extension) { ALCcontext context = ALC10.alcGetCurrentContext(); ALCdevice device = ALC10.alcGetContextsDevice(context); return ALC10.alcIsExtensionPresent(device, extension); } + @Override public void alcGetInteger(int param, IntBuffer buffer, int size) { if (buffer.position() != 0) throw new AssertionError(); if (buffer.limit() != size) throw new AssertionError(); @@ -47,9 +53,11 @@ public void alcGetInteger(int param, IntBuffer buffer, int size) { ALC10.alcGetInteger(device, param, buffer); } + @Override public void alcDevicePauseSOFT() { } + @Override public void alcDeviceResumeSOFT() { } diff --git a/jme3-lwjgl/src/main/java/com/jme3/audio/lwjgl/LwjglEFX.java b/jme3-lwjgl/src/main/java/com/jme3/audio/lwjgl/LwjglEFX.java index 639758c4ef..01292a1288 100644 --- a/jme3-lwjgl/src/main/java/com/jme3/audio/lwjgl/LwjglEFX.java +++ b/jme3-lwjgl/src/main/java/com/jme3/audio/lwjgl/LwjglEFX.java @@ -6,58 +6,69 @@ public class LwjglEFX implements EFX { + @Override public void alGenAuxiliaryEffectSlots(int numSlots, IntBuffer buffers) { if (buffers.position() != 0) throw new AssertionError(); if (buffers.limit() != numSlots) throw new AssertionError(); EFX10.alGenAuxiliaryEffectSlots(buffers); } + @Override public void alGenEffects(int numEffects, IntBuffer buffers) { if (buffers.position() != 0) throw new AssertionError(); if (buffers.limit() != numEffects) throw new AssertionError(); EFX10.alGenEffects(buffers); } + @Override public void alEffecti(int effect, int param, int value) { EFX10.alEffecti(effect, param, value); } + @Override public void alAuxiliaryEffectSloti(int effectSlot, int param, int value) { EFX10.alAuxiliaryEffectSloti(effectSlot, param, value); } + @Override public void alDeleteEffects(int numEffects, IntBuffer buffers) { if (buffers.position() != 0) throw new AssertionError(); if (buffers.limit() != numEffects) throw new AssertionError(); EFX10.alDeleteEffects(buffers); } + @Override public void alDeleteAuxiliaryEffectSlots(int numEffectSlots, IntBuffer buffers) { if (buffers.position() != 0) throw new AssertionError(); if (buffers.limit() != numEffectSlots) throw new AssertionError(); EFX10.alDeleteAuxiliaryEffectSlots(buffers); } + @Override public void alGenFilters(int numFilters, IntBuffer buffers) { if (buffers.position() != 0) throw new AssertionError(); if (buffers.limit() != numFilters) throw new AssertionError(); EFX10.alGenFilters(buffers); } + @Override public void alFilteri(int filter, int param, int value) { EFX10.alFilteri(filter, param, value); } + @Override public void alFilterf(int filter, int param, float value) { EFX10.alFilterf(filter, param, value); } + @Override public void alDeleteFilters(int numFilters, IntBuffer buffers) { if (buffers.position() != 0) throw new AssertionError(); if (buffers.limit() != numFilters) throw new AssertionError(); EFX10.alDeleteFilters(buffers); } + @Override public void alEffectf(int effect, int param, float value) { EFX10.alEffectf(effect, param, value); } diff --git a/jme3-lwjgl/src/main/java/com/jme3/input/lwjgl/JInputJoyInput.java b/jme3-lwjgl/src/main/java/com/jme3/input/lwjgl/JInputJoyInput.java index d89a07af51..928fb4338c 100644 --- a/jme3-lwjgl/src/main/java/com/jme3/input/lwjgl/JInputJoyInput.java +++ b/jme3-lwjgl/src/main/java/com/jme3/input/lwjgl/JInputJoyInput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2016 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -66,6 +66,7 @@ public class JInputJoyInput implements JoyInput { private Map joystickIndex = new HashMap(); + @Override public void setJoyRumble(int joyId, float amount){ if( joyId >= joysticks.length ) @@ -77,6 +78,7 @@ public void setJoyRumble(int joyId, float amount){ } } + @Override public Joystick[] loadJoysticks(InputManager inputManager){ ControllerEnvironment ce = ControllerEnvironment.getDefaultEnvironment(); @@ -113,10 +115,12 @@ public Joystick[] loadJoysticks(InputManager inputManager){ return joysticks; } + @Override public void initialize() { inited = true; } + @Override public void update() { ControllerEnvironment ce = ControllerEnvironment.getDefaultEnvironment(); @@ -182,18 +186,22 @@ public void update() { } } + @Override public void destroy() { inited = false; } + @Override public boolean isInitialized() { return inited; } + @Override public void setInputListener(RawInputListener listener) { this.listener = listener; } + @Override public long getInputTimeNanos() { return 0; } diff --git a/jme3-lwjgl/src/main/java/com/jme3/input/lwjgl/LwjglKeyInput.java b/jme3-lwjgl/src/main/java/com/jme3/input/lwjgl/LwjglKeyInput.java index e7b9f9268a..ab8397b15e 100644 --- a/jme3-lwjgl/src/main/java/com/jme3/input/lwjgl/LwjglKeyInput.java +++ b/jme3-lwjgl/src/main/java/com/jme3/input/lwjgl/LwjglKeyInput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -55,6 +55,7 @@ public LwjglKeyInput(LwjglAbstractDisplay context){ this.context = context; } + @Override public void initialize() { if (!context.isRenderable()) return; @@ -72,6 +73,7 @@ public int getKeyCount(){ return Keyboard.KEYBOARD_SIZE; } + @Override public void update() { if (!context.isRenderable()) return; @@ -89,6 +91,7 @@ public void update() { } } + @Override public void destroy() { if (!context.isRenderable()) return; @@ -97,14 +100,17 @@ public void destroy() { logger.fine("Keyboard destroyed."); } + @Override public boolean isInitialized() { return Keyboard.isCreated(); } + @Override public void setInputListener(RawInputListener listener) { this.listener = listener; } + @Override public long getInputTimeNanos() { return Sys.getTime() * LwjglTimer.LWJGL_TIME_TO_NANOS; } diff --git a/jme3-lwjgl/src/main/java/com/jme3/input/lwjgl/LwjglMouseInput.java b/jme3-lwjgl/src/main/java/com/jme3/input/lwjgl/LwjglMouseInput.java index b53d93660b..7f9106bfae 100644 --- a/jme3-lwjgl/src/main/java/com/jme3/input/lwjgl/LwjglMouseInput.java +++ b/jme3-lwjgl/src/main/java/com/jme3/input/lwjgl/LwjglMouseInput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -71,6 +71,7 @@ public LwjglMouseInput(LwjglAbstractDisplay context){ this.context = context; } + @Override public void initialize() { if (!context.isRenderable()) return; @@ -91,14 +92,17 @@ public void initialize() { } } + @Override public boolean isInitialized(){ return Mouse.isCreated(); } + @Override public int getButtonCount(){ return Mouse.getButtonCount(); } + @Override public void update() { if (!context.isRenderable()) return; @@ -139,6 +143,7 @@ public void update() { } } + @Override public void destroy() { if (!context.isRenderable()) return; @@ -154,6 +159,7 @@ public void destroy() { logger.fine("Mouse destroyed."); } + @Override public void setCursorVisible(boolean visible){ cursorVisible = visible; if (!context.isRenderable()) @@ -190,10 +196,12 @@ private void sendFirstMouseEvent() { listener.onMouseMotionEvent(evt); } + @Override public long getInputTimeNanos() { return Sys.getTime() * LwjglTimer.LWJGL_TIME_TO_NANOS; } + @Override public void setNativeCursor(JmeCursor jmeCursor) { try { Cursor newCursor = null; diff --git a/jme3-lwjgl/src/main/java/com/jme3/opencl/lwjgl/Utils.java b/jme3-lwjgl/src/main/java/com/jme3/opencl/lwjgl/Utils.java index 29b141325e..54bb948835 100644 --- a/jme3-lwjgl/src/main/java/com/jme3/opencl/lwjgl/Utils.java +++ b/jme3-lwjgl/src/main/java/com/jme3/opencl/lwjgl/Utils.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2016 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -56,6 +56,7 @@ private Utils() {} Taken directly from org.lwjgl.opencl.Util */ private static final Map CL_ERROR_TOKENS = LWJGLUtil.getClassTokens(new LWJGLUtil.TokenFilter() { + @Override public boolean accept(final Field field, final int value) { return value < 0; // Currently, all OpenCL errors have negative values. } diff --git a/jme3-lwjgl/src/main/java/com/jme3/renderer/lwjgl/LwjglGL.java b/jme3-lwjgl/src/main/java/com/jme3/renderer/lwjgl/LwjglGL.java index bca6d0dbb1..e08461a561 100644 --- a/jme3-lwjgl/src/main/java/com/jme3/renderer/lwjgl/LwjglGL.java +++ b/jme3-lwjgl/src/main/java/com/jme3/renderer/lwjgl/LwjglGL.java @@ -26,17 +26,21 @@ private static void checkLimit(Buffer buffer) { } } + @Override public void resetStats() { } + @Override public void glActiveTexture(int param1) { GL13.glActiveTexture(param1); } + @Override public void glAlphaFunc(int param1, float param2) { GL11.glAlphaFunc(param1, param2); } + @Override public void glAttachShader(int param1, int param2) { GL20.glAttachShader(param1, param2); } @@ -46,166 +50,204 @@ public void glBeginQuery(int target, int query) { GL15.glBeginQuery(target, query); } + @Override public void glBindBuffer(int param1, int param2) { GL15.glBindBuffer(param1, param2); } + @Override public void glBindTexture(int param1, int param2) { GL11.glBindTexture(param1, param2); } + @Override public void glBlendEquationSeparate(int colorMode, int alphaMode){ GL20.glBlendEquationSeparate(colorMode,alphaMode); } + @Override public void glBlendFunc(int param1, int param2) { GL11.glBlendFunc(param1, param2); } + @Override public void glBlendFuncSeparate(int param1, int param2, int param3, int param4) { GL14.glBlendFuncSeparate(param1, param2, param3, param4); } + @Override public void glBufferData(int param1, long param2, int param3) { GL15.glBufferData(param1, param2, param3); } + @Override public void glBufferData(int param1, FloatBuffer param2, int param3) { checkLimit(param2); GL15.glBufferData(param1, param2, param3); } + @Override public void glBufferData(int param1, ShortBuffer param2, int param3) { checkLimit(param2); GL15.glBufferData(param1, param2, param3); } + @Override public void glBufferData(int param1, ByteBuffer param2, int param3) { checkLimit(param2); GL15.glBufferData(param1, param2, param3); } + @Override public void glBufferSubData(int param1, long param2, FloatBuffer param3) { checkLimit(param3); GL15.glBufferSubData(param1, param2, param3); } + @Override public void glBufferSubData(int param1, long param2, ShortBuffer param3) { checkLimit(param3); GL15.glBufferSubData(param1, param2, param3); } + @Override public void glBufferSubData(int param1, long param2, ByteBuffer param3) { checkLimit(param3); GL15.glBufferSubData(param1, param2, param3); } + @Override public void glClear(int param1) { GL11.glClear(param1); } + @Override public void glClearColor(float param1, float param2, float param3, float param4) { GL11.glClearColor(param1, param2, param3, param4); } + @Override public void glColorMask(boolean param1, boolean param2, boolean param3, boolean param4) { GL11.glColorMask(param1, param2, param3, param4); } + @Override public void glCompileShader(int param1) { GL20.glCompileShader(param1); } + @Override public void glCompressedTexImage2D(int param1, int param2, int param3, int param4, int param5, int param6, ByteBuffer param7) { checkLimit(param7); GL13.glCompressedTexImage2D(param1, param2, param3, param4, param5, param6, param7); } + @Override public void glCompressedTexImage3D(int param1, int param2, int param3, int param4, int param5, int param6, int param7, ByteBuffer param8) { checkLimit(param8); GL13.glCompressedTexImage3D(param1, param2, param3, param4, param5, param6, param7, param8); } + @Override public void glCompressedTexSubImage2D(int param1, int param2, int param3, int param4, int param5, int param6, int param7, ByteBuffer param8) { checkLimit(param8); GL13.glCompressedTexSubImage2D(param1, param2, param3, param4, param5, param6, param7, param8); } + @Override public void glCompressedTexSubImage3D(int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, int param9, ByteBuffer param10) { checkLimit(param10); GL13.glCompressedTexSubImage3D(param1, param2, param3, param4, param5, param6, param7, param8, param9, param10); } + @Override public int glCreateProgram() { return GL20.glCreateProgram(); } + @Override public int glCreateShader(int param1) { return GL20.glCreateShader(param1); } + @Override public void glCullFace(int param1) { GL11.glCullFace(param1); } + @Override public void glDeleteBuffers(IntBuffer param1) { checkLimit(param1); GL15.glDeleteBuffers(param1); } + @Override public void glDeleteProgram(int param1) { GL20.glDeleteProgram(param1); } + @Override public void glDeleteShader(int param1) { GL20.glDeleteShader(param1); } + @Override public void glDeleteTextures(IntBuffer param1) { checkLimit(param1); GL11.glDeleteTextures(param1); } + @Override public void glDepthFunc(int param1) { GL11.glDepthFunc(param1); } + @Override public void glDepthMask(boolean param1) { GL11.glDepthMask(param1); } + @Override public void glDepthRange(double param1, double param2) { GL11.glDepthRange(param1, param2); } + @Override public void glDetachShader(int param1, int param2) { GL20.glDetachShader(param1, param2); } + @Override public void glDisable(int param1) { GL11.glDisable(param1); } + @Override public void glDisableVertexAttribArray(int param1) { GL20.glDisableVertexAttribArray(param1); } + @Override public void glDrawArrays(int param1, int param2, int param3) { GL11.glDrawArrays(param1, param2, param3); } + @Override public void glDrawBuffer(int param1) { GL11.glDrawBuffer(param1); } + @Override public void glDrawRangeElements(int param1, int param2, int param3, int param4, int param5, long param6) { GL12.glDrawRangeElements(param1, param2, param3, param4, param5, param6); } + @Override public void glEnable(int param1) { GL11.glEnable(param1); } + @Override public void glEnableVertexAttribArray(int param1) { GL20.glEnableVertexAttribArray(param1); } @@ -215,6 +257,7 @@ public void glEndQuery(int target) { GL15.glEndQuery(target); } + @Override public void glGenBuffers(IntBuffer param1) { checkLimit(param1); GL15.glGenBuffers(param1); @@ -225,226 +268,276 @@ public void glGenQueries(int num, IntBuffer ids) { GL15.glGenQueries(ids); } + @Override public void glGenTextures(IntBuffer param1) { checkLimit(param1); GL11.glGenTextures(param1); } + @Override public void glGetBoolean(int param1, ByteBuffer param2) { checkLimit(param2); GL11.glGetBoolean(param1, param2); } + @Override public void glGetBufferSubData(int target, long offset, ByteBuffer data) { checkLimit(data); GL15.glGetBufferSubData(target, offset, data); } + @Override public int glGetError() { return GL11.glGetError(); } + @Override public void glGetInteger(int param1, IntBuffer param2) { checkLimit(param2); GL11.glGetInteger(param1, param2); } + @Override public void glGetProgram(int param1, int param2, IntBuffer param3) { checkLimit(param3); GL20.glGetProgram(param1, param2, param3); } + @Override public void glGetShader(int param1, int param2, IntBuffer param3) { checkLimit(param3); GL20.glGetShader(param1, param2, param3); } + @Override public String glGetString(int param1) { return GL11.glGetString(param1); } + @Override public String glGetString(int param1, int param2) { return GL30.glGetStringi(param1, param2); } + @Override public boolean glIsEnabled(int param1) { return GL11.glIsEnabled(param1); } + @Override public void glLineWidth(float param1) { GL11.glLineWidth(param1); } + @Override public void glLinkProgram(int param1) { GL20.glLinkProgram(param1); } + @Override public void glPixelStorei(int param1, int param2) { GL11.glPixelStorei(param1, param2); } + @Override public void glPointSize(float param1) { GL11.glPointSize(param1); } + @Override public void glPolygonMode(int param1, int param2) { GL11.glPolygonMode(param1, param2); } + @Override public void glPolygonOffset(float param1, float param2) { GL11.glPolygonOffset(param1, param2); } + @Override public void glReadBuffer(int param1) { GL11.glReadBuffer(param1); } + @Override public void glReadPixels(int param1, int param2, int param3, int param4, int param5, int param6, ByteBuffer param7) { checkLimit(param7); GL11.glReadPixels(param1, param2, param3, param4, param5, param6, param7); } + @Override public void glReadPixels(int param1, int param2, int param3, int param4, int param5, int param6, long param7) { GL11.glReadPixels(param1, param2, param3, param4, param5, param6, param7); } + @Override public void glScissor(int param1, int param2, int param3, int param4) { GL11.glScissor(param1, param2, param3, param4); } + @Override public void glStencilFuncSeparate(int param1, int param2, int param3, int param4) { GL20.glStencilFuncSeparate(param1, param2, param3, param4); } + @Override public void glStencilOpSeparate(int param1, int param2, int param3, int param4) { GL20.glStencilOpSeparate(param1, param2, param3, param4); } + @Override public void glTexImage2D(int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, ByteBuffer param9) { checkLimit(param9); GL11.glTexImage2D(param1, param2, param3, param4, param5, param6, param7, param8, param9); } + @Override public void glTexImage3D(int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, int param9, ByteBuffer param10) { checkLimit(param10); GL12.glTexImage3D(param1, param2, param3, param4, param5, param6, param7, param8, param9, param10); } + @Override public void glTexParameterf(int param1, int param2, float param3) { GL11.glTexParameterf(param1, param2, param3); } + @Override public void glTexParameteri(int param1, int param2, int param3) { GL11.glTexParameteri(param1, param2, param3); } + @Override public void glTexSubImage2D(int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, ByteBuffer param9) { checkLimit(param9); GL11.glTexSubImage2D(param1, param2, param3, param4, param5, param6, param7, param8, param9); } + @Override public void glTexSubImage3D(int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, int param9, int param10, ByteBuffer param11) { checkLimit(param11); GL12.glTexSubImage3D(param1, param2, param3, param4, param5, param6, param7, param8, param9, param10, param11); } + @Override public void glUniform1(int param1, FloatBuffer param2) { checkLimit(param2); GL20.glUniform1(param1, param2); } + @Override public void glUniform1(int param1, IntBuffer param2) { checkLimit(param2); GL20.glUniform1(param1, param2); } + @Override public void glUniform1f(int param1, float param2) { GL20.glUniform1f(param1, param2); } + @Override public void glUniform1i(int param1, int param2) { GL20.glUniform1i(param1, param2); } + @Override public void glUniform2(int param1, IntBuffer param2) { checkLimit(param2); GL20.glUniform2(param1, param2); } + @Override public void glUniform2(int param1, FloatBuffer param2) { checkLimit(param2); GL20.glUniform2(param1, param2); } + @Override public void glUniform2f(int param1, float param2, float param3) { GL20.glUniform2f(param1, param2, param3); } + @Override public void glUniform3(int param1, IntBuffer param2) { checkLimit(param2); GL20.glUniform3(param1, param2); } + @Override public void glUniform3(int param1, FloatBuffer param2) { checkLimit(param2); GL20.glUniform3(param1, param2); } + @Override public void glUniform3f(int param1, float param2, float param3, float param4) { GL20.glUniform3f(param1, param2, param3, param4); } + @Override public void glUniform4(int param1, FloatBuffer param2) { checkLimit(param2); GL20.glUniform4(param1, param2); } + @Override public void glUniform4(int param1, IntBuffer param2) { checkLimit(param2); GL20.glUniform4(param1, param2); } + @Override public void glUniform4f(int param1, float param2, float param3, float param4, float param5) { GL20.glUniform4f(param1, param2, param3, param4, param5); } + @Override public void glUniformMatrix3(int param1, boolean param2, FloatBuffer param3) { checkLimit(param3); GL20.glUniformMatrix3(param1, param2, param3); } + @Override public void glUniformMatrix4(int param1, boolean param2, FloatBuffer param3) { checkLimit(param3); GL20.glUniformMatrix4(param1, param2, param3); } + @Override public void glUseProgram(int param1) { GL20.glUseProgram(param1); } + @Override public void glVertexAttribPointer(int param1, int param2, int param3, boolean param4, int param5, long param6) { GL20.glVertexAttribPointer(param1, param2, param3, param4, param5, param6); } + @Override public void glViewport(int param1, int param2, int param3, int param4) { GL11.glViewport(param1, param2, param3, param4); } + @Override public int glGetAttribLocation(int param1, String param2) { // NOTE: LWJGL requires null-terminated strings return GL20.glGetAttribLocation(param1, param2 + "\0"); } + @Override public int glGetUniformLocation(int param1, String param2) { // NOTE: LWJGL requires null-terminated strings return GL20.glGetUniformLocation(param1, param2 + "\0"); } + @Override public void glShaderSource(int param1, String[] param2, IntBuffer param3) { checkLimit(param3); GL20.glShaderSource(param1, param2); } + @Override public String glGetProgramInfoLog(int program, int maxSize) { return GL20.glGetProgramInfoLog(program, maxSize); } @@ -459,6 +552,7 @@ public int glGetQueryObjectiv(int query, int pname) { return GL15.glGetQueryObjecti(query, pname); } + @Override public String glGetShaderInfoLog(int shader, int maxSize) { return GL20.glGetShaderInfoLog(shader, maxSize); } diff --git a/jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglAbstractDisplay.java b/jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglAbstractDisplay.java index 528c788ead..dfc0f28a57 100644 --- a/jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglAbstractDisplay.java +++ b/jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglAbstractDisplay.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -63,17 +63,20 @@ public abstract class LwjglAbstractDisplay extends LwjglContext implements Runna /** * @return Type.Display or Type.Canvas */ + @Override public abstract Type getType(); /** * Set the title if it's a windowed display * @param title */ + @Override public abstract void setTitle(String title); /** * Restart if it's a windowed or full-screen display. */ + @Override public abstract void restart(); /** @@ -95,6 +98,7 @@ protected boolean initInThread(){ if (!JmeSystem.isLowPermissions()){ // Enable uncaught exception handler only for current thread Thread.currentThread().setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() { + @Override public void uncaughtException(Thread thread, Throwable thrown) { listener.handleError("Uncaught exception thrown in "+thread.toString(), thrown); if (needClose.get()){ @@ -200,6 +204,7 @@ protected void deinitInThread(){ super.internalDestroy(); } + @Override public void run(){ if (listener == null) { throw new IllegalStateException("SystemListener is not set on context!" @@ -237,6 +242,7 @@ public void run(){ deinitInThread(); } + @Override public JoyInput getJoyInput() { if (joyInput == null){ joyInput = new JInputJoyInput(); @@ -244,6 +250,7 @@ public JoyInput getJoyInput() { return joyInput; } + @Override public MouseInput getMouseInput() { if (mouseInput == null){ mouseInput = new LwjglMouseInput(this); @@ -251,6 +258,7 @@ public MouseInput getMouseInput() { return mouseInput; } + @Override public KeyInput getKeyInput() { if (keyInput == null){ keyInput = new LwjglKeyInput(this); @@ -258,15 +266,22 @@ public KeyInput getKeyInput() { return keyInput; } + @Override public TouchInput getTouchInput() { return null; } + @Override public void setAutoFlushFrames(boolean enabled){ this.autoFlush = enabled; } - public void destroy(boolean waitFor){ + @Override + public void destroy(boolean waitFor) { + if (needClose.get()) { + return; // Already destroyed + } + needClose.set(true); if (waitFor) waitFor(false); diff --git a/jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglCanvas.java b/jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglCanvas.java index 0c5392b192..6100ae514a 100644 --- a/jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglCanvas.java +++ b/jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglCanvas.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -158,6 +158,7 @@ public Type getType() { return Type.Canvas; } + @Override public void create(boolean waitFor){ if (renderThread == null){ logger.log(Level.FINE, "MAIN: Creating OGL thread."); @@ -182,6 +183,7 @@ public void restart() { // TODO: Handle other cases, like change of pixel format, etc. } + @Override public Canvas getCanvas(){ return canvas; } @@ -285,6 +287,7 @@ private void restoreCanvas(){ } SwingUtilities.invokeLater(new Runnable(){ + @Override public void run(){ canvas.requestFocus(); } @@ -369,6 +372,7 @@ protected void destroyPbuffer(){ * 1) When the context thread ends * 2) Any time the canvas becomes non-displayable */ + @Override protected void destroyContext(){ try { // invalidate the state so renderer can resume operation diff --git a/jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglContext.java b/jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglContext.java index 4d2d776c52..32066efdcd 100644 --- a/jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglContext.java +++ b/jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglContext.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -92,6 +92,7 @@ public abstract class LwjglContext implements JmeContext { protected LwjglPlatform clPlatform; protected com.jme3.opencl.lwjgl.LwjglContext clContext; + @Override public void setSystemListener(SystemListener listener) { this.listener = listener; } @@ -117,6 +118,10 @@ protected int[] getGLVersion(String renderer) { maj = 3; min = 0; break; + case AppSettings.LWJGL_OPENGL31: + maj = 3; + min = 1; + break; case AppSettings.LWJGL_OPENGL32: maj = 3; min = 2; @@ -446,25 +451,31 @@ protected void waitFor(boolean createdVal) { } } + @Override public boolean isCreated() { return created.get(); } + @Override public boolean isRenderable() { return renderable.get(); } + @Override public void setSettings(AppSettings settings) { this.settings.copyFrom(settings); } + @Override public AppSettings getSettings() { return settings; } + @Override public Renderer getRenderer() { return renderer; } + @Override public Timer getTimer() { return timer; } diff --git a/jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglDisplay.java b/jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglDisplay.java index 0fb787efef..bbf02adacd 100644 --- a/jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglDisplay.java +++ b/jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglDisplay.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -67,6 +67,7 @@ protected DisplayMode getFullscreenDisplayMode(int width, int height, int bpp, i return null; } + @Override protected void createContext(AppSettings settings) throws LWJGLException{ DisplayMode displayMode; if (settings.getWidth() <= 0 || settings.getHeight() <= 0){ @@ -112,15 +113,11 @@ protected void createContext(AppSettings settings) throws LWJGLException{ Display.setTitle(settings.getTitle()); Display.setResizable(settings.isResizable()); - if (displayMode != null) { - if (settings.isFullscreen()) { - Display.setDisplayModeAndFullscreen(displayMode); - } else { - Display.setFullscreen(false); - Display.setDisplayMode(displayMode); - } + if (settings.isFullscreen()) { + Display.setDisplayModeAndFullscreen(displayMode); } else { - Display.setFullscreen(settings.isFullscreen()); + Display.setFullscreen(false); + Display.setDisplayMode(displayMode); } if (settings.getIcons() != null) { @@ -155,6 +152,7 @@ protected void createContext(AppSettings settings) throws LWJGLException{ } } + @Override protected void destroyContext(){ try { renderer.cleanup(); @@ -165,6 +163,7 @@ protected void destroyContext(){ } } + @Override public void create(boolean waitFor){ if (created.get()){ logger.warning("create() called when display is already created!"); @@ -206,10 +205,12 @@ public void restart() { } } + @Override public Type getType() { return Type.Display; } + @Override public void setTitle(String title){ if (created.get()) Display.setTitle(title); diff --git a/jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglOffscreenBuffer.java b/jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglOffscreenBuffer.java index d4c86a780b..48f327be88 100644 --- a/jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglOffscreenBuffer.java +++ b/jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglOffscreenBuffer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -71,6 +71,7 @@ protected void initInThread(){ height = settings.getHeight(); try{ Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() { + @Override public void uncaughtException(Thread thread, Throwable thrown) { listener.handleError("Uncaught exception thrown in "+thread.toString(), thrown); } @@ -148,6 +149,7 @@ protected void deinitInThread(){ super.internalDestroy(); } + @Override public void run(){ loadNatives(); logger.log(Level.FINE, "Using LWJGL {0}", Sys.getVersion()); @@ -158,12 +160,14 @@ public void run(){ deinitInThread(); } + @Override public void destroy(boolean waitFor){ needClose.set(true); if (waitFor) waitFor(false); } + @Override public void create(boolean waitFor){ if (created.get()){ logger.warning("create() called when pbuffer is already created!"); @@ -175,32 +179,40 @@ public void create(boolean waitFor){ waitFor(true); } + @Override public void restart() { } + @Override public void setAutoFlushFrames(boolean enabled){ } + @Override public Type getType() { return Type.OffscreenSurface; } + @Override public MouseInput getMouseInput() { return new DummyMouseInput(); } + @Override public KeyInput getKeyInput() { return new DummyKeyInput(); } + @Override public JoyInput getJoyInput() { return null; } + @Override public TouchInput getTouchInput() { return null; } + @Override public void setTitle(String title) { } diff --git a/jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglSmoothingTimer.java b/jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglSmoothingTimer.java index 213d472c59..8c4da71b20 100644 --- a/jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglSmoothingTimer.java +++ b/jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglSmoothingTimer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -85,6 +85,7 @@ public LwjglSmoothingTimer() { logger.log(Level.FINE, "Timer resolution: {0} ticks per second", LWJGL_TIMER_RES); } + @Override public void reset() { lastFrameDiff = 0; lastFPS = 0; @@ -108,6 +109,7 @@ public void reset() { /** * @see Timer#getTime() */ + @Override public long getTime() { return Sys.getTime() - startTime; } @@ -115,6 +117,7 @@ public long getTime() { /** * @see Timer#getResolution() */ + @Override public long getResolution() { return LWJGL_TIMER_RES; } @@ -125,10 +128,12 @@ public long getResolution() { * * @return the current frame rate. */ + @Override public float getFrameRate() { return lastFPS; } + @Override public float getTimePerFrame() { return lastTPF; } @@ -137,6 +142,7 @@ public float getTimePerFrame() { * update recalulates the frame rate based on the previous * call to update. It is assumed that update is called each frame. */ + @Override public void update() { long newTime = Sys.getTime(); long oldTime = this.oldTime; diff --git a/jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglTimer.java b/jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglTimer.java index fb69a55500..efa339ef92 100644 --- a/jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglTimer.java +++ b/jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglTimer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -70,6 +70,7 @@ public LwjglTimer() { logger.log(Level.FINE, "Timer resolution: {0} ticks per second", LWJGL_TIMER_RES); } + @Override public void reset() { startTime = Sys.getTime(); oldTime = getTime(); @@ -83,6 +84,7 @@ public float getTimeInSeconds() { /** * @see Timer#getTime() */ + @Override public long getTime() { return Sys.getTime() - startTime; } @@ -90,6 +92,7 @@ public long getTime() { /** * @see Timer#getResolution() */ + @Override public long getResolution() { return LWJGL_TIMER_RES; } @@ -100,10 +103,12 @@ public long getResolution() { * * @return the current frame rate. */ + @Override public float getFrameRate() { return lastFPS; } + @Override public float getTimePerFrame() { return lastTPF; } @@ -112,6 +117,7 @@ public float getTimePerFrame() { * update recalulates the frame rate based on the previous * call to update. It is assumed that update is called each frame. */ + @Override public void update() { long curTime = getTime(); lastTPF = (curTime - oldTime) * (1.0f / LWJGL_TIMER_RES); diff --git a/jme3-lwjgl3/src/main/java/com/jme3/input/lwjgl/GlfwKeyInput.java b/jme3-lwjgl3/src/main/java/com/jme3/input/lwjgl/GlfwKeyInput.java index b8049a8f88..97580ee802 100644 --- a/jme3-lwjgl3/src/main/java/com/jme3/input/lwjgl/GlfwKeyInput.java +++ b/jme3-lwjgl3/src/main/java/com/jme3/input/lwjgl/GlfwKeyInput.java @@ -83,11 +83,33 @@ public GlfwKeyInput(final LwjglWindow context) { @Override public void initialize() { + if (!context.isRenderable()) { + return; + } + initCallbacks(); + + initialized = true; + logger.fine("Keyboard created."); + } + /** + * Re-initializes the key input context window specific callbacks + */ + public void resetContext() { if (!context.isRenderable()) { return; } + closeCallbacks(); + initCallbacks(); + } + + private void closeCallbacks() { + keyCallback.close(); + charCallback.close(); + } + + private void initCallbacks() { glfwSetKeyCallback(context.getWindowHandle(), keyCallback = new GLFWKeyCallback() { @Override public void invoke(final long window, final int key, final int scancode, final int action, final int mods) { @@ -122,9 +144,6 @@ public void invoke(final long window, final int codepoint) { keyInputEvents.add(released); } }); - - initialized = true; - logger.fine("Keyboard created."); } public int getKeyCount() { @@ -149,8 +168,7 @@ public void destroy() { return; } - keyCallback.close(); - charCallback.close(); + closeCallbacks(); logger.fine("Keyboard destroyed."); } diff --git a/jme3-lwjgl3/src/main/java/com/jme3/input/lwjgl/GlfwMouseInput.java b/jme3-lwjgl3/src/main/java/com/jme3/input/lwjgl/GlfwMouseInput.java index f198234a6c..8b1563bfbb 100644 --- a/jme3-lwjgl3/src/main/java/com/jme3/input/lwjgl/GlfwMouseInput.java +++ b/jme3-lwjgl3/src/main/java/com/jme3/input/lwjgl/GlfwMouseInput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -176,7 +176,30 @@ private void onMouseButton(final long window, final int button, final int action @Override public void initialize() { + initCallbacks(); + if (listener != null) { + sendFirstMouseEvent(); + } + + setCursorVisible(cursorVisible); + logger.fine("Mouse created."); + initialized = true; + } + + /** + * Re-initializes the mouse input context window specific callbacks + */ + public void resetContext() { + if (!context.isRenderable()) { + return; + } + + closeCallbacks(); + initCallbacks(); + } + + private void initCallbacks() { final long window = context.getWindowHandle(); try (MemoryStack stack = MemoryStack.stackPush()) { @@ -219,14 +242,6 @@ public void invoke(final long window, final int width, final int height) { currentWidth = width; } }); - - if(listener != null) { - sendFirstMouseEvent(); - } - - setCursorVisible(cursorVisible); - logger.fine("Mouse created."); - initialized = true; } private void initCurrentMousePosition(long window) { @@ -234,7 +249,7 @@ private void initCurrentMousePosition(long window) { DoubleBuffer y = BufferUtils.createDoubleBuffer(1); glfwGetCursorPos(window, x, y); mouseX = (int) Math.round(x.get()); - mouseY = (int) currentHeight - (int) Math.round(y.get()); + mouseY = currentHeight - (int) Math.round(y.get()); } /** @@ -295,9 +310,7 @@ public void destroy() { return; } - cursorPosCallback.close(); - scrollCallback.close(); - mouseButtonCallback.close(); + closeCallbacks(); currentCursor = null; currentCursorDelays = null; @@ -313,6 +326,12 @@ public void destroy() { logger.fine("Mouse destroyed."); } + private void closeCallbacks() { + cursorPosCallback.close(); + scrollCallback.close(); + mouseButtonCallback.close(); + } + @Override public void setCursorVisible(boolean visible) { cursorVisible = visible; diff --git a/jme3-lwjgl3/src/main/java/com/jme3/renderer/lwjgl/LwjglGL.java b/jme3-lwjgl3/src/main/java/com/jme3/renderer/lwjgl/LwjglGL.java index 0d8c32a8df..618b123b48 100644 --- a/jme3-lwjgl3/src/main/java/com/jme3/renderer/lwjgl/LwjglGL.java +++ b/jme3-lwjgl3/src/main/java/com/jme3/renderer/lwjgl/LwjglGL.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -591,6 +591,7 @@ public int glGetQueryObjectiv(int query, int pname) { return GL15.glGetQueryObjecti(query, pname); } + @Override public String glGetShaderInfoLog(int shader, int maxSize) { return GL20.glGetShaderInfoLog(shader, maxSize); } diff --git a/jme3-lwjgl3/src/main/java/com/jme3/system/lwjgl/LwjglContext.java b/jme3-lwjgl3/src/main/java/com/jme3/system/lwjgl/LwjglContext.java index 8f3afca85a..028ad881f4 100644 --- a/jme3-lwjgl3/src/main/java/com/jme3/system/lwjgl/LwjglContext.java +++ b/jme3-lwjgl3/src/main/java/com/jme3/system/lwjgl/LwjglContext.java @@ -106,6 +106,7 @@ public abstract class LwjglContext implements JmeContext { private static final Set SUPPORTED_RENDERS = new HashSet<>(Arrays.asList( AppSettings.LWJGL_OPENGL2, AppSettings.LWJGL_OPENGL30, + AppSettings.LWJGL_OPENGL31, AppSettings.LWJGL_OPENGL32, AppSettings.LWJGL_OPENGL33, AppSettings.LWJGL_OPENGL40, diff --git a/jme3-lwjgl3/src/main/java/com/jme3/system/lwjgl/LwjglWindow.java b/jme3-lwjgl3/src/main/java/com/jme3/system/lwjgl/LwjglWindow.java index e84c5c3ce6..ab82bbc058 100644 --- a/jme3-lwjgl3/src/main/java/com/jme3/system/lwjgl/LwjglWindow.java +++ b/jme3-lwjgl3/src/main/java/com/jme3/system/lwjgl/LwjglWindow.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -80,6 +80,10 @@ public abstract class LwjglWindow extends LwjglContext implements Runnable { glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0); }); + RENDER_CONFIGS.put(AppSettings.LWJGL_OPENGL31, () -> { + glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); + glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 1); + }); RENDER_CONFIGS.put(AppSettings.LWJGL_OPENGL32, () -> { glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2); @@ -145,6 +149,7 @@ public LwjglWindow(final JmeContext.Type type) { /** * @return Type.Display or Type.Canvas */ + @Override public JmeContext.Type getType() { return type; } @@ -154,6 +159,7 @@ public JmeContext.Type getType() { * * @param title the title to set */ + @Override public void setTitle(final String title) { if (created.get() && window != NULL) { glfwSetWindowTitle(window, title); @@ -163,6 +169,7 @@ public void setTitle(final String title) { /** * Restart if it's a windowed or full-screen display. */ + @Override public void restart() { if (created.get()) { needRestart.set(true); @@ -295,6 +302,11 @@ public void invoke(final long window, final boolean focus) { showWindow(); allowSwapBuffers = settings.isSwapBuffers(); + + // Create OpenCL + if (settings.isOpenCLSupport()) { + initOpenCL(window); + } } protected void showWindow() { @@ -303,6 +315,8 @@ protected void showWindow() { /** * Set custom icons to the window of this application. + * + * @param settings settings for getting the icons */ protected void setWindowIcon(final AppSettings settings) { @@ -409,7 +423,6 @@ protected void destroyContext() { window = NULL; } - glfwTerminate(); } catch (final Exception ex) { listener.handleError("Failed to destroy context", ex); } @@ -429,6 +442,8 @@ public void create(boolean waitFor) { /** * Does LWJGL display initialization in the OpenGL thread + * + * @return returns {@code true} if the context initialization was successful */ protected boolean initInThread() { try { @@ -455,13 +470,6 @@ protected boolean initInThread() { created.set(true); super.internalCreate(); - - //create OpenCL - //Must be done here because the window handle is needed - if (settings.isOpenCLSupport()) { - initOpenCL(window); - } - } catch (Exception ex) { try { if (window != NULL) { @@ -486,14 +494,7 @@ protected boolean initInThread() { protected void runLoop() { // If a restart is required, lets recreate the context. if (needRestart.getAndSet(false)) { - try { - destroyContext(); - createContext(settings); - } catch (Exception ex) { - LOGGER.log(Level.SEVERE, "Failed to set display settings!", ex); - } - - LOGGER.fine("Display restarted."); + restartContext(); } if (!created.get()) { @@ -549,6 +550,25 @@ protected void runLoop() { glfwPollEvents(); } + private void restartContext() { + try { + destroyContext(); + createContext(settings); + } catch (Exception ex) { + LOGGER.log(Level.SEVERE, "Failed to set display settings!", ex); + } + + // We need to reinit the mouse and keyboard input as they are tied to a window handle + if (keyInput != null && keyInput.isInitialized()) { + keyInput.resetContext(); + } + if (mouseInput != null && mouseInput.isInitialized()) { + mouseInput.resetContext(); + } + + LOGGER.fine("Display restarted."); + } + private void setFrameRateLimit(int frameRateLimit) { this.frameRateLimit = frameRateLimit; frameSleepTime = 1000.0 / this.frameRateLimit; @@ -562,6 +582,7 @@ protected void deinitInThread() { destroyContext(); super.internalDestroy(); + glfwTerminate(); LOGGER.fine("Display destroyed."); } diff --git a/jme3-networking/src/main/java/com/jme3/network/AbstractMessage.java b/jme3-networking/src/main/java/com/jme3/network/AbstractMessage.java index 5a13a68239..2fe7b20b01 100644 --- a/jme3-networking/src/main/java/com/jme3/network/AbstractMessage.java +++ b/jme3-networking/src/main/java/com/jme3/network/AbstractMessage.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -57,6 +57,7 @@ protected AbstractMessage( boolean reliable ) * Sets this message to 'reliable' or not and returns this * message. */ + @Override public Message setReliable(boolean f) { this.reliable = f; @@ -67,6 +68,7 @@ public Message setReliable(boolean f) * Indicates which way an outgoing message should be sent * or which way an incoming message was sent. */ + @Override public boolean isReliable() { return reliable; diff --git a/jme3-networking/src/main/java/com/jme3/network/Client.java b/jme3-networking/src/main/java/com/jme3/network/Client.java index 3ef9134dfe..28c966cb8f 100644 --- a/jme3-networking/src/main/java/com/jme3/network/Client.java +++ b/jme3-networking/src/main/java/com/jme3/network/Client.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -90,12 +90,14 @@ public interface Client extends MessageConnection /** * Sends a message to the server. */ + @Override public void send( Message message ); /** * Sends a message to the other end of the connection using * the specified alternate channel. */ + @Override public void send( int channel, Message message ); /** diff --git a/jme3-networking/src/main/java/com/jme3/network/Filters.java b/jme3-networking/src/main/java/com/jme3/network/Filters.java index 1cc45e0170..ebcc52b225 100644 --- a/jme3-networking/src/main/java/com/jme3/network/Filters.java +++ b/jme3-networking/src/main/java/com/jme3/network/Filters.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -118,6 +118,7 @@ public EqualToFilter( T value ) this.value = value; } + @Override public boolean apply( T input ) { return value == input || (value != null && value.equals(input)); @@ -133,6 +134,7 @@ public InFilter( Collection collection ) this.collection = collection; } + @Override public boolean apply( T input ) { return collection.contains(input); @@ -148,6 +150,7 @@ public NotFilter( Filter delegate ) this.delegate = delegate; } + @Override public boolean apply( T input ) { return !delegate.apply(input); diff --git a/jme3-networking/src/main/java/com/jme3/network/Network.java b/jme3-networking/src/main/java/com/jme3/network/Network.java index 9dac8eae85..6b968a6012 100644 --- a/jme3-networking/src/main/java/com/jme3/network/Network.java +++ b/jme3-networking/src/main/java/com/jme3/network/Network.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -175,11 +175,13 @@ public NetworkClientImpl(String gameName, int version) super( gameName, version ); } + @Override public void connectToServer( String host, int port, int remoteUdpPort ) throws IOException { connectToServer( InetAddress.getByName(host), port, remoteUdpPort ); } + @Override public void connectToServer( InetAddress address, int port, int remoteUdpPort ) throws IOException { UdpConnector fast = new UdpConnector( address, remoteUdpPort ); diff --git a/jme3-networking/src/main/java/com/jme3/network/base/ConnectorAdapter.java b/jme3-networking/src/main/java/com/jme3/network/base/ConnectorAdapter.java index 100747ffd7..592d69f499 100644 --- a/jme3-networking/src/main/java/com/jme3/network/base/ConnectorAdapter.java +++ b/jme3-networking/src/main/java/com/jme3/network/base/ConnectorAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -152,6 +152,7 @@ protected void handleError( Exception e ) errorHandler.handleError( this, e ); } + @Override public void run() { MessageBuffer messageBuffer = protocol.createBuffer(); @@ -203,6 +204,7 @@ private void write( ByteBuffer data ) } } + @Override public void run() { while( go.get() ) { diff --git a/jme3-networking/src/main/java/com/jme3/network/base/DefaultServer.java b/jme3-networking/src/main/java/com/jme3/network/base/DefaultServer.java index 3040fdcdae..e2241b538f 100644 --- a/jme3-networking/src/main/java/com/jme3/network/base/DefaultServer.java +++ b/jme3-networking/src/main/java/com/jme3/network/base/DefaultServer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -287,7 +287,7 @@ public boolean hasConnections() @Override public Collection getConnections() { - return Collections.unmodifiableCollection((Collection)connections.values()); + return Collections.unmodifiableCollection(connections.values()); } @Override diff --git a/jme3-networking/src/main/java/com/jme3/network/base/KernelAdapter.java b/jme3-networking/src/main/java/com/jme3/network/base/KernelAdapter.java index cb2dd21929..97fb42583c 100644 --- a/jme3-networking/src/main/java/com/jme3/network/base/KernelAdapter.java +++ b/jme3-networking/src/main/java/com/jme3/network/base/KernelAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -264,6 +264,7 @@ protected void flushEvents() } } + @Override public void run() { while( go.get() ) { diff --git a/jme3-networking/src/main/java/com/jme3/network/base/NioKernelFactory.java b/jme3-networking/src/main/java/com/jme3/network/base/NioKernelFactory.java index 024c4d0099..6f1a552c6b 100644 --- a/jme3-networking/src/main/java/com/jme3/network/base/NioKernelFactory.java +++ b/jme3-networking/src/main/java/com/jme3/network/base/NioKernelFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -45,6 +45,7 @@ */ public class NioKernelFactory implements KernelFactory { + @Override public Kernel createKernel( int channel, int port ) throws IOException { return new SelectorKernel(port); diff --git a/jme3-networking/src/main/java/com/jme3/network/base/TcpConnectorFactory.java b/jme3-networking/src/main/java/com/jme3/network/base/TcpConnectorFactory.java index 1166dd32e0..5a952e040c 100644 --- a/jme3-networking/src/main/java/com/jme3/network/base/TcpConnectorFactory.java +++ b/jme3-networking/src/main/java/com/jme3/network/base/TcpConnectorFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -52,6 +52,7 @@ public TcpConnectorFactory( InetAddress remoteAddress ) this.remoteAddress = remoteAddress; } + @Override public Connector createConnector( int channel, int port ) throws IOException { return new SocketConnector( remoteAddress, port ); diff --git a/jme3-networking/src/main/java/com/jme3/network/base/protocol/GreedyMessageBuffer.java b/jme3-networking/src/main/java/com/jme3/network/base/protocol/GreedyMessageBuffer.java index 14831dfda9..6385b0c083 100644 --- a/jme3-networking/src/main/java/com/jme3/network/base/protocol/GreedyMessageBuffer.java +++ b/jme3-networking/src/main/java/com/jme3/network/base/protocol/GreedyMessageBuffer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -69,6 +69,7 @@ public GreedyMessageBuffer( MessageProtocol protocol ) { * Returns the next message in the buffer or null if there are no more * messages in the buffer. */ + @Override public Message pollMessage() { if( messages.isEmpty() ) { return null; @@ -79,6 +80,7 @@ public Message pollMessage() { /** * Returns true if there is a message waiting in the buffer. */ + @Override public boolean hasMessages() { return !messages.isEmpty(); } @@ -87,6 +89,7 @@ public boolean hasMessages() { * Adds byte data to the message buffer. Returns true if there is * a message waiting after this call. */ + @Override public boolean addBytes( ByteBuffer buffer ) { // push the data from the buffer into as // many messages as we can diff --git a/jme3-networking/src/main/java/com/jme3/network/base/protocol/LazyMessageBuffer.java b/jme3-networking/src/main/java/com/jme3/network/base/protocol/LazyMessageBuffer.java index fc66cb148f..f3a41ce061 100644 --- a/jme3-networking/src/main/java/com/jme3/network/base/protocol/LazyMessageBuffer.java +++ b/jme3-networking/src/main/java/com/jme3/network/base/protocol/LazyMessageBuffer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -66,6 +66,7 @@ public LazyMessageBuffer( MessageProtocol protocol ) { * Returns the next message in the buffer or null if there are no more * messages in the buffer. */ + @Override public Message pollMessage() { if( messages.isEmpty() ) { return null; @@ -77,6 +78,7 @@ public Message pollMessage() { /** * Returns true if there is a message waiting in the buffer. */ + @Override public boolean hasMessages() { return !messages.isEmpty(); } @@ -85,6 +87,7 @@ public boolean hasMessages() { * Adds byte data to the message buffer. Returns true if there is * a message waiting after this call. */ + @Override public boolean addBytes( ByteBuffer buffer ) { // push the data from the buffer into as // many messages as we can diff --git a/jme3-networking/src/main/java/com/jme3/network/base/protocol/SerializerMessageProtocol.java b/jme3-networking/src/main/java/com/jme3/network/base/protocol/SerializerMessageProtocol.java index 80493660ee..6344b7d5af 100644 --- a/jme3-networking/src/main/java/com/jme3/network/base/protocol/SerializerMessageProtocol.java +++ b/jme3-networking/src/main/java/com/jme3/network/base/protocol/SerializerMessageProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -61,6 +61,7 @@ public SerializerMessageProtocol() { * and the (short length) + data protocol. If target is null * then a 32k byte buffer will be created and filled. */ + @Override public ByteBuffer toByteBuffer( Message message, ByteBuffer target ) { // Could let the caller pass their own in @@ -84,6 +85,7 @@ public ByteBuffer toByteBuffer( Message message, ByteBuffer target ) { * Creates and returns a message from the properly sized byte buffer * using com.jme3.network.serializing.Serializer. */ + @Override public Message toMessage( ByteBuffer bytes ) { try { return (Message)Serializer.readClassAndObject(bytes); @@ -92,6 +94,7 @@ public Message toMessage( ByteBuffer bytes ) { } } + @Override public MessageBuffer createBuffer() { // Defaulting to LazyMessageBuffer return new LazyMessageBuffer(this); diff --git a/jme3-networking/src/main/java/com/jme3/network/kernel/AbstractKernel.java b/jme3-networking/src/main/java/com/jme3/network/kernel/AbstractKernel.java index 7f992e94ab..ca1909570d 100644 --- a/jme3-networking/src/main/java/com/jme3/network/kernel/AbstractKernel.java +++ b/jme3-networking/src/main/java/com/jme3/network/kernel/AbstractKernel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -96,6 +96,7 @@ protected long nextEndpointId() /** * Returns true if there are waiting envelopes. */ + @Override public boolean hasEnvelopes() { return !envelopes.isEmpty(); @@ -105,6 +106,7 @@ public boolean hasEnvelopes() * Removes one envelope from the received messages queue or * blocks until one is available. */ + @Override public Envelope read() throws InterruptedException { return envelopes.take(); @@ -114,6 +116,7 @@ public Envelope read() throws InterruptedException * Removes and returnsn one endpoint event from the event queue or * null if there are no endpoint events. */ + @Override public EndpointEvent nextEvent() { return endpointEvents.poll(); diff --git a/jme3-networking/src/main/java/com/jme3/network/kernel/EndpointEvent.java b/jme3-networking/src/main/java/com/jme3/network/kernel/EndpointEvent.java index b43f2aaf33..86599da771 100644 --- a/jme3-networking/src/main/java/com/jme3/network/kernel/EndpointEvent.java +++ b/jme3-networking/src/main/java/com/jme3/network/kernel/EndpointEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -79,6 +79,7 @@ public Type getType() return type; } + @Override public String toString() { return "EndpointEvent[" + type + ", " + endpoint + "]"; diff --git a/jme3-networking/src/main/java/com/jme3/network/kernel/Envelope.java b/jme3-networking/src/main/java/com/jme3/network/kernel/Envelope.java index 9b92a1b6d7..3739c86118 100644 --- a/jme3-networking/src/main/java/com/jme3/network/kernel/Envelope.java +++ b/jme3-networking/src/main/java/com/jme3/network/kernel/Envelope.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -71,6 +71,7 @@ public boolean isReliable() return reliable; } + @Override public String toString() { return "Envelope[" + source + ", " + (reliable?"reliable":"unreliable") + ", " + data.length + "]"; diff --git a/jme3-networking/src/main/java/com/jme3/network/kernel/NamedThreadFactory.java b/jme3-networking/src/main/java/com/jme3/network/kernel/NamedThreadFactory.java index 59dedd8835..efc055d633 100644 --- a/jme3-networking/src/main/java/com/jme3/network/kernel/NamedThreadFactory.java +++ b/jme3-networking/src/main/java/com/jme3/network/kernel/NamedThreadFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -70,6 +70,7 @@ public NamedThreadFactory( String name, boolean daemon, ThreadFactory delegate ) this.delegate = delegate; } + @Override public Thread newThread( Runnable r ) { Thread result = delegate.newThread(r); diff --git a/jme3-networking/src/main/java/com/jme3/network/kernel/tcp/NioEndpoint.java b/jme3-networking/src/main/java/com/jme3/network/kernel/tcp/NioEndpoint.java index 0a022758ff..751d7c3c18 100644 --- a/jme3-networking/src/main/java/com/jme3/network/kernel/tcp/NioEndpoint.java +++ b/jme3-networking/src/main/java/com/jme3/network/kernel/tcp/NioEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -65,16 +65,19 @@ public NioEndpoint( SelectorKernel kernel, long id, SocketChannel socket ) this.kernel = kernel; } + @Override public Kernel getKernel() { return kernel; } + @Override public void close() { close(false); } + @Override public void close( boolean flushData ) { if( flushData ) { @@ -97,16 +100,19 @@ public void close( boolean flushData ) } } + @Override public long getId() { return id; } + @Override public String getAddress() { return String.valueOf(socket.socket().getRemoteSocketAddress()); } + @Override public boolean isConnected() { return socket.isConnected(); @@ -162,6 +168,7 @@ protected boolean hasPending() return !outbound.isEmpty(); } + @Override public void send( ByteBuffer data ) { if( data == null ) { @@ -173,6 +180,7 @@ public void send( ByteBuffer data ) send( data, true, true ); } + @Override public String toString() { return "NioEndpoint[" + id + ", " + socket + "]"; diff --git a/jme3-networking/src/main/java/com/jme3/network/kernel/tcp/SelectorKernel.java b/jme3-networking/src/main/java/com/jme3/network/kernel/tcp/SelectorKernel.java index 4db90f68b0..7713ca804e 100644 --- a/jme3-networking/src/main/java/com/jme3/network/kernel/tcp/SelectorKernel.java +++ b/jme3-networking/src/main/java/com/jme3/network/kernel/tcp/SelectorKernel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -83,6 +83,7 @@ protected SelectorThread createSelectorThread() return new SelectorThread(); } + @Override public void initialize() { if( thread != null ) @@ -98,6 +99,7 @@ public void initialize() } } + @Override public void terminate() throws InterruptedException { if( thread == null ) @@ -114,6 +116,7 @@ public void terminate() throws InterruptedException } } + @Override public void broadcast( Filter filter, ByteBuffer data, boolean reliable, boolean copy ) { @@ -439,6 +442,7 @@ else if( key.isReadable() ) } } + @Override public void run() { log.log( Level.FINE, "Kernel started for connection:{0}.", address ); diff --git a/jme3-networking/src/main/java/com/jme3/network/kernel/tcp/SocketConnector.java b/jme3-networking/src/main/java/com/jme3/network/kernel/tcp/SocketConnector.java index 1cb2373032..be4682bd9e 100644 --- a/jme3-networking/src/main/java/com/jme3/network/kernel/tcp/SocketConnector.java +++ b/jme3-networking/src/main/java/com/jme3/network/kernel/tcp/SocketConnector.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -81,6 +81,7 @@ protected void checkClosed() throw new ConnectorException( "Connection is closed:" + remoteAddress ); } + @Override public boolean isConnected() { if( sock == null ) @@ -88,6 +89,7 @@ public boolean isConnected() return sock.isConnected(); } + @Override public void close() { checkClosed(); @@ -101,6 +103,7 @@ public void close() } } + @Override public boolean available() { checkClosed(); @@ -111,6 +114,7 @@ public boolean available() } } + @Override public ByteBuffer read() { checkClosed(); @@ -135,6 +139,7 @@ public ByteBuffer read() } } + @Override public void write( ByteBuffer data ) { checkClosed(); diff --git a/jme3-networking/src/main/java/com/jme3/network/kernel/udp/UdpConnector.java b/jme3-networking/src/main/java/com/jme3/network/kernel/udp/UdpConnector.java index bf0f7ddb1a..9d27227cf8 100644 --- a/jme3-networking/src/main/java/com/jme3/network/kernel/udp/UdpConnector.java +++ b/jme3-networking/src/main/java/com/jme3/network/kernel/udp/UdpConnector.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -81,6 +81,7 @@ protected void checkClosed() throw new ConnectorException( "Connection is closed:" + remoteAddress ); } + @Override public boolean isConnected() { if( sock == null ) @@ -88,6 +89,7 @@ public boolean isConnected() return sock.isConnected(); } + @Override public void close() { checkClosed(); @@ -101,6 +103,7 @@ public void close() * This always returns false since the simple DatagramSocket usage * cannot be run in a non-blocking way. */ + @Override public boolean available() { // It would take a separate thread or an NIO Selector based implementation to get this @@ -110,6 +113,7 @@ public boolean available() return false; } + @Override public ByteBuffer read() { checkClosed(); @@ -128,6 +132,7 @@ public ByteBuffer read() } } + @Override public void write( ByteBuffer data ) { checkClosed(); diff --git a/jme3-networking/src/main/java/com/jme3/network/kernel/udp/UdpEndpoint.java b/jme3-networking/src/main/java/com/jme3/network/kernel/udp/UdpEndpoint.java index 0c915ff81f..2540fe42e1 100644 --- a/jme3-networking/src/main/java/com/jme3/network/kernel/udp/UdpEndpoint.java +++ b/jme3-networking/src/main/java/com/jme3/network/kernel/udp/UdpEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -66,6 +66,7 @@ public UdpEndpoint( UdpKernel kernel, long id, SocketAddress address, DatagramSo this.kernel = kernel; } + @Override public Kernel getKernel() { return kernel; @@ -76,11 +77,13 @@ protected SocketAddress getRemoteAddress() return address; } + @Override public void close() { close( false ); } + @Override public void close( boolean flush ) { // No real reason to flush UDP traffic yet... especially @@ -95,16 +98,19 @@ public void close( boolean flush ) } } + @Override public long getId() { return id; } + @Override public String getAddress() { return String.valueOf(address); } + @Override public boolean isConnected() { // The socket is always unconnected anyway so we track our @@ -112,6 +118,7 @@ public boolean isConnected() return connected; } + @Override public void send( ByteBuffer data ) { if( !isConnected() ) { @@ -139,6 +146,7 @@ public void send( ByteBuffer data ) } } + @Override public String toString() { return "UdpEndpoint[" + id + ", " + address + "]"; diff --git a/jme3-networking/src/main/java/com/jme3/network/kernel/udp/UdpKernel.java b/jme3-networking/src/main/java/com/jme3/network/kernel/udp/UdpKernel.java index 57ea178647..4f27385d5e 100644 --- a/jme3-networking/src/main/java/com/jme3/network/kernel/udp/UdpKernel.java +++ b/jme3-networking/src/main/java/com/jme3/network/kernel/udp/UdpKernel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -84,6 +84,7 @@ protected HostThread createHostThread() return new HostThread(); } + @Override public void initialize() { if( thread != null ) @@ -101,6 +102,7 @@ public void initialize() } } + @Override public void terminate() throws InterruptedException { if( thread == null ) @@ -122,6 +124,7 @@ public void terminate() throws InterruptedException * Dispatches the data to all endpoints managed by the * kernel. 'routing' is currently ignored. */ + @Override public void broadcast( Filter filter, ByteBuffer data, boolean reliable, boolean copy ) { @@ -209,6 +212,7 @@ public MessageWriter( Endpoint endpoint, DatagramPacket packet ) this.packet = packet; } + @Override public void run() { // Not guaranteed to always work but an extra datagram @@ -263,6 +267,7 @@ public void close() throws IOException, InterruptedException join(); } + @Override public void run() { log.log( Level.FINE, "Kernel started for connection:{0}.", address ); diff --git a/jme3-networking/src/main/java/com/jme3/network/message/ChannelInfoMessage.java b/jme3-networking/src/main/java/com/jme3/network/message/ChannelInfoMessage.java index cbf4355656..231fe19ff6 100644 --- a/jme3-networking/src/main/java/com/jme3/network/message/ChannelInfoMessage.java +++ b/jme3-networking/src/main/java/com/jme3/network/message/ChannelInfoMessage.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -67,6 +67,7 @@ public int[] getPorts() { return ports; } + @Override public String toString() { return "ChannelInfoMessage[" + id + ", " + Arrays.asList(ports) + "]"; } diff --git a/jme3-networking/src/main/java/com/jme3/network/message/ClientRegistrationMessage.java b/jme3-networking/src/main/java/com/jme3/network/message/ClientRegistrationMessage.java index d8c19a20c9..50272e9deb 100644 --- a/jme3-networking/src/main/java/com/jme3/network/message/ClientRegistrationMessage.java +++ b/jme3-networking/src/main/java/com/jme3/network/message/ClientRegistrationMessage.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -79,6 +79,7 @@ public int getVersion() { return version; } + @Override public String toString() { return getClass().getName() + "[id=" + id + ", gameName=" + gameName + ", version=" + version + "]"; } @@ -91,6 +92,7 @@ public String toString() { */ public static class ClientRegistrationSerializer extends Serializer { + @Override public ClientRegistrationMessage readObject( ByteBuffer data, Class c ) throws IOException { // Read the null/non-null marker @@ -106,6 +108,7 @@ public ClientRegistrationMessage readObject( ByteBuffer data, Class c ) throws I return msg; } + @Override public void writeObject(ByteBuffer buffer, Object object) throws IOException { // Add the null/non-null marker diff --git a/jme3-networking/src/main/java/com/jme3/network/message/DisconnectMessage.java b/jme3-networking/src/main/java/com/jme3/network/message/DisconnectMessage.java index d514232f43..29f732768c 100644 --- a/jme3-networking/src/main/java/com/jme3/network/message/DisconnectMessage.java +++ b/jme3-networking/src/main/java/com/jme3/network/message/DisconnectMessage.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -71,6 +71,7 @@ public void setType(String type) { this.type = type; } + @Override public String toString() { return getClass().getName() + "[reason=" + reason + ", type=" + type + "]"; } @@ -83,6 +84,7 @@ public String toString() { */ public static class DisconnectSerializer extends Serializer { + @Override public DisconnectMessage readObject( ByteBuffer data, Class c ) throws IOException { // Read the null/non-null marker @@ -97,6 +99,7 @@ public DisconnectMessage readObject( ByteBuffer data, Class c ) throws IOExcepti return msg; } + @Override public void writeObject(ByteBuffer buffer, Object object) throws IOException { // Add the null/non-null marker diff --git a/jme3-networking/src/main/java/com/jme3/network/rmi/ObjectStore.java b/jme3-networking/src/main/java/com/jme3/network/rmi/ObjectStore.java index 05634b3ab2..7313be0d88 100644 --- a/jme3-networking/src/main/java/com/jme3/network/rmi/ObjectStore.java +++ b/jme3-networking/src/main/java/com/jme3/network/rmi/ObjectStore.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -87,14 +87,17 @@ public String toString(){ public class ServerEventHandler implements MessageListener, ConnectionListener { + @Override public void messageReceived(HostedConnection source, Message m) { onMessage(source, m); } + @Override public void connectionAdded(Server server, HostedConnection conn) { onConnection(conn); } + @Override public void connectionRemoved(Server server, HostedConnection conn) { } @@ -103,14 +106,17 @@ public void connectionRemoved(Server server, HostedConnection conn) { public class ClientEventHandler implements MessageListener, ClientStateListener { + @Override public void messageReceived(Object source, Message m) { onMessage(null, m); } + @Override public void clientConnected(Client c) { onConnection(null); } + @Override public void clientDisconnected(Client c, DisconnectInfo info) { } diff --git a/jme3-networking/src/main/java/com/jme3/network/rmi/RemoteObject.java b/jme3-networking/src/main/java/com/jme3/network/rmi/RemoteObject.java index 66f6c35312..7d822b9294 100644 --- a/jme3-networking/src/main/java/com/jme3/network/rmi/RemoteObject.java +++ b/jme3-networking/src/main/java/com/jme3/network/rmi/RemoteObject.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -129,6 +129,7 @@ public void loadMethods(Class interfaceClass){ /** * Callback from InvocationHandler. */ + @Override public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { return store.invokeRemoteMethod(this, method, args); } diff --git a/jme3-networking/src/main/java/com/jme3/network/serializing/SerializerRegistration.java b/jme3-networking/src/main/java/com/jme3/network/serializing/SerializerRegistration.java index 373d969eb5..7b1de57384 100644 --- a/jme3-networking/src/main/java/com/jme3/network/serializing/SerializerRegistration.java +++ b/jme3-networking/src/main/java/com/jme3/network/serializing/SerializerRegistration.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -75,6 +75,7 @@ public Class getType() { return type; } + @Override public String toString() { return "SerializerRegistration[" + id + ", " + type + ", " + serializer + "]"; } diff --git a/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/ArraySerializer.java b/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/ArraySerializer.java index 564f4a06e3..ade05a59f8 100644 --- a/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/ArraySerializer.java +++ b/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/ArraySerializer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine, Java Game Networking + * Copyright (c) 2009-2020 jMonkeyEngine, Java Game Networking * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -67,6 +67,7 @@ private void collectDimensions (Object array, int dimension, int[] dimensions) { } } + @Override public T readObject(ByteBuffer data, Class c) throws IOException { byte dimensionCount = data.get(); if (dimensionCount == 0) @@ -89,6 +90,7 @@ public T readObject(ByteBuffer data, Class c) throws IOException { return array; } + @Override public void writeObject(ByteBuffer buffer, Object object) throws IOException { if (object == null){ buffer.put((byte)0); diff --git a/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/BooleanSerializer.java b/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/BooleanSerializer.java index 2bfb8e62b6..7393edd1a3 100644 --- a/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/BooleanSerializer.java +++ b/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/BooleanSerializer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -43,10 +43,12 @@ @SuppressWarnings("unchecked") public class BooleanSerializer extends Serializer { + @Override public Boolean readObject(ByteBuffer data, Class c) throws IOException { return data.get() == 1; } + @Override public void writeObject(ByteBuffer buffer, Object object) throws IOException { buffer.put(((Boolean)object) ? (byte)1 : (byte)0); } diff --git a/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/ByteSerializer.java b/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/ByteSerializer.java index 4e085bbe6a..9c36954f97 100644 --- a/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/ByteSerializer.java +++ b/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/ByteSerializer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -43,10 +43,12 @@ @SuppressWarnings("unchecked") public class ByteSerializer extends Serializer { + @Override public Byte readObject(ByteBuffer data, Class c) throws IOException { return data.get(); } + @Override public void writeObject(ByteBuffer buffer, Object object) throws IOException { buffer.put((Byte)object); } diff --git a/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/CharSerializer.java b/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/CharSerializer.java index 274bc30db1..be32765658 100644 --- a/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/CharSerializer.java +++ b/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/CharSerializer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -43,10 +43,12 @@ @SuppressWarnings("unchecked") public class CharSerializer extends Serializer { + @Override public Character readObject(ByteBuffer data, Class c) throws IOException { return data.getChar(); } + @Override public void writeObject(ByteBuffer buffer, Object object) throws IOException { buffer.putChar((Character)object); } diff --git a/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/CollectionSerializer.java b/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/CollectionSerializer.java index 960e8be10f..c26185df7e 100644 --- a/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/CollectionSerializer.java +++ b/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/CollectionSerializer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -48,6 +48,7 @@ public class CollectionSerializer extends Serializer { @SuppressWarnings("unchecked") + @Override public T readObject(ByteBuffer data, Class c) throws IOException { int length = data.getInt(); @@ -77,6 +78,7 @@ public T readObject(ByteBuffer data, Class c) throws IOException { return (T)collection; } + @Override public void writeObject(ByteBuffer buffer, Object object) throws IOException { Collection collection = (Collection)object; int length = collection.size(); diff --git a/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/DateSerializer.java b/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/DateSerializer.java index 5bd8c465aa..7ce507a702 100644 --- a/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/DateSerializer.java +++ b/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/DateSerializer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -44,10 +44,12 @@ @SuppressWarnings("unchecked") public class DateSerializer extends Serializer { + @Override public Date readObject(ByteBuffer data, Class c) throws IOException { return new Date(data.getLong()); } + @Override public void writeObject(ByteBuffer buffer, Object object) throws IOException { buffer.putLong(((Date)object).getTime()); } diff --git a/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/DoubleSerializer.java b/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/DoubleSerializer.java index cb7494d9e6..5472d7b065 100644 --- a/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/DoubleSerializer.java +++ b/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/DoubleSerializer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -43,10 +43,12 @@ @SuppressWarnings("unchecked") public class DoubleSerializer extends Serializer { + @Override public Double readObject(ByteBuffer data, Class c) throws IOException { return data.getDouble(); } + @Override public void writeObject(ByteBuffer buffer, Object object) throws IOException { buffer.putDouble((Double)object); } diff --git a/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/EnumSerializer.java b/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/EnumSerializer.java index 3b89f7d5a8..6740ea0389 100644 --- a/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/EnumSerializer.java +++ b/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/EnumSerializer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -42,6 +42,7 @@ * @author Lars Wesselius */ public class EnumSerializer extends Serializer { + @Override public T readObject(ByteBuffer data, Class c) throws IOException { try { int ordinal = data.getInt(); @@ -57,6 +58,7 @@ public T readObject(ByteBuffer data, Class c) throws IOException { } } + @Override public void writeObject(ByteBuffer buffer, Object object) throws IOException { if (object == null) { buffer.putInt(-1); diff --git a/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/FieldSerializer.java b/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/FieldSerializer.java index 0d410bb4dd..bbe2db2780 100644 --- a/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/FieldSerializer.java +++ b/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/FieldSerializer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine, Java Game Networking + * Copyright (c) 2009-2020 jMonkeyEngine, Java Game Networking * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -80,6 +80,7 @@ protected void checkClass(Class clazz) { throw new RuntimeException( "Registration error: no-argument constructor not found on:" + clazz ); } + @Override public void initialize(Class clazz) { checkClass(clazz); @@ -123,6 +124,7 @@ public void initialize(Class clazz) { } Collections.sort(cachedFields, new Comparator() { + @Override public int compare (SavedField o1, SavedField o2) { return o1.field.getName().compareTo(o2.field.getName()); } @@ -133,6 +135,7 @@ public int compare (SavedField o1, SavedField o2) { } @SuppressWarnings("unchecked") + @Override public T readObject(ByteBuffer data, Class c) throws IOException { // Read the null/non-null marker @@ -143,7 +146,7 @@ public T readObject(ByteBuffer data, Class c) throws IOException { T object; try { - Constructor ctor = (Constructor)savedCtors.get(c); + Constructor ctor = savedCtors.get(c); object = ctor.newInstance(); } catch (Exception e) { throw new SerializerException( "Error creating object of type:" + c, e ); @@ -171,6 +174,7 @@ public T readObject(ByteBuffer data, Class c) throws IOException { return object; } + @Override public void writeObject(ByteBuffer buffer, Object object) throws IOException { // Add the null/non-null marker diff --git a/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/FloatSerializer.java b/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/FloatSerializer.java index 519b43550f..42e65487f7 100644 --- a/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/FloatSerializer.java +++ b/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/FloatSerializer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -43,10 +43,12 @@ @SuppressWarnings("unchecked") public class FloatSerializer extends Serializer { + @Override public Float readObject(ByteBuffer data, Class c) throws IOException { return data.getFloat(); } + @Override public void writeObject(ByteBuffer buffer, Object object) throws IOException { buffer.putFloat((Float)object); } diff --git a/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/GZIPSerializer.java b/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/GZIPSerializer.java index 7579e84c57..63b264e6c6 100644 --- a/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/GZIPSerializer.java +++ b/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/GZIPSerializer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -49,6 +49,7 @@ public class GZIPSerializer extends Serializer { @SuppressWarnings("unchecked") + @Override public T readObject(ByteBuffer data, Class c) throws IOException { try { @@ -77,6 +78,7 @@ public T readObject(ByteBuffer data, Class c) throws IOException { } } + @Override public void writeObject(ByteBuffer buffer, Object object) throws IOException { if (!(object instanceof GZIPCompressedMessage)) return; Message message = ((GZIPCompressedMessage)object).getMessage(); diff --git a/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/IntSerializer.java b/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/IntSerializer.java index db8a4954cb..373ab89dbd 100644 --- a/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/IntSerializer.java +++ b/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/IntSerializer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -43,10 +43,12 @@ @SuppressWarnings("unchecked") public class IntSerializer extends Serializer { + @Override public Integer readObject(ByteBuffer data, Class c) throws IOException { return data.getInt(); } + @Override public void writeObject(ByteBuffer buffer, Object object) throws IOException { buffer.putInt((Integer)object); } diff --git a/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/LongSerializer.java b/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/LongSerializer.java index 28ebb28caf..6545d4b4d0 100644 --- a/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/LongSerializer.java +++ b/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/LongSerializer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -43,10 +43,12 @@ @SuppressWarnings("unchecked") public class LongSerializer extends Serializer { + @Override public Long readObject(ByteBuffer data, Class c) throws IOException { return data.getLong(); } + @Override public void writeObject(ByteBuffer buffer, Object object) throws IOException { buffer.putLong((Long)object); } diff --git a/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/MapSerializer.java b/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/MapSerializer.java index 4d41c57f0f..a83e506f3e 100644 --- a/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/MapSerializer.java +++ b/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/MapSerializer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -71,6 +71,7 @@ public class MapSerializer extends Serializer { */ @SuppressWarnings("unchecked") + @Override public T readObject(ByteBuffer data, Class c) throws IOException { int length = data.getInt(); @@ -124,6 +125,7 @@ public T readObject(ByteBuffer data, Class c) throws IOException { } @SuppressWarnings("unchecked") + @Override public void writeObject(ByteBuffer buffer, Object object) throws IOException { Map map = (Map)object; int length = map.size(); diff --git a/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/SerializableSerializer.java b/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/SerializableSerializer.java index 32eb2af2e1..927053e557 100644 --- a/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/SerializableSerializer.java +++ b/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/SerializableSerializer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -45,10 +45,12 @@ @SuppressWarnings("unchecked") public class SerializableSerializer extends Serializer { + @Override public Serializable readObject(ByteBuffer data, Class c) throws IOException { throw new UnsupportedOperationException( "Serializable serialization not supported." ); } + @Override public void writeObject(ByteBuffer buffer, Object object) throws IOException { throw new UnsupportedOperationException( "Serializable serialization not supported." ); } diff --git a/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/ShortSerializer.java b/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/ShortSerializer.java index 5131626667..c306335165 100644 --- a/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/ShortSerializer.java +++ b/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/ShortSerializer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -42,10 +42,12 @@ */ @SuppressWarnings("unchecked") public class ShortSerializer extends Serializer { + @Override public Short readObject(ByteBuffer data, Class c) throws IOException { return data.getShort(); } + @Override public void writeObject(ByteBuffer buffer, Object object) throws IOException { buffer.putShort((Short)object); } diff --git a/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/StringSerializer.java b/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/StringSerializer.java index 3452bfa37d..2f3bd80027 100644 --- a/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/StringSerializer.java +++ b/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/StringSerializer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -93,10 +93,12 @@ public static String readString( ByteBuffer data ) throws IOException { return new String(buffer, "UTF-8"); } + @Override public String readObject(ByteBuffer data, Class c) throws IOException { return readString(data); } + @Override public void writeObject(ByteBuffer buffer, Object object) throws IOException { String string = (String)object; diff --git a/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/Vector3Serializer.java b/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/Vector3Serializer.java index 685dc5b9e5..8c4251acb3 100644 --- a/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/Vector3Serializer.java +++ b/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/Vector3Serializer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -42,6 +42,7 @@ @SuppressWarnings("unchecked") public class Vector3Serializer extends Serializer { + @Override public Vector3f readObject(ByteBuffer data, Class c) throws IOException { Vector3f vec3 = new Vector3f(); vec3.x = data.getFloat(); @@ -50,6 +51,7 @@ public Vector3f readObject(ByteBuffer data, Class c) throws IOException { return vec3; } + @Override public void writeObject(ByteBuffer buffer, Object object) throws IOException { Vector3f vec3 = (Vector3f) object; buffer.putFloat(vec3.x); diff --git a/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/ZIPSerializer.java b/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/ZIPSerializer.java index ad7d7162d9..cb8bd2a189 100644 --- a/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/ZIPSerializer.java +++ b/jme3-networking/src/main/java/com/jme3/network/serializing/serializers/ZIPSerializer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -50,6 +50,7 @@ public class ZIPSerializer extends Serializer { @SuppressWarnings("unchecked") + @Override public T readObject(ByteBuffer data, Class c) throws IOException { try { @@ -83,6 +84,7 @@ public T readObject(ByteBuffer data, Class c) throws IOException { } } + @Override public void writeObject(ByteBuffer buffer, Object object) throws IOException { if (!(object instanceof ZIPCompressedMessage)) return; diff --git a/jme3-networking/src/main/java/com/jme3/network/util/SessionDataDelegator.java b/jme3-networking/src/main/java/com/jme3/network/util/SessionDataDelegator.java index f2bee33737..6bad709519 100644 --- a/jme3-networking/src/main/java/com/jme3/network/util/SessionDataDelegator.java +++ b/jme3-networking/src/main/java/com/jme3/network/util/SessionDataDelegator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 jMonkeyEngine + * Copyright (c) 2015-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -92,6 +92,7 @@ protected void miss( HostedConnection source ) { * HostConnection. If there is no value at that attribute then * the miss() method is called. */ + @Override protected Object getSourceDelegate( HostedConnection source ) { Object result = source.getAttribute(attributeName); if( result == null ) { diff --git a/jme3-niftygui/src/main/java/com/jme3/cinematic/events/GuiEvent.java b/jme3-niftygui/src/main/java/com/jme3/cinematic/events/GuiEvent.java index 5671432b62..8b5f29977e 100644 --- a/jme3-niftygui/src/main/java/com/jme3/cinematic/events/GuiEvent.java +++ b/jme3-niftygui/src/main/java/com/jme3/cinematic/events/GuiEvent.java @@ -37,6 +37,7 @@ import com.jme3.export.JmeImporter; import com.jme3.export.OutputCapsule; import de.lessvoid.nifty.Nifty; +import de.lessvoid.nifty.screen.Screen; import java.io.IOException; import java.util.logging.Level; import java.util.logging.Logger; @@ -51,7 +52,7 @@ public class GuiEvent extends AbstractCinematicEvent { /** * message logger for this class */ - static final Logger log = Logger.getLogger(GuiEvent.class.getName()); + private static final Logger log = Logger.getLogger(GuiEvent.class.getName()); /** * name of the associated Nifty screen(not null) @@ -135,8 +136,9 @@ public void onPlay() { */ @Override public void onStop() { - if (nifty.getCurrentScreen() != null) { - nifty.getCurrentScreen().endScreen(null); + Screen currentScreen = nifty.getCurrentScreen(); + if (currentScreen != null) { + currentScreen.endScreen(null); } } diff --git a/jme3-niftygui/src/main/java/com/jme3/cinematic/events/GuiTrack.java b/jme3-niftygui/src/main/java/com/jme3/cinematic/events/GuiTrack.java index a7bd123bca..06e25271a6 100644 --- a/jme3-niftygui/src/main/java/com/jme3/cinematic/events/GuiTrack.java +++ b/jme3-niftygui/src/main/java/com/jme3/cinematic/events/GuiTrack.java @@ -37,6 +37,7 @@ import com.jme3.export.JmeImporter; import com.jme3.export.OutputCapsule; import de.lessvoid.nifty.Nifty; +import de.lessvoid.nifty.screen.Screen; import java.io.IOException; /** @@ -84,8 +85,9 @@ public void onPlay() { @Override public void onStop() { - if (nifty.getCurrentScreen() != null) { - nifty.getCurrentScreen().endScreen(null); + Screen currentScreen = nifty.getCurrentScreen(); + if (currentScreen != null) { + currentScreen.endScreen(null); } } diff --git a/jme3-niftygui/src/main/java/com/jme3/niftygui/InputSystemJme.java b/jme3-niftygui/src/main/java/com/jme3/niftygui/InputSystemJme.java index 38c7427f15..3954ebc8ef 100644 --- a/jme3-niftygui/src/main/java/com/jme3/niftygui/InputSystemJme.java +++ b/jme3-niftygui/src/main/java/com/jme3/niftygui/InputSystemJme.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -46,14 +46,15 @@ import de.lessvoid.nifty.spi.input.InputSystem; import de.lessvoid.nifty.tools.resourceloader.NiftyResourceLoader; import java.util.ArrayList; +import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; public class InputSystemJme implements InputSystem, RawInputListener { - private final ArrayList inputQueue = new ArrayList(); - private InputManager inputManager; - private boolean[] niftyOwnsDragging = new boolean[3]; + private final List inputQueue = new ArrayList<>(); + private final InputManager inputManager; + private final boolean[] niftyOwnsDragging = new boolean[3]; private int inputPointerId = -1; private int x, y; private int height; @@ -65,6 +66,7 @@ public InputSystemJme(InputManager inputManager) { this.inputManager = inputManager; } + @Override public void setResourceLoader(NiftyResourceLoader niftyResourceLoader) { } @@ -101,15 +103,18 @@ public void setHeight(int height) { this.height = height; } + @Override public void setMousePosition(int x, int y) { // TODO: When does nifty use this? } + @Override public void beginInput() { } + @Override public void endInput() { - boolean result = nifty.update(); + nifty.update(); } private void handleMouseEvent(int button, boolean value, NiftyInputConsumer nic, InputEvent evt) { @@ -226,8 +231,8 @@ private void onMouseMotionEventQueued(MouseMotionEvent evt, NiftyInputConsumer n } private void onMouseButtonEventQueued(MouseButtonEvent evt, NiftyInputConsumer nic) { - x = (int) evt.getX(); - y = (int) (height - evt.getY()); + x = evt.getX(); + y = height - evt.getY(); handleMouseEvent(evt.getButtonIndex(), evt.isPressed(), nic, evt); } @@ -251,6 +256,7 @@ private void onKeyEventQueued(KeyInputEvent evt, NiftyInputConsumer nic) { } } + @Override public void onMouseMotionEvent(MouseMotionEvent evt) { // Only forward the event if there's actual motion involved. if (inputManager.isCursorVisible() && (evt.getDX() != 0 @@ -260,6 +266,7 @@ public void onMouseMotionEvent(MouseMotionEvent evt) { } } + @Override public void onMouseButtonEvent(MouseButtonEvent evt) { if (evt.getButtonIndex() >= 0 && evt.getButtonIndex() <= 2) { if (evt.isReleased() || inputManager.isCursorVisible()) { @@ -270,20 +277,25 @@ public void onMouseButtonEvent(MouseButtonEvent evt) { } } + @Override public void onJoyAxisEvent(JoyAxisEvent evt) { } + @Override public void onJoyButtonEvent(JoyButtonEvent evt) { } + @Override public void onKeyEvent(KeyInputEvent evt) { inputQueue.add(evt); } + @Override public void onTouchEvent(TouchEvent evt) { inputQueue.add(evt); } + @Override public void forwardEvents(NiftyInputConsumer nic) { int queueSize = inputQueue.size(); @@ -317,6 +329,8 @@ private void processSoftKeyboard() { } softTextDialogInput.requestDialog(SoftTextDialogInput.TEXT_ENTRY_DIALOG, "Enter Text", initialValue, new SoftTextDialogInputListener() { + + @Override public void onSoftText(int action, String text) { if (action == SoftTextDialogInputListener.COMPLETE) { textField.setText(text); diff --git a/jme3-niftygui/src/main/java/com/jme3/niftygui/JmeBatchRenderBackend.java b/jme3-niftygui/src/main/java/com/jme3/niftygui/JmeBatchRenderBackend.java index d84c41b96b..aba542fb77 100644 --- a/jme3-niftygui/src/main/java/com/jme3/niftygui/JmeBatchRenderBackend.java +++ b/jme3-niftygui/src/main/java/com/jme3/niftygui/JmeBatchRenderBackend.java @@ -31,19 +31,12 @@ */ package com.jme3.niftygui; -import java.io.IOException; -import java.nio.ByteBuffer; -import java.nio.FloatBuffer; -import java.nio.ShortBuffer; -import java.util.ArrayList; -import java.util.List; -import java.util.logging.Level; -import java.util.logging.Logger; - import com.jme3.asset.TextureKey; import com.jme3.material.Material; import com.jme3.material.RenderState; +import com.jme3.math.ColorRGBA; import com.jme3.math.Matrix4f; +import com.jme3.renderer.Caps; import com.jme3.renderer.RenderManager; import com.jme3.renderer.Renderer; import com.jme3.scene.Geometry; @@ -56,540 +49,592 @@ import com.jme3.texture.Texture.MinFilter; import com.jme3.texture.Texture2D; import com.jme3.texture.image.ColorSpace; +import com.jme3.texture.image.ImageRaster; import com.jme3.util.BufferUtils; - -import de.lessvoid.nifty.render.batch.spi.BatchRenderBackend; import de.lessvoid.nifty.render.BlendMode; +import de.lessvoid.nifty.render.batch.spi.BatchRenderBackend; import de.lessvoid.nifty.spi.render.MouseCursor; import de.lessvoid.nifty.tools.Color; import de.lessvoid.nifty.tools.Factory; import de.lessvoid.nifty.tools.ObjectPool; import de.lessvoid.nifty.tools.resourceloader.NiftyResourceLoader; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.FloatBuffer; +import java.nio.ShortBuffer; +import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; /** * Nifty GUI BatchRenderBackend Implementation for jMonkeyEngine. + * * @author void */ public class JmeBatchRenderBackend implements BatchRenderBackend { - private static Logger log = Logger.getLogger(JmeBatchRenderBackend.class.getName()); - - private final ObjectPool batchPool; - private final List batches = new ArrayList(); - - // a modify texture call needs a jme Renderer to execute. if we're called to modify a texture but don't - // have a Renderer yet - since it was not initialized on the jme side - we'll cache the modify texture calls - // in here and execute them later (at the next beginFrame() call). - private final List modifyTextureCalls = new ArrayList(); - - private RenderManager renderManager; - private NiftyJmeDisplay display; - private Map textures = new HashMap(); - private int textureAtlasId = 1; - private Batch currentBatch; - private Matrix4f tempMat = new Matrix4f(); - private ByteBuffer initialData; - - // this is only used for debugging purpose and will make the removed textures filled with a color - // please note: the old way to init this via a system property has been - // removed since it's now possible to configure it using the - // BatchRenderConfiguration class when you create the NiftyJmeDisplay instance - private boolean fillRemovedTexture = false; - - public JmeBatchRenderBackend(final NiftyJmeDisplay display) { - this.display = display; - this.batchPool = new ObjectPool(new Factory() { - @Override - public Batch createNew() { - return new Batch(); - } - }); - } - - public void setRenderManager(final RenderManager rm) { - this.renderManager = rm; - } - - @Override - public void setResourceLoader(final NiftyResourceLoader resourceLoader) { - } - - @Override - public int getWidth() { - return display.getWidth(); - } - - @Override - public int getHeight() { - return display.getHeight(); - } - - @Override - public void beginFrame() { - log.fine("beginFrame()"); - - for (int i=0; i batchPool; + private final List batches = new ArrayList<>(); + + // a modify texture call needs a jme Renderer to execute. if we're called to modify a texture but don't + // have a Renderer yet - since it was not initialized on the jme side - we'll cache the modify texture calls + // in here and execute them later (at the next beginFrame() call). + private final List modifyTextureCalls = new ArrayList<>(); + + private RenderManager renderManager; + private NiftyJmeDisplay display; + private Map textures = new HashMap<>(); + private int textureAtlasId = 1; + private Batch currentBatch; + private Matrix4f tempMat = new Matrix4f(); + private ByteBuffer initialData; + + // this is only used for debugging purpose and will make the removed textures filled with a color + // please note: the old way to init this via a system property has been + // removed since it's now possible to configure it using the + // BatchRenderConfiguration class when you create the NiftyJmeDisplay instance + private boolean fillRemovedTexture = false; + + public JmeBatchRenderBackend(final NiftyJmeDisplay display) { + this.display = display; + this.batchPool = new ObjectPool<>(new Factory() { + + @Override + public Batch createNew() { + return new Batch(); + } + }); + } + + public void setRenderManager(final RenderManager rm) { + this.renderManager = rm; + } + + @Override + public void setResourceLoader(final NiftyResourceLoader resourceLoader) { + } + + @Override + public int getWidth() { + return display.getWidth(); + } + + @Override + public int getHeight() { + return display.getHeight(); + } + + @Override + public void beginFrame() { + log.fine("beginFrame()"); + + for (int i = 0; i < batches.size(); i++) { + batchPool.free(batches.get(i)); + } + batches.clear(); + + // in case we have pending modifyTexture calls we'll need to execute them now + if (!modifyTextureCalls.isEmpty()) { + Renderer renderer = display.getRenderer(); + for (int i = 0; i < modifyTextureCalls.size(); i++) { + modifyTextureCalls.get(i).execute(renderer); + } + modifyTextureCalls.clear(); } + } - @Override - public void enable() { + @Override + public void endFrame() { + log.fine("endFrame"); + } + + @Override + public void clear() { + } + + // TODO: Cursor support + @Override + public MouseCursor createMouseCursor(final String filename, final int hotspotX, final int hotspotY) throws IOException { + return new MouseCursor() { + @Override + public void dispose() { + } + + @Override + public void enable() { + } + + @Override + public void disable() { + } + }; + } + + @Override + public void enableMouseCursor(final MouseCursor mouseCursor) { + } + + @Override + public void disableMouseCursor() { + } + + @Override + public int createTextureAtlas(final int width, final int height) { + try { + int atlasId = addTexture(createAtlasTextureInternal(width, height)); + + // we just initialize a second buffer here that will replace the texture atlas image + initialData = BufferUtils.createByteBuffer(width * height * 4); + for (int i = 0; i < width * height; i++) { + initialData.put((byte) 0x00); + initialData.put((byte) 0xff); + initialData.put((byte) 0x00); + initialData.put((byte) 0xff); + } + return atlasId; + } catch (Exception e) { + log.log(Level.WARNING, e.getMessage(), e); + return 0; // TODO Nifty always expects this call to be successfull + // there currently is no way to return failure or something :/ } + } - @Override - public void disable() { + @Override + public void clearTextureAtlas(final int atlasId) { + initialData.rewind(); + getTextureAtlas(atlasId).getImage().setData(initialData); + } + + @Override + public Image loadImage(final String filename) { + TextureKey key = new TextureKey(filename, false); + key.setAnisotropy(0); + key.setGenerateMips(false); + + Texture2D texture = (Texture2D) display.getAssetManager().loadTexture(key); + // Fix GLES format incompatibility issue with glTexSubImage + Renderer renderer = display.getRenderer(); + if (renderer == null || renderer.getCaps().contains(Caps.OpenGLES20)) { + if (texture.getImage().getFormat() != Format.RGBA8) { + com.jme3.texture.Image sourceImage = texture.getImage(); + int size = sourceImage.getWidth() * sourceImage.getHeight() * 4; + ByteBuffer buffer = BufferUtils.createByteBuffer(size); + com.jme3.texture.Image rgba8Image = new com.jme3.texture.Image(Format.RGBA8, + sourceImage.getWidth(), + sourceImage.getHeight(), + buffer, + sourceImage.getColorSpace()); + + ImageRaster input = ImageRaster.create(sourceImage, 0, 0, false); + ImageRaster output = ImageRaster.create(rgba8Image, 0, 0, false); + ColorRGBA color = new ColorRGBA(); + + for (int y = 0; y < sourceImage.getHeight(); y++) { + for (int x = 0; x < sourceImage.getWidth(); x++) { + output.setPixel(x, y, input.getPixel(x, y, color)); + } + } + return new ImageImpl(rgba8Image); + } } - }; - } - - @Override - public void enableMouseCursor(final MouseCursor mouseCursor) { - } - - @Override - public void disableMouseCursor() { - } - - @Override - public int createTextureAtlas(final int width, final int height) { - try { - int atlasId = addTexture(createAtlasTextureInternal(width, height)); - - // we just initialize a second buffer here that will replace the texture atlas image - initialData = BufferUtils.createByteBuffer(width*height*4); - for (int i=0; i key = new AssetKey(path); + AssetKey key = new AssetKey<>(path); AssetInfo info = assetManager.locateAsset(key); if (info != null) { return info.openStream(); @@ -86,6 +85,7 @@ public InputStream getResourceAsStream(String path) { } } + @Override public URL getResource(String path) { throw new UnsupportedOperationException(); } @@ -112,6 +112,7 @@ public NiftyJmeDisplay() { * @param inputManager jME InputManager * @param audioRenderer jME AudioRenderer * @param viewport Viewport to use + * @return new NiftyJmeDisplay instance */ public static NiftyJmeDisplay newNiftyJmeDisplay( final AssetManager assetManager, @@ -142,6 +143,7 @@ public static NiftyJmeDisplay newNiftyJmeDisplay( * you can use to further configure batch rendering. If unsure you * can simply use new BatchRenderConfiguration() in here for the * default configuration which should give you good default values. + * @return new NiftyJmeDisplay instance */ public static NiftyJmeDisplay newNiftyJmeDisplay( final AssetManager assetManager, @@ -171,7 +173,7 @@ public static NiftyJmeDisplay newNiftyJmeDisplay( * * A complete re-organisation of the texture atlas happens when a Nifty screen ends and another begins. Dynamically * adding images while a screen is running is supported as well. - * + * * @param assetManager jME AssetManager * @param inputManager jME InputManager * @param audioRenderer jME AudioRenderer @@ -250,7 +252,7 @@ private NiftyJmeDisplay( * @param audioRenderer jME AudioRenderer * @param vp Viewport to use */ - public NiftyJmeDisplay(AssetManager assetManager, + public NiftyJmeDisplay(AssetManager assetManager, InputManager inputManager, AudioRenderer audioRenderer, ViewPort vp){ @@ -280,6 +282,7 @@ private void initialize( this.inputSys = new InputSystemJme(inputManager); } + @Override public void initialize(RenderManager rm, ViewPort vp) { this.renderManager = rm; if (renderDev != null) { @@ -295,7 +298,7 @@ public void initialize(RenderManager rm, ViewPort vp) { inited = true; this.vp = vp; this.renderer = rm.getRenderer(); - + inputSys.reset(); inputSys.setHeight(vp.getCamera().getHeight()); } @@ -305,7 +308,7 @@ public Nifty getNifty() { } public void simulateKeyEvent( KeyInputEvent event ) { - inputSys.onKeyEvent(event); + inputSys.onKeyEvent(event); } AssetManager getAssetManager() { @@ -328,6 +331,7 @@ Renderer getRenderer(){ return renderer; } + @Override public void reshape(ViewPort vp, int w, int h) { this.w = w; this.h = h; @@ -335,13 +339,16 @@ public void reshape(ViewPort vp, int w, int h) { nifty.resolutionChanged(); } + @Override public boolean isInitialized() { return inited; } + @Override public void preFrame(float tpf) { } + @Override public void postQueue(RenderQueue rq) { // render nifty before anything else renderManager.setCamera(vp.getCamera(), true); @@ -350,9 +357,11 @@ public void postQueue(RenderQueue rq) { renderManager.setCamera(vp.getCamera(), false); } + @Override public void postFrame(FrameBuffer out) { } + @Override public void cleanup() { inited = false; inputSys.reset(); diff --git a/jme3-niftygui/src/main/java/com/jme3/niftygui/RenderDeviceJme.java b/jme3-niftygui/src/main/java/com/jme3/niftygui/RenderDeviceJme.java index 7390a32654..c848144867 100644 --- a/jme3-niftygui/src/main/java/com/jme3/niftygui/RenderDeviceJme.java +++ b/jme3-niftygui/src/main/java/com/jme3/niftygui/RenderDeviceJme.java @@ -57,40 +57,41 @@ import java.nio.ByteBuffer; import java.nio.FloatBuffer; import java.util.HashMap; +import java.util.Map; public class RenderDeviceJme implements RenderDevice { - - private NiftyJmeDisplay display; + + private final NiftyJmeDisplay display; private RenderManager rm; private Renderer r; - private HashMap textCacheLastFrame = new HashMap(); - private HashMap textCacheCurrentFrame = new HashMap(); + private Map textCacheLastFrame = new HashMap<>(); + private Map textCacheCurrentFrame = new HashMap<>(); private final Quad quad = new Quad(1, -1, true); private final Geometry quadGeom = new Geometry("nifty-quad", quad); private boolean clipWasSet = false; - private VertexBuffer quadDefaultTC = quad.getBuffer(Type.TexCoord); - private VertexBuffer quadModTC = quadDefaultTC.clone(); - private VertexBuffer quadColor; - private Matrix4f tempMat = new Matrix4f(); - private ColorRGBA tempColor = new ColorRGBA(); - private RenderState renderState = new RenderState(); - - private Material colorMaterial; - private Material textureColorMaterial; - private Material vertexColorMaterial; - + private final VertexBuffer quadDefaultTC = quad.getBuffer(Type.TexCoord); + private final VertexBuffer quadModTC = quadDefaultTC.clone(); + private final VertexBuffer quadColor; + private final Matrix4f tempMat = new Matrix4f(); + private final ColorRGBA tempColor = new ColorRGBA(); + private final RenderState renderState = new RenderState(); + + private final Material colorMaterial; + private final Material textureColorMaterial; + private final Material vertexColorMaterial; + private static class CachedTextKey { - + BitmapFont font; String text; // ColorRGBA color; - + public CachedTextKey(BitmapFont font, String text/*, ColorRGBA color*/) { this.font = font; this.text = text; // this.color = color; } - + @Override public boolean equals(Object other) { CachedTextKey otherKey = (CachedTextKey) other; @@ -108,47 +109,51 @@ public int hashCode() { return hash; } } - + public RenderDeviceJme(NiftyJmeDisplay display) { this.display = display; - + quadColor = new VertexBuffer(Type.Color); quadColor.setNormalized(true); ByteBuffer bb = BufferUtils.createByteBuffer(4 * 4); quadColor.setupData(Usage.Stream, 4, Format.UnsignedByte, bb); quad.setBuffer(quadColor); - + quadModTC.setUsage(Usage.Stream); - + // Load the 3 material types separately to avoid // reloading the shader when the defines change. - + // Material with a single color (no texture or vertex color) colorMaterial = new Material(display.getAssetManager(), "Common/MatDefs/Misc/Unshaded.j3md"); - + // Material with a texture and a color (no vertex color) textureColorMaterial = new Material(display.getAssetManager(), "Common/MatDefs/Misc/Unshaded.j3md"); - + // Material with vertex color, used for gradients (no texture) vertexColorMaterial = new Material(display.getAssetManager(), "Common/MatDefs/Misc/Unshaded.j3md"); vertexColorMaterial.setBoolean("VertexColor", true); - + // Shared render state for all materials renderState.setDepthTest(false); renderState.setDepthWrite(false); } - + + @Override public void setResourceLoader(NiftyResourceLoader niftyResourceLoader) { } - + public void setRenderManager(RenderManager rm) { this.rm = rm; this.r = rm.getRenderer(); } // TODO: Cursor support + @Override public MouseCursor createMouseCursor(String str, int x, int y) { return new MouseCursor() { + + @Override public void dispose() { } @@ -161,60 +166,72 @@ public void disable() { } }; } - + + @Override public void enableMouseCursor(MouseCursor cursor) { } - + + @Override public void disableMouseCursor() { } - + + @Override public RenderImage createImage(String filename, boolean linear) { //System.out.println("createImage(" + filename + ", " + linear + ")"); return new RenderImageJme(filename, linear, display); } - + + @Override public RenderFont createFont(String filename) { return new RenderFontJme(filename, display); } - + + @Override public void beginFrame() { } - + + @Override public void endFrame() { - HashMap temp = textCacheLastFrame; + Map temp = textCacheLastFrame; textCacheLastFrame = textCacheCurrentFrame; textCacheCurrentFrame = temp; textCacheCurrentFrame.clear(); rm.setForcedRenderState(null); } - + + @Override public int getWidth() { return display.getWidth(); } - + + @Override public int getHeight() { return display.getHeight(); } - + + @Override public void clear() { } - + + @Override public void setBlendMode(BlendMode blendMode) { renderState.setBlendMode(convertBlend(blendMode)); } - + private RenderState.BlendMode convertBlend(BlendMode blendMode) { if (blendMode == null) { return RenderState.BlendMode.Off; - } else if (blendMode == BlendMode.BLEND) { - return RenderState.BlendMode.Alpha; - } else if (blendMode == BlendMode.MULIPLY) { - return RenderState.BlendMode.Alpha; - } else { - throw new UnsupportedOperationException(); + } else + switch (blendMode) { + case BLEND: + return RenderState.BlendMode.Alpha; + case MULIPLY: + return RenderState.BlendMode.Alpha; + default: + throw new UnsupportedOperationException(); } } - + private int convertColor(Color color) { int color2 = 0; color2 |= ((int) (255.0 * color.getAlpha())) << 24; @@ -223,19 +240,19 @@ private int convertColor(Color color) { color2 |= ((int) (255.0 * color.getRed())); return color2; } - + private ColorRGBA convertColor(Color inColor, ColorRGBA outColor) { return outColor.set(inColor.getRed(), inColor.getGreen(), inColor.getBlue(), inColor.getAlpha()); } @Override - public void renderFont(RenderFont font, String str, int x, int y, Color color, float sizeX, float sizeY) { + public void renderFont(RenderFont font, String str, int x, int y, Color color, float sizeX, float sizeY) { if (str.length() == 0) { return; } - + RenderFontJme jmeFont = (RenderFontJme) font; - + ColorRGBA colorRgba = convertColor(color, tempColor); CachedTextKey key = new CachedTextKey(jmeFont.getFont(), str/*, colorRgba*/); BitmapText text = textCacheLastFrame.get(key); @@ -245,12 +262,12 @@ public void renderFont(RenderFont font, String str, int x, int y, Color color, f text.updateLogicalState(0); } textCacheCurrentFrame.put(key, text); - + // float width = text.getLineWidth(); // float height = text.getLineHeight(); float x0 = x; //+ 0.5f * width * (1f - sizeX); float y0 = y; // + 0.5f * height * (1f - sizeY); - + tempMat.loadIdentity(); tempMat.setTranslation(x0, getHeight() - y0, 0); tempMat.setScale(sizeX, sizeY, 0); @@ -260,33 +277,34 @@ public void renderFont(RenderFont font, String str, int x, int y, Color color, f text.setColor(colorRgba); text.updateLogicalState(0); text.render(rm, colorRgba); - + // System.out.format("renderFont(%s, %s, %d, %d, %s, %f, %f)\n", jmeFont.getFont(), str, x, y, color.toString(), sizeX, sizeY); } - + + @Override public void renderImage(RenderImage image, int x, int y, int w, int h, int srcX, int srcY, int srcW, int srcH, Color color, float scale, int centerX, int centerY) { - + RenderImageJme jmeImage = (RenderImageJme) image; Texture2D texture = jmeImage.getTexture(); - + textureColorMaterial.setColor("Color", convertColor(color, tempColor)); - textureColorMaterial.setTexture("ColorMap", texture); - + textureColorMaterial.setTexture("ColorMap", texture); + float imageWidth = jmeImage.getWidth(); float imageHeight = jmeImage.getHeight(); FloatBuffer texCoords = (FloatBuffer) quadModTC.getData(); - + float startX = srcX / imageWidth; float startY = srcY / imageHeight; float endX = startX + (srcW / imageWidth); float endY = startY + (srcH / imageHeight); - + startY = 1f - startY; endY = 1f - endY; - + texCoords.rewind(); texCoords.put(startX).put(startY); texCoords.put(endX).put(startY); @@ -294,51 +312,53 @@ public void renderImage(RenderImage image, int x, int y, int w, int h, texCoords.put(startX).put(endY); texCoords.flip(); quadModTC.updateData(texCoords); - + quad.clearBuffer(Type.TexCoord); quad.setBuffer(quadModTC); - + float x0 = centerX + (x - centerX) * scale; float y0 = centerY + (y - centerY) * scale; - + tempMat.loadIdentity(); tempMat.setTranslation(x0, getHeight() - y0, 0); tempMat.setScale(w * scale, h * scale, 0); - + rm.setWorldMatrix(tempMat); rm.setForcedRenderState(renderState); textureColorMaterial.render(quadGeom, rm); - + //System.out.format("renderImage2(%s, %d, %d, %d, %d, %d, %d, %d, %d, %s, %f, %d, %d)\n", texture.getKey().toString(), // x, y, w, h, srcX, srcY, srcW, srcH, // color.toString(), scale, centerX, centerY); } - + + @Override public void renderImage(RenderImage image, int x, int y, int width, int height, Color color, float imageScale) { - + RenderImageJme jmeImage = (RenderImageJme) image; - + textureColorMaterial.setColor("Color", convertColor(color, tempColor)); textureColorMaterial.setTexture("ColorMap", jmeImage.getTexture()); - + quad.clearBuffer(Type.TexCoord); quad.setBuffer(quadDefaultTC); - + float x0 = x + 0.5f * width * (1f - imageScale); float y0 = y + 0.5f * height * (1f - imageScale); - + tempMat.loadIdentity(); tempMat.setTranslation(x0, getHeight() - y0, 0); tempMat.setScale(width * imageScale, height * imageScale, 0); - + rm.setWorldMatrix(tempMat); rm.setForcedRenderState(renderState); textureColorMaterial.render(quadGeom, rm); - + //System.out.format("renderImage1(%s, %d, %d, %d, %d, %s, %f)\n", jmeImage.getTexture().getKey().toString(), x, y, width, height, color.toString(), imageScale); } - + + @Override public void renderQuad(int x, int y, int width, int height, Color color) { //We test for alpha >0 as an optimization to prevent the render of completely transparent quads. //Nifty use layers that are often used for logical positionning and not rendering. @@ -346,7 +366,7 @@ public void renderQuad(int x, int y, int width, int height, Color color) { //Since we disable depth write, there is absolutely no point in rendering those quads //This optimization can result in a huge increase of perfs on complex Nifty UIs. if(color.getAlpha() >0){ - colorMaterial.setColor("Color", convertColor(color, tempColor)); + colorMaterial.setColor("Color", convertColor(color, tempColor)); tempMat.loadIdentity(); tempMat.setTranslation(x, getHeight() - y, 0); @@ -356,44 +376,47 @@ public void renderQuad(int x, int y, int width, int height, Color color) { rm.setForcedRenderState(renderState); colorMaterial.render(quadGeom, rm); } - + //System.out.format("renderQuad1(%d, %d, %d, %d, %s)\n", x, y, width, height, color.toString()); } - + + @Override public void renderQuad(int x, int y, int width, int height, Color topLeft, Color topRight, Color bottomRight, Color bottomLeft) { - + ByteBuffer buf = (ByteBuffer) quadColor.getData(); buf.rewind(); - + buf.putInt(convertColor(topRight)); buf.putInt(convertColor(topLeft)); - + buf.putInt(convertColor(bottomLeft)); buf.putInt(convertColor(bottomRight)); - + buf.flip(); quadColor.updateData(buf); - + tempMat.loadIdentity(); tempMat.setTranslation(x, getHeight() - y, 0); tempMat.setScale(width, height, 0); - + rm.setWorldMatrix(tempMat); rm.setForcedRenderState(renderState); vertexColorMaterial.render(quadGeom, rm); - + //System.out.format("renderQuad2(%d, %d, %d, %d, %s, %s, %s, %s)\n", x, y, width, height, topLeft.toString(), // topRight.toString(), // bottomRight.toString(), // bottomLeft.toString()); } - + + @Override public void enableClip(int x0, int y0, int x1, int y1) { clipWasSet = true; r.setClipRect(x0, getHeight() - y1, x1 - x0, y1 - y0); } - + + @Override public void disableClip() { if (clipWasSet) { r.clearClipRect(); diff --git a/jme3-niftygui/src/main/java/com/jme3/niftygui/RenderFontJme.java b/jme3-niftygui/src/main/java/com/jme3/niftygui/RenderFontJme.java index 48a995e5be..16fdcaa043 100644 --- a/jme3-niftygui/src/main/java/com/jme3/niftygui/RenderFontJme.java +++ b/jme3-niftygui/src/main/java/com/jme3/niftygui/RenderFontJme.java @@ -37,17 +37,16 @@ public class RenderFontJme implements RenderFont { - private NiftyJmeDisplay display; - private BitmapFont font; - private BitmapText text; - private float actualSize; + private final BitmapFont font; + private final BitmapText text; + private final float actualSize; /** * Initialize the font. * @param name font filename + * @param display */ public RenderFontJme(String name, NiftyJmeDisplay display) { - this.display = display; font = display.getAssetManager().loadFont(name); text = new BitmapText(font); actualSize = font.getPreferredSize(); @@ -61,7 +60,7 @@ public BitmapText createText() { public BitmapFont getFont() { return font; } - + public BitmapText getText(){ return text; } @@ -70,6 +69,7 @@ public BitmapText getText(){ * get font height. * @return height */ + @Override public int getHeight() { return (int) text.getLineHeight(); } @@ -79,17 +79,18 @@ public int getHeight() { * @param str text * @return width of the given text for the current font */ + @Override public int getWidth(final String str) { if (str.length() == 0) { return 0; } - + // Note: BitmapFont is now fixed to return the proper line width // at least for now. The older commented out (by someone else, not me) // code below is arguably 'more accurate' if BitmapFont gets // buggy again. The issue is that the BitmapText and BitmapFont // use a different algorithm for calculating size and both must - // be modified in sync. + // be modified in sync. int result = (int) font.getLineWidth(str); // text.setText(str); // text.updateLogicalState(0); @@ -98,6 +99,7 @@ public int getWidth(final String str) { return result; } + @Override public int getWidth(final String str, final float size) { // Note: This is supposed to return the width of the String when scaled // with the size factor. Since I don't know how to do that with @@ -113,10 +115,12 @@ public int getWidth(final String str, final float size) { * @param size font size * @return width of the character or null when no information for the character is available */ + @Override public int getCharacterAdvance(final char currentCharacter, final char nextCharacter, final float size) { return Math.round(font.getCharacterAdvance(currentCharacter, nextCharacter, size)); } + @Override public void dispose() { } } diff --git a/jme3-niftygui/src/main/java/com/jme3/niftygui/RenderImageJme.java b/jme3-niftygui/src/main/java/com/jme3/niftygui/RenderImageJme.java index 584c9bbf91..7e2071b155 100644 --- a/jme3-niftygui/src/main/java/com/jme3/niftygui/RenderImageJme.java +++ b/jme3-niftygui/src/main/java/com/jme3/niftygui/RenderImageJme.java @@ -50,7 +50,7 @@ public RenderImageJme(String filename, boolean linear, NiftyJmeDisplay display){ key.setAnisotropy(0); key.setGenerateMips(false); - + texture = (Texture2D) display.getAssetManager().loadTexture(key); texture.setMagFilter(linear ? MagFilter.Bilinear : MagFilter.Nearest); texture.setMinFilter(linear ? MinFilter.BilinearNoMipMaps : MinFilter.NearestNoMipMaps); @@ -64,7 +64,7 @@ public RenderImageJme(Texture2D texture){ if (texture.getImage() == null) { throw new IllegalArgumentException("texture.getImage() cannot be null"); } - + this.texture = texture; this.image = texture.getImage(); width = image.getWidth(); @@ -75,14 +75,17 @@ public Texture2D getTexture(){ return texture; } + @Override public int getWidth() { return width; } + @Override public int getHeight() { return height; } + @Override public void dispose() { } } diff --git a/jme3-niftygui/src/main/java/com/jme3/niftygui/SoundDeviceJme.java b/jme3-niftygui/src/main/java/com/jme3/niftygui/SoundDeviceJme.java index 7868468e93..5425481fae 100644 --- a/jme3-niftygui/src/main/java/com/jme3/niftygui/SoundDeviceJme.java +++ b/jme3-niftygui/src/main/java/com/jme3/niftygui/SoundDeviceJme.java @@ -50,20 +50,24 @@ public SoundDeviceJme(AssetManager assetManager, AudioRenderer ar){ this.ar = ar; } + @Override public void setResourceLoader(NiftyResourceLoader niftyResourceLoader) { } + @Override public SoundHandle loadSound(SoundSystem soundSystem, String filename) { AudioNode an = new AudioNode(assetManager, filename, AudioData.DataType.Buffer); an.setPositional(false); return new SoundHandleJme(ar, an); } + @Override public SoundHandle loadMusic(SoundSystem soundSystem, String filename) { return new SoundHandleJme(ar, assetManager, filename); } + @Override public void update(int delta) { } - + } diff --git a/jme3-niftygui/src/main/java/com/jme3/niftygui/SoundHandleJme.java b/jme3-niftygui/src/main/java/com/jme3/niftygui/SoundHandleJme.java index 545f3d2012..f2ceec0178 100644 --- a/jme3-niftygui/src/main/java/com/jme3/niftygui/SoundHandleJme.java +++ b/jme3-niftygui/src/main/java/com/jme3/niftygui/SoundHandleJme.java @@ -34,8 +34,8 @@ import com.jme3.asset.AssetManager; import com.jme3.audio.AudioData; import com.jme3.audio.AudioNode; -import com.jme3.audio.AudioSource.Status; import com.jme3.audio.AudioRenderer; +import com.jme3.audio.AudioSource.Status; import de.lessvoid.nifty.spi.sound.SoundHandle; public class SoundHandleJme implements SoundHandle { @@ -68,10 +68,11 @@ public SoundHandleJme(AudioRenderer ar, AssetManager am, String fileName){ if (fileName == null) { throw new NullPointerException(); } - + this.fileName = fileName; } + @Override public void play() { if (fileName != null){ if (node != null){ @@ -87,6 +88,7 @@ public void play() { } } + @Override public void stop() { if (node != null){ node.stop(); @@ -98,6 +100,7 @@ public void stop() { } } + @Override public void setVolume(float f) { if (node != null) { node.setVolume(f); @@ -105,14 +108,17 @@ public void setVolume(float f) { volume = f; } + @Override public float getVolume() { return volume; } + @Override public boolean isPlaying() { return node != null && node.getStatus() == Status.Playing; } + @Override public void dispose() { } } diff --git a/jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/SceneLoader.java b/jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/SceneLoader.java index 43565837ae..b7167d2226 100644 --- a/jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/SceneLoader.java +++ b/jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/SceneLoader.java @@ -355,7 +355,7 @@ private void buildAnimations() { int firstKeyIndex = 0; int lastKeyIndex = keyTimes.length - 1; for(int i = 0; i < keyTimes.length; ++i) { - float time = (float) (((double) keyTimes[i]) * secondsPerUnit); // Translate into seconds + float time = (float) (keyTimes[i] * secondsPerUnit); // Translate into seconds if(time <= animStart) firstKeyIndex = i; if(time >= animStop && animStop >= 0) { @@ -373,7 +373,7 @@ private void buildAnimations() { // Calculate keyframes times for(int i = 0; i < keysCount; ++i) { int keyIndex = firstKeyIndex + i; - float time = (float) (((double) keyTimes[keyIndex]) * secondsPerUnit); // Translate into seconds + float time = (float) (keyTimes[keyIndex] * secondsPerUnit); // Translate into seconds times[i] = time - animStart; realLength = Math.max(realLength, times[i]); } diff --git a/jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/file/FbxDump.java b/jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/file/FbxDump.java index 00619dce7b..68b4d2403a 100644 --- a/jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/file/FbxDump.java +++ b/jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/file/FbxDump.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2015 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -148,9 +148,9 @@ protected static void dumpProperty(String id, char propertyType, case 'F': // Double, Float. if (property instanceof Double) { - ps.print(DECIMAL_FORMAT.format((Double)property)); + ps.print(DECIMAL_FORMAT.format(property)); } else if (property instanceof Float) { - ps.print(DECIMAL_FORMAT.format((Float)property)); + ps.print(DECIMAL_FORMAT.format(property)); } else { ps.print(property); } diff --git a/jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/mesh/FbxLayerElement.java b/jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/mesh/FbxLayerElement.java index bffd94c658..03d0f318fc 100644 --- a/jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/mesh/FbxLayerElement.java +++ b/jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/mesh/FbxLayerElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2015 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -108,6 +108,7 @@ public enum TextureBlendMode { private FbxLayerElement() { } + @Override public String toString() { return "LayerElement[type=" + type + ", layer=" + index + ", mapInfoType=" + mapInfoType + ", refInfoType=" + refInfoType + "]"; diff --git a/jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/node/FbxNode.java b/jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/node/FbxNode.java index c0ce06d4b9..bc0294c8c8 100644 --- a/jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/node/FbxNode.java +++ b/jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/node/FbxNode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2015 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -280,9 +280,9 @@ public void fromElement(FbxElement element) { Object userDataValue; if (userDataType.equals("KString")) { - userDataValue = (String) e2.properties.get(4); + userDataValue = e2.properties.get(4); } else if (userDataType.equals("int")) { - userDataValue = (Integer) e2.properties.get(4); + userDataValue = e2.properties.get(4); } else if (userDataType.equals("double")) { // NOTE: jME3 does not support doubles in UserData. // Need to convert to float. diff --git a/jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/objects/FbxAnimCurve.java b/jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/objects/FbxAnimCurve.java index 3952161569..90d7897c6c 100644 --- a/jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/objects/FbxAnimCurve.java +++ b/jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/objects/FbxAnimCurve.java @@ -36,8 +36,8 @@ public float getValue(long time) { return defaultValue;//keyValues[0]; } else { // Interpolate between two keyframes - float dt = (float) (keyTimes[i] - keyTimes[i - 1]); - float dtInt = (float) (time - keyTimes[i - 1]); + float dt = keyTimes[i] - keyTimes[i - 1]; + float dtInt = time - keyTimes[i - 1]; float dv = keyValues[i] - keyValues[i - 1]; return keyValues[i - 1] + dv * (dtInt / dt); } diff --git a/jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/objects/FbxImage.java b/jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/objects/FbxImage.java index 0b50aa163e..21ca597f5a 100644 --- a/jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/objects/FbxImage.java +++ b/jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/objects/FbxImage.java @@ -117,7 +117,7 @@ private Image createImage() { } } if(image == null) - return new Image(Image.Format.RGB8, 1, 1, BufferUtils.createByteBuffer((int) ((long) 1 * (long) 1 * (long) Image.Format.RGB8.getBitsPerPixel() / 8L)), ColorSpace.Linear); + return new Image(Image.Format.RGB8, 1, 1, BufferUtils.createByteBuffer((int) (Image.Format.RGB8.getBitsPerPixel() / 8L)), ColorSpace.Linear); return image; } } diff --git a/jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/objects/FbxNode.java b/jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/objects/FbxNode.java index ebb2094928..41a2022d26 100644 --- a/jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/objects/FbxNode.java +++ b/jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/objects/FbxNode.java @@ -92,9 +92,9 @@ public FbxNode(SceneLoader scene, FbxElement element) { String userDataType = (String) prop.properties.get(1); Object userDataValue; if(userDataType.equals("KString")) { - userDataValue = (String) prop.properties.get(4); + userDataValue = prop.properties.get(4); } else if(userDataType.equals("int")) { - userDataValue = (Integer) prop.properties.get(4); + userDataValue = prop.properties.get(4); } else if(userDataType.equals("double")) { // NOTE: jME3 does not support doubles in UserData. // Need to convert to float. diff --git a/jme3-plugins/src/gltf/java/com/jme3/scene/plugins/gltf/GltfUtils.java b/jme3-plugins/src/gltf/java/com/jme3/scene/plugins/gltf/GltfUtils.java index f6200f533b..a16fb7733d 100644 --- a/jme3-plugins/src/gltf/java/com/jme3/scene/plugins/gltf/GltfUtils.java +++ b/jme3-plugins/src/gltf/java/com/jme3/scene/plugins/gltf/GltfUtils.java @@ -350,16 +350,16 @@ public static float readAsFloat(LittleEndien stream, VertexBuffer.Format format) switch (format) { case Byte: b = stream.readByte(); - return Math.max((float) b / 127f, -1f); + return Math.max(b / 127f, -1f); case UnsignedByte: b = stream.readByte(); - return (float) b / 255f; + return b / 255f; case Short: b = stream.readByte(); - return Math.max((float) b / 32767f, -1f); + return Math.max(b / 32767f, -1f); case UnsignedShort: b = stream.readByte(); - return (float) b / 65535f; + return b / 65535f; default: //we have a regular float return stream.readFloat(); diff --git a/jme3-plugins/src/ogre/java/com/jme3/scene/plugins/ogre/MaterialLoader.java b/jme3-plugins/src/ogre/java/com/jme3/scene/plugins/ogre/MaterialLoader.java index ed11ddd253..45e33b0f4f 100644 --- a/jme3-plugins/src/ogre/java/com/jme3/scene/plugins/ogre/MaterialLoader.java +++ b/jme3-plugins/src/ogre/java/com/jme3/scene/plugins/ogre/MaterialLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -483,6 +483,7 @@ private MaterialList load(AssetManager assetManager, AssetKey key, InputStream i return list; } + @Override public Object load(AssetInfo info) throws IOException { InputStream in = null; try { diff --git a/jme3-plugins/src/ogre/java/com/jme3/scene/plugins/ogre/MeshLoader.java b/jme3-plugins/src/ogre/java/com/jme3/scene/plugins/ogre/MeshLoader.java index 01474b5c46..1ef446b8fc 100644 --- a/jme3-plugins/src/ogre/java/com/jme3/scene/plugins/ogre/MeshLoader.java +++ b/jme3-plugins/src/ogre/java/com/jme3/scene/plugins/ogre/MeshLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -817,6 +817,7 @@ private Node compileModel() { return model; } + @Override public Object load(AssetInfo info) throws IOException { try { key = info.getKey(); @@ -840,7 +841,7 @@ public Object load(AssetInfo info) throws IOException { if (materialList == null && materialName != null) { OgreMaterialKey materialKey = new OgreMaterialKey(folderName + materialName + ".material"); try { - materialList = (MaterialList) assetManager.loadAsset(materialKey); + materialList = assetManager.loadAsset(materialKey); } catch (AssetNotFoundException e) { logger.log(Level.WARNING, "Cannot locate {0} for model {1}", new Object[]{materialKey, key}); } @@ -857,7 +858,7 @@ public Object load(AssetInfo info) throws IOException { if (materialList == null) { OgreMaterialKey materialKey = new OgreMaterialKey(folderName + meshName + ".material"); try { - materialList = (MaterialList) assetManager.loadAsset(materialKey); + materialList = assetManager.loadAsset(materialKey); } catch (AssetNotFoundException e) { logger.log(Level.WARNING, "Cannot locate {0} for model {1}", new Object[]{materialKey, key}); } diff --git a/jme3-plugins/src/ogre/java/com/jme3/scene/plugins/ogre/SceneLoader.java b/jme3-plugins/src/ogre/java/com/jme3/scene/plugins/ogre/SceneLoader.java index 4c26eb5f4b..13205817b7 100644 --- a/jme3-plugins/src/ogre/java/com/jme3/scene/plugins/ogre/SceneLoader.java +++ b/jme3-plugins/src/ogre/java/com/jme3/scene/plugins/ogre/SceneLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -489,6 +489,7 @@ public void endElement(String uri, String name, String qName) throws SAXExceptio public void characters(char ch[], int start, int length) { } + @Override public Object load(AssetInfo info) throws IOException { try { key = info.getKey(); @@ -509,7 +510,7 @@ public Object load(AssetInfo info) throws IOException { // (Backward compatibility only!) OgreMaterialKey materialKey = new OgreMaterialKey(sceneName + ".material"); try { - materialList = (MaterialList) assetManager.loadAsset(materialKey); + materialList = assetManager.loadAsset(materialKey); } catch (AssetNotFoundException ex) { logger.log(Level.WARNING, "Cannot locate {0} for scene {1}", new Object[]{materialKey, key}); materialList = null; diff --git a/jme3-plugins/src/ogre/java/com/jme3/scene/plugins/ogre/SceneMaterialLoader.java b/jme3-plugins/src/ogre/java/com/jme3/scene/plugins/ogre/SceneMaterialLoader.java index 3507de2f7c..63b528905c 100644 --- a/jme3-plugins/src/ogre/java/com/jme3/scene/plugins/ogre/SceneMaterialLoader.java +++ b/jme3-plugins/src/ogre/java/com/jme3/scene/plugins/ogre/SceneMaterialLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -100,7 +100,7 @@ public void startElement(String uri, String localName, String qName, Attributes String materialName = new File(materialPath).getName(); String matFile = folderName + materialName; try { - MaterialList loadedMaterialList = (MaterialList) assetManager.loadAsset(new OgreMaterialKey(matFile)); + MaterialList loadedMaterialList = assetManager.loadAsset(new OgreMaterialKey(matFile)); materialList.putAll(loadedMaterialList); } catch (AssetNotFoundException ex) { logger.log(Level.WARNING, "Cannot locate material file: {0}", matFile); diff --git a/jme3-plugins/src/ogre/java/com/jme3/scene/plugins/ogre/SkeletonLoader.java b/jme3-plugins/src/ogre/java/com/jme3/scene/plugins/ogre/SkeletonLoader.java index 59be5cf7d5..caf4101c3f 100644 --- a/jme3-plugins/src/ogre/java/com/jme3/scene/plugins/ogre/SkeletonLoader.java +++ b/jme3-plugins/src/ogre/java/com/jme3/scene/plugins/ogre/SkeletonLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -72,6 +72,7 @@ public class SkeletonLoader extends DefaultHandler implements AssetLoader { private Vector3f axis; private List unusedJoints = new ArrayList<>(); + @Override public void startElement(String uri, String localName, String qName, Attributes attribs) throws SAXException { if (qName.equals("position") || qName.equals("translate")) { position = SAXUtil.parseVector3(attribs); @@ -132,6 +133,7 @@ public void startElement(String uri, String localName, String qName, Attributes elementStack.add(qName); } + @Override public void endElement(String uri, String name, String qName) { if (qName.equals("translate") || qName.equals("position") || qName.equals("scale")) { } else if (qName.equals("axis")) { @@ -288,6 +290,7 @@ public Object load(InputStream in) throws IOException { } + @Override public Object load(AssetInfo info) throws IOException { //AssetManager assetManager = info.getManager(); InputStream in = null; diff --git a/jme3-plugins/src/xml/java/com/jme3/export/xml/DOMInputCapsule.java b/jme3-plugins/src/xml/java/com/jme3/export/xml/DOMInputCapsule.java index 22779cf254..0fdc7f210e 100644 --- a/jme3-plugins/src/xml/java/com/jme3/export/xml/DOMInputCapsule.java +++ b/jme3-plugins/src/xml/java/com/jme3/export/xml/DOMInputCapsule.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -76,6 +76,7 @@ public DOMInputCapsule(Document doc, XMLImporter importer) { importer.formatVersion = version.equals("") ? 0 : Integer.parseInt(version); } + @Override public int getSavableVersion(Class desiredClass) { if (classHierarchyVersions != null){ return SavableClassUtil.getSavedSavableVersion(savable, desiredClass, @@ -123,6 +124,7 @@ private Element findNextSiblingElement(Element current) { return null; } + @Override public byte readByte(String name, byte defVal) throws IOException { String tmpString = currentElem.getAttribute(name); if (tmpString == null || tmpString.length() < 1) return defVal; @@ -139,6 +141,7 @@ public byte readByte(String name, byte defVal) throws IOException { } } + @Override public byte[] readByteArray(String name, byte[] defVal) throws IOException { try { Element tmpEl; @@ -178,6 +181,7 @@ public byte[] readByteArray(String name, byte[] defVal) throws IOException { } } + @Override public byte[][] readByteArray2D(String name, byte[][] defVal) throws IOException { try { Element tmpEl; @@ -224,6 +228,7 @@ public byte[][] readByteArray2D(String name, byte[][] defVal) throws IOException } } + @Override public int readInt(String name, int defVal) throws IOException { String tmpString = currentElem.getAttribute(name); if (tmpString == null || tmpString.length() < 1) return defVal; @@ -240,6 +245,7 @@ public int readInt(String name, int defVal) throws IOException { } } + @Override public int[] readIntArray(String name, int[] defVal) throws IOException { try { Element tmpEl; @@ -278,6 +284,7 @@ public int[] readIntArray(String name, int[] defVal) throws IOException { } } + @Override public int[][] readIntArray2D(String name, int[][] defVal) throws IOException { try { Element tmpEl; @@ -327,6 +334,7 @@ public int[][] readIntArray2D(String name, int[][] defVal) throws IOException { } } + @Override public float readFloat(String name, float defVal) throws IOException { String tmpString = currentElem.getAttribute(name); if (tmpString == null || tmpString.length() < 1) return defVal; @@ -343,6 +351,7 @@ public float readFloat(String name, float defVal) throws IOException { } } + @Override public float[] readFloatArray(String name, float[] defVal) throws IOException { try { Element tmpEl; @@ -377,6 +386,7 @@ public float[] readFloatArray(String name, float[] defVal) throws IOException { } } + @Override public float[][] readFloatArray2D(String name, float[][] defVal) throws IOException { /* Why does this one method ignore the 'size attr.? */ try { @@ -413,6 +423,7 @@ public float[][] readFloatArray2D(String name, float[][] defVal) throws IOExcept } } + @Override public double readDouble(String name, double defVal) throws IOException { String tmpString = currentElem.getAttribute(name); if (tmpString == null || tmpString.length() < 1) return defVal; @@ -429,6 +440,7 @@ public double readDouble(String name, double defVal) throws IOException { } } + @Override public double[] readDoubleArray(String name, double[] defVal) throws IOException { try { Element tmpEl; @@ -467,6 +479,7 @@ public double[] readDoubleArray(String name, double[] defVal) throws IOException } } + @Override public double[][] readDoubleArray2D(String name, double[][] defVal) throws IOException { try { Element tmpEl; @@ -512,6 +525,7 @@ public double[][] readDoubleArray2D(String name, double[][] defVal) throws IOExc } } + @Override public long readLong(String name, long defVal) throws IOException { String tmpString = currentElem.getAttribute(name); if (tmpString == null || tmpString.length() < 1) return defVal; @@ -528,6 +542,7 @@ public long readLong(String name, long defVal) throws IOException { } } + @Override public long[] readLongArray(String name, long[] defVal) throws IOException { try { Element tmpEl; @@ -566,6 +581,7 @@ public long[] readLongArray(String name, long[] defVal) throws IOException { } } + @Override public long[][] readLongArray2D(String name, long[][] defVal) throws IOException { try { Element tmpEl; @@ -611,6 +627,7 @@ public long[][] readLongArray2D(String name, long[][] defVal) throws IOException } } + @Override public short readShort(String name, short defVal) throws IOException { String tmpString = currentElem.getAttribute(name); if (tmpString == null || tmpString.length() < 1) return defVal; @@ -627,6 +644,7 @@ public short readShort(String name, short defVal) throws IOException { } } + @Override public short[] readShortArray(String name, short[] defVal) throws IOException { try { Element tmpEl; @@ -665,6 +683,7 @@ public short[] readShortArray(String name, short[] defVal) throws IOException { } } + @Override public short[][] readShortArray2D(String name, short[][] defVal) throws IOException { try { Element tmpEl; @@ -711,6 +730,7 @@ public short[][] readShortArray2D(String name, short[][] defVal) throws IOExcept } } + @Override public boolean readBoolean(String name, boolean defVal) throws IOException { String tmpString = currentElem.getAttribute(name); if (tmpString == null || tmpString.length() < 1) return defVal; @@ -723,6 +743,7 @@ public boolean readBoolean(String name, boolean defVal) throws IOException { } } + @Override public boolean[] readBooleanArray(String name, boolean[] defVal) throws IOException { try { Element tmpEl; @@ -757,6 +778,7 @@ public boolean[] readBooleanArray(String name, boolean[] defVal) throws IOExcept } } + @Override public boolean[][] readBooleanArray2D(String name, boolean[][] defVal) throws IOException { try { Element tmpEl; @@ -802,6 +824,7 @@ public boolean[][] readBooleanArray2D(String name, boolean[][] defVal) throws IO } } + @Override public String readString(String name, String defVal) throws IOException { String tmpString = currentElem.getAttribute(name); if (tmpString == null || tmpString.length() < 1) return defVal; @@ -814,6 +837,7 @@ public String readString(String name, String defVal) throws IOException { } } + @Override public String[] readStringArray(String name, String[] defVal) throws IOException { try { Element tmpEl; @@ -858,6 +882,7 @@ public String[] readStringArray(String name, String[] defVal) throws IOException } } + @Override public String[][] readStringArray2D(String name, String[][] defVal) throws IOException { try { Element tmpEl; @@ -903,6 +928,7 @@ public String[][] readStringArray2D(String name, String[][] defVal) throws IOExc } } + @Override public BitSet readBitSet(String name, BitSet defVal) throws IOException { String tmpString = currentElem.getAttribute(name); if (tmpString == null || tmpString.length() < 1) return defVal; @@ -927,6 +953,7 @@ public BitSet readBitSet(String name, BitSet defVal) throws IOException { } } + @Override public Savable readSavable(String name, Savable defVal) throws IOException { Savable ret = defVal; if (name != null && name.equals("")) @@ -1007,6 +1034,7 @@ private Savable readSavableFromCurrentElem(Savable defVal) throws return ret; } + @Override public Savable[] readSavableArray(String name, Savable[] defVal) throws IOException { Savable[] ret = defVal; try { @@ -1041,6 +1069,7 @@ public Savable[] readSavableArray(String name, Savable[] defVal) throws IOExcept } } + @Override public Savable[][] readSavableArray2D(String name, Savable[][] defVal) throws IOException { Savable[][] ret = defVal; try { @@ -1075,6 +1104,7 @@ public Savable[][] readSavableArray2D(String name, Savable[][] defVal) throws IO } } + @Override public ArrayList readSavableArrayList(String name, ArrayList defVal) throws IOException { try { Element tmpEl = findChildElement(currentElem, name); @@ -1108,6 +1138,7 @@ public ArrayList readSavableArrayList(String name, ArrayList defVal) th } } + @Override public ArrayList[] readSavableArrayListArray( String name, ArrayList[] defVal) throws IOException { try { @@ -1153,6 +1184,7 @@ public ArrayList[] readSavableArrayListArray( } } + @Override public ArrayList[][] readSavableArrayListArray2D(String name, ArrayList[][] defVal) throws IOException { try { Element tmpEl = findChildElement(currentElem, name); @@ -1186,6 +1218,7 @@ public ArrayList[][] readSavableArrayListArray2D(String name, ArrayList } } + @Override public ArrayList readFloatBufferArrayList( String name, ArrayList defVal) throws IOException { try { @@ -1224,6 +1257,7 @@ public ArrayList readFloatBufferArrayList( } } + @Override public Map readSavableMap(String name, Map defVal) throws IOException { Map ret; Element tempEl; @@ -1250,6 +1284,7 @@ public ArrayList readFloatBufferArrayList( return ret; } + @Override public Map readStringSavableMap(String name, Map defVal) throws IOException { Map ret = null; Element tempEl; @@ -1280,6 +1315,7 @@ public ArrayList readFloatBufferArrayList( return ret; } + @Override public IntMap readIntSavableMap(String name, IntMap defVal) throws IOException { IntMap ret = null; Element tempEl; @@ -1313,6 +1349,7 @@ public IntMap readIntSavableMap(String name, IntMap readByteBufferArrayList(String name, ArrayList defVal) throws IOException { try { Element tmpEl = findChildElement(currentElem, name); @@ -1485,6 +1526,7 @@ public ArrayList readByteBufferArrayList(String name, ArrayList> T readEnum(String name, Class enumType, T defVal) throws IOException { T ret = defVal; diff --git a/jme3-plugins/src/xml/java/com/jme3/export/xml/XMLImporter.java b/jme3-plugins/src/xml/java/com/jme3/export/xml/XMLImporter.java index d531a0840c..b8f1867c06 100644 --- a/jme3-plugins/src/xml/java/com/jme3/export/xml/XMLImporter.java +++ b/jme3-plugins/src/xml/java/com/jme3/export/xml/XMLImporter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -59,10 +59,12 @@ public class XMLImporter implements JmeImporter { public XMLImporter() { } + @Override public int getFormatVersion() { return formatVersion; } + @Override public AssetManager getAssetManager(){ return assetManager; } @@ -71,6 +73,7 @@ public void setAssetManager(AssetManager assetManager){ this.assetManager = assetManager; } + @Override public Object load(AssetInfo info) throws IOException { assetManager = info.getManager(); InputStream in = info.openStream(); @@ -108,6 +111,7 @@ public Savable load(InputStream f) throws IOException { } } + @Override public InputCapsule getCapsule(Savable id) { return domIn; } diff --git a/jme3-terrain/src/main/java/com/jme3/terrain/GeoMap.java b/jme3-terrain/src/main/java/com/jme3/terrain/GeoMap.java index a6774400ab..a060617c50 100644 --- a/jme3-terrain/src/main/java/com/jme3/terrain/GeoMap.java +++ b/jme3-terrain/src/main/java/com/jme3/terrain/GeoMap.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -239,9 +239,9 @@ public FloatBuffer writeVertexArray(FloatBuffer store, Vector3f scale, boolean c int i = 0; for (int z = 0; z < height; z++){ for (int x = 0; x < width; x++){ - store.put( (float)x*scale.x + offset.x ); - store.put( (float)hdata[i++]*scale.y ); - store.put( (float)z*scale.z + offset.z ); + store.put( x*scale.x + offset.x ); + store.put( hdata[i++]*scale.y ); + store.put( z*scale.z + offset.z ); } } @@ -249,8 +249,8 @@ public FloatBuffer writeVertexArray(FloatBuffer store, Vector3f scale, boolean c } public Vector2f getUV(int x, int y, Vector2f store){ - store.set( (float)x / (float)getWidth(), - (float)y / (float)getHeight() ); + store.set( x / (float)getWidth(), + y / (float)getHeight() ); return store; } @@ -323,6 +323,7 @@ public Mesh createMesh(Vector3f scale, Vector2f tcScale, boolean center){ return m; } + @Override public void write(JmeExporter ex) throws IOException { OutputCapsule oc = ex.getCapsule(this); oc.write(hdata, "hdataarray", null); @@ -331,6 +332,7 @@ public void write(JmeExporter ex) throws IOException { oc.write(maxval, "maxval", 0); } + @Override public void read(JmeImporter im) throws IOException { InputCapsule ic = im.getCapsule(this); hdata = ic.readFloatArray("hdataarray", null); diff --git a/jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/LODGeomap.java b/jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/LODGeomap.java index 0f18af88ef..ccffca1c89 100644 --- a/jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/LODGeomap.java +++ b/jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/LODGeomap.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -141,8 +141,8 @@ public Vector2f getUV(int x, int y, Vector2f store, Vector2f offset, float offse float offsetX = offset.x + (offsetAmount * 1.0f); float offsetY = -offset.y + (offsetAmount * 1.0f);//note the -, we flip the tex coords - store.set((((float) x) + offsetX) / (float) (totalSize - 1), // calculates percentage of texture here - (((float) y) + offsetY) / (float) (totalSize - 1)); + store.set((x + offsetX) / (totalSize - 1), // calculates percentage of texture here + (y + offsetY) / (totalSize - 1)); return store; } diff --git a/jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/TerrainGrid.java b/jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/TerrainGrid.java index fe754242ef..b2e145b42b 100644 --- a/jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/TerrainGrid.java +++ b/jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/TerrainGrid.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -140,6 +140,7 @@ public UpdateQuadCache(Vector3f location) { * attachQuadAt() method. It also resets any cached values in TerrainQuad (such as * neighbours). */ + @Override public void run() { for (int i = 0; i < 4; i++) { for (int j = 0; j < 4; j++) { @@ -164,6 +165,7 @@ public void run() { // if it should be attached as a child right now, attach it getControl(UpdateControl.class).enqueue(new Callable() { // back on the OpenGL thread: + @Override public Object call() throws Exception { if (newQuad.getParent() != null) { attachQuadAt(newQuad, quadrant, quadCell, true); @@ -176,6 +178,7 @@ public Object call() throws Exception { }); } else { getControl(UpdateControl.class).enqueue(new Callable() { + @Override public Object call() throws Exception { removeQuad(newQuad); return null; @@ -187,6 +190,7 @@ public Object call() throws Exception { getControl(UpdateControl.class).enqueue(new Callable() { // back on the OpenGL thread: + @Override public Object call() throws Exception { for (Spatial s : getChildren()) { if (s instanceof TerrainQuad) { @@ -489,6 +493,7 @@ public Material getMaterial(Vector3f worldLocation) { */ protected ExecutorService createExecutorService() { final ThreadFactory threadFactory = new ThreadFactory() { + @Override public Thread newThread(Runnable r) { Thread th = new Thread(r); th.setName("jME TerrainGrid Thread"); @@ -500,6 +505,7 @@ public Thread newThread(Runnable r) { 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue(), threadFactory) { + @Override protected void afterExecute(Runnable r, Throwable t) { super.afterExecute(r, t); if (t == null && r instanceof Future) { diff --git a/jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/TerrainLodControl.java b/jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/TerrainLodControl.java index 7bab7f2072..9e0e3e1e07 100644 --- a/jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/TerrainLodControl.java +++ b/jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/TerrainLodControl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -462,6 +462,7 @@ protected UpdateLOD(final List camLocations, final LodCalculator lodCa this.lodCalculator = lodCalculator; } + @Override public HashMap call() throws Exception { TerrainQuad terrainQuad = (TerrainQuad) getSpatial(); diff --git a/jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/TerrainPatch.java b/jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/TerrainPatch.java index 36c44ea462..a4e8179471 100644 --- a/jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/TerrainPatch.java +++ b/jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/TerrainPatch.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -200,11 +200,7 @@ public void generateLodEntropies() { for (int i = 0; i <= getMaxLod(); i++){ int curLod = (int) Math.pow(2, i); IndexBuffer idxB = geomap.writeIndexArrayLodDiff(curLod, false, false, false, false, totalSize); - Buffer ib; - if (idxB.getBuffer() instanceof IntBuffer) - ib = (IntBuffer)idxB.getBuffer(); - else - ib = (ShortBuffer)idxB.getBuffer(); + Buffer ib = idxB.getBuffer(); entropies[i] = EntropyComputeUtil.computeLodEntropy(mesh, ib); } @@ -253,11 +249,7 @@ protected void reIndexGeometry(HashMap updated, bool else idxB = geomap.writeIndexArrayLodDiff(pow, right, top, left, bottom, totalSize); - Buffer b; - if (idxB.getBuffer() instanceof IntBuffer) - b = (IntBuffer)idxB.getBuffer(); - else - b = (ShortBuffer)idxB.getBuffer(); + Buffer b = idxB.getBuffer(); utp.setNewIndexBuffer(b); } diff --git a/jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/TerrainQuad.java b/jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/TerrainQuad.java index f89198f251..7f2ebb3dc6 100644 --- a/jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/TerrainQuad.java +++ b/jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/TerrainQuad.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -282,6 +282,7 @@ private int collideWithRay(Ray ray, CollisionResults results) { * calculator. This routine can take a long time to run! * @param progressMonitor optional */ + @Override public void generateEntropy(ProgressMonitor progressMonitor) { // only check this on the root quad if (isRootQuad()) @@ -313,10 +314,12 @@ protected boolean isRootQuad() { return (getParent() != null && !(getParent() instanceof TerrainQuad) ); } + @Override public Material getMaterial() { return getMaterial(null); } + @Override public Material getMaterial(Vector3f worldLocation) { // get the material from one of the children. They all share the same material if (children != null) { @@ -332,6 +335,7 @@ public Material getMaterial(Vector3f worldLocation) { return null; } + @Override public int getNumMajorSubdivisions() { return 1; } @@ -873,6 +877,7 @@ protected void setNeedToRecalculateNormals() { affectedAreaBBox = new BoundingBox(getWorldTranslation(), Float.MAX_VALUE, Float.MAX_VALUE, Float.MAX_VALUE); } + @Override public float getHeightmapHeight(Vector2f xz) { // offset int halfSize = totalSize / 2; @@ -1048,10 +1053,11 @@ private QuadrantChild findMatchingChild(int x, int z) { * @param xz the location to get the height for * @return Float.NAN if the value does not exist, or the coordinates are outside of the terrain */ + @Override public float getHeight(Vector2f xz) { // offset - float x = (float)(((xz.x - getWorldTranslation().x) / getWorldScale().x) + (float)(totalSize-1) / 2f); - float z = (float)(((xz.y - getWorldTranslation().z) / getWorldScale().z) + (float)(totalSize-1) / 2f); + float x = ((xz.x - getWorldTranslation().x) / getWorldScale().x) + (totalSize-1) / 2f; + float z = ((xz.y - getWorldTranslation().z) / getWorldScale().z) + (totalSize-1) / 2f; if (!isInside((int)x, (int)z)) return Float.NaN; float height = getHeight((int)x, (int)z, (x%1f), (z%1f)); @@ -1075,10 +1081,11 @@ protected float getHeight(int x, int z, float xm, float zm) { return Float.NaN; } + @Override public Vector3f getNormal(Vector2f xz) { // offset - float x = (float)(((xz.x - getWorldTranslation().x) / getWorldScale().x) + (float)(totalSize-1) / 2f); - float z = (float)(((xz.y - getWorldTranslation().z) / getWorldScale().z) + (float)(totalSize-1) / 2f); + float x = ((xz.x - getWorldTranslation().x) / getWorldScale().x) + (totalSize-1) / 2f; + float z = ((xz.y - getWorldTranslation().z) / getWorldScale().z) + (totalSize-1) / 2f; Vector3f normal = getNormal(x, z, xz); return normal; @@ -1107,6 +1114,7 @@ protected Vector3f getNormal(float x, float z, Vector2f xz) { return n1.add(n2).add(n3).add(n4).normalize(); } + @Override public void setHeight(Vector2f xz, float height) { List coord = new ArrayList(); coord.add(xz); @@ -1116,6 +1124,7 @@ public void setHeight(Vector2f xz, float height) { setHeight(coord, h); } + @Override public void adjustHeight(Vector2f xz, float delta) { List coord = new ArrayList(); coord.add(xz); @@ -1125,10 +1134,12 @@ public void adjustHeight(Vector2f xz, float delta) { adjustHeight(coord, h); } + @Override public void setHeight(List xz, List height) { setHeight(xz, height, true); } + @Override public void adjustHeight(List xz, List height) { setHeight(xz, height, false); } @@ -1265,6 +1276,7 @@ protected boolean isPointOnTerrain(int x, int z) { } + @Override public int getTerrainSize() { return totalSize; } @@ -1290,6 +1302,7 @@ private int findQuadrant(int x, int y) { * Locked meshes are uneditable but have better performance. * @param locked or unlocked */ + @Override public void setLocked(boolean locked) { for (int i = 0; i < this.getQuantity(); i++) { if (this.getChild(i) instanceof TerrainQuad) { @@ -1576,10 +1589,10 @@ protected void fixNormals(BoundingBox affectedArea) { for (int x = children.size(); --x >= 0;) { Spatial child = children.get(x); if (child instanceof TerrainQuad) { - if (affectedArea != null && affectedArea.intersects(((TerrainQuad) child).getWorldBound()) ) + if (affectedArea != null && affectedArea.intersects( child.getWorldBound()) ) ((TerrainQuad) child).fixNormals(affectedArea); } else if (child instanceof TerrainPatch) { - if (affectedArea != null && affectedArea.intersects(((TerrainPatch) child).getWorldBound()) ) + if (affectedArea != null && affectedArea.intersects(child.getWorldBound()) ) ((TerrainPatch) child).updateNormals(); // recalculate the patch's normals } } @@ -1595,10 +1608,10 @@ protected void fixNormalEdges(BoundingBox affectedArea) { for (int x = children.size(); --x >= 0;) { Spatial child = children.get(x); if (child instanceof TerrainQuad) { - if (affectedArea != null && affectedArea.intersects(((TerrainQuad) child).getWorldBound()) ) + if (affectedArea != null && affectedArea.intersects(child.getWorldBound()) ) ((TerrainQuad) child).fixNormalEdges(affectedArea); } else if (child instanceof TerrainPatch) { - if (affectedArea != null && !affectedArea.intersects(((TerrainPatch) child).getWorldBound()) ) // if doesn't intersect, continue + if (affectedArea != null && !affectedArea.intersects(child.getWorldBound()) ) // if doesn't intersect, continue continue; TerrainPatch tp = (TerrainPatch) child; @@ -1664,7 +1677,7 @@ public void findPick(Ray toTest, List results) { if (tp.getWorldBound().intersects(toTest)) { CollisionResults cr = new CollisionResults(); toTest.collideWith(tp.getWorldBound(), cr); - if (cr != null && cr.getClosestCollision() != null) { + if (cr.getClosestCollision() != null) { cr.getClosestCollision().getDistance(); results.add(new TerrainPickData(tp, cr.getClosestCollision())); } @@ -1793,9 +1806,8 @@ public void cloneFields( Cloner cloner, Object original ) { // This was not cloned before... I think that's a mistake. this.affectedAreaBBox = cloner.clone(affectedAreaBBox); - // picker is not cloneable and not cloned. This also seems like - // a mistake if you ever load the same terrain twice. - // this.picker = cloner.clone(picker); + // Otherwise, picker would be cloned by reference and thus "this" would be wrong + this.picker = new BresenhamTerrainPicker(this); // neighbourFinder is also not cloned. Maybe that's ok. } @@ -1828,6 +1840,7 @@ public void clearCaches() { } } + @Override public int getMaxLod() { if (maxLod < 0) maxLod = Math.max(1, (int) (FastMath.log(size-1)/FastMath.log(2)) -1); // -1 forces our minimum of 4 triangles wide @@ -1843,6 +1856,7 @@ public int getTotalSize() { return totalSize; } + @Override public float[] getHeightMap() { float[] hm = null; diff --git a/jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/grid/AssetTileLoader.java b/jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/grid/AssetTileLoader.java index 54cd15c003..1d04afb042 100644 --- a/jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/grid/AssetTileLoader.java +++ b/jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/grid/AssetTileLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -65,6 +65,7 @@ public AssetTileLoader(AssetManager manager, String name, String assetPath) { this.assetPath = assetPath; } + @Override public TerrainQuad getTerrainQuadAt(Vector3f location) { String modelName = assetPath + "/" + name + "_" + Math.round(location.x) + "_" + Math.round(location.y) + "_" + Math.round(location.z) + ".j3o"; Logger.getLogger(this.getClass().getName()).log(Level.FINE, "Load terrain grid tile: {0}", modelName); @@ -91,10 +92,12 @@ public String getName() { return name; } + @Override public void setPatchSize(int patchSize) { this.patchSize = patchSize; } + @Override public void setQuadSize(int quadSize) { this.quadSize = quadSize; } @@ -104,12 +107,14 @@ private TerrainQuad createNewQuad(Vector3f location) { return q; } + @Override public void write(JmeExporter ex) throws IOException { OutputCapsule c = ex.getCapsule(this); c.write(assetPath, "assetPath", null); c.write(name, "name", null); } + @Override public void read(JmeImporter im) throws IOException { InputCapsule c = im.getCapsule(this); manager = im.getAssetManager(); diff --git a/jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/grid/FractalTileLoader.java b/jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/grid/FractalTileLoader.java index 60f01afcd5..da0b66621e 100644 --- a/jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/grid/FractalTileLoader.java +++ b/jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/grid/FractalTileLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -89,24 +89,29 @@ private HeightMap getHeightMapAt(Vector3f location) { return heightmap; } + @Override public TerrainQuad getTerrainQuadAt(Vector3f location) { HeightMap heightMapAt = getHeightMapAt(location); TerrainQuad q = new TerrainQuad("Quad" + location, patchSize, quadSize, heightMapAt == null ? null : heightMapAt.getHeightMap()); return q; } + @Override public void setPatchSize(int patchSize) { this.patchSize = patchSize; } + @Override public void setQuadSize(int quadSize) { this.quadSize = quadSize; } + @Override public void write(JmeExporter ex) throws IOException { //TODO: serialization } + @Override public void read(JmeImporter im) throws IOException { //TODO: serialization } diff --git a/jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/grid/ImageTileLoader.java b/jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/grid/ImageTileLoader.java index ffd77c0c7e..16442798f6 100644 --- a/jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/grid/ImageTileLoader.java +++ b/jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/grid/ImageTileLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -62,6 +62,7 @@ public class ImageTileLoader implements TerrainGridTileLoader{ public ImageTileLoader(final String textureBase, final String textureExt, AssetManager assetManager) { this(assetManager, new Namer() { + @Override public String getName(int x, int y) { return textureBase + "_" + x + "_" + y + "." + textureExt; } @@ -156,24 +157,29 @@ public void setSize(int size) { this.patchSize = size - 1; } + @Override public TerrainQuad getTerrainQuadAt(Vector3f location) { HeightMap heightMapAt = getHeightMapAt(location); TerrainQuad q = new TerrainQuad("Quad" + location, patchSize, quadSize, heightMapAt == null ? null : heightMapAt.getHeightMap()); return q; } + @Override public void setPatchSize(int patchSize) { this.patchSize = patchSize; } + @Override public void setQuadSize(int quadSize) { this.quadSize = quadSize; } + @Override public void write(JmeExporter ex) throws IOException { //TODO: serialization } + @Override public void read(JmeImporter im) throws IOException { //TODO: serialization } diff --git a/jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/lodcalc/DistanceLodCalculator.java b/jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/lodcalc/DistanceLodCalculator.java index e60d80b568..6e84bea57f 100644 --- a/jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/lodcalc/DistanceLodCalculator.java +++ b/jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/lodcalc/DistanceLodCalculator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -62,6 +62,7 @@ public DistanceLodCalculator(int patchSize, float multiplier) { this.lodMultiplier = multiplier; } + @Override public boolean calculateLod(TerrainPatch terrainPatch, List locations, HashMap updates) { if (locations == null || locations.isEmpty()) return false;// no camera yet @@ -114,12 +115,14 @@ protected Vector3f getCenterLocation(TerrainPatch terrainPatch) { return loc; } + @Override public void write(JmeExporter ex) throws IOException { OutputCapsule oc = ex.getCapsule(this); oc.write(size, "patchSize", 32); oc.write(lodMultiplier, "lodMultiplier", 32); } + @Override public void read(JmeImporter im) throws IOException { InputCapsule ic = im.getCapsule(this); size = ic.readInt("patchSize", 32); @@ -148,6 +151,7 @@ protected float getLodDistanceThreshold() { * Does this calculator require the terrain to have the difference of * LOD levels of neighbours to be more than 1. */ + @Override public boolean usesVariableLod() { return false; } @@ -168,14 +172,17 @@ public void setSize(int size) { this.size = size; } + @Override public void turnOffLod() { turnOffLod = true; } + @Override public boolean isLodOff() { return turnOffLod; } + @Override public void turnOnLod() { turnOffLod = false; } diff --git a/jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/lodcalc/PerspectiveLodCalculator.java b/jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/lodcalc/PerspectiveLodCalculator.java index b266996317..e2441503c7 100644 --- a/jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/lodcalc/PerspectiveLodCalculator.java +++ b/jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/lodcalc/PerspectiveLodCalculator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -72,6 +72,7 @@ private float getCameraConstant(Camera cam, float pixelLimit){ return A / T; } + @Override public boolean calculateLod(TerrainPatch patch, List locations, HashMap updates) { if (turnOffLod) { // set to full detail @@ -139,13 +140,16 @@ public LodCalculator clone() { } } + @Override public void write(JmeExporter ex) throws IOException { } + @Override public void read(JmeImporter im) throws IOException { } + @Override public boolean usesVariableLod() { return true; } @@ -162,14 +166,17 @@ public void setCam(Camera cam) { this.cam = cam; } + @Override public void turnOffLod() { turnOffLod = true; } + @Override public boolean isLodOff() { return turnOffLod; } + @Override public void turnOnLod() { turnOffLod = false; } diff --git a/jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/lodcalc/SimpleLodThreshold.java b/jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/lodcalc/SimpleLodThreshold.java index 6f7ea57dca..7ac6aa85b3 100644 --- a/jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/lodcalc/SimpleLodThreshold.java +++ b/jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/lodcalc/SimpleLodThreshold.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -83,16 +83,19 @@ public void setSize(int size) { } + @Override public float getLodDistanceThreshold() { return size*lodMultiplier; } + @Override public void write(JmeExporter ex) throws IOException { OutputCapsule oc = ex.getCapsule(this); oc.write(size, "size", 16); oc.write(lodMultiplier, "lodMultiplier", 2); } + @Override public void read(JmeImporter im) throws IOException { InputCapsule ic = im.getCapsule(this); size = ic.readInt("size", 16); diff --git a/jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/picking/BresenhamTerrainPicker.java b/jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/picking/BresenhamTerrainPicker.java index 5adf4f2bd6..08d354088f 100644 --- a/jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/picking/BresenhamTerrainPicker.java +++ b/jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/picking/BresenhamTerrainPicker.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -82,6 +82,7 @@ public boolean isSupportingMultipleCollisions() { return multipleCollisions; } + @Override public int getTerrainIntersection(Ray worldPick, CollisionResults results) { int numCollisions = 0; worldPickRay.set(worldPick); diff --git a/jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/picking/TerrainPickData.java b/jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/picking/TerrainPickData.java index 576dd15ca4..9edcf11384 100644 --- a/jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/picking/TerrainPickData.java +++ b/jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/picking/TerrainPickData.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -53,6 +53,7 @@ public TerrainPickData(TerrainPatch patch, CollisionResult cr) { this.cr = cr; } + @Override public int compareTo(Object o) { if (o instanceof TerrainPickData) { TerrainPickData tpd = (TerrainPickData) o; diff --git a/jme3-terrain/src/main/java/com/jme3/terrain/heightmap/AbstractHeightMap.java b/jme3-terrain/src/main/java/com/jme3/terrain/heightmap/AbstractHeightMap.java index c6466c17b8..e656bd2aac 100644 --- a/jme3-terrain/src/main/java/com/jme3/terrain/heightmap/AbstractHeightMap.java +++ b/jme3-terrain/src/main/java/com/jme3/terrain/heightmap/AbstractHeightMap.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -69,6 +69,7 @@ public abstract class AbstractHeightMap implements HeightMap { * unloadHeightMap clears the data of the height map. This * insures it is ready for reloading. */ + @Override public void unloadHeightMap() { heightData = null; } @@ -81,6 +82,7 @@ public void unloadHeightMap() { * @param scale * the scale to multiply height values by. */ + @Override public void setHeightScale(float scale) { heightScale = scale; } @@ -97,6 +99,7 @@ public void setHeightScale(float scale) { * @param z * the z (north/south) coordinate. */ + @Override public void setHeightAtPoint(float height, int x, int z) { heightData[x + (z * size)] = height; } @@ -112,6 +115,7 @@ public void setHeightAtPoint(float height, int x, int z) { * @throws JmeException * if the size is less than or equal to zero. */ + @Override public void setSize(int size) throws Exception { if (size <= 0) { throw new Exception("size must be greater than zero."); @@ -131,6 +135,7 @@ public void setSize(int size) throws Exception { * @throws JmeException * if filter is less than 0 or greater than 1. */ + @Override public void setMagnificationFilter(float filter) throws Exception { if (filter < 0 || filter >= 1) { throw new Exception("filter must be between 0 and 1"); @@ -148,6 +153,7 @@ public void setMagnificationFilter(float filter) throws Exception { * the z (north/south) coordinate. * @return the value at (x,z). */ + @Override public float getTrueHeightAtPoint(int x, int z) { //logger.fine( heightData[x + (z*size)]); return heightData[x + (z * size)]; @@ -163,6 +169,7 @@ public float getTrueHeightAtPoint(int x, int z) { * the z (north/south) coordinate. * @return the scaled value at (x, z). */ + @Override public float getScaledHeightAtPoint(int x, int z) { return ((heightData[x + (z * size)]) * heightScale); } @@ -177,6 +184,7 @@ public float getScaledHeightAtPoint(int x, int z) { * the y coordinate of the point. * @return the interpolated height at this point. */ + @Override public float getInterpolatedHeight(float x, float z) { float low, highX, highZ; float intX, intZ; @@ -210,6 +218,7 @@ public float getInterpolatedHeight(float x, float z) { * * @return the grid of height data. */ + @Override public float[] getHeightMap() { return heightData; } @@ -218,6 +227,7 @@ public float[] getHeightMap() { * Build a new array of height data with the scaled values. * @return a new array */ + @Override public float[] getScaledHeightMap() { float[] hm = new float[heightData.length]; for (int i=0; iload is recommended if attributes have changed using * the set methods. */ + @Override public boolean load() { int x, y; int calderaX, calderaY; @@ -312,7 +313,7 @@ public boolean load() { //transfer the new terrain into the height map. for (int i = 0; i < size; i++) { for (int j = 0; j < size; j++) { - setHeightAtPoint((float) tempBuffer[i][j], j, i); + setHeightAtPoint(tempBuffer[i][j], j, i); } } erodeTerrain(); diff --git a/jme3-vr/src/main/java/com/jme3/app/VRApplication.java b/jme3-vr/src/main/java/com/jme3/app/VRApplication.java index c81d9b8825..b609530d9a 100644 --- a/jme3-vr/src/main/java/com/jme3/app/VRApplication.java +++ b/jme3-vr/src/main/java/com/jme3/app/VRApplication.java @@ -463,6 +463,7 @@ public Timer getTimer(){ /** * Handle the error given in parameters by creating a log entry and a dialog window. Internal use only. */ + @Override public void handleError(String errMsg, Throwable t){ // Print error to log. logger.log(Level.SEVERE, errMsg, t); @@ -483,6 +484,7 @@ public void handleError(String errMsg, Throwable t){ /** * Force the focus gain for the application. Internal use only. */ + @Override public void gainFocus(){ if (lostFocusBehavior != LostFocusBehavior.Disabled) { if (lostFocusBehavior == LostFocusBehavior.PauseOnLostFocus) { @@ -498,6 +500,7 @@ public void gainFocus(){ /** * Force the focus lost for the application. Internal use only. */ + @Override public void loseFocus(){ if (lostFocusBehavior != LostFocusBehavior.Disabled){ if (lostFocusBehavior == LostFocusBehavior.PauseOnLostFocus) { @@ -510,6 +513,7 @@ public void loseFocus(){ /** * Reshape the display window. Internal use only. */ + @Override public void reshape(int w, int h){ if (renderManager != null) { renderManager.notifyReshape(w, h); @@ -519,6 +523,7 @@ public void reshape(int w, int h){ /** * Request the application to close. Internal use only. */ + @Override public void requestClose(boolean esc){ context.destroy(false); } @@ -533,6 +538,7 @@ public void requestClose(boolean esc){ * * @param settings The settings to set. */ + @Override public void setSettings(AppSettings settings){ this.settings = settings; if (context != null && settings.useInput() != inputEnabled){ @@ -555,6 +561,7 @@ public void setSettings(AppSettings settings){ * By default, Application will use the Timer as returned by the current {@link JmeContext} implementation. * @param timer the timer to use. */ + @Override public void setTimer(Timer timer){ this.timer = timer; @@ -572,6 +579,7 @@ public void setTimer(Timer timer){ * Determine the application's behavior when unfocused. * @return The lost focus behavior of the application. */ + @Override public LostFocusBehavior getLostFocusBehavior() { return lostFocusBehavior; } @@ -584,6 +592,7 @@ public LostFocusBehavior getLostFocusBehavior() { * * @param lostFocusBehavior The new {@link LostFocusBehavior lost focus behavior} to use. */ + @Override public void setLostFocusBehavior(LostFocusBehavior lostFocusBehavior) { this.lostFocusBehavior = lostFocusBehavior; } @@ -593,6 +602,7 @@ public void setLostFocusBehavior(LostFocusBehavior lostFocusBehavior) { * @return true if pause on lost focus is enabled, false otherwise. * @see #getLostFocusBehavior() */ + @Override public boolean isPauseOnLostFocus() { return getLostFocusBehavior() == LostFocusBehavior.PauseOnLostFocus; } @@ -613,6 +623,7 @@ public boolean isPauseOnLostFocus() { * * @see #setLostFocusBehavior(com.jme3.app.LostFocusBehavior) */ + @Override public void setPauseOnLostFocus(boolean pauseOnLostFocus) { if (pauseOnLostFocus) { setLostFocusBehavior(LostFocusBehavior.PauseOnLostFocus); @@ -784,6 +795,7 @@ public void start() { * @param waitFor if true, the method will wait until the application is started. * @see #start(com.jme3.system.JmeContext.Type, boolean) */ + @Override public void start(boolean waitFor){ start(JmeContext.Type.Display, waitFor); } @@ -1401,6 +1413,7 @@ public void initialize() { /** * Destroy the application (release all resources). */ + @Override public void destroy() { if( VRhardware != null ) { VRhardware.destroy(); @@ -1460,6 +1473,7 @@ public Future enqueue(Callable callable) { * * @param runnable The runnable to run in the main jME3 thread */ + @Override public void enqueue(Runnable runnable){ enqueue(new RunnableWrapper(runnable)); } @@ -1522,6 +1536,7 @@ public void restart(){ * to null. */ + @Override public void setAppProfiler(AppProfiler prof) { return; } @@ -1529,6 +1544,7 @@ public void setAppProfiler(AppProfiler prof) { /** * Returns the current AppProfiler hook, or null if none is set. */ + @Override public AppProfiler getAppProfiler() { return null; } diff --git a/jme3-vr/src/main/java/com/jme3/app/VREnvironment.java b/jme3-vr/src/main/java/com/jme3/app/VREnvironment.java index 3ed87b6960..21ee5eb9d0 100644 --- a/jme3-vr/src/main/java/com/jme3/app/VREnvironment.java +++ b/jme3-vr/src/main/java/com/jme3/app/VREnvironment.java @@ -169,7 +169,7 @@ public void setSeatedExperience(boolean isSeated) { ((OpenVR)hardware).getCompositor().SetTrackingSpace.apply(JOpenVRLibrary.ETrackingUniverseOrigin.ETrackingUniverseOrigin_TrackingUniverseStanding); } } else if (hardware instanceof LWJGLOpenVR) { - if( ((LWJGLOpenVR)hardware).isInitialized() ) { + if( hardware.isInitialized() ) { ((LWJGLOpenVR)hardware).setTrackingSpace(seated); } } diff --git a/jme3-vr/src/main/java/com/jme3/input/lwjgl/GlfwKeyInputVR.java b/jme3-vr/src/main/java/com/jme3/input/lwjgl/GlfwKeyInputVR.java index e551f0fdc2..e5509312ce 100644 --- a/jme3-vr/src/main/java/com/jme3/input/lwjgl/GlfwKeyInputVR.java +++ b/jme3-vr/src/main/java/com/jme3/input/lwjgl/GlfwKeyInputVR.java @@ -1,7 +1,7 @@ package com.jme3.input.lwjgl; /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -69,6 +69,7 @@ public GlfwKeyInputVR(LwjglWindowVR context) { this.context = context; } + @Override public void initialize() { if (!context.isRenderable()) { return; @@ -106,6 +107,7 @@ public int getKeyCount() { return GLFW_KEY_LAST - GLFW_KEY_SPACE; } + @Override public void update() { if (!context.isRenderable()) { return; @@ -116,6 +118,7 @@ public void update() { } } + @Override public void destroy() { if (!context.isRenderable()) { return; @@ -126,14 +129,17 @@ public void destroy() { logger.fine("Keyboard destroyed."); } + @Override public boolean isInitialized() { return initialized; } + @Override public void setInputListener(RawInputListener listener) { this.listener = listener; } + @Override public long getInputTimeNanos() { return (long) (glfwGetTime() * 1000000000); } diff --git a/jme3-vr/src/main/java/com/jme3/input/lwjgl/GlfwMouseInputVR.java b/jme3-vr/src/main/java/com/jme3/input/lwjgl/GlfwMouseInputVR.java index 5dbb958fb7..2ae187d42f 100644 --- a/jme3-vr/src/main/java/com/jme3/input/lwjgl/GlfwMouseInputVR.java +++ b/jme3-vr/src/main/java/com/jme3/input/lwjgl/GlfwMouseInputVR.java @@ -1,7 +1,7 @@ package com.jme3.input.lwjgl; /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -131,6 +131,7 @@ private void onMouseButton(final long window, final int button, final int action mouseButtonEvents.add(mouseButtonEvent); } + @Override public void initialize() { glfwSetCursorPosCallback(context.getWindowHandle(), cursorPosCallback = new GLFWCursorPosCallback() { @Override @@ -216,6 +217,7 @@ public void clearDeltas() { * Check if the input is initialized. * @return true if the input is initialized and false otherwise. */ + @Override public boolean isInitialized() { return initialized; } @@ -291,6 +293,7 @@ private long createGlfwCursor(JmeCursor jmeCursor) { return glfwCreateCursor(glfwImage, jmeCursor.getXHotSpot(), jmeCursor.getYHotSpot()); } + @Override public void setNativeCursor(JmeCursor jmeCursor) { if (jmeCursor != null) { Long glfwCursor = jmeToGlfwCursorMap.get(jmeCursor); diff --git a/jme3-vr/src/main/java/com/jme3/input/vr/AbstractVRViewManager.java b/jme3-vr/src/main/java/com/jme3/input/vr/AbstractVRViewManager.java index 54251fadf3..f49bf98d3e 100644 --- a/jme3-vr/src/main/java/com/jme3/input/vr/AbstractVRViewManager.java +++ b/jme3-vr/src/main/java/com/jme3/input/vr/AbstractVRViewManager.java @@ -69,6 +69,7 @@ public ViewPort getRightViewPort() { * Get the {@link ViewPort view port} attached to the mirror display. * @return the view port attached to the mirror display. */ + @Override public ViewPort getMirrorViewPort() { return mirrorViewPort; } @@ -132,6 +133,7 @@ public VREnvironment getVREnvironment(){ /** * Handles moving filters from the main view to each eye */ + @Override public void moveScreenProcessingToEyes() { if (environment != null){ diff --git a/jme3-vr/src/main/java/com/jme3/input/vr/lwjgl_openvr/LWJGLOpenVR.java b/jme3-vr/src/main/java/com/jme3/input/vr/lwjgl_openvr/LWJGLOpenVR.java index 7615ae8449..6447396f21 100644 --- a/jme3-vr/src/main/java/com/jme3/input/vr/lwjgl_openvr/LWJGLOpenVR.java +++ b/jme3-vr/src/main/java/com/jme3/input/vr/lwjgl_openvr/LWJGLOpenVR.java @@ -170,7 +170,7 @@ public boolean initialize() { VR.k_unTrackedDeviceIndex_Hmd, VR.ETrackedDeviceProperty_Prop_SerialNumber_String, hmdErrorStore)); hmdDisplayFrequency = BufferUtils.createIntBuffer(1); - hmdDisplayFrequency.put( (int) VR.ETrackedDeviceProperty_Prop_DisplayFrequency_Float); + hmdDisplayFrequency.put(VR.ETrackedDeviceProperty_Prop_DisplayFrequency_Float); trackedDevicePose = TrackedDevicePose.create(VR.k_unMaxTrackedDeviceCount); hmdTrackedDevicePoses = new TrackedDevicePose[VR.k_unMaxTrackedDeviceCount]; diff --git a/jme3-vr/src/main/java/com/jme3/input/vr/lwjgl_openvr/LWJGLOpenVRInput.java b/jme3-vr/src/main/java/com/jme3/input/vr/lwjgl_openvr/LWJGLOpenVRInput.java index d0f49594d5..a44410eb4e 100644 --- a/jme3-vr/src/main/java/com/jme3/input/vr/lwjgl_openvr/LWJGLOpenVRInput.java +++ b/jme3-vr/src/main/java/com/jme3/input/vr/lwjgl_openvr/LWJGLOpenVRInput.java @@ -404,7 +404,7 @@ public Quaternion getFinalObserverRotation(int index) { public Vector3f getFinalObserverPosition(int index) { if (environment != null) { - VRViewManager vrvm = (VRViewManager) environment.getVRViewManager(); + VRViewManager vrvm = environment.getVRViewManager(); if (vrvm != null) { if (isInputDeviceTracking(index) == false) { diff --git a/jme3-vr/src/main/java/com/jme3/input/vr/lwjgl_openvr/LWJGLOpenVRViewManager.java b/jme3-vr/src/main/java/com/jme3/input/vr/lwjgl_openvr/LWJGLOpenVRViewManager.java index 78be2565fd..af9e98a7ed 100644 --- a/jme3-vr/src/main/java/com/jme3/input/vr/lwjgl_openvr/LWJGLOpenVRViewManager.java +++ b/jme3-vr/src/main/java/com/jme3/input/vr/lwjgl_openvr/LWJGLOpenVRViewManager.java @@ -74,7 +74,7 @@ public LWJGLOpenVRViewManager(VREnvironment environment) { * @see #getFullTexId() */ protected int getLeftTexId() { - return (int) getLeftTexture().getImage().getId(); + return getLeftTexture().getImage().getId(); } /** @@ -85,7 +85,7 @@ protected int getLeftTexId() { * @see #getFullTexId() */ protected int getRightTexId() { - return (int) getRightTexture().getImage().getId(); + return getRightTexture().getImage().getId(); } /** @@ -96,7 +96,7 @@ protected int getRightTexId() { * @see #getRightTexId() */ private int getFullTexId() { - return (int) dualEyeTex.getImage().getId(); + return dualEyeTex.getImage().getId(); } /** @@ -482,7 +482,7 @@ private ViewPort setupMirrorBuffers(Camera cam, Texture2D tex, boolean expand) { pic.setLocalScale(1.5f, 1f, 1f); } pic.setQueueBucket(Bucket.Opaque); - pic.setTexture(environment.getApplication().getAssetManager(), (Texture2D) tex, false); + pic.setTexture(environment.getApplication().getAssetManager(), tex, false); viewPort.attachScene(pic); viewPort.setOutputFrameBuffer(null); diff --git a/jme3-vr/src/main/java/com/jme3/input/vr/oculus/OculusVR.java b/jme3-vr/src/main/java/com/jme3/input/vr/oculus/OculusVR.java index a3a506d5c1..3329702f53 100644 --- a/jme3-vr/src/main/java/com/jme3/input/vr/oculus/OculusVR.java +++ b/jme3-vr/src/main/java/com/jme3/input/vr/oculus/OculusVR.java @@ -412,6 +412,7 @@ public HmdType getType() { return HmdType.OCULUS_RIFT; } + @Override public boolean initVRCompositor(boolean set) { if (!set) { throw new UnsupportedOperationException("Cannot use LibOVR without compositor!"); @@ -427,18 +428,22 @@ public boolean initVRCompositor(boolean set) { return true; } + @Override public void printLatencyInfoToConsole(boolean set) { throw new UnsupportedOperationException("Not yet implemented!"); } + @Override public void setFlipEyes(boolean set) { throw new UnsupportedOperationException("Not yet implemented!"); } + @Override public Void getCompositor() { throw new UnsupportedOperationException("Not yet implemented!"); } + @Override public Void getVRSystem() { throw new UnsupportedOperationException("Not yet implemented!"); } diff --git a/jme3-vr/src/main/java/com/jme3/input/vr/openvr/OpenVR.java b/jme3-vr/src/main/java/com/jme3/input/vr/openvr/OpenVR.java index a4d76018be..1c5a9449bd 100644 --- a/jme3-vr/src/main/java/com/jme3/input/vr/openvr/OpenVR.java +++ b/jme3-vr/src/main/java/com/jme3/input/vr/openvr/OpenVR.java @@ -206,7 +206,7 @@ public boolean initialize() { _tframeCount = new LongByReference(); hmdDisplayFrequency = IntBuffer.allocate(1); - hmdDisplayFrequency.put( (int) JOpenVRLibrary.ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_DisplayFrequency_Float); + hmdDisplayFrequency.put(JOpenVRLibrary.ETrackedDeviceProperty.ETrackedDeviceProperty_Prop_DisplayFrequency_Float); hmdTrackedDevicePoseReference = new TrackedDevicePose_t.ByReference(); hmdTrackedDevicePoses = (TrackedDevicePose_t[])hmdTrackedDevicePoseReference.toArray(JOpenVRLibrary.k_unMaxTrackedDeviceCount); poseMatrices = new Matrix4f[JOpenVRLibrary.k_unMaxTrackedDeviceCount]; diff --git a/jme3-vr/src/main/java/com/jme3/input/vr/openvr/OpenVRViewManager.java b/jme3-vr/src/main/java/com/jme3/input/vr/openvr/OpenVRViewManager.java index f4bdc920ba..b9c8eb1f21 100644 --- a/jme3-vr/src/main/java/com/jme3/input/vr/openvr/OpenVRViewManager.java +++ b/jme3-vr/src/main/java/com/jme3/input/vr/openvr/OpenVRViewManager.java @@ -75,7 +75,7 @@ public OpenVRViewManager(VREnvironment environment){ * @see #getFullTexId() */ protected int getLeftTexId() { - return (int)getLeftTexture().getImage().getId(); + return getLeftTexture().getImage().getId(); } /** @@ -85,7 +85,7 @@ protected int getLeftTexId() { * @see #getFullTexId() */ protected int getRightTexId() { - return (int)getRightTexture().getImage().getId(); + return getRightTexture().getImage().getId(); } /** @@ -95,7 +95,7 @@ protected int getRightTexId() { * @see #getRightTexId() */ private int getFullTexId() { - return (int)dualEyeTex.getImage().getId(); + return dualEyeTex.getImage().getId(); } /** diff --git a/jme3-vr/src/main/java/com/jme3/input/vr/osvr/OSVRViewManager.java b/jme3-vr/src/main/java/com/jme3/input/vr/osvr/OSVRViewManager.java index 12eef2ca91..e4475397b5 100644 --- a/jme3-vr/src/main/java/com/jme3/input/vr/osvr/OSVRViewManager.java +++ b/jme3-vr/src/main/java/com/jme3/input/vr/osvr/OSVRViewManager.java @@ -93,7 +93,7 @@ public OSVRViewManager(VREnvironment environment){ * @see #getFullTexId() */ protected int getLeftTexId() { - return (int)leftEyeTexture.getImage().getId(); + return leftEyeTexture.getImage().getId(); } /** @@ -103,7 +103,7 @@ protected int getLeftTexId() { * @see #getFullTexId() */ protected int getRightTexId() { - return (int)rightEyeTexture.getImage().getId(); + return rightEyeTexture.getImage().getId(); } /** @@ -113,7 +113,7 @@ protected int getRightTexId() { * @see #getRightTexId() */ private int getFullTexId() { - return (int)dualEyeTex.getImage().getId(); + return dualEyeTex.getImage().getId(); } /** @@ -172,6 +172,7 @@ private void registerOSVRBuffer(OSVR_RenderBufferOpenGL.ByValue buf) { /** * Send the textures to the two eyes. */ + @Override public void postRender() { if (environment != null){ @@ -268,6 +269,7 @@ public void postRender() { /** * Initialize the VR view manager. */ + @Override public void initialize() { logger.config("Initializing VR view manager."); @@ -293,7 +295,7 @@ public void initialize() { int origHeight = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDisplayMode().getHeight(); long window = ((LwjglWindow)environment.getApplication().getContext()).getWindowHandle(); Vector2f windowSize = new Vector2f(); - ((OSVR)environment.getVRHardware()).getRenderSize(windowSize); + environment.getVRHardware().getRenderSize(windowSize); windowSize.x = Math.max(windowSize.x * 2f, leftCamera.getWidth()); org.lwjgl.glfw.GLFW.glfwSetWindowSize(window, (int)windowSize.x, (int)windowSize.y); environment.getApplication().getContext().getSettings().setResolution((int)windowSize.x, (int)windowSize.y); @@ -444,6 +446,7 @@ private void setupVRScene(){ * This method is called by the attached VR application and should not be called manually. * @param tpf the time per frame. */ + @Override public void update(float tpf) { if (environment != null){ @@ -512,6 +515,7 @@ private void finalizeCamera(Vector3f eyePos, Vector3f obsPosition, Camera cam) { /** * Handles moving filters from the main view to each eye */ + @Override public void moveScreenProcessingToEyes() { if( getRightViewPort() == null ){ return; @@ -534,6 +538,7 @@ public void moveScreenProcessingToEyes() { * Sets the two views to use the list of {@link SceneProcessor processors}. * @param sourceViewport the {@link ViewPort viewport} that contains the processors to use. */ + @Override public void syncScreenProcessing(ViewPort sourceViewport) { if( getRightViewPort() == null ){ return; diff --git a/jme3-vr/src/main/java/com/jme3/post/CartoonSSAO.java b/jme3-vr/src/main/java/com/jme3/post/CartoonSSAO.java index 35b2cd95b6..699e13ecd8 100644 --- a/jme3-vr/src/main/java/com/jme3/post/CartoonSSAO.java +++ b/jme3-vr/src/main/java/com/jme3/post/CartoonSSAO.java @@ -140,7 +140,7 @@ protected void initFilter(AssetManager manager, RenderManager renderManager, Vie frustumNearFar = new Vector2f(); float farY = (vp.getCamera().getFrustumTop() / vp.getCamera().getFrustumNear()) * vp.getCamera().getFrustumFar(); - float farX = farY * ((float) screenWidth / (float) screenHeight); + float farX = farY * (screenWidth / (float) screenHeight); frustumCorner = new Vector3f(farX, farY, vp.getCamera().getFrustumFar()); frustumNearFar.x = vp.getCamera().getFrustumNear(); frustumNearFar.y = vp.getCamera().getFrustumFar(); diff --git a/jme3-vr/src/main/java/com/jme3/shadow/AbstractShadowRendererVR.java b/jme3-vr/src/main/java/com/jme3/shadow/AbstractShadowRendererVR.java index 6b30a2812a..6fcbbd85a6 100644 --- a/jme3-vr/src/main/java/com/jme3/shadow/AbstractShadowRendererVR.java +++ b/jme3-vr/src/main/java/com/jme3/shadow/AbstractShadowRendererVR.java @@ -1,7 +1,7 @@ package com.jme3.shadow; /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -327,6 +327,7 @@ protected Geometry createFrustum(Vector3f[] pts, int i) { * @param rm the render manager * @param vp the viewport */ + @Override public void initialize(RenderManager rm, ViewPort vp) { renderManager = rm; viewPort = vp; @@ -346,6 +347,7 @@ public void initialize(RenderManager rm, ViewPort vp) { * * @return true if initialized, otherwise false */ + @Override public boolean isInitialized() { return viewPort != null; } @@ -392,6 +394,7 @@ protected void doDisplayFrustumDebug(int shadowMapIndex) { } @SuppressWarnings("fallthrough") + @Override public void postQueue(RenderQueue rq) { lightReceivers.clear(); skipPostPass = false; @@ -476,6 +479,7 @@ public void displayDebug() { protected abstract void getReceivers(GeometryList lightReceivers); + @Override public void postFrame(FrameBuffer out) { if (skipPostPass) { return; @@ -688,12 +692,15 @@ public float getShadowZFadeLength() { */ protected abstract boolean checkCulling(Camera viewCam); + @Override public void preFrame(float tpf) { } + @Override public void cleanup() { } + @Override public void reshape(ViewPort vp, int w, int h) { } @@ -804,8 +811,9 @@ public boolean isRenderBackFacesShadows() { * * @param im importer (not null) */ + @Override public void read(JmeImporter im) throws IOException { - InputCapsule ic = (InputCapsule) im.getCapsule(this); + InputCapsule ic = im.getCapsule(this); assetManager = im.getAssetManager(); nbShadowMaps = ic.readInt("nbShadowMaps", 1); shadowMapSize = ic.readFloat("shadowMapSize", 0f); @@ -823,8 +831,9 @@ public void read(JmeImporter im) throws IOException { * * @param ex exporter (not null) */ + @Override public void write(JmeExporter ex) throws IOException { - OutputCapsule oc = (OutputCapsule) ex.getCapsule(this); + OutputCapsule oc = ex.getCapsule(this); oc.write(nbShadowMaps, "nbShadowMaps", 1); oc.write(shadowMapSize, "shadowMapSize", 0); oc.write(shadowIntensity, "shadowIntensity", 0.7f); diff --git a/jme3-vr/src/main/java/com/jme3/shadow/DirectionalLightShadowRendererVR.java b/jme3-vr/src/main/java/com/jme3/shadow/DirectionalLightShadowRendererVR.java index c4a1336d35..9c8cae716d 100644 --- a/jme3-vr/src/main/java/com/jme3/shadow/DirectionalLightShadowRendererVR.java +++ b/jme3-vr/src/main/java/com/jme3/shadow/DirectionalLightShadowRendererVR.java @@ -1,7 +1,7 @@ package com.jme3.shadow; /* - * Copyright (c) 2009-2019 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -270,7 +270,7 @@ public void setEnabledStabilization(boolean stabilize) { @Override public void read(JmeImporter im) throws IOException { super.read(im); - InputCapsule ic = (InputCapsule) im.getCapsule(this); + InputCapsule ic = im.getCapsule(this); lambda = ic.readFloat("lambda", 0.65f); zFarOverride = ic.readInt("zFarOverride", 0); light = (DirectionalLight) ic.readSavable("light", null); @@ -282,7 +282,7 @@ public void read(JmeImporter im) throws IOException { @Override public void write(JmeExporter ex) throws IOException { super.write(ex); - OutputCapsule oc = (OutputCapsule) ex.getCapsule(this); + OutputCapsule oc = ex.getCapsule(this); oc.write(lambda, "lambda", 0.65f); oc.write(zFarOverride, "zFarOverride", 0); oc.write(light, "light", null); diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/AppOverrideKeys_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/AppOverrideKeys_t.java index add3d5d9ac..f88400e2bd 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/AppOverrideKeys_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/AppOverrideKeys_t.java @@ -4,46 +4,47 @@ import java.util.Arrays; import java.util.List; /** - * native declaration : headers\openvr_capi.h:1485
- * This file was autogenerated by JNAerator,
- * a tool written by Olivier Chafik that uses a few opensource projects..
- * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class AppOverrideKeys_t extends Structure { + * native declaration : headers\openvr_capi.h:1485
+ * This file was autogenerated by JNAerator,
+ * a tool written by Olivier Chafik that uses a few opensource projects..
+ * For help, please visit NativeLibs4Java , Rococoa, or JNA. + */ +public class AppOverrideKeys_t extends Structure { /** - * const char *
- * C type : char* - */ - public Pointer pchKey; + * const char *
+ * C type : char* + */ + public Pointer pchKey; /** - * const char *
- * C type : char* - */ - public Pointer pchValue; - public AppOverrideKeys_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("pchKey", "pchValue"); - } + * const char *
+ * C type : char* + */ + public Pointer pchValue; + public AppOverrideKeys_t() { + super(); + } + @Override + protected List getFieldOrder() { + return Arrays.asList("pchKey", "pchValue"); + } /** - * @param pchKey const char *
- * C type : char*
- * @param pchValue const char *
- * C type : char* - */ - public AppOverrideKeys_t(Pointer pchKey, Pointer pchValue) { - super(); - this.pchKey = pchKey; - this.pchValue = pchValue; - } - public AppOverrideKeys_t(Pointer peer) { - super(peer); - } - public static class ByReference extends AppOverrideKeys_t implements Structure.ByReference { - - }; - public static class ByValue extends AppOverrideKeys_t implements Structure.ByValue { - - }; + * @param pchKey const char *
+ * C type : char*
+ * @param pchValue const char *
+ * C type : char* + */ + public AppOverrideKeys_t(Pointer pchKey, Pointer pchValue) { + super(); + this.pchKey = pchKey; + this.pchValue = pchValue; + } + public AppOverrideKeys_t(Pointer peer) { + super(peer); + } + public static class ByReference extends AppOverrideKeys_t implements Structure.ByReference { + + }; + public static class ByValue extends AppOverrideKeys_t implements Structure.ByValue { + + }; } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/COpenVRContext.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/COpenVRContext.java index b57646031b..5c3d4fc08e 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/COpenVRContext.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/COpenVRContext.java @@ -5,105 +5,106 @@ import java.util.Arrays; import java.util.List; /** - * native declaration : headers\openvr_capi.h:1670
- * This file was autogenerated by JNAerator,
- * a tool written by Olivier Chafik that uses a few opensource projects..
- * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class COpenVRContext extends Structure { - /** - * class vr::IVRSystem *
- * C type : intptr_t - */ - public IntByReference m_pVRSystem; - /** - * class vr::IVRChaperone *
- * C type : intptr_t - */ - public IntByReference m_pVRChaperone; - /** - * class vr::IVRChaperoneSetup *
- * C type : intptr_t - */ - public IntByReference m_pVRChaperoneSetup; - /** - * class vr::IVRCompositor *
- * C type : intptr_t - */ - public IntByReference m_pVRCompositor; - /** - * class vr::IVROverlay *
- * C type : intptr_t - */ - public IntByReference m_pVROverlay; - /** - * class vr::IVRResources *
- * C type : intptr_t - */ - public IntByReference m_pVRResources; - /** - * class vr::IVRRenderModels *
- * C type : intptr_t - */ - public IntByReference m_pVRRenderModels; - /** - * class vr::IVRExtendedDisplay *
- * C type : intptr_t - */ - public IntByReference m_pVRExtendedDisplay; - /** - * class vr::IVRSettings *
- * C type : intptr_t - */ - public IntByReference m_pVRSettings; - /** - * class vr::IVRApplications *
- * C type : intptr_t - */ - public IntByReference m_pVRApplications; - /** - * class vr::IVRTrackedCamera *
- * C type : intptr_t - */ - public IntByReference m_pVRTrackedCamera; - /** - * class vr::IVRScreenshots *
- * C type : intptr_t - */ - public IntByReference m_pVRScreenshots; - /** - * class vr::IVRDriverManager *
- * C type : intptr_t - */ - public IntByReference m_pVRDriverManager; - /** - * class vr::IVRInput *
- * C type : intptr_t - */ - public IntByReference m_pVRInput; - /** - * class vr::IVRIOBuffer *
- * C type : intptr_t - */ - public IntByReference m_pVRIOBuffer; - /** - * class vr::IVRSpatialAnchors *
- * C type : intptr_t - */ - public IntByReference m_pVRSpatialAnchors; - public COpenVRContext() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("m_pVRSystem", "m_pVRChaperone", "m_pVRChaperoneSetup", "m_pVRCompositor", "m_pVROverlay", "m_pVRResources", "m_pVRRenderModels", "m_pVRExtendedDisplay", "m_pVRSettings", "m_pVRApplications", "m_pVRTrackedCamera", "m_pVRScreenshots", "m_pVRDriverManager", "m_pVRInput", "m_pVRIOBuffer", "m_pVRSpatialAnchors"); - } - public COpenVRContext(Pointer peer) { - super(peer); - } - public static class ByReference extends COpenVRContext implements Structure.ByReference { - - }; - public static class ByValue extends COpenVRContext implements Structure.ByValue { - - }; + * native declaration : headers\openvr_capi.h:1670
+ * This file was autogenerated by JNAerator,
+ * a tool written by Olivier Chafik that uses a few opensource projects..
+ * For help, please visit NativeLibs4Java , Rococoa, or JNA. + */ +public class COpenVRContext extends Structure { + /** + * class vr::IVRSystem *
+ * C type : intptr_t + */ + public IntByReference m_pVRSystem; + /** + * class vr::IVRChaperone *
+ * C type : intptr_t + */ + public IntByReference m_pVRChaperone; + /** + * class vr::IVRChaperoneSetup *
+ * C type : intptr_t + */ + public IntByReference m_pVRChaperoneSetup; + /** + * class vr::IVRCompositor *
+ * C type : intptr_t + */ + public IntByReference m_pVRCompositor; + /** + * class vr::IVROverlay *
+ * C type : intptr_t + */ + public IntByReference m_pVROverlay; + /** + * class vr::IVRResources *
+ * C type : intptr_t + */ + public IntByReference m_pVRResources; + /** + * class vr::IVRRenderModels *
+ * C type : intptr_t + */ + public IntByReference m_pVRRenderModels; + /** + * class vr::IVRExtendedDisplay *
+ * C type : intptr_t + */ + public IntByReference m_pVRExtendedDisplay; + /** + * class vr::IVRSettings *
+ * C type : intptr_t + */ + public IntByReference m_pVRSettings; + /** + * class vr::IVRApplications *
+ * C type : intptr_t + */ + public IntByReference m_pVRApplications; + /** + * class vr::IVRTrackedCamera *
+ * C type : intptr_t + */ + public IntByReference m_pVRTrackedCamera; + /** + * class vr::IVRScreenshots *
+ * C type : intptr_t + */ + public IntByReference m_pVRScreenshots; + /** + * class vr::IVRDriverManager *
+ * C type : intptr_t + */ + public IntByReference m_pVRDriverManager; + /** + * class vr::IVRInput *
+ * C type : intptr_t + */ + public IntByReference m_pVRInput; + /** + * class vr::IVRIOBuffer *
+ * C type : intptr_t + */ + public IntByReference m_pVRIOBuffer; + /** + * class vr::IVRSpatialAnchors *
+ * C type : intptr_t + */ + public IntByReference m_pVRSpatialAnchors; + public COpenVRContext() { + super(); + } + @Override + protected List getFieldOrder() { + return Arrays.asList("m_pVRSystem", "m_pVRChaperone", "m_pVRChaperoneSetup", "m_pVRCompositor", "m_pVROverlay", "m_pVRResources", "m_pVRRenderModels", "m_pVRExtendedDisplay", "m_pVRSettings", "m_pVRApplications", "m_pVRTrackedCamera", "m_pVRScreenshots", "m_pVRDriverManager", "m_pVRInput", "m_pVRIOBuffer", "m_pVRSpatialAnchors"); + } + public COpenVRContext(Pointer peer) { + super(peer); + } + public static class ByReference extends COpenVRContext implements Structure.ByReference { + + }; + public static class ByValue extends COpenVRContext implements Structure.ByValue { + + }; } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/CVRSettingHelper.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/CVRSettingHelper.java index d2c37f9df1..5be90516cb 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/CVRSettingHelper.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/CVRSettingHelper.java @@ -19,6 +19,7 @@ public class CVRSettingHelper extends Structure { public CVRSettingHelper() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("m_pSettings"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/CameraVideoStreamFrameHeader_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/CameraVideoStreamFrameHeader_t.java index d8476324dd..ebbc398bd6 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/CameraVideoStreamFrameHeader_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/CameraVideoStreamFrameHeader_t.java @@ -23,6 +23,7 @@ public class CameraVideoStreamFrameHeader_t extends Structure { public CameraVideoStreamFrameHeader_t() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("eFrameType", "nWidth", "nHeight", "nBytesPerPixel", "nFrameSequence", "standingTrackedDevicePose"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/Compositor_CumulativeStats.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/Compositor_CumulativeStats.java index c2e741fa42..3b426b7b8f 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/Compositor_CumulativeStats.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/Compositor_CumulativeStats.java @@ -4,40 +4,41 @@ import java.util.Arrays; import java.util.List; /** - * native declaration : headers\openvr_capi.h:1528
- * This file was autogenerated by JNAerator,
- * a tool written by Olivier Chafik that uses a few opensource projects..
- * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class Compositor_CumulativeStats extends Structure { - public int m_nPid; - public int m_nNumFramePresents; - public int m_nNumDroppedFrames; - public int m_nNumReprojectedFrames; - public int m_nNumFramePresentsOnStartup; - public int m_nNumDroppedFramesOnStartup; - public int m_nNumReprojectedFramesOnStartup; - public int m_nNumLoading; - public int m_nNumFramePresentsLoading; - public int m_nNumDroppedFramesLoading; - public int m_nNumReprojectedFramesLoading; - public int m_nNumTimedOut; - public int m_nNumFramePresentsTimedOut; - public int m_nNumDroppedFramesTimedOut; - public int m_nNumReprojectedFramesTimedOut; - public Compositor_CumulativeStats() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("m_nPid", "m_nNumFramePresents", "m_nNumDroppedFrames", "m_nNumReprojectedFrames", "m_nNumFramePresentsOnStartup", "m_nNumDroppedFramesOnStartup", "m_nNumReprojectedFramesOnStartup", "m_nNumLoading", "m_nNumFramePresentsLoading", "m_nNumDroppedFramesLoading", "m_nNumReprojectedFramesLoading", "m_nNumTimedOut", "m_nNumFramePresentsTimedOut", "m_nNumDroppedFramesTimedOut", "m_nNumReprojectedFramesTimedOut"); - } - public Compositor_CumulativeStats(Pointer peer) { - super(peer); - } - public static class ByReference extends Compositor_CumulativeStats implements Structure.ByReference { - - }; - public static class ByValue extends Compositor_CumulativeStats implements Structure.ByValue { - - }; + * native declaration : headers\openvr_capi.h:1528
+ * This file was autogenerated by JNAerator,
+ * a tool written by Olivier Chafik that uses a few opensource projects..
+ * For help, please visit NativeLibs4Java , Rococoa, or JNA. + */ +public class Compositor_CumulativeStats extends Structure { + public int m_nPid; + public int m_nNumFramePresents; + public int m_nNumDroppedFrames; + public int m_nNumReprojectedFrames; + public int m_nNumFramePresentsOnStartup; + public int m_nNumDroppedFramesOnStartup; + public int m_nNumReprojectedFramesOnStartup; + public int m_nNumLoading; + public int m_nNumFramePresentsLoading; + public int m_nNumDroppedFramesLoading; + public int m_nNumReprojectedFramesLoading; + public int m_nNumTimedOut; + public int m_nNumFramePresentsTimedOut; + public int m_nNumDroppedFramesTimedOut; + public int m_nNumReprojectedFramesTimedOut; + public Compositor_CumulativeStats() { + super(); + } + @Override + protected List getFieldOrder() { + return Arrays.asList("m_nPid", "m_nNumFramePresents", "m_nNumDroppedFrames", "m_nNumReprojectedFrames", "m_nNumFramePresentsOnStartup", "m_nNumDroppedFramesOnStartup", "m_nNumReprojectedFramesOnStartup", "m_nNumLoading", "m_nNumFramePresentsLoading", "m_nNumDroppedFramesLoading", "m_nNumReprojectedFramesLoading", "m_nNumTimedOut", "m_nNumFramePresentsTimedOut", "m_nNumDroppedFramesTimedOut", "m_nNumReprojectedFramesTimedOut"); + } + public Compositor_CumulativeStats(Pointer peer) { + super(peer); + } + public static class ByReference extends Compositor_CumulativeStats implements Structure.ByReference { + + }; + public static class ByValue extends Compositor_CumulativeStats implements Structure.ByValue { + + }; } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/Compositor_FrameTiming.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/Compositor_FrameTiming.java index 8157254c5a..ede38a055b 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/Compositor_FrameTiming.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/Compositor_FrameTiming.java @@ -4,50 +4,51 @@ import java.util.Arrays; import java.util.List; /** - * native declaration : headers\openvr_capi.h:1511
- * This file was autogenerated by JNAerator,
- * a tool written by Olivier Chafik that uses a few opensource projects..
- * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class Compositor_FrameTiming extends Structure { - public int m_nSize; - public int m_nFrameIndex; - public int m_nNumFramePresents; - public int m_nNumMisPresented; - public int m_nNumDroppedFrames; - public int m_nReprojectionFlags; - public double m_flSystemTimeInSeconds; - public float m_flPreSubmitGpuMs; - public float m_flPostSubmitGpuMs; - public float m_flTotalRenderGpuMs; - public float m_flCompositorRenderGpuMs; - public float m_flCompositorRenderCpuMs; - public float m_flCompositorIdleCpuMs; - public float m_flClientFrameIntervalMs; - public float m_flPresentCallCpuMs; - public float m_flWaitForPresentCpuMs; - public float m_flSubmitFrameMs; - public float m_flWaitGetPosesCalledMs; - public float m_flNewPosesReadyMs; - public float m_flNewFrameReadyMs; - public float m_flCompositorUpdateStartMs; - public float m_flCompositorUpdateEndMs; - public float m_flCompositorRenderStartMs; - /** C type : TrackedDevicePose_t */ - public TrackedDevicePose_t m_HmdPose; - public Compositor_FrameTiming() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("m_nSize", "m_nFrameIndex", "m_nNumFramePresents", "m_nNumMisPresented", "m_nNumDroppedFrames", "m_nReprojectionFlags", "m_flSystemTimeInSeconds", "m_flPreSubmitGpuMs", "m_flPostSubmitGpuMs", "m_flTotalRenderGpuMs", "m_flCompositorRenderGpuMs", "m_flCompositorRenderCpuMs", "m_flCompositorIdleCpuMs", "m_flClientFrameIntervalMs", "m_flPresentCallCpuMs", "m_flWaitForPresentCpuMs", "m_flSubmitFrameMs", "m_flWaitGetPosesCalledMs", "m_flNewPosesReadyMs", "m_flNewFrameReadyMs", "m_flCompositorUpdateStartMs", "m_flCompositorUpdateEndMs", "m_flCompositorRenderStartMs", "m_HmdPose"); - } - public Compositor_FrameTiming(Pointer peer) { - super(peer); - } - public static class ByReference extends Compositor_FrameTiming implements Structure.ByReference { - - }; - public static class ByValue extends Compositor_FrameTiming implements Structure.ByValue { - - }; + * native declaration : headers\openvr_capi.h:1511
+ * This file was autogenerated by JNAerator,
+ * a tool written by Olivier Chafik that uses a few opensource projects..
+ * For help, please visit NativeLibs4Java , Rococoa, or JNA. + */ +public class Compositor_FrameTiming extends Structure { + public int m_nSize; + public int m_nFrameIndex; + public int m_nNumFramePresents; + public int m_nNumMisPresented; + public int m_nNumDroppedFrames; + public int m_nReprojectionFlags; + public double m_flSystemTimeInSeconds; + public float m_flPreSubmitGpuMs; + public float m_flPostSubmitGpuMs; + public float m_flTotalRenderGpuMs; + public float m_flCompositorRenderGpuMs; + public float m_flCompositorRenderCpuMs; + public float m_flCompositorIdleCpuMs; + public float m_flClientFrameIntervalMs; + public float m_flPresentCallCpuMs; + public float m_flWaitForPresentCpuMs; + public float m_flSubmitFrameMs; + public float m_flWaitGetPosesCalledMs; + public float m_flNewPosesReadyMs; + public float m_flNewFrameReadyMs; + public float m_flCompositorUpdateStartMs; + public float m_flCompositorUpdateEndMs; + public float m_flCompositorRenderStartMs; + /** C type : TrackedDevicePose_t */ + public TrackedDevicePose_t m_HmdPose; + public Compositor_FrameTiming() { + super(); + } + @Override + protected List getFieldOrder() { + return Arrays.asList("m_nSize", "m_nFrameIndex", "m_nNumFramePresents", "m_nNumMisPresented", "m_nNumDroppedFrames", "m_nReprojectionFlags", "m_flSystemTimeInSeconds", "m_flPreSubmitGpuMs", "m_flPostSubmitGpuMs", "m_flTotalRenderGpuMs", "m_flCompositorRenderGpuMs", "m_flCompositorRenderCpuMs", "m_flCompositorIdleCpuMs", "m_flClientFrameIntervalMs", "m_flPresentCallCpuMs", "m_flWaitForPresentCpuMs", "m_flSubmitFrameMs", "m_flWaitGetPosesCalledMs", "m_flNewPosesReadyMs", "m_flNewFrameReadyMs", "m_flCompositorUpdateStartMs", "m_flCompositorUpdateEndMs", "m_flCompositorRenderStartMs", "m_HmdPose"); + } + public Compositor_FrameTiming(Pointer peer) { + super(peer); + } + public static class ByReference extends Compositor_FrameTiming implements Structure.ByReference { + + }; + public static class ByValue extends Compositor_FrameTiming implements Structure.ByValue { + + }; } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/Compositor_OverlaySettings.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/Compositor_OverlaySettings.java index ebc1e88b7e..3afba14f1d 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/Compositor_OverlaySettings.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/Compositor_OverlaySettings.java @@ -4,40 +4,41 @@ import java.util.Arrays; import java.util.List; /** - * native declaration : headers\openvr_capi.h:1452
- * This file was autogenerated by JNAerator,
- * a tool written by Olivier Chafik that uses a few opensource projects..
- * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class Compositor_OverlaySettings extends Structure { - public int size; - public byte curved; - public byte antialias; - public float scale; - public float distance; - public float alpha; - public float uOffset; - public float vOffset; - public float uScale; - public float vScale; - public float gridDivs; - public float gridWidth; - public float gridScale; - /** C type : HmdMatrix44_t */ - public HmdMatrix44_t transform; - public Compositor_OverlaySettings() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("size", "curved", "antialias", "scale", "distance", "alpha", "uOffset", "vOffset", "uScale", "vScale", "gridDivs", "gridWidth", "gridScale", "transform"); - } - public Compositor_OverlaySettings(Pointer peer) { - super(peer); - } - public static class ByReference extends Compositor_OverlaySettings implements Structure.ByReference { - - }; - public static class ByValue extends Compositor_OverlaySettings implements Structure.ByValue { - - }; + * native declaration : headers\openvr_capi.h:1452
+ * This file was autogenerated by JNAerator,
+ * a tool written by Olivier Chafik that uses a few opensource projects..
+ * For help, please visit NativeLibs4Java , Rococoa, or JNA. + */ +public class Compositor_OverlaySettings extends Structure { + public int size; + public byte curved; + public byte antialias; + public float scale; + public float distance; + public float alpha; + public float uOffset; + public float vOffset; + public float uScale; + public float vScale; + public float gridDivs; + public float gridWidth; + public float gridScale; + /** C type : HmdMatrix44_t */ + public HmdMatrix44_t transform; + public Compositor_OverlaySettings() { + super(); + } + @Override + protected List getFieldOrder() { + return Arrays.asList("size", "curved", "antialias", "scale", "distance", "alpha", "uOffset", "vOffset", "uScale", "vScale", "gridDivs", "gridWidth", "gridScale", "transform"); + } + public Compositor_OverlaySettings(Pointer peer) { + super(peer); + } + public static class ByReference extends Compositor_OverlaySettings implements Structure.ByReference { + + }; + public static class ByValue extends Compositor_OverlaySettings implements Structure.ByValue { + + }; } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/D3D12TextureData_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/D3D12TextureData_t.java index f6769e3e17..c902ad237a 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/D3D12TextureData_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/D3D12TextureData_t.java @@ -6,48 +6,49 @@ import java.util.Arrays; import java.util.List; /** - * native declaration : headers\openvr_capi.h:1301
- * This file was autogenerated by JNAerator,
- * a tool written by Olivier Chafik that uses a few opensource projects..
- * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class D3D12TextureData_t extends Structure { + * native declaration : headers\openvr_capi.h:1301
+ * This file was autogenerated by JNAerator,
+ * a tool written by Olivier Chafik that uses a few opensource projects..
+ * For help, please visit NativeLibs4Java , Rococoa, or JNA. + */ +public class D3D12TextureData_t extends Structure { /** - * struct ID3D12Resource *
- * C type : ID3D12Resource* - */ - public ID3D12Resource m_pResource; + * struct ID3D12Resource *
+ * C type : ID3D12Resource* + */ + public ID3D12Resource m_pResource; /** - * struct ID3D12CommandQueue *
- * C type : ID3D12CommandQueue* - */ - public ID3D12CommandQueue m_pCommandQueue; - public int m_nNodeMask; - public D3D12TextureData_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("m_pResource", "m_pCommandQueue", "m_nNodeMask"); - } + * struct ID3D12CommandQueue *
+ * C type : ID3D12CommandQueue* + */ + public ID3D12CommandQueue m_pCommandQueue; + public int m_nNodeMask; + public D3D12TextureData_t() { + super(); + } + @Override + protected List getFieldOrder() { + return Arrays.asList("m_pResource", "m_pCommandQueue", "m_nNodeMask"); + } /** - * @param m_pResource struct ID3D12Resource *
- * C type : ID3D12Resource*
- * @param m_pCommandQueue struct ID3D12CommandQueue *
- * C type : ID3D12CommandQueue* - */ - public D3D12TextureData_t(ID3D12Resource m_pResource, ID3D12CommandQueue m_pCommandQueue, int m_nNodeMask) { - super(); - this.m_pResource = m_pResource; - this.m_pCommandQueue = m_pCommandQueue; - this.m_nNodeMask = m_nNodeMask; - } - public D3D12TextureData_t(Pointer peer) { - super(peer); - } - public static class ByReference extends D3D12TextureData_t implements Structure.ByReference { - - }; - public static class ByValue extends D3D12TextureData_t implements Structure.ByValue { - - }; + * @param m_pResource struct ID3D12Resource *
+ * C type : ID3D12Resource*
+ * @param m_pCommandQueue struct ID3D12CommandQueue *
+ * C type : ID3D12CommandQueue* + */ + public D3D12TextureData_t(ID3D12Resource m_pResource, ID3D12CommandQueue m_pCommandQueue, int m_nNodeMask) { + super(); + this.m_pResource = m_pResource; + this.m_pCommandQueue = m_pCommandQueue; + this.m_nNodeMask = m_nNodeMask; + } + public D3D12TextureData_t(Pointer peer) { + super(peer); + } + public static class ByReference extends D3D12TextureData_t implements Structure.ByReference { + + }; + public static class ByValue extends D3D12TextureData_t implements Structure.ByValue { + + }; } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/DistortionCoordinates_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/DistortionCoordinates_t.java index e2f61e38d0..59e0ab3dd1 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/DistortionCoordinates_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/DistortionCoordinates_t.java @@ -4,60 +4,61 @@ import java.util.Arrays; import java.util.List; /** - * native declaration : headers\openvr_capi.h:1237
- * This file was autogenerated by JNAerator,
- * a tool written by Olivier Chafik that uses a few opensource projects..
- * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class DistortionCoordinates_t extends Structure { + * native declaration : headers\openvr_capi.h:1237
+ * This file was autogenerated by JNAerator,
+ * a tool written by Olivier Chafik that uses a few opensource projects..
+ * For help, please visit NativeLibs4Java , Rococoa, or JNA. + */ +public class DistortionCoordinates_t extends Structure { /** - * float[2]
- * C type : float[2] - */ - public float[] rfRed = new float[2]; + * float[2]
+ * C type : float[2] + */ + public float[] rfRed = new float[2]; /** - * float[2]
- * C type : float[2] - */ - public float[] rfGreen = new float[2]; + * float[2]
+ * C type : float[2] + */ + public float[] rfGreen = new float[2]; /** - * float[2]
- * C type : float[2] - */ - public float[] rfBlue = new float[2]; - public DistortionCoordinates_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("rfRed", "rfGreen", "rfBlue"); - } + * float[2]
+ * C type : float[2] + */ + public float[] rfBlue = new float[2]; + public DistortionCoordinates_t() { + super(); + } + @Override + protected List getFieldOrder() { + return Arrays.asList("rfRed", "rfGreen", "rfBlue"); + } /** - * @param rfRed float[2]
- * C type : float[2]
- * @param rfGreen float[2]
- * C type : float[2]
- * @param rfBlue float[2]
- * C type : float[2] - */ - public DistortionCoordinates_t(float rfRed[], float rfGreen[], float rfBlue[]) { - super(); - if ((rfRed.length != this.rfRed.length)) - throw new IllegalArgumentException("Wrong array size !"); - this.rfRed = rfRed; - if ((rfGreen.length != this.rfGreen.length)) - throw new IllegalArgumentException("Wrong array size !"); - this.rfGreen = rfGreen; - if ((rfBlue.length != this.rfBlue.length)) - throw new IllegalArgumentException("Wrong array size !"); - this.rfBlue = rfBlue; - } - public DistortionCoordinates_t(Pointer peer) { - super(peer); - } - public static class ByReference extends DistortionCoordinates_t implements Structure.ByReference { - - }; - public static class ByValue extends DistortionCoordinates_t implements Structure.ByValue { - - }; + * @param rfRed float[2]
+ * C type : float[2]
+ * @param rfGreen float[2]
+ * C type : float[2]
+ * @param rfBlue float[2]
+ * C type : float[2] + */ + public DistortionCoordinates_t(float rfRed[], float rfGreen[], float rfBlue[]) { + super(); + if ((rfRed.length != this.rfRed.length)) + throw new IllegalArgumentException("Wrong array size !"); + this.rfRed = rfRed; + if ((rfGreen.length != this.rfGreen.length)) + throw new IllegalArgumentException("Wrong array size !"); + this.rfGreen = rfGreen; + if ((rfBlue.length != this.rfBlue.length)) + throw new IllegalArgumentException("Wrong array size !"); + this.rfBlue = rfBlue; + } + public DistortionCoordinates_t(Pointer peer) { + super(peer); + } + public static class ByReference extends DistortionCoordinates_t implements Structure.ByReference { + + }; + public static class ByValue extends DistortionCoordinates_t implements Structure.ByValue { + + }; } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/DriverDirectMode_FrameTiming.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/DriverDirectMode_FrameTiming.java index ca52264aba..4b89bc4746 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/DriverDirectMode_FrameTiming.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/DriverDirectMode_FrameTiming.java @@ -18,6 +18,7 @@ public class DriverDirectMode_FrameTiming extends Structure { public DriverDirectMode_FrameTiming() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("m_nSize", "m_nNumFramePresents", "m_nNumMisPresented", "m_nNumDroppedFrames", "m_nReprojectionFlags"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/HiddenAreaMesh_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/HiddenAreaMesh_t.java index a1850de739..2844685d11 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/HiddenAreaMesh_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/HiddenAreaMesh_t.java @@ -4,40 +4,41 @@ import java.util.Arrays; import java.util.List; /** - * native declaration : headers\openvr_capi.h:1425
- * This file was autogenerated by JNAerator,
- * a tool written by Olivier Chafik that uses a few opensource projects..
- * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class HiddenAreaMesh_t extends Structure { + * native declaration : headers\openvr_capi.h:1425
+ * This file was autogenerated by JNAerator,
+ * a tool written by Olivier Chafik that uses a few opensource projects..
+ * For help, please visit NativeLibs4Java , Rococoa, or JNA. + */ +public class HiddenAreaMesh_t extends Structure { /** - * const struct vr::HmdVector2_t *
- * C type : HmdVector2_t* - */ - public com.jme3.system.jopenvr.HmdVector2_t.ByReference pVertexData; - public int unTriangleCount; - public HiddenAreaMesh_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("pVertexData", "unTriangleCount"); - } + * const struct vr::HmdVector2_t *
+ * C type : HmdVector2_t* + */ + public com.jme3.system.jopenvr.HmdVector2_t.ByReference pVertexData; + public int unTriangleCount; + public HiddenAreaMesh_t() { + super(); + } + @Override + protected List getFieldOrder() { + return Arrays.asList("pVertexData", "unTriangleCount"); + } /** - * @param pVertexData const struct vr::HmdVector2_t *
- * C type : HmdVector2_t* - */ - public HiddenAreaMesh_t(com.jme3.system.jopenvr.HmdVector2_t.ByReference pVertexData, int unTriangleCount) { - super(); - this.pVertexData = pVertexData; - this.unTriangleCount = unTriangleCount; - } - public HiddenAreaMesh_t(Pointer peer) { - super(peer); - } - public static class ByReference extends HiddenAreaMesh_t implements Structure.ByReference { - - }; - public static class ByValue extends HiddenAreaMesh_t implements Structure.ByValue { - - }; + * @param pVertexData const struct vr::HmdVector2_t *
+ * C type : HmdVector2_t* + */ + public HiddenAreaMesh_t(com.jme3.system.jopenvr.HmdVector2_t.ByReference pVertexData, int unTriangleCount) { + super(); + this.pVertexData = pVertexData; + this.unTriangleCount = unTriangleCount; + } + public HiddenAreaMesh_t(Pointer peer) { + super(peer); + } + public static class ByReference extends HiddenAreaMesh_t implements Structure.ByReference { + + }; + public static class ByValue extends HiddenAreaMesh_t implements Structure.ByValue { + + }; } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdColor_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdColor_t.java index 78bedfbcf5..6387f1f0f7 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdColor_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdColor_t.java @@ -4,36 +4,37 @@ import java.util.Arrays; import java.util.List; /** - * native declaration : headers\openvr_capi.h:1221
- * This file was autogenerated by JNAerator,
- * a tool written by Olivier Chafik that uses a few opensource projects..
- * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class HmdColor_t extends Structure { - public float r; - public float g; - public float b; - public float a; - public HmdColor_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("r", "g", "b", "a"); - } - public HmdColor_t(float r, float g, float b, float a) { - super(); - this.r = r; - this.g = g; - this.b = b; - this.a = a; - } - public HmdColor_t(Pointer peer) { - super(peer); - } - public static class ByReference extends HmdColor_t implements Structure.ByReference { - - }; - public static class ByValue extends HmdColor_t implements Structure.ByValue { - - }; + * native declaration : headers\openvr_capi.h:1221
+ * This file was autogenerated by JNAerator,
+ * a tool written by Olivier Chafik that uses a few opensource projects..
+ * For help, please visit NativeLibs4Java , Rococoa, or JNA. + */ +public class HmdColor_t extends Structure { + public float r; + public float g; + public float b; + public float a; + public HmdColor_t() { + super(); + } + @Override + protected List getFieldOrder() { + return Arrays.asList("r", "g", "b", "a"); + } + public HmdColor_t(float r, float g, float b, float a) { + super(); + this.r = r; + this.g = g; + this.b = b; + this.a = a; + } + public HmdColor_t(Pointer peer) { + super(peer); + } + public static class ByReference extends HmdColor_t implements Structure.ByReference { + + }; + public static class ByValue extends HmdColor_t implements Structure.ByValue { + + }; } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdMatrix33_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdMatrix33_t.java index df334358bd..25e7f8d670 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdMatrix33_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdMatrix33_t.java @@ -18,6 +18,7 @@ public class HmdMatrix33_t extends Structure { public HmdMatrix33_t() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("m"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdMatrix34_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdMatrix34_t.java index 6593938053..175bc07f75 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdMatrix34_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdMatrix34_t.java @@ -4,40 +4,41 @@ import java.util.Arrays; import java.util.List; /** - * native declaration : headers\openvr_capi.h:1179
- * This file was autogenerated by JNAerator,
- * a tool written by Olivier Chafik that uses a few opensource projects..
- * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class HmdMatrix34_t extends Structure { + * native declaration : headers\openvr_capi.h:1179
+ * This file was autogenerated by JNAerator,
+ * a tool written by Olivier Chafik that uses a few opensource projects..
+ * For help, please visit NativeLibs4Java , Rococoa, or JNA. + */ +public class HmdMatrix34_t extends Structure { /** - * float[3][4]
- * C type : float[3][4] - */ - public float[] m = new float[((3) * (4))]; - public HmdMatrix34_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("m"); - } + * float[3][4]
+ * C type : float[3][4] + */ + public float[] m = new float[((3) * (4))]; + public HmdMatrix34_t() { + super(); + } + @Override + protected List getFieldOrder() { + return Arrays.asList("m"); + } /** - * @param m float[3][4]
- * C type : float[3][4] - */ - public HmdMatrix34_t(float m[]) { - super(); - if ((m.length != this.m.length)) - throw new IllegalArgumentException("Wrong array size !"); - this.m = m; - } - public HmdMatrix34_t(Pointer peer) { - super(peer); - } - public static class ByReference extends HmdMatrix34_t implements Structure.ByReference { - - }; - public static class ByValue extends HmdMatrix34_t implements Structure.ByValue { - - }; + * @param m float[3][4]
+ * C type : float[3][4] + */ + public HmdMatrix34_t(float m[]) { + super(); + if ((m.length != this.m.length)) + throw new IllegalArgumentException("Wrong array size !"); + this.m = m; + } + public HmdMatrix34_t(Pointer peer) { + super(peer); + } + public static class ByReference extends HmdMatrix34_t implements Structure.ByReference { + + }; + public static class ByValue extends HmdMatrix34_t implements Structure.ByValue { + + }; } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdMatrix44_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdMatrix44_t.java index 216aa73410..2243e8f5fa 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdMatrix44_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdMatrix44_t.java @@ -4,40 +4,41 @@ import java.util.Arrays; import java.util.List; /** - * native declaration : headers\openvr_capi.h:1187
- * This file was autogenerated by JNAerator,
- * a tool written by Olivier Chafik that uses a few opensource projects..
- * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class HmdMatrix44_t extends Structure { + * native declaration : headers\openvr_capi.h:1187
+ * This file was autogenerated by JNAerator,
+ * a tool written by Olivier Chafik that uses a few opensource projects..
+ * For help, please visit NativeLibs4Java , Rococoa, or JNA. + */ +public class HmdMatrix44_t extends Structure { /** - * float[4][4]
- * C type : float[4][4] - */ - public float[] m = new float[((4) * (4))]; - public HmdMatrix44_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("m"); - } + * float[4][4]
+ * C type : float[4][4] + */ + public float[] m = new float[((4) * (4))]; + public HmdMatrix44_t() { + super(); + } + @Override + protected List getFieldOrder() { + return Arrays.asList("m"); + } /** - * @param m float[4][4]
- * C type : float[4][4] - */ - public HmdMatrix44_t(float m[]) { - super(); - if ((m.length != this.m.length)) - throw new IllegalArgumentException("Wrong array size !"); - this.m = m; - } - public HmdMatrix44_t(Pointer peer) { - super(peer); - } - public static class ByReference extends HmdMatrix44_t implements Structure.ByReference { - - }; - public static class ByValue extends HmdMatrix44_t implements Structure.ByValue { - - }; + * @param m float[4][4]
+ * C type : float[4][4] + */ + public HmdMatrix44_t(float m[]) { + super(); + if ((m.length != this.m.length)) + throw new IllegalArgumentException("Wrong array size !"); + this.m = m; + } + public HmdMatrix44_t(Pointer peer) { + super(peer); + } + public static class ByReference extends HmdMatrix44_t implements Structure.ByReference { + + }; + public static class ByValue extends HmdMatrix44_t implements Structure.ByValue { + + }; } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdQuad_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdQuad_t.java index 0142d8ef13..28abf8f754 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdQuad_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdQuad_t.java @@ -4,40 +4,41 @@ import java.util.Arrays; import java.util.List; /** - * native declaration : headers\openvr_capi.h:1225
- * This file was autogenerated by JNAerator,
- * a tool written by Olivier Chafik that uses a few opensource projects..
- * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class HmdQuad_t extends Structure { + * native declaration : headers\openvr_capi.h:1225
+ * This file was autogenerated by JNAerator,
+ * a tool written by Olivier Chafik that uses a few opensource projects..
+ * For help, please visit NativeLibs4Java , Rococoa, or JNA. + */ +public class HmdQuad_t extends Structure { /** - * struct vr::HmdVector3_t[4]
- * C type : HmdVector3_t[4] - */ - public HmdVector3_t[] vCorners = new HmdVector3_t[4]; - public HmdQuad_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("vCorners"); - } + * struct vr::HmdVector3_t[4]
+ * C type : HmdVector3_t[4] + */ + public HmdVector3_t[] vCorners = new HmdVector3_t[4]; + public HmdQuad_t() { + super(); + } + @Override + protected List getFieldOrder() { + return Arrays.asList("vCorners"); + } /** - * @param vCorners struct vr::HmdVector3_t[4]
- * C type : HmdVector3_t[4] - */ - public HmdQuad_t(HmdVector3_t vCorners[]) { - super(); - if ((vCorners.length != this.vCorners.length)) - throw new IllegalArgumentException("Wrong array size !"); - this.vCorners = vCorners; - } - public HmdQuad_t(Pointer peer) { - super(peer); - } - public static class ByReference extends HmdQuad_t implements Structure.ByReference { - - }; - public static class ByValue extends HmdQuad_t implements Structure.ByValue { - - }; + * @param vCorners struct vr::HmdVector3_t[4]
+ * C type : HmdVector3_t[4] + */ + public HmdQuad_t(HmdVector3_t vCorners[]) { + super(); + if ((vCorners.length != this.vCorners.length)) + throw new IllegalArgumentException("Wrong array size !"); + this.vCorners = vCorners; + } + public HmdQuad_t(Pointer peer) { + super(peer); + } + public static class ByReference extends HmdQuad_t implements Structure.ByReference { + + }; + public static class ByValue extends HmdQuad_t implements Structure.ByValue { + + }; } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdQuaternion_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdQuaternion_t.java index fb0073ee79..d26c2acfef 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdQuaternion_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdQuaternion_t.java @@ -4,36 +4,37 @@ import java.util.Arrays; import java.util.List; /** - * native declaration : headers\openvr_capi.h:1209
- * This file was autogenerated by JNAerator,
- * a tool written by Olivier Chafik that uses a few opensource projects..
- * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class HmdQuaternion_t extends Structure { - public double w; - public double x; - public double y; - public double z; - public HmdQuaternion_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("w", "x", "y", "z"); - } - public HmdQuaternion_t(double w, double x, double y, double z) { - super(); - this.w = w; - this.x = x; - this.y = y; - this.z = z; - } - public HmdQuaternion_t(Pointer peer) { - super(peer); - } - public static class ByReference extends HmdQuaternion_t implements Structure.ByReference { - - }; - public static class ByValue extends HmdQuaternion_t implements Structure.ByValue { - - }; + * native declaration : headers\openvr_capi.h:1209
+ * This file was autogenerated by JNAerator,
+ * a tool written by Olivier Chafik that uses a few opensource projects..
+ * For help, please visit NativeLibs4Java , Rococoa, or JNA. + */ +public class HmdQuaternion_t extends Structure { + public double w; + public double x; + public double y; + public double z; + public HmdQuaternion_t() { + super(); + } + @Override + protected List getFieldOrder() { + return Arrays.asList("w", "x", "y", "z"); + } + public HmdQuaternion_t(double w, double x, double y, double z) { + super(); + this.w = w; + this.x = x; + this.y = y; + this.z = z; + } + public HmdQuaternion_t(Pointer peer) { + super(peer); + } + public static class ByReference extends HmdQuaternion_t implements Structure.ByReference { + + }; + public static class ByValue extends HmdQuaternion_t implements Structure.ByValue { + + }; } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdQuaternionf_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdQuaternionf_t.java index 6a7b963d6b..b24d5c071d 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdQuaternionf_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdQuaternionf_t.java @@ -17,6 +17,7 @@ public class HmdQuaternionf_t extends Structure { public HmdQuaternionf_t() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("w", "x", "y", "z"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdRect2_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdRect2_t.java index 210843deb6..a8c25431db 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdRect2_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdRect2_t.java @@ -4,38 +4,39 @@ import java.util.Arrays; import java.util.List; /** - * native declaration : headers\openvr_capi.h:1229
- * This file was autogenerated by JNAerator,
- * a tool written by Olivier Chafik that uses a few opensource projects..
- * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class HmdRect2_t extends Structure { - /** C type : HmdVector2_t */ - public HmdVector2_t vTopLeft; - /** C type : HmdVector2_t */ - public HmdVector2_t vBottomRight; - public HmdRect2_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("vTopLeft", "vBottomRight"); - } + * native declaration : headers\openvr_capi.h:1229
+ * This file was autogenerated by JNAerator,
+ * a tool written by Olivier Chafik that uses a few opensource projects..
+ * For help, please visit NativeLibs4Java , Rococoa, or JNA. + */ +public class HmdRect2_t extends Structure { + /** C type : HmdVector2_t */ + public HmdVector2_t vTopLeft; + /** C type : HmdVector2_t */ + public HmdVector2_t vBottomRight; + public HmdRect2_t() { + super(); + } + @Override + protected List getFieldOrder() { + return Arrays.asList("vTopLeft", "vBottomRight"); + } /** - * @param vTopLeft C type : HmdVector2_t
- * @param vBottomRight C type : HmdVector2_t - */ - public HmdRect2_t(HmdVector2_t vTopLeft, HmdVector2_t vBottomRight) { - super(); - this.vTopLeft = vTopLeft; - this.vBottomRight = vBottomRight; - } - public HmdRect2_t(Pointer peer) { - super(peer); - } - public static class ByReference extends HmdRect2_t implements Structure.ByReference { - - }; - public static class ByValue extends HmdRect2_t implements Structure.ByValue { - - }; + * @param vTopLeft C type : HmdVector2_t
+ * @param vBottomRight C type : HmdVector2_t + */ + public HmdRect2_t(HmdVector2_t vTopLeft, HmdVector2_t vBottomRight) { + super(); + this.vTopLeft = vTopLeft; + this.vBottomRight = vBottomRight; + } + public HmdRect2_t(Pointer peer) { + super(peer); + } + public static class ByReference extends HmdRect2_t implements Structure.ByReference { + + }; + public static class ByValue extends HmdRect2_t implements Structure.ByValue { + + }; } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdVector2_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdVector2_t.java index 7a885d4c7d..f66240574d 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdVector2_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdVector2_t.java @@ -4,40 +4,41 @@ import java.util.Arrays; import java.util.List; /** - * native declaration : headers\openvr_capi.h:1203
- * This file was autogenerated by JNAerator,
- * a tool written by Olivier Chafik that uses a few opensource projects..
- * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class HmdVector2_t extends Structure { + * native declaration : headers\openvr_capi.h:1203
+ * This file was autogenerated by JNAerator,
+ * a tool written by Olivier Chafik that uses a few opensource projects..
+ * For help, please visit NativeLibs4Java , Rococoa, or JNA. + */ +public class HmdVector2_t extends Structure { /** - * float[2]
- * C type : float[2] - */ - public float[] v = new float[2]; - public HmdVector2_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("v"); - } + * float[2]
+ * C type : float[2] + */ + public float[] v = new float[2]; + public HmdVector2_t() { + super(); + } + @Override + protected List getFieldOrder() { + return Arrays.asList("v"); + } /** - * @param v float[2]
- * C type : float[2] - */ - public HmdVector2_t(float v[]) { - super(); - if ((v.length != this.v.length)) - throw new IllegalArgumentException("Wrong array size !"); - this.v = v; - } - public HmdVector2_t(Pointer peer) { - super(peer); - } - public static class ByReference extends HmdVector2_t implements Structure.ByReference { - - }; - public static class ByValue extends HmdVector2_t implements Structure.ByValue { - - }; + * @param v float[2]
+ * C type : float[2] + */ + public HmdVector2_t(float v[]) { + super(); + if ((v.length != this.v.length)) + throw new IllegalArgumentException("Wrong array size !"); + this.v = v; + } + public HmdVector2_t(Pointer peer) { + super(peer); + } + public static class ByReference extends HmdVector2_t implements Structure.ByReference { + + }; + public static class ByValue extends HmdVector2_t implements Structure.ByValue { + + }; } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdVector3_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdVector3_t.java index ed87e69916..92ad299605 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdVector3_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdVector3_t.java @@ -4,40 +4,41 @@ import java.util.Arrays; import java.util.List; /** - * native declaration : headers\openvr_capi.h:1191
- * This file was autogenerated by JNAerator,
- * a tool written by Olivier Chafik that uses a few opensource projects..
- * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class HmdVector3_t extends Structure { + * native declaration : headers\openvr_capi.h:1191
+ * This file was autogenerated by JNAerator,
+ * a tool written by Olivier Chafik that uses a few opensource projects..
+ * For help, please visit NativeLibs4Java , Rococoa, or JNA. + */ +public class HmdVector3_t extends Structure { /** - * float[3]
- * C type : float[3] - */ - public float[] v = new float[3]; - public HmdVector3_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("v"); - } + * float[3]
+ * C type : float[3] + */ + public float[] v = new float[3]; + public HmdVector3_t() { + super(); + } + @Override + protected List getFieldOrder() { + return Arrays.asList("v"); + } /** - * @param v float[3]
- * C type : float[3] - */ - public HmdVector3_t(float v[]) { - super(); - if ((v.length != this.v.length)) - throw new IllegalArgumentException("Wrong array size !"); - this.v = v; - } - public HmdVector3_t(Pointer peer) { - super(peer); - } - public static class ByReference extends HmdVector3_t implements Structure.ByReference { - - }; - public static class ByValue extends HmdVector3_t implements Structure.ByValue { - - }; + * @param v float[3]
+ * C type : float[3] + */ + public HmdVector3_t(float v[]) { + super(); + if ((v.length != this.v.length)) + throw new IllegalArgumentException("Wrong array size !"); + this.v = v; + } + public HmdVector3_t(Pointer peer) { + super(peer); + } + public static class ByReference extends HmdVector3_t implements Structure.ByReference { + + }; + public static class ByValue extends HmdVector3_t implements Structure.ByValue { + + }; } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdVector3d_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdVector3d_t.java index 1b1bfe2b9c..7bde50647c 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdVector3d_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdVector3d_t.java @@ -4,40 +4,41 @@ import java.util.Arrays; import java.util.List; /** - * native declaration : headers\openvr_capi.h:1199
- * This file was autogenerated by JNAerator,
- * a tool written by Olivier Chafik that uses a few opensource projects..
- * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class HmdVector3d_t extends Structure { + * native declaration : headers\openvr_capi.h:1199
+ * This file was autogenerated by JNAerator,
+ * a tool written by Olivier Chafik that uses a few opensource projects..
+ * For help, please visit NativeLibs4Java , Rococoa, or JNA. + */ +public class HmdVector3d_t extends Structure { /** - * double[3]
- * C type : double[3] - */ - public double[] v = new double[3]; - public HmdVector3d_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("v"); - } + * double[3]
+ * C type : double[3] + */ + public double[] v = new double[3]; + public HmdVector3d_t() { + super(); + } + @Override + protected List getFieldOrder() { + return Arrays.asList("v"); + } /** - * @param v double[3]
- * C type : double[3] - */ - public HmdVector3d_t(double v[]) { - super(); - if ((v.length != this.v.length)) - throw new IllegalArgumentException("Wrong array size !"); - this.v = v; - } - public HmdVector3d_t(Pointer peer) { - super(peer); - } - public static class ByReference extends HmdVector3d_t implements Structure.ByReference { - - }; - public static class ByValue extends HmdVector3d_t implements Structure.ByValue { - - }; + * @param v double[3]
+ * C type : double[3] + */ + public HmdVector3d_t(double v[]) { + super(); + if ((v.length != this.v.length)) + throw new IllegalArgumentException("Wrong array size !"); + this.v = v; + } + public HmdVector3d_t(Pointer peer) { + super(peer); + } + public static class ByReference extends HmdVector3d_t implements Structure.ByReference { + + }; + public static class ByValue extends HmdVector3d_t implements Structure.ByValue { + + }; } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdVector4_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdVector4_t.java index b022e05d61..1db01177cf 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdVector4_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/HmdVector4_t.java @@ -4,40 +4,41 @@ import java.util.Arrays; import java.util.List; /** - * native declaration : headers\openvr_capi.h:1195
- * This file was autogenerated by JNAerator,
- * a tool written by Olivier Chafik that uses a few opensource projects..
- * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class HmdVector4_t extends Structure { + * native declaration : headers\openvr_capi.h:1195
+ * This file was autogenerated by JNAerator,
+ * a tool written by Olivier Chafik that uses a few opensource projects..
+ * For help, please visit NativeLibs4Java , Rococoa, or JNA. + */ +public class HmdVector4_t extends Structure { /** - * float[4]
- * C type : float[4] - */ - public float[] v = new float[4]; - public HmdVector4_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("v"); - } + * float[4]
+ * C type : float[4] + */ + public float[] v = new float[4]; + public HmdVector4_t() { + super(); + } + @Override + protected List getFieldOrder() { + return Arrays.asList("v"); + } /** - * @param v float[4]
- * C type : float[4] - */ - public HmdVector4_t(float v[]) { - super(); - if ((v.length != this.v.length)) - throw new IllegalArgumentException("Wrong array size !"); - this.v = v; - } - public HmdVector4_t(Pointer peer) { - super(peer); - } - public static class ByReference extends HmdVector4_t implements Structure.ByReference { - - }; - public static class ByValue extends HmdVector4_t implements Structure.ByValue { - - }; + * @param v float[4]
+ * C type : float[4] + */ + public HmdVector4_t(float v[]) { + super(); + if ((v.length != this.v.length)) + throw new IllegalArgumentException("Wrong array size !"); + this.v = v; + } + public HmdVector4_t(Pointer peer) { + super(peer); + } + public static class ByReference extends HmdVector4_t implements Structure.ByReference { + + }; + public static class ByValue extends HmdVector4_t implements Structure.ByValue { + + }; } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/ImuSample_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/ImuSample_t.java index 799893d2eb..1cadc4b7f2 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/ImuSample_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/ImuSample_t.java @@ -19,6 +19,7 @@ public class ImuSample_t extends Structure { public ImuSample_t() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("fSampleTime", "vAccel", "vGyro", "unOffScaleFlags"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/InputAnalogActionData_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/InputAnalogActionData_t.java index 61fee6243c..7f7a2a6922 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/InputAnalogActionData_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/InputAnalogActionData_t.java @@ -23,6 +23,7 @@ public class InputAnalogActionData_t extends Structure { public InputAnalogActionData_t() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("bActive", "activeOrigin", "x", "y", "z", "deltaX", "deltaY", "deltaZ", "fUpdateTime"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/InputDigitalActionData_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/InputDigitalActionData_t.java index 7325022eea..3b212e44af 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/InputDigitalActionData_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/InputDigitalActionData_t.java @@ -19,6 +19,7 @@ public class InputDigitalActionData_t extends Structure { public InputDigitalActionData_t() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("bActive", "activeOrigin", "bState", "bChanged", "fUpdateTime"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/InputOriginInfo_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/InputOriginInfo_t.java index f63555b8cc..eff72867ae 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/InputOriginInfo_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/InputOriginInfo_t.java @@ -22,6 +22,7 @@ public class InputOriginInfo_t extends Structure { public InputOriginInfo_t() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("devicePath", "trackedDeviceIndex", "rchRenderModelComponentName"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/InputPoseActionData_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/InputPoseActionData_t.java index 747493078a..bc375f1a57 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/InputPoseActionData_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/InputPoseActionData_t.java @@ -18,6 +18,7 @@ public class InputPoseActionData_t extends Structure { public InputPoseActionData_t() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("bActive", "activeOrigin", "pose"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/InputSkeletalActionData_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/InputSkeletalActionData_t.java index d9d32b9516..8d1f26514b 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/InputSkeletalActionData_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/InputSkeletalActionData_t.java @@ -17,6 +17,7 @@ public class InputSkeletalActionData_t extends Structure { public InputSkeletalActionData_t() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("bActive", "activeOrigin", "boneCount"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/IntersectionMaskCircle_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/IntersectionMaskCircle_t.java index 631a127a95..8c994f84ba 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/IntersectionMaskCircle_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/IntersectionMaskCircle_t.java @@ -4,34 +4,35 @@ import java.util.Arrays; import java.util.List; /** - * native declaration : headers\openvr_capi.h:1552
- * This file was autogenerated by JNAerator,
- * a tool written by Olivier Chafik that uses a few opensource projects..
- * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class IntersectionMaskCircle_t extends Structure { - public float m_flCenterX; - public float m_flCenterY; - public float m_flRadius; - public IntersectionMaskCircle_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("m_flCenterX", "m_flCenterY", "m_flRadius"); - } - public IntersectionMaskCircle_t(float m_flCenterX, float m_flCenterY, float m_flRadius) { - super(); - this.m_flCenterX = m_flCenterX; - this.m_flCenterY = m_flCenterY; - this.m_flRadius = m_flRadius; - } - public IntersectionMaskCircle_t(Pointer peer) { - super(peer); - } - public static class ByReference extends IntersectionMaskCircle_t implements Structure.ByReference { - - }; - public static class ByValue extends IntersectionMaskCircle_t implements Structure.ByValue { - - }; + * native declaration : headers\openvr_capi.h:1552
+ * This file was autogenerated by JNAerator,
+ * a tool written by Olivier Chafik that uses a few opensource projects..
+ * For help, please visit NativeLibs4Java , Rococoa, or JNA. + */ +public class IntersectionMaskCircle_t extends Structure { + public float m_flCenterX; + public float m_flCenterY; + public float m_flRadius; + public IntersectionMaskCircle_t() { + super(); + } + @Override + protected List getFieldOrder() { + return Arrays.asList("m_flCenterX", "m_flCenterY", "m_flRadius"); + } + public IntersectionMaskCircle_t(float m_flCenterX, float m_flCenterY, float m_flRadius) { + super(); + this.m_flCenterX = m_flCenterX; + this.m_flCenterY = m_flCenterY; + this.m_flRadius = m_flRadius; + } + public IntersectionMaskCircle_t(Pointer peer) { + super(peer); + } + public static class ByReference extends IntersectionMaskCircle_t implements Structure.ByReference { + + }; + public static class ByValue extends IntersectionMaskCircle_t implements Structure.ByValue { + + }; } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/IntersectionMaskRectangle_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/IntersectionMaskRectangle_t.java index bbb4c0f578..e33a836db9 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/IntersectionMaskRectangle_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/IntersectionMaskRectangle_t.java @@ -4,36 +4,37 @@ import java.util.Arrays; import java.util.List; /** - * native declaration : headers\openvr_capi.h:1547
- * This file was autogenerated by JNAerator,
- * a tool written by Olivier Chafik that uses a few opensource projects..
- * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class IntersectionMaskRectangle_t extends Structure { - public float m_flTopLeftX; - public float m_flTopLeftY; - public float m_flWidth; - public float m_flHeight; - public IntersectionMaskRectangle_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("m_flTopLeftX", "m_flTopLeftY", "m_flWidth", "m_flHeight"); - } - public IntersectionMaskRectangle_t(float m_flTopLeftX, float m_flTopLeftY, float m_flWidth, float m_flHeight) { - super(); - this.m_flTopLeftX = m_flTopLeftX; - this.m_flTopLeftY = m_flTopLeftY; - this.m_flWidth = m_flWidth; - this.m_flHeight = m_flHeight; - } - public IntersectionMaskRectangle_t(Pointer peer) { - super(peer); - } - public static class ByReference extends IntersectionMaskRectangle_t implements Structure.ByReference { - - }; - public static class ByValue extends IntersectionMaskRectangle_t implements Structure.ByValue { - - }; + * native declaration : headers\openvr_capi.h:1547
+ * This file was autogenerated by JNAerator,
+ * a tool written by Olivier Chafik that uses a few opensource projects..
+ * For help, please visit NativeLibs4Java , Rococoa, or JNA. + */ +public class IntersectionMaskRectangle_t extends Structure { + public float m_flTopLeftX; + public float m_flTopLeftY; + public float m_flWidth; + public float m_flHeight; + public IntersectionMaskRectangle_t() { + super(); + } + @Override + protected List getFieldOrder() { + return Arrays.asList("m_flTopLeftX", "m_flTopLeftY", "m_flWidth", "m_flHeight"); + } + public IntersectionMaskRectangle_t(float m_flTopLeftX, float m_flTopLeftY, float m_flWidth, float m_flHeight) { + super(); + this.m_flTopLeftX = m_flTopLeftX; + this.m_flTopLeftY = m_flTopLeftY; + this.m_flWidth = m_flWidth; + this.m_flHeight = m_flHeight; + } + public IntersectionMaskRectangle_t(Pointer peer) { + super(peer); + } + public static class ByReference extends IntersectionMaskRectangle_t implements Structure.ByReference { + + }; + public static class ByValue extends IntersectionMaskRectangle_t implements Structure.ByValue { + + }; } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/NotificationBitmap_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/NotificationBitmap_t.java index 217eedb2c5..b9aaffe311 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/NotificationBitmap_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/NotificationBitmap_t.java @@ -4,44 +4,45 @@ import java.util.Arrays; import java.util.List; /** - * native declaration : headers\openvr_capi.h:1588
- * This file was autogenerated by JNAerator,
- * a tool written by Olivier Chafik that uses a few opensource projects..
- * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class NotificationBitmap_t extends Structure { + * native declaration : headers\openvr_capi.h:1588
+ * This file was autogenerated by JNAerator,
+ * a tool written by Olivier Chafik that uses a few opensource projects..
+ * For help, please visit NativeLibs4Java , Rococoa, or JNA. + */ +public class NotificationBitmap_t extends Structure { /** - * void *
- * C type : void* - */ - public Pointer m_pImageData; - public int m_nWidth; - public int m_nHeight; - public int m_nBytesPerPixel; - public NotificationBitmap_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("m_pImageData", "m_nWidth", "m_nHeight", "m_nBytesPerPixel"); - } + * void *
+ * C type : void* + */ + public Pointer m_pImageData; + public int m_nWidth; + public int m_nHeight; + public int m_nBytesPerPixel; + public NotificationBitmap_t() { + super(); + } + @Override + protected List getFieldOrder() { + return Arrays.asList("m_pImageData", "m_nWidth", "m_nHeight", "m_nBytesPerPixel"); + } /** - * @param m_pImageData void *
- * C type : void* - */ - public NotificationBitmap_t(Pointer m_pImageData, int m_nWidth, int m_nHeight, int m_nBytesPerPixel) { - super(); - this.m_pImageData = m_pImageData; - this.m_nWidth = m_nWidth; - this.m_nHeight = m_nHeight; - this.m_nBytesPerPixel = m_nBytesPerPixel; - } - public NotificationBitmap_t(Pointer peer) { - super(peer); - } - public static class ByReference extends NotificationBitmap_t implements Structure.ByReference { - - }; - public static class ByValue extends NotificationBitmap_t implements Structure.ByValue { - - }; + * @param m_pImageData void *
+ * C type : void* + */ + public NotificationBitmap_t(Pointer m_pImageData, int m_nWidth, int m_nHeight, int m_nBytesPerPixel) { + super(); + this.m_pImageData = m_pImageData; + this.m_nWidth = m_nWidth; + this.m_nHeight = m_nHeight; + this.m_nBytesPerPixel = m_nBytesPerPixel; + } + public NotificationBitmap_t(Pointer peer) { + super(peer); + } + public static class ByReference extends NotificationBitmap_t implements Structure.ByReference { + + }; + public static class ByValue extends NotificationBitmap_t implements Structure.ByValue { + + }; } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/RenderModel_ComponentState_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/RenderModel_ComponentState_t.java index a55f51b933..7e72d93c88 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/RenderModel_ComponentState_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/RenderModel_ComponentState_t.java @@ -4,42 +4,43 @@ import java.util.Arrays; import java.util.List; /** - * native declaration : headers\openvr_capi.h:1557
- * This file was autogenerated by JNAerator,
- * a tool written by Olivier Chafik that uses a few opensource projects..
- * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class RenderModel_ComponentState_t extends Structure { - /** C type : HmdMatrix34_t */ - public HmdMatrix34_t mTrackingToComponentRenderModel; - /** C type : HmdMatrix34_t */ - public HmdMatrix34_t mTrackingToComponentLocal; - /** C type : VRComponentProperties */ - public int uProperties; - public RenderModel_ComponentState_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("mTrackingToComponentRenderModel", "mTrackingToComponentLocal", "uProperties"); - } + * native declaration : headers\openvr_capi.h:1557
+ * This file was autogenerated by JNAerator,
+ * a tool written by Olivier Chafik that uses a few opensource projects..
+ * For help, please visit NativeLibs4Java , Rococoa, or JNA. + */ +public class RenderModel_ComponentState_t extends Structure { + /** C type : HmdMatrix34_t */ + public HmdMatrix34_t mTrackingToComponentRenderModel; + /** C type : HmdMatrix34_t */ + public HmdMatrix34_t mTrackingToComponentLocal; + /** C type : VRComponentProperties */ + public int uProperties; + public RenderModel_ComponentState_t() { + super(); + } + @Override + protected List getFieldOrder() { + return Arrays.asList("mTrackingToComponentRenderModel", "mTrackingToComponentLocal", "uProperties"); + } /** - * @param mTrackingToComponentRenderModel C type : HmdMatrix34_t
- * @param mTrackingToComponentLocal C type : HmdMatrix34_t
- * @param uProperties C type : VRComponentProperties - */ - public RenderModel_ComponentState_t(HmdMatrix34_t mTrackingToComponentRenderModel, HmdMatrix34_t mTrackingToComponentLocal, int uProperties) { - super(); - this.mTrackingToComponentRenderModel = mTrackingToComponentRenderModel; - this.mTrackingToComponentLocal = mTrackingToComponentLocal; - this.uProperties = uProperties; - } - public RenderModel_ComponentState_t(Pointer peer) { - super(peer); - } - public static class ByReference extends RenderModel_ComponentState_t implements Structure.ByReference { - - }; - public static class ByValue extends RenderModel_ComponentState_t implements Structure.ByValue { - - }; + * @param mTrackingToComponentRenderModel C type : HmdMatrix34_t
+ * @param mTrackingToComponentLocal C type : HmdMatrix34_t
+ * @param uProperties C type : VRComponentProperties + */ + public RenderModel_ComponentState_t(HmdMatrix34_t mTrackingToComponentRenderModel, HmdMatrix34_t mTrackingToComponentLocal, int uProperties) { + super(); + this.mTrackingToComponentRenderModel = mTrackingToComponentRenderModel; + this.mTrackingToComponentLocal = mTrackingToComponentLocal; + this.uProperties = uProperties; + } + public RenderModel_ComponentState_t(Pointer peer) { + super(peer); + } + public static class ByReference extends RenderModel_ComponentState_t implements Structure.ByReference { + + }; + public static class ByValue extends RenderModel_ComponentState_t implements Structure.ByValue { + + }; } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/RenderModel_ControllerMode_State_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/RenderModel_ControllerMode_State_t.java index 5d5e45d57d..cf1eac008f 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/RenderModel_ControllerMode_State_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/RenderModel_ControllerMode_State_t.java @@ -4,30 +4,31 @@ import java.util.Arrays; import java.util.List; /** - * native declaration : headers\openvr_capi.h:1581
- * This file was autogenerated by JNAerator,
- * a tool written by Olivier Chafik that uses a few opensource projects..
- * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class RenderModel_ControllerMode_State_t extends Structure { - public byte bScrollWheelVisible; - public RenderModel_ControllerMode_State_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("bScrollWheelVisible"); - } - public RenderModel_ControllerMode_State_t(byte bScrollWheelVisible) { - super(); - this.bScrollWheelVisible = bScrollWheelVisible; - } - public RenderModel_ControllerMode_State_t(Pointer peer) { - super(peer); - } - public static class ByReference extends RenderModel_ControllerMode_State_t implements Structure.ByReference { - - }; - public static class ByValue extends RenderModel_ControllerMode_State_t implements Structure.ByValue { - - }; + * native declaration : headers\openvr_capi.h:1581
+ * This file was autogenerated by JNAerator,
+ * a tool written by Olivier Chafik that uses a few opensource projects..
+ * For help, please visit NativeLibs4Java , Rococoa, or JNA. + */ +public class RenderModel_ControllerMode_State_t extends Structure { + public byte bScrollWheelVisible; + public RenderModel_ControllerMode_State_t() { + super(); + } + @Override + protected List getFieldOrder() { + return Arrays.asList("bScrollWheelVisible"); + } + public RenderModel_ControllerMode_State_t(byte bScrollWheelVisible) { + super(); + this.bScrollWheelVisible = bScrollWheelVisible; + } + public RenderModel_ControllerMode_State_t(Pointer peer) { + super(peer); + } + public static class ByReference extends RenderModel_ControllerMode_State_t implements Structure.ByReference { + + }; + public static class ByValue extends RenderModel_ControllerMode_State_t implements Structure.ByValue { + + }; } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/RenderModel_TextureMap_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/RenderModel_TextureMap_t.java index c6baff6fef..41670df53b 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/RenderModel_TextureMap_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/RenderModel_TextureMap_t.java @@ -4,42 +4,43 @@ import java.util.Arrays; import java.util.List; /** - * native declaration : headers\openvr_capi.h:1569
- * This file was autogenerated by JNAerator,
- * a tool written by Olivier Chafik that uses a few opensource projects..
- * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class RenderModel_TextureMap_t extends Structure { - public short unWidth; - public short unHeight; + * native declaration : headers\openvr_capi.h:1569
+ * This file was autogenerated by JNAerator,
+ * a tool written by Olivier Chafik that uses a few opensource projects..
+ * For help, please visit NativeLibs4Java , Rococoa, or JNA. + */ +public class RenderModel_TextureMap_t extends Structure { + public short unWidth; + public short unHeight; /** - * const uint8_t *
- * C type : uint8_t* - */ - public Pointer rubTextureMapData; - public RenderModel_TextureMap_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("unWidth", "unHeight", "rubTextureMapData"); - } + * const uint8_t *
+ * C type : uint8_t* + */ + public Pointer rubTextureMapData; + public RenderModel_TextureMap_t() { + super(); + } + @Override + protected List getFieldOrder() { + return Arrays.asList("unWidth", "unHeight", "rubTextureMapData"); + } /** - * @param rubTextureMapData const uint8_t *
- * C type : uint8_t* - */ - public RenderModel_TextureMap_t(short unWidth, short unHeight, Pointer rubTextureMapData) { - super(); - this.unWidth = unWidth; - this.unHeight = unHeight; - this.rubTextureMapData = rubTextureMapData; - } - public RenderModel_TextureMap_t(Pointer peer) { - super(peer); - } - public static class ByReference extends RenderModel_TextureMap_t implements Structure.ByReference { - - }; - public static class ByValue extends RenderModel_TextureMap_t implements Structure.ByValue { - - }; + * @param rubTextureMapData const uint8_t *
+ * C type : uint8_t* + */ + public RenderModel_TextureMap_t(short unWidth, short unHeight, Pointer rubTextureMapData) { + super(); + this.unWidth = unWidth; + this.unHeight = unHeight; + this.rubTextureMapData = rubTextureMapData; + } + public RenderModel_TextureMap_t(Pointer peer) { + super(peer); + } + public static class ByReference extends RenderModel_TextureMap_t implements Structure.ByReference { + + }; + public static class ByValue extends RenderModel_TextureMap_t implements Structure.ByValue { + + }; } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/RenderModel_Vertex_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/RenderModel_Vertex_t.java index 12e9217d82..17fac6dd53 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/RenderModel_Vertex_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/RenderModel_Vertex_t.java @@ -4,48 +4,49 @@ import java.util.Arrays; import java.util.List; /** - * native declaration : headers\openvr_capi.h:1563
- * This file was autogenerated by JNAerator,
- * a tool written by Olivier Chafik that uses a few opensource projects..
- * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class RenderModel_Vertex_t extends Structure { - /** C type : HmdVector3_t */ - public HmdVector3_t vPosition; - /** C type : HmdVector3_t */ - public HmdVector3_t vNormal; + * native declaration : headers\openvr_capi.h:1563
+ * This file was autogenerated by JNAerator,
+ * a tool written by Olivier Chafik that uses a few opensource projects..
+ * For help, please visit NativeLibs4Java , Rococoa, or JNA. + */ +public class RenderModel_Vertex_t extends Structure { + /** C type : HmdVector3_t */ + public HmdVector3_t vPosition; + /** C type : HmdVector3_t */ + public HmdVector3_t vNormal; /** - * float[2]
- * C type : float[2] - */ - public float[] rfTextureCoord = new float[2]; - public RenderModel_Vertex_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("vPosition", "vNormal", "rfTextureCoord"); - } + * float[2]
+ * C type : float[2] + */ + public float[] rfTextureCoord = new float[2]; + public RenderModel_Vertex_t() { + super(); + } + @Override + protected List getFieldOrder() { + return Arrays.asList("vPosition", "vNormal", "rfTextureCoord"); + } /** - * @param vPosition C type : HmdVector3_t
- * @param vNormal C type : HmdVector3_t
- * @param rfTextureCoord float[2]
- * C type : float[2] - */ - public RenderModel_Vertex_t(HmdVector3_t vPosition, HmdVector3_t vNormal, float rfTextureCoord[]) { - super(); - this.vPosition = vPosition; - this.vNormal = vNormal; - if ((rfTextureCoord.length != this.rfTextureCoord.length)) - throw new IllegalArgumentException("Wrong array size !"); - this.rfTextureCoord = rfTextureCoord; - } - public RenderModel_Vertex_t(Pointer peer) { - super(peer); - } - public static class ByReference extends RenderModel_Vertex_t implements Structure.ByReference { - - }; - public static class ByValue extends RenderModel_Vertex_t implements Structure.ByValue { - - }; + * @param vPosition C type : HmdVector3_t
+ * @param vNormal C type : HmdVector3_t
+ * @param rfTextureCoord float[2]
+ * C type : float[2] + */ + public RenderModel_Vertex_t(HmdVector3_t vPosition, HmdVector3_t vNormal, float rfTextureCoord[]) { + super(); + this.vPosition = vPosition; + this.vNormal = vNormal; + if ((rfTextureCoord.length != this.rfTextureCoord.length)) + throw new IllegalArgumentException("Wrong array size !"); + this.rfTextureCoord = rfTextureCoord; + } + public RenderModel_Vertex_t(Pointer peer) { + super(peer); + } + public static class ByReference extends RenderModel_Vertex_t implements Structure.ByReference { + + }; + public static class ByValue extends RenderModel_Vertex_t implements Structure.ByValue { + + }; } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/RenderModel_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/RenderModel_t.java index 697c79cdf9..9828f148fe 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/RenderModel_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/RenderModel_t.java @@ -5,54 +5,55 @@ import java.util.Arrays; import java.util.List; /** - * native declaration : headers\openvr_capi.h:1578
- * This file was autogenerated by JNAerator,
- * a tool written by Olivier Chafik that uses a few opensource projects..
- * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class RenderModel_t extends Structure { + * native declaration : headers\openvr_capi.h:1578
+ * This file was autogenerated by JNAerator,
+ * a tool written by Olivier Chafik that uses a few opensource projects..
+ * For help, please visit NativeLibs4Java , Rococoa, or JNA. + */ +public class RenderModel_t extends Structure { /** - * const struct vr::RenderModel_Vertex_t *
- * C type : RenderModel_Vertex_t* - */ - public com.jme3.system.jopenvr.RenderModel_Vertex_t.ByReference rVertexData; - public int unVertexCount; + * const struct vr::RenderModel_Vertex_t *
+ * C type : RenderModel_Vertex_t* + */ + public com.jme3.system.jopenvr.RenderModel_Vertex_t.ByReference rVertexData; + public int unVertexCount; /** - * const uint16_t *
- * C type : uint16_t* - */ - public ShortByReference rIndexData; - public int unTriangleCount; - /** C type : TextureID_t */ - public int diffuseTextureId; - public RenderModel_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("rVertexData", "unVertexCount", "rIndexData", "unTriangleCount", "diffuseTextureId"); - } + * const uint16_t *
+ * C type : uint16_t* + */ + public ShortByReference rIndexData; + public int unTriangleCount; + /** C type : TextureID_t */ + public int diffuseTextureId; + public RenderModel_t() { + super(); + } + @Override + protected List getFieldOrder() { + return Arrays.asList("rVertexData", "unVertexCount", "rIndexData", "unTriangleCount", "diffuseTextureId"); + } /** - * @param rVertexData const struct vr::RenderModel_Vertex_t *
- * C type : RenderModel_Vertex_t*
- * @param rIndexData const uint16_t *
- * C type : uint16_t*
- * @param diffuseTextureId C type : TextureID_t - */ - public RenderModel_t(com.jme3.system.jopenvr.RenderModel_Vertex_t.ByReference rVertexData, int unVertexCount, ShortByReference rIndexData, int unTriangleCount, int diffuseTextureId) { - super(); - this.rVertexData = rVertexData; - this.unVertexCount = unVertexCount; - this.rIndexData = rIndexData; - this.unTriangleCount = unTriangleCount; - this.diffuseTextureId = diffuseTextureId; - } - public RenderModel_t(Pointer peer) { - super(peer); - } - public static class ByReference extends RenderModel_t implements Structure.ByReference { - - }; - public static class ByValue extends RenderModel_t implements Structure.ByValue { - - }; + * @param rVertexData const struct vr::RenderModel_Vertex_t *
+ * C type : RenderModel_Vertex_t*
+ * @param rIndexData const uint16_t *
+ * C type : uint16_t*
+ * @param diffuseTextureId C type : TextureID_t + */ + public RenderModel_t(com.jme3.system.jopenvr.RenderModel_Vertex_t.ByReference rVertexData, int unVertexCount, ShortByReference rIndexData, int unTriangleCount, int diffuseTextureId) { + super(); + this.rVertexData = rVertexData; + this.unVertexCount = unVertexCount; + this.rIndexData = rIndexData; + this.unTriangleCount = unTriangleCount; + this.diffuseTextureId = diffuseTextureId; + } + public RenderModel_t(Pointer peer) { + super(peer); + } + public static class ByReference extends RenderModel_t implements Structure.ByReference { + + }; + public static class ByValue extends RenderModel_t implements Structure.ByValue { + + }; } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/SpatialAnchorPose_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/SpatialAnchorPose_t.java index 3bc24a3ad5..2d3fc2cfdb 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/SpatialAnchorPose_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/SpatialAnchorPose_t.java @@ -15,6 +15,7 @@ public class SpatialAnchorPose_t extends Structure { public SpatialAnchorPose_t() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("mAnchorToAbsoluteTracking"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/Texture_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/Texture_t.java index ad0cc5c139..fc6cfeb95e 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/Texture_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/Texture_t.java @@ -26,6 +26,7 @@ public class Texture_t extends Structure { public Texture_t() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("handle", "eType", "eColorSpace"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/TrackedDevicePose_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/TrackedDevicePose_t.java index 81eaf41517..d2a39b1184 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/TrackedDevicePose_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/TrackedDevicePose_t.java @@ -25,6 +25,7 @@ public class TrackedDevicePose_t extends Structure { public TrackedDevicePose_t() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("mDeviceToAbsoluteTracking", "vVelocity", "vAngularVelocity", "eTrackingResult", "bPoseIsValid", "bDeviceIsConnected"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRActiveActionSet_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRActiveActionSet_t.java index 3a643b893f..49720d038e 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRActiveActionSet_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRActiveActionSet_t.java @@ -21,6 +21,7 @@ public class VRActiveActionSet_t extends Structure { public VRActiveActionSet_t() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("ulActionSet", "ulRestrictedToDevice", "ulSecondaryActionSet", "unPadding", "nPriority"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRBoneTransform_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRBoneTransform_t.java index 671e95d9bf..e6e7626d24 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRBoneTransform_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRBoneTransform_t.java @@ -17,6 +17,7 @@ public class VRBoneTransform_t extends Structure { public VRBoneTransform_t() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("position", "orientation"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRControllerAxis_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRControllerAxis_t.java index 8114fdf94b..41f0e13665 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRControllerAxis_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRControllerAxis_t.java @@ -4,32 +4,33 @@ import java.util.Arrays; import java.util.List; /** - * native declaration : headers\openvr_capi.h:1429
- * This file was autogenerated by JNAerator,
- * a tool written by Olivier Chafik that uses a few opensource projects..
- * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VRControllerAxis_t extends Structure { - public float x; - public float y; - public VRControllerAxis_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("x", "y"); - } - public VRControllerAxis_t(float x, float y) { - super(); - this.x = x; - this.y = y; - } - public VRControllerAxis_t(Pointer peer) { - super(peer); - } - public static class ByReference extends VRControllerAxis_t implements Structure.ByReference { - - }; - public static class ByValue extends VRControllerAxis_t implements Structure.ByValue { - - }; + * native declaration : headers\openvr_capi.h:1429
+ * This file was autogenerated by JNAerator,
+ * a tool written by Olivier Chafik that uses a few opensource projects..
+ * For help, please visit NativeLibs4Java , Rococoa, or JNA. + */ +public class VRControllerAxis_t extends Structure { + public float x; + public float y; + public VRControllerAxis_t() { + super(); + } + @Override + protected List getFieldOrder() { + return Arrays.asList("x", "y"); + } + public VRControllerAxis_t(float x, float y) { + super(); + this.x = x; + this.y = y; + } + public VRControllerAxis_t(Pointer peer) { + super(peer); + } + public static class ByReference extends VRControllerAxis_t implements Structure.ByReference { + + }; + public static class ByValue extends VRControllerAxis_t implements Structure.ByValue { + + }; } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRControllerState_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRControllerState_t.java index f1becb6fd7..9adc41c7d2 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRControllerState_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRControllerState_t.java @@ -4,46 +4,47 @@ import java.util.Arrays; import java.util.List; /** - * native declaration : headers\openvr_capi.h:1436
- * This file was autogenerated by JNAerator,
- * a tool written by Olivier Chafik that uses a few opensource projects..
- * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VRControllerState_t extends Structure { - public int unPacketNum; - public long ulButtonPressed; - public long ulButtonTouched; + * native declaration : headers\openvr_capi.h:1436
+ * This file was autogenerated by JNAerator,
+ * a tool written by Olivier Chafik that uses a few opensource projects..
+ * For help, please visit NativeLibs4Java , Rococoa, or JNA. + */ +public class VRControllerState_t extends Structure { + public int unPacketNum; + public long ulButtonPressed; + public long ulButtonTouched; /** - * struct vr::VRControllerAxis_t[5]
- * C type : VRControllerAxis_t[5] - */ - public VRControllerAxis_t[] rAxis = new VRControllerAxis_t[5]; - public VRControllerState_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("unPacketNum", "ulButtonPressed", "ulButtonTouched", "rAxis"); - } + * struct vr::VRControllerAxis_t[5]
+ * C type : VRControllerAxis_t[5] + */ + public VRControllerAxis_t[] rAxis = new VRControllerAxis_t[5]; + public VRControllerState_t() { + super(); + } + @Override + protected List getFieldOrder() { + return Arrays.asList("unPacketNum", "ulButtonPressed", "ulButtonTouched", "rAxis"); + } /** - * @param rAxis struct vr::VRControllerAxis_t[5]
- * C type : VRControllerAxis_t[5] - */ - public VRControllerState_t(int unPacketNum, long ulButtonPressed, long ulButtonTouched, VRControllerAxis_t rAxis[]) { - super(); - this.unPacketNum = unPacketNum; - this.ulButtonPressed = ulButtonPressed; - this.ulButtonTouched = ulButtonTouched; - if ((rAxis.length != this.rAxis.length)) - throw new IllegalArgumentException("Wrong array size !"); - this.rAxis = rAxis; - } - public VRControllerState_t(Pointer peer) { - super(peer); - } - public static class ByReference extends VRControllerState_t implements Structure.ByReference { - - }; - public static class ByValue extends VRControllerState_t implements Structure.ByValue { - - }; + * @param rAxis struct vr::VRControllerAxis_t[5]
+ * C type : VRControllerAxis_t[5] + */ + public VRControllerState_t(int unPacketNum, long ulButtonPressed, long ulButtonTouched, VRControllerAxis_t rAxis[]) { + super(); + this.unPacketNum = unPacketNum; + this.ulButtonPressed = ulButtonPressed; + this.ulButtonTouched = ulButtonTouched; + if ((rAxis.length != this.rAxis.length)) + throw new IllegalArgumentException("Wrong array size !"); + this.rAxis = rAxis; + } + public VRControllerState_t(Pointer peer) { + super(peer); + } + public static class ByReference extends VRControllerState_t implements Structure.ByReference { + + }; + public static class ByValue extends VRControllerState_t implements Structure.ByValue { + + }; } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_ApplicationLaunch_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_ApplicationLaunch_t.java index 675e0ac07f..845ca8799c 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_ApplicationLaunch_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_ApplicationLaunch_t.java @@ -4,32 +4,33 @@ import java.util.Arrays; import java.util.List; /** - * native declaration : headers\openvr_capi.h:1373
- * This file was autogenerated by JNAerator,
- * a tool written by Olivier Chafik that uses a few opensource projects..
- * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VREvent_ApplicationLaunch_t extends Structure { - public int pid; - public int unArgsHandle; - public VREvent_ApplicationLaunch_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("pid", "unArgsHandle"); - } - public VREvent_ApplicationLaunch_t(int pid, int unArgsHandle) { - super(); - this.pid = pid; - this.unArgsHandle = unArgsHandle; - } - public VREvent_ApplicationLaunch_t(Pointer peer) { - super(peer); - } - public static class ByReference extends VREvent_ApplicationLaunch_t implements Structure.ByReference { - - }; - public static class ByValue extends VREvent_ApplicationLaunch_t implements Structure.ByValue { - - }; + * native declaration : headers\openvr_capi.h:1373
+ * This file was autogenerated by JNAerator,
+ * a tool written by Olivier Chafik that uses a few opensource projects..
+ * For help, please visit NativeLibs4Java , Rococoa, or JNA. + */ +public class VREvent_ApplicationLaunch_t extends Structure { + public int pid; + public int unArgsHandle; + public VREvent_ApplicationLaunch_t() { + super(); + } + @Override + protected List getFieldOrder() { + return Arrays.asList("pid", "unArgsHandle"); + } + public VREvent_ApplicationLaunch_t(int pid, int unArgsHandle) { + super(); + this.pid = pid; + this.unArgsHandle = unArgsHandle; + } + public VREvent_ApplicationLaunch_t(Pointer peer) { + super(peer); + } + public static class ByReference extends VREvent_ApplicationLaunch_t implements Structure.ByReference { + + }; + public static class ByValue extends VREvent_ApplicationLaunch_t implements Structure.ByValue { + + }; } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Chaperone_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Chaperone_t.java index 65287c0d73..92e97a4580 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Chaperone_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Chaperone_t.java @@ -4,32 +4,33 @@ import java.util.Arrays; import java.util.List; /** - * native declaration : headers\openvr_capi.h:1350
- * This file was autogenerated by JNAerator,
- * a tool written by Olivier Chafik that uses a few opensource projects..
- * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VREvent_Chaperone_t extends Structure { - public long m_nPreviousUniverse; - public long m_nCurrentUniverse; - public VREvent_Chaperone_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("m_nPreviousUniverse", "m_nCurrentUniverse"); - } - public VREvent_Chaperone_t(long m_nPreviousUniverse, long m_nCurrentUniverse) { - super(); - this.m_nPreviousUniverse = m_nPreviousUniverse; - this.m_nCurrentUniverse = m_nCurrentUniverse; - } - public VREvent_Chaperone_t(Pointer peer) { - super(peer); - } - public static class ByReference extends VREvent_Chaperone_t implements Structure.ByReference { - - }; - public static class ByValue extends VREvent_Chaperone_t implements Structure.ByValue { - - }; + * native declaration : headers\openvr_capi.h:1350
+ * This file was autogenerated by JNAerator,
+ * a tool written by Olivier Chafik that uses a few opensource projects..
+ * For help, please visit NativeLibs4Java , Rococoa, or JNA. + */ +public class VREvent_Chaperone_t extends Structure { + public long m_nPreviousUniverse; + public long m_nCurrentUniverse; + public VREvent_Chaperone_t() { + super(); + } + @Override + protected List getFieldOrder() { + return Arrays.asList("m_nPreviousUniverse", "m_nCurrentUniverse"); + } + public VREvent_Chaperone_t(long m_nPreviousUniverse, long m_nCurrentUniverse) { + super(); + this.m_nPreviousUniverse = m_nPreviousUniverse; + this.m_nCurrentUniverse = m_nCurrentUniverse; + } + public VREvent_Chaperone_t(Pointer peer) { + super(peer); + } + public static class ByReference extends VREvent_Chaperone_t implements Structure.ByReference { + + }; + public static class ByValue extends VREvent_Chaperone_t implements Structure.ByValue { + + }; } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Controller_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Controller_t.java index c2a632c695..e7959582cc 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Controller_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Controller_t.java @@ -4,30 +4,31 @@ import java.util.Arrays; import java.util.List; /** - * native declaration : headers\openvr_capi.h:1304
- * This file was autogenerated by JNAerator,
- * a tool written by Olivier Chafik that uses a few opensource projects..
- * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VREvent_Controller_t extends Structure { - public int button; - public VREvent_Controller_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("button"); - } - public VREvent_Controller_t(int button) { - super(); - this.button = button; - } - public VREvent_Controller_t(Pointer peer) { - super(peer); - } - public static class ByReference extends VREvent_Controller_t implements Structure.ByReference { - - }; - public static class ByValue extends VREvent_Controller_t implements Structure.ByValue { - - }; + * native declaration : headers\openvr_capi.h:1304
+ * This file was autogenerated by JNAerator,
+ * a tool written by Olivier Chafik that uses a few opensource projects..
+ * For help, please visit NativeLibs4Java , Rococoa, or JNA. + */ +public class VREvent_Controller_t extends Structure { + public int button; + public VREvent_Controller_t() { + super(); + } + @Override + protected List getFieldOrder() { + return Arrays.asList("button"); + } + public VREvent_Controller_t(int button) { + super(); + this.button = button; + } + public VREvent_Controller_t(Pointer peer) { + super(peer); + } + public static class ByReference extends VREvent_Controller_t implements Structure.ByReference { + + }; + public static class ByValue extends VREvent_Controller_t implements Structure.ByValue { + + }; } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_DualAnalog_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_DualAnalog_t.java index a1fb2a523f..f5e45f5b24 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_DualAnalog_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_DualAnalog_t.java @@ -21,6 +21,7 @@ public class VREvent_DualAnalog_t extends Structure { public VREvent_DualAnalog_t() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("x", "y", "transformedX", "transformedY", "which"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_EditingCameraSurface_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_EditingCameraSurface_t.java index 6a8f5c8c35..5a54cdd582 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_EditingCameraSurface_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_EditingCameraSurface_t.java @@ -4,32 +4,33 @@ import java.util.Arrays; import java.util.List; /** - * native declaration : headers\openvr_capi.h:1377
- * This file was autogenerated by JNAerator,
- * a tool written by Olivier Chafik that uses a few opensource projects..
- * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VREvent_EditingCameraSurface_t extends Structure { - public long overlayHandle; - public int nVisualMode; - public VREvent_EditingCameraSurface_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("overlayHandle", "nVisualMode"); - } - public VREvent_EditingCameraSurface_t(long overlayHandle, int nVisualMode) { - super(); - this.overlayHandle = overlayHandle; - this.nVisualMode = nVisualMode; - } - public VREvent_EditingCameraSurface_t(Pointer peer) { - super(peer); - } - public static class ByReference extends VREvent_EditingCameraSurface_t implements Structure.ByReference { - - }; - public static class ByValue extends VREvent_EditingCameraSurface_t implements Structure.ByValue { - - }; + * native declaration : headers\openvr_capi.h:1377
+ * This file was autogenerated by JNAerator,
+ * a tool written by Olivier Chafik that uses a few opensource projects..
+ * For help, please visit NativeLibs4Java , Rococoa, or JNA. + */ +public class VREvent_EditingCameraSurface_t extends Structure { + public long overlayHandle; + public int nVisualMode; + public VREvent_EditingCameraSurface_t() { + super(); + } + @Override + protected List getFieldOrder() { + return Arrays.asList("overlayHandle", "nVisualMode"); + } + public VREvent_EditingCameraSurface_t(long overlayHandle, int nVisualMode) { + super(); + this.overlayHandle = overlayHandle; + this.nVisualMode = nVisualMode; + } + public VREvent_EditingCameraSurface_t(Pointer peer) { + super(peer); + } + public static class ByReference extends VREvent_EditingCameraSurface_t implements Structure.ByReference { + + }; + public static class ByValue extends VREvent_EditingCameraSurface_t implements Structure.ByValue { + + }; } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_HapticVibration_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_HapticVibration_t.java index 1501bcbf43..7175e4c862 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_HapticVibration_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_HapticVibration_t.java @@ -18,6 +18,7 @@ public class VREvent_HapticVibration_t extends Structure { public VREvent_HapticVibration_t() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("containerHandle", "componentHandle", "fDurationSeconds", "fFrequency", "fAmplitude"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_InputActionManifestLoad_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_InputActionManifestLoad_t.java index 955ad7abdd..427eddfbc2 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_InputActionManifestLoad_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_InputActionManifestLoad_t.java @@ -17,6 +17,7 @@ public class VREvent_InputActionManifestLoad_t extends Structure { public VREvent_InputActionManifestLoad_t() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("pathAppKey", "pathMessage", "pathMessageParam", "pathManifestPath"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_InputBindingLoad_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_InputBindingLoad_t.java index f7a02b4bf5..9b88905847 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_InputBindingLoad_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_InputBindingLoad_t.java @@ -18,6 +18,7 @@ public class VREvent_InputBindingLoad_t extends Structure { public VREvent_InputBindingLoad_t() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("ulAppContainer", "pathMessage", "pathUrl", "pathControllerType"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Ipd_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Ipd_t.java index 02b100e350..afc05f74ea 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Ipd_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Ipd_t.java @@ -4,30 +4,31 @@ import java.util.Arrays; import java.util.List; /** - * native declaration : headers\openvr_capi.h:1346
- * This file was autogenerated by JNAerator,
- * a tool written by Olivier Chafik that uses a few opensource projects..
- * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VREvent_Ipd_t extends Structure { - public float ipdMeters; - public VREvent_Ipd_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("ipdMeters"); - } - public VREvent_Ipd_t(float ipdMeters) { - super(); - this.ipdMeters = ipdMeters; - } - public VREvent_Ipd_t(Pointer peer) { - super(peer); - } - public static class ByReference extends VREvent_Ipd_t implements Structure.ByReference { - - }; - public static class ByValue extends VREvent_Ipd_t implements Structure.ByValue { - - }; + * native declaration : headers\openvr_capi.h:1346
+ * This file was autogenerated by JNAerator,
+ * a tool written by Olivier Chafik that uses a few opensource projects..
+ * For help, please visit NativeLibs4Java , Rococoa, or JNA. + */ +public class VREvent_Ipd_t extends Structure { + public float ipdMeters; + public VREvent_Ipd_t() { + super(); + } + @Override + protected List getFieldOrder() { + return Arrays.asList("ipdMeters"); + } + public VREvent_Ipd_t(float ipdMeters) { + super(); + this.ipdMeters = ipdMeters; + } + public VREvent_Ipd_t(Pointer peer) { + super(peer); + } + public static class ByReference extends VREvent_Ipd_t implements Structure.ByReference { + + }; + public static class ByValue extends VREvent_Ipd_t implements Structure.ByValue { + + }; } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Keyboard_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Keyboard_t.java index a6fb1e6e9b..9cf8c64ed3 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Keyboard_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Keyboard_t.java @@ -4,42 +4,43 @@ import java.util.Arrays; import java.util.List; /** - * native declaration : headers\openvr_capi.h:1343
- * This file was autogenerated by JNAerator,
- * a tool written by Olivier Chafik that uses a few opensource projects..
- * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VREvent_Keyboard_t extends Structure { + * native declaration : headers\openvr_capi.h:1343
+ * This file was autogenerated by JNAerator,
+ * a tool written by Olivier Chafik that uses a few opensource projects..
+ * For help, please visit NativeLibs4Java , Rococoa, or JNA. + */ +public class VREvent_Keyboard_t extends Structure { /** - * char[8]
- * C type : char*[8] - */ - public Pointer[] cNewInput = new Pointer[8]; - public long uUserValue; - public VREvent_Keyboard_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("cNewInput", "uUserValue"); - } + * char[8]
+ * C type : char*[8] + */ + public Pointer[] cNewInput = new Pointer[8]; + public long uUserValue; + public VREvent_Keyboard_t() { + super(); + } + @Override + protected List getFieldOrder() { + return Arrays.asList("cNewInput", "uUserValue"); + } /** - * @param cNewInput char[8]
- * C type : char*[8] - */ - public VREvent_Keyboard_t(Pointer cNewInput[], long uUserValue) { - super(); - if ((cNewInput.length != this.cNewInput.length)) - throw new IllegalArgumentException("Wrong array size !"); - this.cNewInput = cNewInput; - this.uUserValue = uUserValue; - } - public VREvent_Keyboard_t(Pointer peer) { - super(peer); - } - public static class ByReference extends VREvent_Keyboard_t implements Structure.ByReference { - - }; - public static class ByValue extends VREvent_Keyboard_t implements Structure.ByValue { - - }; + * @param cNewInput char[8]
+ * C type : char*[8] + */ + public VREvent_Keyboard_t(Pointer cNewInput[], long uUserValue) { + super(); + if ((cNewInput.length != this.cNewInput.length)) + throw new IllegalArgumentException("Wrong array size !"); + this.cNewInput = cNewInput; + this.uUserValue = uUserValue; + } + public VREvent_Keyboard_t(Pointer peer) { + super(peer); + } + public static class ByReference extends VREvent_Keyboard_t implements Structure.ByReference { + + }; + public static class ByValue extends VREvent_Keyboard_t implements Structure.ByValue { + + }; } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_MessageOverlay_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_MessageOverlay_t.java index fc9e82c9bf..b0fe1b8c2e 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_MessageOverlay_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_MessageOverlay_t.java @@ -4,30 +4,31 @@ import java.util.Arrays; import java.util.List; /** - * native declaration : headers\openvr_capi.h:1380
- * This file was autogenerated by JNAerator,
- * a tool written by Olivier Chafik that uses a few opensource projects..
- * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VREvent_MessageOverlay_t extends Structure { - public int unVRMessageOverlayResponse; - public VREvent_MessageOverlay_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("unVRMessageOverlayResponse"); - } - public VREvent_MessageOverlay_t(int unVRMessageOverlayResponse) { - super(); - this.unVRMessageOverlayResponse = unVRMessageOverlayResponse; - } - public VREvent_MessageOverlay_t(Pointer peer) { - super(peer); - } - public static class ByReference extends VREvent_MessageOverlay_t implements Structure.ByReference { - - }; - public static class ByValue extends VREvent_MessageOverlay_t implements Structure.ByValue { - - }; + * native declaration : headers\openvr_capi.h:1380
+ * This file was autogenerated by JNAerator,
+ * a tool written by Olivier Chafik that uses a few opensource projects..
+ * For help, please visit NativeLibs4Java , Rococoa, or JNA. + */ +public class VREvent_MessageOverlay_t extends Structure { + public int unVRMessageOverlayResponse; + public VREvent_MessageOverlay_t() { + super(); + } + @Override + protected List getFieldOrder() { + return Arrays.asList("unVRMessageOverlayResponse"); + } + public VREvent_MessageOverlay_t(int unVRMessageOverlayResponse) { + super(); + this.unVRMessageOverlayResponse = unVRMessageOverlayResponse; + } + public VREvent_MessageOverlay_t(Pointer peer) { + super(peer); + } + public static class ByReference extends VREvent_MessageOverlay_t implements Structure.ByReference { + + }; + public static class ByValue extends VREvent_MessageOverlay_t implements Structure.ByValue { + + }; } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Mouse_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Mouse_t.java index b55c523c7c..d20db8c841 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Mouse_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Mouse_t.java @@ -4,34 +4,35 @@ import java.util.Arrays; import java.util.List; /** - * native declaration : headers\openvr_capi.h:1309
- * This file was autogenerated by JNAerator,
- * a tool written by Olivier Chafik that uses a few opensource projects..
- * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VREvent_Mouse_t extends Structure { - public float x; - public float y; - public int button; - public VREvent_Mouse_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("x", "y", "button"); - } - public VREvent_Mouse_t(float x, float y, int button) { - super(); - this.x = x; - this.y = y; - this.button = button; - } - public VREvent_Mouse_t(Pointer peer) { - super(peer); - } - public static class ByReference extends VREvent_Mouse_t implements Structure.ByReference { - - }; - public static class ByValue extends VREvent_Mouse_t implements Structure.ByValue { - - }; + * native declaration : headers\openvr_capi.h:1309
+ * This file was autogenerated by JNAerator,
+ * a tool written by Olivier Chafik that uses a few opensource projects..
+ * For help, please visit NativeLibs4Java , Rococoa, or JNA. + */ +public class VREvent_Mouse_t extends Structure { + public float x; + public float y; + public int button; + public VREvent_Mouse_t() { + super(); + } + @Override + protected List getFieldOrder() { + return Arrays.asList("x", "y", "button"); + } + public VREvent_Mouse_t(float x, float y, int button) { + super(); + this.x = x; + this.y = y; + this.button = button; + } + public VREvent_Mouse_t(Pointer peer) { + super(peer); + } + public static class ByReference extends VREvent_Mouse_t implements Structure.ByReference { + + }; + public static class ByValue extends VREvent_Mouse_t implements Structure.ByValue { + + }; } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Notification_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Notification_t.java index 0f65ecfc38..fa67bd5e7c 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Notification_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Notification_t.java @@ -4,32 +4,33 @@ import java.util.Arrays; import java.util.List; /** - * native declaration : headers\openvr_capi.h:1326
- * This file was autogenerated by JNAerator,
- * a tool written by Olivier Chafik that uses a few opensource projects..
- * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VREvent_Notification_t extends Structure { - public long ulUserValue; - public int notificationId; - public VREvent_Notification_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("ulUserValue", "notificationId"); - } - public VREvent_Notification_t(long ulUserValue, int notificationId) { - super(); - this.ulUserValue = ulUserValue; - this.notificationId = notificationId; - } - public VREvent_Notification_t(Pointer peer) { - super(peer); - } - public static class ByReference extends VREvent_Notification_t implements Structure.ByReference { - - }; - public static class ByValue extends VREvent_Notification_t implements Structure.ByValue { - - }; + * native declaration : headers\openvr_capi.h:1326
+ * This file was autogenerated by JNAerator,
+ * a tool written by Olivier Chafik that uses a few opensource projects..
+ * For help, please visit NativeLibs4Java , Rococoa, or JNA. + */ +public class VREvent_Notification_t extends Structure { + public long ulUserValue; + public int notificationId; + public VREvent_Notification_t() { + super(); + } + @Override + protected List getFieldOrder() { + return Arrays.asList("ulUserValue", "notificationId"); + } + public VREvent_Notification_t(long ulUserValue, int notificationId) { + super(); + this.ulUserValue = ulUserValue; + this.notificationId = notificationId; + } + public VREvent_Notification_t(Pointer peer) { + super(peer); + } + public static class ByReference extends VREvent_Notification_t implements Structure.ByReference { + + }; + public static class ByValue extends VREvent_Notification_t implements Structure.ByValue { + + }; } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Overlay_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Overlay_t.java index d112d92e2e..683c485ab7 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Overlay_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Overlay_t.java @@ -4,32 +4,33 @@ import java.util.Arrays; import java.util.List; /** - * native declaration : headers\openvr_capi.h:1335
- * This file was autogenerated by JNAerator,
- * a tool written by Olivier Chafik that uses a few opensource projects..
- * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VREvent_Overlay_t extends Structure { - public long overlayHandle; - public long devicePath; - public VREvent_Overlay_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("overlayHandle", "devicePath"); - } - public VREvent_Overlay_t(long overlayHandle, long devicePath) { - super(); - this.overlayHandle = overlayHandle; - this.devicePath = devicePath; - } - public VREvent_Overlay_t(Pointer peer) { - super(peer); - } - public static class ByReference extends VREvent_Overlay_t implements Structure.ByReference { - - }; - public static class ByValue extends VREvent_Overlay_t implements Structure.ByValue { - - }; + * native declaration : headers\openvr_capi.h:1335
+ * This file was autogenerated by JNAerator,
+ * a tool written by Olivier Chafik that uses a few opensource projects..
+ * For help, please visit NativeLibs4Java , Rococoa, or JNA. + */ +public class VREvent_Overlay_t extends Structure { + public long overlayHandle; + public long devicePath; + public VREvent_Overlay_t() { + super(); + } + @Override + protected List getFieldOrder() { + return Arrays.asList("overlayHandle", "devicePath"); + } + public VREvent_Overlay_t(long overlayHandle, long devicePath) { + super(); + this.overlayHandle = overlayHandle; + this.devicePath = devicePath; + } + public VREvent_Overlay_t(Pointer peer) { + super(peer); + } + public static class ByReference extends VREvent_Overlay_t implements Structure.ByReference { + + }; + public static class ByValue extends VREvent_Overlay_t implements Structure.ByValue { + + }; } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_PerformanceTest_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_PerformanceTest_t.java index 37e357bef1..13f14852cc 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_PerformanceTest_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_PerformanceTest_t.java @@ -4,30 +4,31 @@ import java.util.Arrays; import java.util.List; /** - * native declaration : headers\openvr_capi.h:1359
- * This file was autogenerated by JNAerator,
- * a tool written by Olivier Chafik that uses a few opensource projects..
- * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VREvent_PerformanceTest_t extends Structure { - public int m_nFidelityLevel; - public VREvent_PerformanceTest_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("m_nFidelityLevel"); - } - public VREvent_PerformanceTest_t(int m_nFidelityLevel) { - super(); - this.m_nFidelityLevel = m_nFidelityLevel; - } - public VREvent_PerformanceTest_t(Pointer peer) { - super(peer); - } - public static class ByReference extends VREvent_PerformanceTest_t implements Structure.ByReference { - - }; - public static class ByValue extends VREvent_PerformanceTest_t implements Structure.ByValue { - - }; + * native declaration : headers\openvr_capi.h:1359
+ * This file was autogenerated by JNAerator,
+ * a tool written by Olivier Chafik that uses a few opensource projects..
+ * For help, please visit NativeLibs4Java , Rococoa, or JNA. + */ +public class VREvent_PerformanceTest_t extends Structure { + public int m_nFidelityLevel; + public VREvent_PerformanceTest_t() { + super(); + } + @Override + protected List getFieldOrder() { + return Arrays.asList("m_nFidelityLevel"); + } + public VREvent_PerformanceTest_t(int m_nFidelityLevel) { + super(); + this.m_nFidelityLevel = m_nFidelityLevel; + } + public VREvent_PerformanceTest_t(Pointer peer) { + super(peer); + } + public static class ByReference extends VREvent_PerformanceTest_t implements Structure.ByReference { + + }; + public static class ByValue extends VREvent_PerformanceTest_t implements Structure.ByValue { + + }; } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Process_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Process_t.java index ad89d03c95..0e7f9ae2fb 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Process_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Process_t.java @@ -4,34 +4,35 @@ import java.util.Arrays; import java.util.List; /** - * native declaration : headers\openvr_capi.h:1331
- * This file was autogenerated by JNAerator,
- * a tool written by Olivier Chafik that uses a few opensource projects..
- * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VREvent_Process_t extends Structure { - public int pid; - public int oldPid; - public byte bForced; - public VREvent_Process_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("pid", "oldPid", "bForced"); - } - public VREvent_Process_t(int pid, int oldPid, byte bForced) { - super(); - this.pid = pid; - this.oldPid = oldPid; - this.bForced = bForced; - } - public VREvent_Process_t(Pointer peer) { - super(peer); - } - public static class ByReference extends VREvent_Process_t implements Structure.ByReference { - - }; - public static class ByValue extends VREvent_Process_t implements Structure.ByValue { - - }; + * native declaration : headers\openvr_capi.h:1331
+ * This file was autogenerated by JNAerator,
+ * a tool written by Olivier Chafik that uses a few opensource projects..
+ * For help, please visit NativeLibs4Java , Rococoa, or JNA. + */ +public class VREvent_Process_t extends Structure { + public int pid; + public int oldPid; + public byte bForced; + public VREvent_Process_t() { + super(); + } + @Override + protected List getFieldOrder() { + return Arrays.asList("pid", "oldPid", "bForced"); + } + public VREvent_Process_t(int pid, int oldPid, byte bForced) { + super(); + this.pid = pid; + this.oldPid = oldPid; + this.bForced = bForced; + } + public VREvent_Process_t(Pointer peer) { + super(peer); + } + public static class ByReference extends VREvent_Process_t implements Structure.ByReference { + + }; + public static class ByValue extends VREvent_Process_t implements Structure.ByValue { + + }; } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Property_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Property_t.java index 945d766cf9..be84aa3129 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Property_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Property_t.java @@ -19,6 +19,7 @@ public class VREvent_Property_t extends Structure { public VREvent_Property_t() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("container", "prop"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Reserved_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Reserved_t.java index 11dd3f849e..13f0c8d822 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Reserved_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Reserved_t.java @@ -4,36 +4,37 @@ import java.util.Arrays; import java.util.List; /** - * native declaration : headers\openvr_capi.h:1356
- * This file was autogenerated by JNAerator,
- * a tool written by Olivier Chafik that uses a few opensource projects..
- * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VREvent_Reserved_t extends Structure { - public long reserved0; - public long reserved1; - public long reserved2; - public long reserved3; - public VREvent_Reserved_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("reserved0", "reserved1", "reserved2", "reserved3"); - } - public VREvent_Reserved_t(long reserved0, long reserved1, long reserved2, long reserved3) { - super(); - this.reserved0 = reserved0; - this.reserved1 = reserved1; - this.reserved2 = reserved2; - this.reserved3 = reserved3; - } - public VREvent_Reserved_t(Pointer peer) { - super(peer); - } - public static class ByReference extends VREvent_Reserved_t implements Structure.ByReference { - - }; - public static class ByValue extends VREvent_Reserved_t implements Structure.ByValue { - - }; + * native declaration : headers\openvr_capi.h:1356
+ * This file was autogenerated by JNAerator,
+ * a tool written by Olivier Chafik that uses a few opensource projects..
+ * For help, please visit NativeLibs4Java , Rococoa, or JNA. + */ +public class VREvent_Reserved_t extends Structure { + public long reserved0; + public long reserved1; + public long reserved2; + public long reserved3; + public VREvent_Reserved_t() { + super(); + } + @Override + protected List getFieldOrder() { + return Arrays.asList("reserved0", "reserved1", "reserved2", "reserved3"); + } + public VREvent_Reserved_t(long reserved0, long reserved1, long reserved2, long reserved3) { + super(); + this.reserved0 = reserved0; + this.reserved1 = reserved1; + this.reserved2 = reserved2; + this.reserved3 = reserved3; + } + public VREvent_Reserved_t(Pointer peer) { + super(peer); + } + public static class ByReference extends VREvent_Reserved_t implements Structure.ByReference { + + }; + public static class ByValue extends VREvent_Reserved_t implements Structure.ByValue { + + }; } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_ScreenshotProgress_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_ScreenshotProgress_t.java index 7d616dec60..b0511dbc24 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_ScreenshotProgress_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_ScreenshotProgress_t.java @@ -4,30 +4,31 @@ import java.util.Arrays; import java.util.List; /** - * native declaration : headers\openvr_capi.h:1369
- * This file was autogenerated by JNAerator,
- * a tool written by Olivier Chafik that uses a few opensource projects..
- * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VREvent_ScreenshotProgress_t extends Structure { - public float progress; - public VREvent_ScreenshotProgress_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("progress"); - } - public VREvent_ScreenshotProgress_t(float progress) { - super(); - this.progress = progress; - } - public VREvent_ScreenshotProgress_t(Pointer peer) { - super(peer); - } - public static class ByReference extends VREvent_ScreenshotProgress_t implements Structure.ByReference { - - }; - public static class ByValue extends VREvent_ScreenshotProgress_t implements Structure.ByValue { - - }; + * native declaration : headers\openvr_capi.h:1369
+ * This file was autogenerated by JNAerator,
+ * a tool written by Olivier Chafik that uses a few opensource projects..
+ * For help, please visit NativeLibs4Java , Rococoa, or JNA. + */ +public class VREvent_ScreenshotProgress_t extends Structure { + public float progress; + public VREvent_ScreenshotProgress_t() { + super(); + } + @Override + protected List getFieldOrder() { + return Arrays.asList("progress"); + } + public VREvent_ScreenshotProgress_t(float progress) { + super(); + this.progress = progress; + } + public VREvent_ScreenshotProgress_t(Pointer peer) { + super(peer); + } + public static class ByReference extends VREvent_ScreenshotProgress_t implements Structure.ByReference { + + }; + public static class ByValue extends VREvent_ScreenshotProgress_t implements Structure.ByValue { + + }; } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Screenshot_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Screenshot_t.java index d34f6e0898..c35acd1390 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Screenshot_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Screenshot_t.java @@ -4,32 +4,33 @@ import java.util.Arrays; import java.util.List; /** - * native declaration : headers\openvr_capi.h:1366
- * This file was autogenerated by JNAerator,
- * a tool written by Olivier Chafik that uses a few opensource projects..
- * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VREvent_Screenshot_t extends Structure { - public int handle; - public int type; - public VREvent_Screenshot_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("handle", "type"); - } - public VREvent_Screenshot_t(int handle, int type) { - super(); - this.handle = handle; - this.type = type; - } - public VREvent_Screenshot_t(Pointer peer) { - super(peer); - } - public static class ByReference extends VREvent_Screenshot_t implements Structure.ByReference { - - }; - public static class ByValue extends VREvent_Screenshot_t implements Structure.ByValue { - - }; + * native declaration : headers\openvr_capi.h:1366
+ * This file was autogenerated by JNAerator,
+ * a tool written by Olivier Chafik that uses a few opensource projects..
+ * For help, please visit NativeLibs4Java , Rococoa, or JNA. + */ +public class VREvent_Screenshot_t extends Structure { + public int handle; + public int type; + public VREvent_Screenshot_t() { + super(); + } + @Override + protected List getFieldOrder() { + return Arrays.asList("handle", "type"); + } + public VREvent_Screenshot_t(int handle, int type) { + super(); + this.handle = handle; + this.type = type; + } + public VREvent_Screenshot_t(Pointer peer) { + super(peer); + } + public static class ByReference extends VREvent_Screenshot_t implements Structure.ByReference { + + }; + public static class ByValue extends VREvent_Screenshot_t implements Structure.ByValue { + + }; } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Scroll_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Scroll_t.java index 8a428e8bb5..1d29ea839b 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Scroll_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Scroll_t.java @@ -4,34 +4,35 @@ import java.util.Arrays; import java.util.List; /** - * native declaration : headers\openvr_capi.h:1314
- * This file was autogenerated by JNAerator,
- * a tool written by Olivier Chafik that uses a few opensource projects..
- * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VREvent_Scroll_t extends Structure { - public float xdelta; - public float ydelta; - public int repeatCount; - public VREvent_Scroll_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("xdelta", "ydelta", "repeatCount"); - } - public VREvent_Scroll_t(float xdelta, float ydelta, int repeatCount) { - super(); - this.xdelta = xdelta; - this.ydelta = ydelta; - this.repeatCount = repeatCount; - } - public VREvent_Scroll_t(Pointer peer) { - super(peer); - } - public static class ByReference extends VREvent_Scroll_t implements Structure.ByReference { - - }; - public static class ByValue extends VREvent_Scroll_t implements Structure.ByValue { - - }; + * native declaration : headers\openvr_capi.h:1314
+ * This file was autogenerated by JNAerator,
+ * a tool written by Olivier Chafik that uses a few opensource projects..
+ * For help, please visit NativeLibs4Java , Rococoa, or JNA. + */ +public class VREvent_Scroll_t extends Structure { + public float xdelta; + public float ydelta; + public int repeatCount; + public VREvent_Scroll_t() { + super(); + } + @Override + protected List getFieldOrder() { + return Arrays.asList("xdelta", "ydelta", "repeatCount"); + } + public VREvent_Scroll_t(float xdelta, float ydelta, int repeatCount) { + super(); + this.xdelta = xdelta; + this.ydelta = ydelta; + this.repeatCount = repeatCount; + } + public VREvent_Scroll_t(Pointer peer) { + super(peer); + } + public static class ByReference extends VREvent_Scroll_t implements Structure.ByReference { + + }; + public static class ByValue extends VREvent_Scroll_t implements Structure.ByValue { + + }; } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_SeatedZeroPoseReset_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_SeatedZeroPoseReset_t.java index fb8edda62a..cb7c9f62c5 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_SeatedZeroPoseReset_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_SeatedZeroPoseReset_t.java @@ -4,30 +4,31 @@ import java.util.Arrays; import java.util.List; /** - * native declaration : headers\openvr_capi.h:1362
- * This file was autogenerated by JNAerator,
- * a tool written by Olivier Chafik that uses a few opensource projects..
- * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VREvent_SeatedZeroPoseReset_t extends Structure { - public byte bResetBySystemMenu; - public VREvent_SeatedZeroPoseReset_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("bResetBySystemMenu"); - } - public VREvent_SeatedZeroPoseReset_t(byte bResetBySystemMenu) { - super(); - this.bResetBySystemMenu = bResetBySystemMenu; - } - public VREvent_SeatedZeroPoseReset_t(Pointer peer) { - super(peer); - } - public static class ByReference extends VREvent_SeatedZeroPoseReset_t implements Structure.ByReference { - - }; - public static class ByValue extends VREvent_SeatedZeroPoseReset_t implements Structure.ByValue { - - }; + * native declaration : headers\openvr_capi.h:1362
+ * This file was autogenerated by JNAerator,
+ * a tool written by Olivier Chafik that uses a few opensource projects..
+ * For help, please visit NativeLibs4Java , Rococoa, or JNA. + */ +public class VREvent_SeatedZeroPoseReset_t extends Structure { + public byte bResetBySystemMenu; + public VREvent_SeatedZeroPoseReset_t() { + super(); + } + @Override + protected List getFieldOrder() { + return Arrays.asList("bResetBySystemMenu"); + } + public VREvent_SeatedZeroPoseReset_t(byte bResetBySystemMenu) { + super(); + this.bResetBySystemMenu = bResetBySystemMenu; + } + public VREvent_SeatedZeroPoseReset_t(Pointer peer) { + super(peer); + } + public static class ByReference extends VREvent_SeatedZeroPoseReset_t implements Structure.ByReference { + + }; + public static class ByValue extends VREvent_SeatedZeroPoseReset_t implements Structure.ByValue { + + }; } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_SpatialAnchor_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_SpatialAnchor_t.java index 5e26d5b4cf..eeb51f2e26 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_SpatialAnchor_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_SpatialAnchor_t.java @@ -15,6 +15,7 @@ public class VREvent_SpatialAnchor_t extends Structure { public VREvent_SpatialAnchor_t() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("unHandle"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Status_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Status_t.java index 054b72f682..d16d2c0727 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Status_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_Status_t.java @@ -4,30 +4,31 @@ import java.util.Arrays; import java.util.List; /** - * native declaration : headers\openvr_capi.h:1338
- * This file was autogenerated by JNAerator,
- * a tool written by Olivier Chafik that uses a few opensource projects..
- * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VREvent_Status_t extends Structure { - public int statusState; - public VREvent_Status_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("statusState"); - } - public VREvent_Status_t(int statusState) { - super(); - this.statusState = statusState; - } - public VREvent_Status_t(Pointer peer) { - super(peer); - } - public static class ByReference extends VREvent_Status_t implements Structure.ByReference { - - }; - public static class ByValue extends VREvent_Status_t implements Structure.ByValue { - - }; + * native declaration : headers\openvr_capi.h:1338
+ * This file was autogenerated by JNAerator,
+ * a tool written by Olivier Chafik that uses a few opensource projects..
+ * For help, please visit NativeLibs4Java , Rococoa, or JNA. + */ +public class VREvent_Status_t extends Structure { + public int statusState; + public VREvent_Status_t() { + super(); + } + @Override + protected List getFieldOrder() { + return Arrays.asList("statusState"); + } + public VREvent_Status_t(int statusState) { + super(); + this.statusState = statusState; + } + public VREvent_Status_t(Pointer peer) { + super(peer); + } + public static class ByReference extends VREvent_Status_t implements Structure.ByReference { + + }; + public static class ByValue extends VREvent_Status_t implements Structure.ByValue { + + }; } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_TouchPadMove_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_TouchPadMove_t.java index 58f4af1122..dd123e0d3b 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_TouchPadMove_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_TouchPadMove_t.java @@ -4,40 +4,41 @@ import java.util.Arrays; import java.util.List; /** - * native declaration : headers\openvr_capi.h:1322
- * This file was autogenerated by JNAerator,
- * a tool written by Olivier Chafik that uses a few opensource projects..
- * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VREvent_TouchPadMove_t extends Structure { - public byte bFingerDown; - public float flSecondsFingerDown; - public float fValueXFirst; - public float fValueYFirst; - public float fValueXRaw; - public float fValueYRaw; - public VREvent_TouchPadMove_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("bFingerDown", "flSecondsFingerDown", "fValueXFirst", "fValueYFirst", "fValueXRaw", "fValueYRaw"); - } - public VREvent_TouchPadMove_t(byte bFingerDown, float flSecondsFingerDown, float fValueXFirst, float fValueYFirst, float fValueXRaw, float fValueYRaw) { - super(); - this.bFingerDown = bFingerDown; - this.flSecondsFingerDown = flSecondsFingerDown; - this.fValueXFirst = fValueXFirst; - this.fValueYFirst = fValueYFirst; - this.fValueXRaw = fValueXRaw; - this.fValueYRaw = fValueYRaw; - } - public VREvent_TouchPadMove_t(Pointer peer) { - super(peer); - } - public static class ByReference extends VREvent_TouchPadMove_t implements Structure.ByReference { - - }; - public static class ByValue extends VREvent_TouchPadMove_t implements Structure.ByValue { - - }; + * native declaration : headers\openvr_capi.h:1322
+ * This file was autogenerated by JNAerator,
+ * a tool written by Olivier Chafik that uses a few opensource projects..
+ * For help, please visit NativeLibs4Java , Rococoa, or JNA. + */ +public class VREvent_TouchPadMove_t extends Structure { + public byte bFingerDown; + public float flSecondsFingerDown; + public float fValueXFirst; + public float fValueYFirst; + public float fValueXRaw; + public float fValueYRaw; + public VREvent_TouchPadMove_t() { + super(); + } + @Override + protected List getFieldOrder() { + return Arrays.asList("bFingerDown", "flSecondsFingerDown", "fValueXFirst", "fValueYFirst", "fValueXRaw", "fValueYRaw"); + } + public VREvent_TouchPadMove_t(byte bFingerDown, float flSecondsFingerDown, float fValueXFirst, float fValueYFirst, float fValueXRaw, float fValueYRaw) { + super(); + this.bFingerDown = bFingerDown; + this.flSecondsFingerDown = flSecondsFingerDown; + this.fValueXFirst = fValueXFirst; + this.fValueYFirst = fValueYFirst; + this.fValueXRaw = fValueXRaw; + this.fValueYRaw = fValueYRaw; + } + public VREvent_TouchPadMove_t(Pointer peer) { + super(peer); + } + public static class ByReference extends VREvent_TouchPadMove_t implements Structure.ByReference { + + }; + public static class ByValue extends VREvent_TouchPadMove_t implements Structure.ByValue { + + }; } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_WebConsole_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_WebConsole_t.java index bcde8c67c3..21d9bdf390 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_WebConsole_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_WebConsole_t.java @@ -15,6 +15,7 @@ public class VREvent_WebConsole_t extends Structure { public VREvent_WebConsole_t() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("webConsoleHandle"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_t.java index e22ad5687e..843f9da821 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VREvent_t.java @@ -4,45 +4,46 @@ import java.util.Arrays; import java.util.List; /** - * An event posted by the server to all running applications
- * native declaration : headers\openvr_capi.h:1694
- * This file was autogenerated by JNAerator,
- * a tool written by Olivier Chafik that uses a few opensource projects..
- * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VREvent_t extends Structure { - /** EVREventType enum */ - public int eventType; - /** C type : TrackedDeviceIndex_t */ - public int trackedDeviceIndex; - public float eventAgeSeconds; - /** C type : VREvent_Data_t */ - public VREvent_Data_t data; - public VREvent_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("eventType", "trackedDeviceIndex", "eventAgeSeconds", "data"); - } + * An event posted by the server to all running applications
+ * native declaration : headers\openvr_capi.h:1694
+ * This file was autogenerated by JNAerator,
+ * a tool written by Olivier Chafik that uses a few opensource projects..
+ * For help, please visit NativeLibs4Java , Rococoa, or JNA. + */ +public class VREvent_t extends Structure { + /** EVREventType enum */ + public int eventType; + /** C type : TrackedDeviceIndex_t */ + public int trackedDeviceIndex; + public float eventAgeSeconds; + /** C type : VREvent_Data_t */ + public VREvent_Data_t data; + public VREvent_t() { + super(); + } + @Override + protected List getFieldOrder() { + return Arrays.asList("eventType", "trackedDeviceIndex", "eventAgeSeconds", "data"); + } /** - * @param eventType EVREventType enum
- * @param trackedDeviceIndex C type : TrackedDeviceIndex_t
- * @param data C type : VREvent_Data_t - */ - public VREvent_t(int eventType, int trackedDeviceIndex, float eventAgeSeconds, VREvent_Data_t data) { - super(); - this.eventType = eventType; - this.trackedDeviceIndex = trackedDeviceIndex; - this.eventAgeSeconds = eventAgeSeconds; - this.data = data; - } - public VREvent_t(Pointer peer) { - super(peer); - } - public static class ByReference extends VREvent_t implements Structure.ByReference { - - }; - public static class ByValue extends VREvent_t implements Structure.ByValue { - - }; + * @param eventType EVREventType enum
+ * @param trackedDeviceIndex C type : TrackedDeviceIndex_t
+ * @param data C type : VREvent_Data_t + */ + public VREvent_t(int eventType, int trackedDeviceIndex, float eventAgeSeconds, VREvent_Data_t data) { + super(); + this.eventType = eventType; + this.trackedDeviceIndex = trackedDeviceIndex; + this.eventAgeSeconds = eventAgeSeconds; + this.data = data; + } + public VREvent_t(Pointer peer) { + super(peer); + } + public static class ByReference extends VREvent_t implements Structure.ByReference { + + }; + public static class ByValue extends VREvent_t implements Structure.ByValue { + + }; } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VROverlayIntersectionMaskPrimitive_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VROverlayIntersectionMaskPrimitive_t.java index 63ec6c5b78..e0396fda97 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VROverlayIntersectionMaskPrimitive_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VROverlayIntersectionMaskPrimitive_t.java @@ -19,6 +19,7 @@ public class VROverlayIntersectionMaskPrimitive_t extends Structure { public VROverlayIntersectionMaskPrimitive_t() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("m_nPrimitiveType", "m_Primitive"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VROverlayIntersectionParams_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VROverlayIntersectionParams_t.java index 872e6609fe..053942a0e3 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VROverlayIntersectionParams_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VROverlayIntersectionParams_t.java @@ -21,6 +21,7 @@ public class VROverlayIntersectionParams_t extends Structure { public VROverlayIntersectionParams_t() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("vSource", "vDirection", "eOrigin"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VROverlayIntersectionResults_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VROverlayIntersectionResults_t.java index 22374baccc..7fa5b020f2 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VROverlayIntersectionResults_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VROverlayIntersectionResults_t.java @@ -4,44 +4,45 @@ import java.util.Arrays; import java.util.List; /** - * native declaration : headers\openvr_capi.h:1541
- * This file was autogenerated by JNAerator,
- * a tool written by Olivier Chafik that uses a few opensource projects..
- * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VROverlayIntersectionResults_t extends Structure { - /** C type : HmdVector3_t */ - public HmdVector3_t vPoint; - /** C type : HmdVector3_t */ - public HmdVector3_t vNormal; - /** C type : HmdVector2_t */ - public HmdVector2_t vUVs; - public float fDistance; - public VROverlayIntersectionResults_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("vPoint", "vNormal", "vUVs", "fDistance"); - } + * native declaration : headers\openvr_capi.h:1541
+ * This file was autogenerated by JNAerator,
+ * a tool written by Olivier Chafik that uses a few opensource projects..
+ * For help, please visit NativeLibs4Java , Rococoa, or JNA. + */ +public class VROverlayIntersectionResults_t extends Structure { + /** C type : HmdVector3_t */ + public HmdVector3_t vPoint; + /** C type : HmdVector3_t */ + public HmdVector3_t vNormal; + /** C type : HmdVector2_t */ + public HmdVector2_t vUVs; + public float fDistance; + public VROverlayIntersectionResults_t() { + super(); + } + @Override + protected List getFieldOrder() { + return Arrays.asList("vPoint", "vNormal", "vUVs", "fDistance"); + } /** - * @param vPoint C type : HmdVector3_t
- * @param vNormal C type : HmdVector3_t
- * @param vUVs C type : HmdVector2_t - */ - public VROverlayIntersectionResults_t(HmdVector3_t vPoint, HmdVector3_t vNormal, HmdVector2_t vUVs, float fDistance) { - super(); - this.vPoint = vPoint; - this.vNormal = vNormal; - this.vUVs = vUVs; - this.fDistance = fDistance; - } - public VROverlayIntersectionResults_t(Pointer peer) { - super(peer); - } - public static class ByReference extends VROverlayIntersectionResults_t implements Structure.ByReference { - - }; - public static class ByValue extends VROverlayIntersectionResults_t implements Structure.ByValue { - - }; + * @param vPoint C type : HmdVector3_t
+ * @param vNormal C type : HmdVector3_t
+ * @param vUVs C type : HmdVector2_t + */ + public VROverlayIntersectionResults_t(HmdVector3_t vPoint, HmdVector3_t vNormal, HmdVector2_t vUVs, float fDistance) { + super(); + this.vPoint = vPoint; + this.vNormal = vNormal; + this.vUVs = vUVs; + this.fDistance = fDistance; + } + public VROverlayIntersectionResults_t(Pointer peer) { + super(peer); + } + public static class ByReference extends VROverlayIntersectionResults_t implements Structure.ByReference { + + }; + public static class ByValue extends VROverlayIntersectionResults_t implements Structure.ByValue { + + }; } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRTextureBounds_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRTextureBounds_t.java index 3a0ce15df2..88c779846c 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRTextureBounds_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRTextureBounds_t.java @@ -4,36 +4,37 @@ import java.util.Arrays; import java.util.List; /** - * native declaration : headers\openvr_capi.h:1263
- * This file was autogenerated by JNAerator,
- * a tool written by Olivier Chafik that uses a few opensource projects..
- * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VRTextureBounds_t extends Structure { - public float uMin; - public float vMin; - public float uMax; - public float vMax; - public VRTextureBounds_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("uMin", "vMin", "uMax", "vMax"); - } - public VRTextureBounds_t(float uMin, float vMin, float uMax, float vMax) { - super(); - this.uMin = uMin; - this.vMin = vMin; - this.uMax = uMax; - this.vMax = vMax; - } - public VRTextureBounds_t(Pointer peer) { - super(peer); - } - public static class ByReference extends VRTextureBounds_t implements Structure.ByReference { - - }; - public static class ByValue extends VRTextureBounds_t implements Structure.ByValue { - - }; + * native declaration : headers\openvr_capi.h:1263
+ * This file was autogenerated by JNAerator,
+ * a tool written by Olivier Chafik that uses a few opensource projects..
+ * For help, please visit NativeLibs4Java , Rococoa, or JNA. + */ +public class VRTextureBounds_t extends Structure { + public float uMin; + public float vMin; + public float uMax; + public float vMax; + public VRTextureBounds_t() { + super(); + } + @Override + protected List getFieldOrder() { + return Arrays.asList("uMin", "vMin", "uMax", "vMax"); + } + public VRTextureBounds_t(float uMin, float vMin, float uMax, float vMax) { + super(); + this.uMin = uMin; + this.vMin = vMin; + this.uMax = uMax; + this.vMax = vMax; + } + public VRTextureBounds_t(Pointer peer) { + super(peer); + } + public static class ByReference extends VRTextureBounds_t implements Structure.ByReference { + + }; + public static class ByValue extends VRTextureBounds_t implements Structure.ByValue { + + }; } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRTextureDepthInfo_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRTextureDepthInfo_t.java index 6dc69f3fba..89f42f80be 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRTextureDepthInfo_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRTextureDepthInfo_t.java @@ -22,6 +22,7 @@ public class VRTextureDepthInfo_t extends Structure { public VRTextureDepthInfo_t() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("handle", "mProjection", "vRange"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRTextureWithDepth_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRTextureWithDepth_t.java index 2b58cfa601..0601b2b7a3 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRTextureWithDepth_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRTextureWithDepth_t.java @@ -15,6 +15,7 @@ public class VRTextureWithDepth_t extends Structure { public VRTextureWithDepth_t() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("depth"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRTextureWithPoseAndDepth_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRTextureWithPoseAndDepth_t.java index 1ae24aa8b8..bbe447ba2c 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRTextureWithPoseAndDepth_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRTextureWithPoseAndDepth_t.java @@ -15,6 +15,7 @@ public class VRTextureWithPoseAndDepth_t extends Structure { public VRTextureWithPoseAndDepth_t() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("depth"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRTextureWithPose_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRTextureWithPose_t.java index 694562e441..8eff35c066 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRTextureWithPose_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRTextureWithPose_t.java @@ -15,6 +15,7 @@ public class VRTextureWithPose_t extends Structure { public VRTextureWithPose_t() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("mDeviceToAbsoluteTracking"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRVulkanTextureData_t.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRVulkanTextureData_t.java index cf26144bc4..9ac3eb08bf 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRVulkanTextureData_t.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VRVulkanTextureData_t.java @@ -8,51 +8,52 @@ import java.util.Arrays; import java.util.List; /** - * native declaration : headers\openvr_capi.h:1294
- * This file was autogenerated by JNAerator,
- * a tool written by Olivier Chafik that uses a few opensource projects..
- * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VRVulkanTextureData_t extends Structure { - public long m_nImage; + * native declaration : headers\openvr_capi.h:1294
+ * This file was autogenerated by JNAerator,
+ * a tool written by Olivier Chafik that uses a few opensource projects..
+ * For help, please visit NativeLibs4Java , Rococoa, or JNA. + */ +public class VRVulkanTextureData_t extends Structure { + public long m_nImage; /** - * struct VkDevice_T *
- * C type : VkDevice_T* - */ - public VkDevice_T m_pDevice; + * struct VkDevice_T *
+ * C type : VkDevice_T* + */ + public VkDevice_T m_pDevice; /** - * struct VkPhysicalDevice_T *
- * C type : VkPhysicalDevice_T* - */ - public VkPhysicalDevice_T m_pPhysicalDevice; + * struct VkPhysicalDevice_T *
+ * C type : VkPhysicalDevice_T* + */ + public VkPhysicalDevice_T m_pPhysicalDevice; /** - * struct VkInstance_T *
- * C type : VkInstance_T* - */ - public VkInstance_T m_pInstance; + * struct VkInstance_T *
+ * C type : VkInstance_T* + */ + public VkInstance_T m_pInstance; /** - * struct VkQueue_T *
- * C type : VkQueue_T* - */ - public VkQueue_T m_pQueue; - public int m_nQueueFamilyIndex; - public int m_nWidth; - public int m_nHeight; - public int m_nFormat; - public int m_nSampleCount; - public VRVulkanTextureData_t() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("m_nImage", "m_pDevice", "m_pPhysicalDevice", "m_pInstance", "m_pQueue", "m_nQueueFamilyIndex", "m_nWidth", "m_nHeight", "m_nFormat", "m_nSampleCount"); - } - public VRVulkanTextureData_t(Pointer peer) { - super(peer); - } - public static class ByReference extends VRVulkanTextureData_t implements Structure.ByReference { - - }; - public static class ByValue extends VRVulkanTextureData_t implements Structure.ByValue { - - }; + * struct VkQueue_T *
+ * C type : VkQueue_T* + */ + public VkQueue_T m_pQueue; + public int m_nQueueFamilyIndex; + public int m_nWidth; + public int m_nHeight; + public int m_nFormat; + public int m_nSampleCount; + public VRVulkanTextureData_t() { + super(); + } + @Override + protected List getFieldOrder() { + return Arrays.asList("m_nImage", "m_pDevice", "m_pPhysicalDevice", "m_pInstance", "m_pQueue", "m_nQueueFamilyIndex", "m_nWidth", "m_nHeight", "m_nFormat", "m_nSampleCount"); + } + public VRVulkanTextureData_t(Pointer peer) { + super(peer); + } + public static class ByReference extends VRVulkanTextureData_t implements Structure.ByReference { + + }; + public static class ByValue extends VRVulkanTextureData_t implements Structure.ByValue { + + }; } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRApplications_FnTable.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRApplications_FnTable.java index 8c42698940..eed61b3e02 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRApplications_FnTable.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRApplications_FnTable.java @@ -6,211 +6,212 @@ import java.util.Arrays; import java.util.List; /** - * native declaration : headers\openvr_capi.h:1897
- * This file was autogenerated by JNAerator,
- * a tool written by Olivier Chafik that uses a few opensource projects..
- * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VR_IVRApplications_FnTable extends Structure { - /** C type : AddApplicationManifest_callback* */ - public VR_IVRApplications_FnTable.AddApplicationManifest_callback AddApplicationManifest; - /** C type : RemoveApplicationManifest_callback* */ - public VR_IVRApplications_FnTable.RemoveApplicationManifest_callback RemoveApplicationManifest; - /** C type : IsApplicationInstalled_callback* */ - public VR_IVRApplications_FnTable.IsApplicationInstalled_callback IsApplicationInstalled; - /** C type : GetApplicationCount_callback* */ - public VR_IVRApplications_FnTable.GetApplicationCount_callback GetApplicationCount; - /** C type : GetApplicationKeyByIndex_callback* */ - public VR_IVRApplications_FnTable.GetApplicationKeyByIndex_callback GetApplicationKeyByIndex; - /** C type : GetApplicationKeyByProcessId_callback* */ - public VR_IVRApplications_FnTable.GetApplicationKeyByProcessId_callback GetApplicationKeyByProcessId; - /** C type : LaunchApplication_callback* */ - public VR_IVRApplications_FnTable.LaunchApplication_callback LaunchApplication; - /** C type : LaunchTemplateApplication_callback* */ - public VR_IVRApplications_FnTable.LaunchTemplateApplication_callback LaunchTemplateApplication; - /** C type : LaunchApplicationFromMimeType_callback* */ - public VR_IVRApplications_FnTable.LaunchApplicationFromMimeType_callback LaunchApplicationFromMimeType; - /** C type : LaunchDashboardOverlay_callback* */ - public VR_IVRApplications_FnTable.LaunchDashboardOverlay_callback LaunchDashboardOverlay; - /** C type : CancelApplicationLaunch_callback* */ - public VR_IVRApplications_FnTable.CancelApplicationLaunch_callback CancelApplicationLaunch; - /** C type : IdentifyApplication_callback* */ - public VR_IVRApplications_FnTable.IdentifyApplication_callback IdentifyApplication; - /** C type : GetApplicationProcessId_callback* */ - public VR_IVRApplications_FnTable.GetApplicationProcessId_callback GetApplicationProcessId; - /** C type : GetApplicationsErrorNameFromEnum_callback* */ - public VR_IVRApplications_FnTable.GetApplicationsErrorNameFromEnum_callback GetApplicationsErrorNameFromEnum; - /** C type : GetApplicationPropertyString_callback* */ - public VR_IVRApplications_FnTable.GetApplicationPropertyString_callback GetApplicationPropertyString; - /** C type : GetApplicationPropertyBool_callback* */ - public VR_IVRApplications_FnTable.GetApplicationPropertyBool_callback GetApplicationPropertyBool; - /** C type : GetApplicationPropertyUint64_callback* */ - public VR_IVRApplications_FnTable.GetApplicationPropertyUint64_callback GetApplicationPropertyUint64; - /** C type : SetApplicationAutoLaunch_callback* */ - public VR_IVRApplications_FnTable.SetApplicationAutoLaunch_callback SetApplicationAutoLaunch; - /** C type : GetApplicationAutoLaunch_callback* */ - public VR_IVRApplications_FnTable.GetApplicationAutoLaunch_callback GetApplicationAutoLaunch; - /** C type : SetDefaultApplicationForMimeType_callback* */ - public VR_IVRApplications_FnTable.SetDefaultApplicationForMimeType_callback SetDefaultApplicationForMimeType; - /** C type : GetDefaultApplicationForMimeType_callback* */ - public VR_IVRApplications_FnTable.GetDefaultApplicationForMimeType_callback GetDefaultApplicationForMimeType; - /** C type : GetApplicationSupportedMimeTypes_callback* */ - public VR_IVRApplications_FnTable.GetApplicationSupportedMimeTypes_callback GetApplicationSupportedMimeTypes; - /** C type : GetApplicationsThatSupportMimeType_callback* */ - public VR_IVRApplications_FnTable.GetApplicationsThatSupportMimeType_callback GetApplicationsThatSupportMimeType; - /** C type : GetApplicationLaunchArguments_callback* */ - public VR_IVRApplications_FnTable.GetApplicationLaunchArguments_callback GetApplicationLaunchArguments; - /** C type : GetStartingApplication_callback* */ - public VR_IVRApplications_FnTable.GetStartingApplication_callback GetStartingApplication; - /** C type : GetTransitionState_callback* */ - public VR_IVRApplications_FnTable.GetTransitionState_callback GetTransitionState; - /** C type : PerformApplicationPrelaunchCheck_callback* */ - public VR_IVRApplications_FnTable.PerformApplicationPrelaunchCheck_callback PerformApplicationPrelaunchCheck; - /** C type : GetApplicationsTransitionStateNameFromEnum_callback* */ - public VR_IVRApplications_FnTable.GetApplicationsTransitionStateNameFromEnum_callback GetApplicationsTransitionStateNameFromEnum; - /** C type : IsQuitUserPromptRequested_callback* */ - public VR_IVRApplications_FnTable.IsQuitUserPromptRequested_callback IsQuitUserPromptRequested; - /** C type : LaunchInternalProcess_callback* */ - public VR_IVRApplications_FnTable.LaunchInternalProcess_callback LaunchInternalProcess; - /** C type : GetCurrentSceneProcessId_callback* */ - public VR_IVRApplications_FnTable.GetCurrentSceneProcessId_callback GetCurrentSceneProcessId; - /** native declaration : headers\openvr_capi.h:1866 */ - public interface AddApplicationManifest_callback extends Callback { - int apply(Pointer pchApplicationManifestFullPath, byte bTemporary); - }; - /** native declaration : headers\openvr_capi.h:1867 */ - public interface RemoveApplicationManifest_callback extends Callback { - int apply(Pointer pchApplicationManifestFullPath); - }; - /** native declaration : headers\openvr_capi.h:1868 */ - public interface IsApplicationInstalled_callback extends Callback { - byte apply(Pointer pchAppKey); - }; - /** native declaration : headers\openvr_capi.h:1869 */ - public interface GetApplicationCount_callback extends Callback { - int apply(); - }; - /** native declaration : headers\openvr_capi.h:1870 */ - public interface GetApplicationKeyByIndex_callback extends Callback { - int apply(int unApplicationIndex, Pointer pchAppKeyBuffer, int unAppKeyBufferLen); - }; - /** native declaration : headers\openvr_capi.h:1871 */ - public interface GetApplicationKeyByProcessId_callback extends Callback { - int apply(int unProcessId, Pointer pchAppKeyBuffer, int unAppKeyBufferLen); - }; - /** native declaration : headers\openvr_capi.h:1872 */ - public interface LaunchApplication_callback extends Callback { - int apply(Pointer pchAppKey); - }; - /** native declaration : headers\openvr_capi.h:1873 */ - public interface LaunchTemplateApplication_callback extends Callback { - int apply(Pointer pchTemplateAppKey, Pointer pchNewAppKey, AppOverrideKeys_t pKeys, int unKeys); - }; - /** native declaration : headers\openvr_capi.h:1874 */ - public interface LaunchApplicationFromMimeType_callback extends Callback { - int apply(Pointer pchMimeType, Pointer pchArgs); - }; - /** native declaration : headers\openvr_capi.h:1875 */ - public interface LaunchDashboardOverlay_callback extends Callback { - int apply(Pointer pchAppKey); - }; - /** native declaration : headers\openvr_capi.h:1876 */ - public interface CancelApplicationLaunch_callback extends Callback { - byte apply(Pointer pchAppKey); - }; - /** native declaration : headers\openvr_capi.h:1877 */ - public interface IdentifyApplication_callback extends Callback { - int apply(int unProcessId, Pointer pchAppKey); - }; - /** native declaration : headers\openvr_capi.h:1878 */ - public interface GetApplicationProcessId_callback extends Callback { - int apply(Pointer pchAppKey); - }; - /** native declaration : headers\openvr_capi.h:1879 */ - public interface GetApplicationsErrorNameFromEnum_callback extends Callback { - Pointer apply(int error); - }; - /** native declaration : headers\openvr_capi.h:1880 */ - public interface GetApplicationPropertyString_callback extends Callback { - int apply(Pointer pchAppKey, int eProperty, Pointer pchPropertyValueBuffer, int unPropertyValueBufferLen, IntByReference peError); - }; - /** native declaration : headers\openvr_capi.h:1881 */ - public interface GetApplicationPropertyBool_callback extends Callback { - byte apply(Pointer pchAppKey, int eProperty, IntByReference peError); - }; - /** native declaration : headers\openvr_capi.h:1882 */ - public interface GetApplicationPropertyUint64_callback extends Callback { - long apply(Pointer pchAppKey, int eProperty, IntByReference peError); - }; - /** native declaration : headers\openvr_capi.h:1883 */ - public interface SetApplicationAutoLaunch_callback extends Callback { - int apply(Pointer pchAppKey, byte bAutoLaunch); - }; - /** native declaration : headers\openvr_capi.h:1884 */ - public interface GetApplicationAutoLaunch_callback extends Callback { - byte apply(Pointer pchAppKey); - }; - /** native declaration : headers\openvr_capi.h:1885 */ - public interface SetDefaultApplicationForMimeType_callback extends Callback { - int apply(Pointer pchAppKey, Pointer pchMimeType); - }; - /** native declaration : headers\openvr_capi.h:1886 */ - public interface GetDefaultApplicationForMimeType_callback extends Callback { - byte apply(Pointer pchMimeType, Pointer pchAppKeyBuffer, int unAppKeyBufferLen); - }; - /** native declaration : headers\openvr_capi.h:1887 */ - public interface GetApplicationSupportedMimeTypes_callback extends Callback { - byte apply(Pointer pchAppKey, Pointer pchMimeTypesBuffer, int unMimeTypesBuffer); - }; - /** native declaration : headers\openvr_capi.h:1888 */ - public interface GetApplicationsThatSupportMimeType_callback extends Callback { - int apply(Pointer pchMimeType, Pointer pchAppKeysThatSupportBuffer, int unAppKeysThatSupportBuffer); - }; - /** native declaration : headers\openvr_capi.h:1889 */ - public interface GetApplicationLaunchArguments_callback extends Callback { - int apply(int unHandle, Pointer pchArgs, int unArgs); - }; - /** native declaration : headers\openvr_capi.h:1890 */ - public interface GetStartingApplication_callback extends Callback { - int apply(Pointer pchAppKeyBuffer, int unAppKeyBufferLen); - }; - /** native declaration : headers\openvr_capi.h:1891 */ - public interface GetTransitionState_callback extends Callback { - int apply(); - }; - /** native declaration : headers\openvr_capi.h:1892 */ - public interface PerformApplicationPrelaunchCheck_callback extends Callback { - int apply(Pointer pchAppKey); - }; - /** native declaration : headers\openvr_capi.h:1893 */ - public interface GetApplicationsTransitionStateNameFromEnum_callback extends Callback { - Pointer apply(int state); - }; - /** native declaration : headers\openvr_capi.h:1894 */ - public interface IsQuitUserPromptRequested_callback extends Callback { - byte apply(); - }; - /** native declaration : headers\openvr_capi.h:1895 */ - public interface LaunchInternalProcess_callback extends Callback { - int apply(Pointer pchBinaryPath, Pointer pchArguments, Pointer pchWorkingDirectory); - }; - /** native declaration : headers\openvr_capi.h:1896 */ - public interface GetCurrentSceneProcessId_callback extends Callback { - int apply(); - }; - public VR_IVRApplications_FnTable() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("AddApplicationManifest", "RemoveApplicationManifest", "IsApplicationInstalled", "GetApplicationCount", "GetApplicationKeyByIndex", "GetApplicationKeyByProcessId", "LaunchApplication", "LaunchTemplateApplication", "LaunchApplicationFromMimeType", "LaunchDashboardOverlay", "CancelApplicationLaunch", "IdentifyApplication", "GetApplicationProcessId", "GetApplicationsErrorNameFromEnum", "GetApplicationPropertyString", "GetApplicationPropertyBool", "GetApplicationPropertyUint64", "SetApplicationAutoLaunch", "GetApplicationAutoLaunch", "SetDefaultApplicationForMimeType", "GetDefaultApplicationForMimeType", "GetApplicationSupportedMimeTypes", "GetApplicationsThatSupportMimeType", "GetApplicationLaunchArguments", "GetStartingApplication", "GetTransitionState", "PerformApplicationPrelaunchCheck", "GetApplicationsTransitionStateNameFromEnum", "IsQuitUserPromptRequested", "LaunchInternalProcess", "GetCurrentSceneProcessId"); - } - public VR_IVRApplications_FnTable(Pointer peer) { - super(peer); - } - public static class ByReference extends VR_IVRApplications_FnTable implements Structure.ByReference { - - }; - public static class ByValue extends VR_IVRApplications_FnTable implements Structure.ByValue { - - }; + * native declaration : headers\openvr_capi.h:1897
+ * This file was autogenerated by JNAerator,
+ * a tool written by Olivier Chafik that uses a few opensource projects..
+ * For help, please visit NativeLibs4Java , Rococoa, or JNA. + */ +public class VR_IVRApplications_FnTable extends Structure { + /** C type : AddApplicationManifest_callback* */ + public VR_IVRApplications_FnTable.AddApplicationManifest_callback AddApplicationManifest; + /** C type : RemoveApplicationManifest_callback* */ + public VR_IVRApplications_FnTable.RemoveApplicationManifest_callback RemoveApplicationManifest; + /** C type : IsApplicationInstalled_callback* */ + public VR_IVRApplications_FnTable.IsApplicationInstalled_callback IsApplicationInstalled; + /** C type : GetApplicationCount_callback* */ + public VR_IVRApplications_FnTable.GetApplicationCount_callback GetApplicationCount; + /** C type : GetApplicationKeyByIndex_callback* */ + public VR_IVRApplications_FnTable.GetApplicationKeyByIndex_callback GetApplicationKeyByIndex; + /** C type : GetApplicationKeyByProcessId_callback* */ + public VR_IVRApplications_FnTable.GetApplicationKeyByProcessId_callback GetApplicationKeyByProcessId; + /** C type : LaunchApplication_callback* */ + public VR_IVRApplications_FnTable.LaunchApplication_callback LaunchApplication; + /** C type : LaunchTemplateApplication_callback* */ + public VR_IVRApplications_FnTable.LaunchTemplateApplication_callback LaunchTemplateApplication; + /** C type : LaunchApplicationFromMimeType_callback* */ + public VR_IVRApplications_FnTable.LaunchApplicationFromMimeType_callback LaunchApplicationFromMimeType; + /** C type : LaunchDashboardOverlay_callback* */ + public VR_IVRApplications_FnTable.LaunchDashboardOverlay_callback LaunchDashboardOverlay; + /** C type : CancelApplicationLaunch_callback* */ + public VR_IVRApplications_FnTable.CancelApplicationLaunch_callback CancelApplicationLaunch; + /** C type : IdentifyApplication_callback* */ + public VR_IVRApplications_FnTable.IdentifyApplication_callback IdentifyApplication; + /** C type : GetApplicationProcessId_callback* */ + public VR_IVRApplications_FnTable.GetApplicationProcessId_callback GetApplicationProcessId; + /** C type : GetApplicationsErrorNameFromEnum_callback* */ + public VR_IVRApplications_FnTable.GetApplicationsErrorNameFromEnum_callback GetApplicationsErrorNameFromEnum; + /** C type : GetApplicationPropertyString_callback* */ + public VR_IVRApplications_FnTable.GetApplicationPropertyString_callback GetApplicationPropertyString; + /** C type : GetApplicationPropertyBool_callback* */ + public VR_IVRApplications_FnTable.GetApplicationPropertyBool_callback GetApplicationPropertyBool; + /** C type : GetApplicationPropertyUint64_callback* */ + public VR_IVRApplications_FnTable.GetApplicationPropertyUint64_callback GetApplicationPropertyUint64; + /** C type : SetApplicationAutoLaunch_callback* */ + public VR_IVRApplications_FnTable.SetApplicationAutoLaunch_callback SetApplicationAutoLaunch; + /** C type : GetApplicationAutoLaunch_callback* */ + public VR_IVRApplications_FnTable.GetApplicationAutoLaunch_callback GetApplicationAutoLaunch; + /** C type : SetDefaultApplicationForMimeType_callback* */ + public VR_IVRApplications_FnTable.SetDefaultApplicationForMimeType_callback SetDefaultApplicationForMimeType; + /** C type : GetDefaultApplicationForMimeType_callback* */ + public VR_IVRApplications_FnTable.GetDefaultApplicationForMimeType_callback GetDefaultApplicationForMimeType; + /** C type : GetApplicationSupportedMimeTypes_callback* */ + public VR_IVRApplications_FnTable.GetApplicationSupportedMimeTypes_callback GetApplicationSupportedMimeTypes; + /** C type : GetApplicationsThatSupportMimeType_callback* */ + public VR_IVRApplications_FnTable.GetApplicationsThatSupportMimeType_callback GetApplicationsThatSupportMimeType; + /** C type : GetApplicationLaunchArguments_callback* */ + public VR_IVRApplications_FnTable.GetApplicationLaunchArguments_callback GetApplicationLaunchArguments; + /** C type : GetStartingApplication_callback* */ + public VR_IVRApplications_FnTable.GetStartingApplication_callback GetStartingApplication; + /** C type : GetTransitionState_callback* */ + public VR_IVRApplications_FnTable.GetTransitionState_callback GetTransitionState; + /** C type : PerformApplicationPrelaunchCheck_callback* */ + public VR_IVRApplications_FnTable.PerformApplicationPrelaunchCheck_callback PerformApplicationPrelaunchCheck; + /** C type : GetApplicationsTransitionStateNameFromEnum_callback* */ + public VR_IVRApplications_FnTable.GetApplicationsTransitionStateNameFromEnum_callback GetApplicationsTransitionStateNameFromEnum; + /** C type : IsQuitUserPromptRequested_callback* */ + public VR_IVRApplications_FnTable.IsQuitUserPromptRequested_callback IsQuitUserPromptRequested; + /** C type : LaunchInternalProcess_callback* */ + public VR_IVRApplications_FnTable.LaunchInternalProcess_callback LaunchInternalProcess; + /** C type : GetCurrentSceneProcessId_callback* */ + public VR_IVRApplications_FnTable.GetCurrentSceneProcessId_callback GetCurrentSceneProcessId; + /** native declaration : headers\openvr_capi.h:1866 */ + public interface AddApplicationManifest_callback extends Callback { + int apply(Pointer pchApplicationManifestFullPath, byte bTemporary); + }; + /** native declaration : headers\openvr_capi.h:1867 */ + public interface RemoveApplicationManifest_callback extends Callback { + int apply(Pointer pchApplicationManifestFullPath); + }; + /** native declaration : headers\openvr_capi.h:1868 */ + public interface IsApplicationInstalled_callback extends Callback { + byte apply(Pointer pchAppKey); + }; + /** native declaration : headers\openvr_capi.h:1869 */ + public interface GetApplicationCount_callback extends Callback { + int apply(); + }; + /** native declaration : headers\openvr_capi.h:1870 */ + public interface GetApplicationKeyByIndex_callback extends Callback { + int apply(int unApplicationIndex, Pointer pchAppKeyBuffer, int unAppKeyBufferLen); + }; + /** native declaration : headers\openvr_capi.h:1871 */ + public interface GetApplicationKeyByProcessId_callback extends Callback { + int apply(int unProcessId, Pointer pchAppKeyBuffer, int unAppKeyBufferLen); + }; + /** native declaration : headers\openvr_capi.h:1872 */ + public interface LaunchApplication_callback extends Callback { + int apply(Pointer pchAppKey); + }; + /** native declaration : headers\openvr_capi.h:1873 */ + public interface LaunchTemplateApplication_callback extends Callback { + int apply(Pointer pchTemplateAppKey, Pointer pchNewAppKey, AppOverrideKeys_t pKeys, int unKeys); + }; + /** native declaration : headers\openvr_capi.h:1874 */ + public interface LaunchApplicationFromMimeType_callback extends Callback { + int apply(Pointer pchMimeType, Pointer pchArgs); + }; + /** native declaration : headers\openvr_capi.h:1875 */ + public interface LaunchDashboardOverlay_callback extends Callback { + int apply(Pointer pchAppKey); + }; + /** native declaration : headers\openvr_capi.h:1876 */ + public interface CancelApplicationLaunch_callback extends Callback { + byte apply(Pointer pchAppKey); + }; + /** native declaration : headers\openvr_capi.h:1877 */ + public interface IdentifyApplication_callback extends Callback { + int apply(int unProcessId, Pointer pchAppKey); + }; + /** native declaration : headers\openvr_capi.h:1878 */ + public interface GetApplicationProcessId_callback extends Callback { + int apply(Pointer pchAppKey); + }; + /** native declaration : headers\openvr_capi.h:1879 */ + public interface GetApplicationsErrorNameFromEnum_callback extends Callback { + Pointer apply(int error); + }; + /** native declaration : headers\openvr_capi.h:1880 */ + public interface GetApplicationPropertyString_callback extends Callback { + int apply(Pointer pchAppKey, int eProperty, Pointer pchPropertyValueBuffer, int unPropertyValueBufferLen, IntByReference peError); + }; + /** native declaration : headers\openvr_capi.h:1881 */ + public interface GetApplicationPropertyBool_callback extends Callback { + byte apply(Pointer pchAppKey, int eProperty, IntByReference peError); + }; + /** native declaration : headers\openvr_capi.h:1882 */ + public interface GetApplicationPropertyUint64_callback extends Callback { + long apply(Pointer pchAppKey, int eProperty, IntByReference peError); + }; + /** native declaration : headers\openvr_capi.h:1883 */ + public interface SetApplicationAutoLaunch_callback extends Callback { + int apply(Pointer pchAppKey, byte bAutoLaunch); + }; + /** native declaration : headers\openvr_capi.h:1884 */ + public interface GetApplicationAutoLaunch_callback extends Callback { + byte apply(Pointer pchAppKey); + }; + /** native declaration : headers\openvr_capi.h:1885 */ + public interface SetDefaultApplicationForMimeType_callback extends Callback { + int apply(Pointer pchAppKey, Pointer pchMimeType); + }; + /** native declaration : headers\openvr_capi.h:1886 */ + public interface GetDefaultApplicationForMimeType_callback extends Callback { + byte apply(Pointer pchMimeType, Pointer pchAppKeyBuffer, int unAppKeyBufferLen); + }; + /** native declaration : headers\openvr_capi.h:1887 */ + public interface GetApplicationSupportedMimeTypes_callback extends Callback { + byte apply(Pointer pchAppKey, Pointer pchMimeTypesBuffer, int unMimeTypesBuffer); + }; + /** native declaration : headers\openvr_capi.h:1888 */ + public interface GetApplicationsThatSupportMimeType_callback extends Callback { + int apply(Pointer pchMimeType, Pointer pchAppKeysThatSupportBuffer, int unAppKeysThatSupportBuffer); + }; + /** native declaration : headers\openvr_capi.h:1889 */ + public interface GetApplicationLaunchArguments_callback extends Callback { + int apply(int unHandle, Pointer pchArgs, int unArgs); + }; + /** native declaration : headers\openvr_capi.h:1890 */ + public interface GetStartingApplication_callback extends Callback { + int apply(Pointer pchAppKeyBuffer, int unAppKeyBufferLen); + }; + /** native declaration : headers\openvr_capi.h:1891 */ + public interface GetTransitionState_callback extends Callback { + int apply(); + }; + /** native declaration : headers\openvr_capi.h:1892 */ + public interface PerformApplicationPrelaunchCheck_callback extends Callback { + int apply(Pointer pchAppKey); + }; + /** native declaration : headers\openvr_capi.h:1893 */ + public interface GetApplicationsTransitionStateNameFromEnum_callback extends Callback { + Pointer apply(int state); + }; + /** native declaration : headers\openvr_capi.h:1894 */ + public interface IsQuitUserPromptRequested_callback extends Callback { + byte apply(); + }; + /** native declaration : headers\openvr_capi.h:1895 */ + public interface LaunchInternalProcess_callback extends Callback { + int apply(Pointer pchBinaryPath, Pointer pchArguments, Pointer pchWorkingDirectory); + }; + /** native declaration : headers\openvr_capi.h:1896 */ + public interface GetCurrentSceneProcessId_callback extends Callback { + int apply(); + }; + public VR_IVRApplications_FnTable() { + super(); + } + @Override + protected List getFieldOrder() { + return Arrays.asList("AddApplicationManifest", "RemoveApplicationManifest", "IsApplicationInstalled", "GetApplicationCount", "GetApplicationKeyByIndex", "GetApplicationKeyByProcessId", "LaunchApplication", "LaunchTemplateApplication", "LaunchApplicationFromMimeType", "LaunchDashboardOverlay", "CancelApplicationLaunch", "IdentifyApplication", "GetApplicationProcessId", "GetApplicationsErrorNameFromEnum", "GetApplicationPropertyString", "GetApplicationPropertyBool", "GetApplicationPropertyUint64", "SetApplicationAutoLaunch", "GetApplicationAutoLaunch", "SetDefaultApplicationForMimeType", "GetDefaultApplicationForMimeType", "GetApplicationSupportedMimeTypes", "GetApplicationsThatSupportMimeType", "GetApplicationLaunchArguments", "GetStartingApplication", "GetTransitionState", "PerformApplicationPrelaunchCheck", "GetApplicationsTransitionStateNameFromEnum", "IsQuitUserPromptRequested", "LaunchInternalProcess", "GetCurrentSceneProcessId"); + } + public VR_IVRApplications_FnTable(Pointer peer) { + super(peer); + } + public static class ByReference extends VR_IVRApplications_FnTable implements Structure.ByReference { + + }; + public static class ByValue extends VR_IVRApplications_FnTable implements Structure.ByValue { + + }; } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRChaperoneSetup_FnTable.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRChaperoneSetup_FnTable.java index 36be54ea5b..5795f54df7 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRChaperoneSetup_FnTable.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRChaperoneSetup_FnTable.java @@ -7,145 +7,146 @@ import java.util.Arrays; import java.util.List; /** - * native declaration : headers\openvr_capi.h:1957
- * This file was autogenerated by JNAerator,
- * a tool written by Olivier Chafik that uses a few opensource projects..
- * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VR_IVRChaperoneSetup_FnTable extends Structure { - /** C type : CommitWorkingCopy_callback* */ - public VR_IVRChaperoneSetup_FnTable.CommitWorkingCopy_callback CommitWorkingCopy; - /** C type : RevertWorkingCopy_callback* */ - public VR_IVRChaperoneSetup_FnTable.RevertWorkingCopy_callback RevertWorkingCopy; - /** C type : GetWorkingPlayAreaSize_callback* */ - public VR_IVRChaperoneSetup_FnTable.GetWorkingPlayAreaSize_callback GetWorkingPlayAreaSize; - /** C type : GetWorkingPlayAreaRect_callback* */ - public VR_IVRChaperoneSetup_FnTable.GetWorkingPlayAreaRect_callback GetWorkingPlayAreaRect; - /** C type : GetWorkingCollisionBoundsInfo_callback* */ - public VR_IVRChaperoneSetup_FnTable.GetWorkingCollisionBoundsInfo_callback GetWorkingCollisionBoundsInfo; - /** C type : GetLiveCollisionBoundsInfo_callback* */ - public VR_IVRChaperoneSetup_FnTable.GetLiveCollisionBoundsInfo_callback GetLiveCollisionBoundsInfo; - /** C type : GetWorkingSeatedZeroPoseToRawTrackingPose_callback* */ - public VR_IVRChaperoneSetup_FnTable.GetWorkingSeatedZeroPoseToRawTrackingPose_callback GetWorkingSeatedZeroPoseToRawTrackingPose; - /** C type : GetWorkingStandingZeroPoseToRawTrackingPose_callback* */ - public VR_IVRChaperoneSetup_FnTable.GetWorkingStandingZeroPoseToRawTrackingPose_callback GetWorkingStandingZeroPoseToRawTrackingPose; - /** C type : SetWorkingPlayAreaSize_callback* */ - public VR_IVRChaperoneSetup_FnTable.SetWorkingPlayAreaSize_callback SetWorkingPlayAreaSize; - /** C type : SetWorkingCollisionBoundsInfo_callback* */ - public VR_IVRChaperoneSetup_FnTable.SetWorkingCollisionBoundsInfo_callback SetWorkingCollisionBoundsInfo; - /** C type : SetWorkingSeatedZeroPoseToRawTrackingPose_callback* */ - public VR_IVRChaperoneSetup_FnTable.SetWorkingSeatedZeroPoseToRawTrackingPose_callback SetWorkingSeatedZeroPoseToRawTrackingPose; - /** C type : SetWorkingStandingZeroPoseToRawTrackingPose_callback* */ - public VR_IVRChaperoneSetup_FnTable.SetWorkingStandingZeroPoseToRawTrackingPose_callback SetWorkingStandingZeroPoseToRawTrackingPose; - /** C type : ReloadFromDisk_callback* */ - public VR_IVRChaperoneSetup_FnTable.ReloadFromDisk_callback ReloadFromDisk; - /** C type : GetLiveSeatedZeroPoseToRawTrackingPose_callback* */ - public VR_IVRChaperoneSetup_FnTable.GetLiveSeatedZeroPoseToRawTrackingPose_callback GetLiveSeatedZeroPoseToRawTrackingPose; - /** C type : SetWorkingCollisionBoundsTagsInfo_callback* */ - public VR_IVRChaperoneSetup_FnTable.SetWorkingCollisionBoundsTagsInfo_callback SetWorkingCollisionBoundsTagsInfo; - /** C type : GetLiveCollisionBoundsTagsInfo_callback* */ - public VR_IVRChaperoneSetup_FnTable.GetLiveCollisionBoundsTagsInfo_callback GetLiveCollisionBoundsTagsInfo; - /** C type : SetWorkingPhysicalBoundsInfo_callback* */ - public VR_IVRChaperoneSetup_FnTable.SetWorkingPhysicalBoundsInfo_callback SetWorkingPhysicalBoundsInfo; - /** C type : GetLivePhysicalBoundsInfo_callback* */ - public VR_IVRChaperoneSetup_FnTable.GetLivePhysicalBoundsInfo_callback GetLivePhysicalBoundsInfo; - /** C type : ExportLiveToBuffer_callback* */ - public VR_IVRChaperoneSetup_FnTable.ExportLiveToBuffer_callback ExportLiveToBuffer; - /** C type : ImportFromBufferToWorking_callback* */ - public VR_IVRChaperoneSetup_FnTable.ImportFromBufferToWorking_callback ImportFromBufferToWorking; - /** native declaration : headers\openvr_capi.h:1937 */ - public interface CommitWorkingCopy_callback extends Callback { - byte apply(int configFile); - }; - /** native declaration : headers\openvr_capi.h:1938 */ - public interface RevertWorkingCopy_callback extends Callback { - void apply(); - }; - /** native declaration : headers\openvr_capi.h:1939 */ - public interface GetWorkingPlayAreaSize_callback extends Callback { - byte apply(FloatByReference pSizeX, FloatByReference pSizeZ); - }; - /** native declaration : headers\openvr_capi.h:1940 */ - public interface GetWorkingPlayAreaRect_callback extends Callback { - byte apply(HmdQuad_t rect); - }; - /** native declaration : headers\openvr_capi.h:1941 */ - public interface GetWorkingCollisionBoundsInfo_callback extends Callback { - byte apply(HmdQuad_t pQuadsBuffer, IntByReference punQuadsCount); - }; - /** native declaration : headers\openvr_capi.h:1942 */ - public interface GetLiveCollisionBoundsInfo_callback extends Callback { - byte apply(HmdQuad_t pQuadsBuffer, IntByReference punQuadsCount); - }; - /** native declaration : headers\openvr_capi.h:1943 */ - public interface GetWorkingSeatedZeroPoseToRawTrackingPose_callback extends Callback { - byte apply(HmdMatrix34_t pmatSeatedZeroPoseToRawTrackingPose); - }; - /** native declaration : headers\openvr_capi.h:1944 */ - public interface GetWorkingStandingZeroPoseToRawTrackingPose_callback extends Callback { - byte apply(HmdMatrix34_t pmatStandingZeroPoseToRawTrackingPose); - }; - /** native declaration : headers\openvr_capi.h:1945 */ - public interface SetWorkingPlayAreaSize_callback extends Callback { - void apply(float sizeX, float sizeZ); - }; - /** native declaration : headers\openvr_capi.h:1946 */ - public interface SetWorkingCollisionBoundsInfo_callback extends Callback { - void apply(HmdQuad_t pQuadsBuffer, int unQuadsCount); - }; - /** native declaration : headers\openvr_capi.h:1947 */ - public interface SetWorkingSeatedZeroPoseToRawTrackingPose_callback extends Callback { - void apply(HmdMatrix34_t pMatSeatedZeroPoseToRawTrackingPose); - }; - /** native declaration : headers\openvr_capi.h:1948 */ - public interface SetWorkingStandingZeroPoseToRawTrackingPose_callback extends Callback { - void apply(HmdMatrix34_t pMatStandingZeroPoseToRawTrackingPose); - }; - /** native declaration : headers\openvr_capi.h:1949 */ - public interface ReloadFromDisk_callback extends Callback { - void apply(int configFile); - }; - /** native declaration : headers\openvr_capi.h:1950 */ - public interface GetLiveSeatedZeroPoseToRawTrackingPose_callback extends Callback { - byte apply(HmdMatrix34_t pmatSeatedZeroPoseToRawTrackingPose); - }; - /** native declaration : headers\openvr_capi.h:1951 */ - public interface SetWorkingCollisionBoundsTagsInfo_callback extends Callback { - void apply(Pointer pTagsBuffer, int unTagCount); - }; - /** native declaration : headers\openvr_capi.h:1952 */ - public interface GetLiveCollisionBoundsTagsInfo_callback extends Callback { - byte apply(Pointer pTagsBuffer, IntByReference punTagCount); - }; - /** native declaration : headers\openvr_capi.h:1953 */ - public interface SetWorkingPhysicalBoundsInfo_callback extends Callback { - byte apply(HmdQuad_t pQuadsBuffer, int unQuadsCount); - }; - /** native declaration : headers\openvr_capi.h:1954 */ - public interface GetLivePhysicalBoundsInfo_callback extends Callback { - byte apply(HmdQuad_t pQuadsBuffer, IntByReference punQuadsCount); - }; - /** native declaration : headers\openvr_capi.h:1955 */ - public interface ExportLiveToBuffer_callback extends Callback { - byte apply(Pointer pBuffer, IntByReference pnBufferLength); - }; - /** native declaration : headers\openvr_capi.h:1956 */ - public interface ImportFromBufferToWorking_callback extends Callback { - byte apply(Pointer pBuffer, int nImportFlags); - }; - public VR_IVRChaperoneSetup_FnTable() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("CommitWorkingCopy", "RevertWorkingCopy", "GetWorkingPlayAreaSize", "GetWorkingPlayAreaRect", "GetWorkingCollisionBoundsInfo", "GetLiveCollisionBoundsInfo", "GetWorkingSeatedZeroPoseToRawTrackingPose", "GetWorkingStandingZeroPoseToRawTrackingPose", "SetWorkingPlayAreaSize", "SetWorkingCollisionBoundsInfo", "SetWorkingSeatedZeroPoseToRawTrackingPose", "SetWorkingStandingZeroPoseToRawTrackingPose", "ReloadFromDisk", "GetLiveSeatedZeroPoseToRawTrackingPose", "SetWorkingCollisionBoundsTagsInfo", "GetLiveCollisionBoundsTagsInfo", "SetWorkingPhysicalBoundsInfo", "GetLivePhysicalBoundsInfo", "ExportLiveToBuffer", "ImportFromBufferToWorking"); - } - public VR_IVRChaperoneSetup_FnTable(Pointer peer) { - super(peer); - } - public static class ByReference extends VR_IVRChaperoneSetup_FnTable implements Structure.ByReference { - - }; - public static class ByValue extends VR_IVRChaperoneSetup_FnTable implements Structure.ByValue { - - }; + * native declaration : headers\openvr_capi.h:1957
+ * This file was autogenerated by JNAerator,
+ * a tool written by Olivier Chafik that uses a few opensource projects..
+ * For help, please visit NativeLibs4Java , Rococoa, or JNA. + */ +public class VR_IVRChaperoneSetup_FnTable extends Structure { + /** C type : CommitWorkingCopy_callback* */ + public VR_IVRChaperoneSetup_FnTable.CommitWorkingCopy_callback CommitWorkingCopy; + /** C type : RevertWorkingCopy_callback* */ + public VR_IVRChaperoneSetup_FnTable.RevertWorkingCopy_callback RevertWorkingCopy; + /** C type : GetWorkingPlayAreaSize_callback* */ + public VR_IVRChaperoneSetup_FnTable.GetWorkingPlayAreaSize_callback GetWorkingPlayAreaSize; + /** C type : GetWorkingPlayAreaRect_callback* */ + public VR_IVRChaperoneSetup_FnTable.GetWorkingPlayAreaRect_callback GetWorkingPlayAreaRect; + /** C type : GetWorkingCollisionBoundsInfo_callback* */ + public VR_IVRChaperoneSetup_FnTable.GetWorkingCollisionBoundsInfo_callback GetWorkingCollisionBoundsInfo; + /** C type : GetLiveCollisionBoundsInfo_callback* */ + public VR_IVRChaperoneSetup_FnTable.GetLiveCollisionBoundsInfo_callback GetLiveCollisionBoundsInfo; + /** C type : GetWorkingSeatedZeroPoseToRawTrackingPose_callback* */ + public VR_IVRChaperoneSetup_FnTable.GetWorkingSeatedZeroPoseToRawTrackingPose_callback GetWorkingSeatedZeroPoseToRawTrackingPose; + /** C type : GetWorkingStandingZeroPoseToRawTrackingPose_callback* */ + public VR_IVRChaperoneSetup_FnTable.GetWorkingStandingZeroPoseToRawTrackingPose_callback GetWorkingStandingZeroPoseToRawTrackingPose; + /** C type : SetWorkingPlayAreaSize_callback* */ + public VR_IVRChaperoneSetup_FnTable.SetWorkingPlayAreaSize_callback SetWorkingPlayAreaSize; + /** C type : SetWorkingCollisionBoundsInfo_callback* */ + public VR_IVRChaperoneSetup_FnTable.SetWorkingCollisionBoundsInfo_callback SetWorkingCollisionBoundsInfo; + /** C type : SetWorkingSeatedZeroPoseToRawTrackingPose_callback* */ + public VR_IVRChaperoneSetup_FnTable.SetWorkingSeatedZeroPoseToRawTrackingPose_callback SetWorkingSeatedZeroPoseToRawTrackingPose; + /** C type : SetWorkingStandingZeroPoseToRawTrackingPose_callback* */ + public VR_IVRChaperoneSetup_FnTable.SetWorkingStandingZeroPoseToRawTrackingPose_callback SetWorkingStandingZeroPoseToRawTrackingPose; + /** C type : ReloadFromDisk_callback* */ + public VR_IVRChaperoneSetup_FnTable.ReloadFromDisk_callback ReloadFromDisk; + /** C type : GetLiveSeatedZeroPoseToRawTrackingPose_callback* */ + public VR_IVRChaperoneSetup_FnTable.GetLiveSeatedZeroPoseToRawTrackingPose_callback GetLiveSeatedZeroPoseToRawTrackingPose; + /** C type : SetWorkingCollisionBoundsTagsInfo_callback* */ + public VR_IVRChaperoneSetup_FnTable.SetWorkingCollisionBoundsTagsInfo_callback SetWorkingCollisionBoundsTagsInfo; + /** C type : GetLiveCollisionBoundsTagsInfo_callback* */ + public VR_IVRChaperoneSetup_FnTable.GetLiveCollisionBoundsTagsInfo_callback GetLiveCollisionBoundsTagsInfo; + /** C type : SetWorkingPhysicalBoundsInfo_callback* */ + public VR_IVRChaperoneSetup_FnTable.SetWorkingPhysicalBoundsInfo_callback SetWorkingPhysicalBoundsInfo; + /** C type : GetLivePhysicalBoundsInfo_callback* */ + public VR_IVRChaperoneSetup_FnTable.GetLivePhysicalBoundsInfo_callback GetLivePhysicalBoundsInfo; + /** C type : ExportLiveToBuffer_callback* */ + public VR_IVRChaperoneSetup_FnTable.ExportLiveToBuffer_callback ExportLiveToBuffer; + /** C type : ImportFromBufferToWorking_callback* */ + public VR_IVRChaperoneSetup_FnTable.ImportFromBufferToWorking_callback ImportFromBufferToWorking; + /** native declaration : headers\openvr_capi.h:1937 */ + public interface CommitWorkingCopy_callback extends Callback { + byte apply(int configFile); + }; + /** native declaration : headers\openvr_capi.h:1938 */ + public interface RevertWorkingCopy_callback extends Callback { + void apply(); + }; + /** native declaration : headers\openvr_capi.h:1939 */ + public interface GetWorkingPlayAreaSize_callback extends Callback { + byte apply(FloatByReference pSizeX, FloatByReference pSizeZ); + }; + /** native declaration : headers\openvr_capi.h:1940 */ + public interface GetWorkingPlayAreaRect_callback extends Callback { + byte apply(HmdQuad_t rect); + }; + /** native declaration : headers\openvr_capi.h:1941 */ + public interface GetWorkingCollisionBoundsInfo_callback extends Callback { + byte apply(HmdQuad_t pQuadsBuffer, IntByReference punQuadsCount); + }; + /** native declaration : headers\openvr_capi.h:1942 */ + public interface GetLiveCollisionBoundsInfo_callback extends Callback { + byte apply(HmdQuad_t pQuadsBuffer, IntByReference punQuadsCount); + }; + /** native declaration : headers\openvr_capi.h:1943 */ + public interface GetWorkingSeatedZeroPoseToRawTrackingPose_callback extends Callback { + byte apply(HmdMatrix34_t pmatSeatedZeroPoseToRawTrackingPose); + }; + /** native declaration : headers\openvr_capi.h:1944 */ + public interface GetWorkingStandingZeroPoseToRawTrackingPose_callback extends Callback { + byte apply(HmdMatrix34_t pmatStandingZeroPoseToRawTrackingPose); + }; + /** native declaration : headers\openvr_capi.h:1945 */ + public interface SetWorkingPlayAreaSize_callback extends Callback { + void apply(float sizeX, float sizeZ); + }; + /** native declaration : headers\openvr_capi.h:1946 */ + public interface SetWorkingCollisionBoundsInfo_callback extends Callback { + void apply(HmdQuad_t pQuadsBuffer, int unQuadsCount); + }; + /** native declaration : headers\openvr_capi.h:1947 */ + public interface SetWorkingSeatedZeroPoseToRawTrackingPose_callback extends Callback { + void apply(HmdMatrix34_t pMatSeatedZeroPoseToRawTrackingPose); + }; + /** native declaration : headers\openvr_capi.h:1948 */ + public interface SetWorkingStandingZeroPoseToRawTrackingPose_callback extends Callback { + void apply(HmdMatrix34_t pMatStandingZeroPoseToRawTrackingPose); + }; + /** native declaration : headers\openvr_capi.h:1949 */ + public interface ReloadFromDisk_callback extends Callback { + void apply(int configFile); + }; + /** native declaration : headers\openvr_capi.h:1950 */ + public interface GetLiveSeatedZeroPoseToRawTrackingPose_callback extends Callback { + byte apply(HmdMatrix34_t pmatSeatedZeroPoseToRawTrackingPose); + }; + /** native declaration : headers\openvr_capi.h:1951 */ + public interface SetWorkingCollisionBoundsTagsInfo_callback extends Callback { + void apply(Pointer pTagsBuffer, int unTagCount); + }; + /** native declaration : headers\openvr_capi.h:1952 */ + public interface GetLiveCollisionBoundsTagsInfo_callback extends Callback { + byte apply(Pointer pTagsBuffer, IntByReference punTagCount); + }; + /** native declaration : headers\openvr_capi.h:1953 */ + public interface SetWorkingPhysicalBoundsInfo_callback extends Callback { + byte apply(HmdQuad_t pQuadsBuffer, int unQuadsCount); + }; + /** native declaration : headers\openvr_capi.h:1954 */ + public interface GetLivePhysicalBoundsInfo_callback extends Callback { + byte apply(HmdQuad_t pQuadsBuffer, IntByReference punQuadsCount); + }; + /** native declaration : headers\openvr_capi.h:1955 */ + public interface ExportLiveToBuffer_callback extends Callback { + byte apply(Pointer pBuffer, IntByReference pnBufferLength); + }; + /** native declaration : headers\openvr_capi.h:1956 */ + public interface ImportFromBufferToWorking_callback extends Callback { + byte apply(Pointer pBuffer, int nImportFlags); + }; + public VR_IVRChaperoneSetup_FnTable() { + super(); + } + @Override + protected List getFieldOrder() { + return Arrays.asList("CommitWorkingCopy", "RevertWorkingCopy", "GetWorkingPlayAreaSize", "GetWorkingPlayAreaRect", "GetWorkingCollisionBoundsInfo", "GetLiveCollisionBoundsInfo", "GetWorkingSeatedZeroPoseToRawTrackingPose", "GetWorkingStandingZeroPoseToRawTrackingPose", "SetWorkingPlayAreaSize", "SetWorkingCollisionBoundsInfo", "SetWorkingSeatedZeroPoseToRawTrackingPose", "SetWorkingStandingZeroPoseToRawTrackingPose", "ReloadFromDisk", "GetLiveSeatedZeroPoseToRawTrackingPose", "SetWorkingCollisionBoundsTagsInfo", "GetLiveCollisionBoundsTagsInfo", "SetWorkingPhysicalBoundsInfo", "GetLivePhysicalBoundsInfo", "ExportLiveToBuffer", "ImportFromBufferToWorking"); + } + public VR_IVRChaperoneSetup_FnTable(Pointer peer) { + super(peer); + } + public static class ByReference extends VR_IVRChaperoneSetup_FnTable implements Structure.ByReference { + + }; + public static class ByValue extends VR_IVRChaperoneSetup_FnTable implements Structure.ByValue { + + }; } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRChaperone_FnTable.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRChaperone_FnTable.java index 6d71c06af7..1a575c6c09 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRChaperone_FnTable.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRChaperone_FnTable.java @@ -6,94 +6,95 @@ import java.util.Arrays; import java.util.List; /** - * native declaration : headers\openvr_capi.h:1915
- * This file was autogenerated by JNAerator,
- * a tool written by Olivier Chafik that uses a few opensource projects..
- * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VR_IVRChaperone_FnTable extends Structure { - /** C type : GetCalibrationState_callback* */ - public VR_IVRChaperone_FnTable.GetCalibrationState_callback GetCalibrationState; - /** C type : GetPlayAreaSize_callback* */ - public VR_IVRChaperone_FnTable.GetPlayAreaSize_callback GetPlayAreaSize; - /** C type : GetPlayAreaRect_callback* */ - public VR_IVRChaperone_FnTable.GetPlayAreaRect_callback GetPlayAreaRect; - /** C type : ReloadInfo_callback* */ - public VR_IVRChaperone_FnTable.ReloadInfo_callback ReloadInfo; - /** C type : SetSceneColor_callback* */ - public VR_IVRChaperone_FnTable.SetSceneColor_callback SetSceneColor; - /** C type : GetBoundsColor_callback* */ - public VR_IVRChaperone_FnTable.GetBoundsColor_callback GetBoundsColor; - /** C type : AreBoundsVisible_callback* */ - public VR_IVRChaperone_FnTable.AreBoundsVisible_callback AreBoundsVisible; - /** C type : ForceBoundsVisible_callback* */ - public VR_IVRChaperone_FnTable.ForceBoundsVisible_callback ForceBoundsVisible; - /** native declaration : headers\openvr_capi.h:1907 */ - public interface GetCalibrationState_callback extends Callback { - int apply(); - }; - /** native declaration : headers\openvr_capi.h:1908 */ - public interface GetPlayAreaSize_callback extends Callback { - byte apply(FloatByReference pSizeX, FloatByReference pSizeZ); - }; - /** native declaration : headers\openvr_capi.h:1909 */ - public interface GetPlayAreaRect_callback extends Callback { - byte apply(HmdQuad_t rect); - }; - /** native declaration : headers\openvr_capi.h:1910 */ - public interface ReloadInfo_callback extends Callback { - void apply(); - }; - /** native declaration : headers\openvr_capi.h:1911 */ - public interface SetSceneColor_callback extends Callback { - void apply(HmdColor_t.ByValue color); - }; - /** native declaration : headers\openvr_capi.h:1912 */ - public interface GetBoundsColor_callback extends Callback { - void apply(HmdColor_t pOutputColorArray, int nNumOutputColors, float flCollisionBoundsFadeDistance, HmdColor_t pOutputCameraColor); - }; - /** native declaration : headers\openvr_capi.h:1913 */ - public interface AreBoundsVisible_callback extends Callback { - byte apply(); - }; - /** native declaration : headers\openvr_capi.h:1914 */ - public interface ForceBoundsVisible_callback extends Callback { - void apply(byte bForce); - }; - public VR_IVRChaperone_FnTable() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("GetCalibrationState", "GetPlayAreaSize", "GetPlayAreaRect", "ReloadInfo", "SetSceneColor", "GetBoundsColor", "AreBoundsVisible", "ForceBoundsVisible"); - } + * native declaration : headers\openvr_capi.h:1915
+ * This file was autogenerated by JNAerator,
+ * a tool written by Olivier Chafik that uses a few opensource projects..
+ * For help, please visit NativeLibs4Java , Rococoa, or JNA. + */ +public class VR_IVRChaperone_FnTable extends Structure { + /** C type : GetCalibrationState_callback* */ + public VR_IVRChaperone_FnTable.GetCalibrationState_callback GetCalibrationState; + /** C type : GetPlayAreaSize_callback* */ + public VR_IVRChaperone_FnTable.GetPlayAreaSize_callback GetPlayAreaSize; + /** C type : GetPlayAreaRect_callback* */ + public VR_IVRChaperone_FnTable.GetPlayAreaRect_callback GetPlayAreaRect; + /** C type : ReloadInfo_callback* */ + public VR_IVRChaperone_FnTable.ReloadInfo_callback ReloadInfo; + /** C type : SetSceneColor_callback* */ + public VR_IVRChaperone_FnTable.SetSceneColor_callback SetSceneColor; + /** C type : GetBoundsColor_callback* */ + public VR_IVRChaperone_FnTable.GetBoundsColor_callback GetBoundsColor; + /** C type : AreBoundsVisible_callback* */ + public VR_IVRChaperone_FnTable.AreBoundsVisible_callback AreBoundsVisible; + /** C type : ForceBoundsVisible_callback* */ + public VR_IVRChaperone_FnTable.ForceBoundsVisible_callback ForceBoundsVisible; + /** native declaration : headers\openvr_capi.h:1907 */ + public interface GetCalibrationState_callback extends Callback { + int apply(); + }; + /** native declaration : headers\openvr_capi.h:1908 */ + public interface GetPlayAreaSize_callback extends Callback { + byte apply(FloatByReference pSizeX, FloatByReference pSizeZ); + }; + /** native declaration : headers\openvr_capi.h:1909 */ + public interface GetPlayAreaRect_callback extends Callback { + byte apply(HmdQuad_t rect); + }; + /** native declaration : headers\openvr_capi.h:1910 */ + public interface ReloadInfo_callback extends Callback { + void apply(); + }; + /** native declaration : headers\openvr_capi.h:1911 */ + public interface SetSceneColor_callback extends Callback { + void apply(HmdColor_t.ByValue color); + }; + /** native declaration : headers\openvr_capi.h:1912 */ + public interface GetBoundsColor_callback extends Callback { + void apply(HmdColor_t pOutputColorArray, int nNumOutputColors, float flCollisionBoundsFadeDistance, HmdColor_t pOutputCameraColor); + }; + /** native declaration : headers\openvr_capi.h:1913 */ + public interface AreBoundsVisible_callback extends Callback { + byte apply(); + }; + /** native declaration : headers\openvr_capi.h:1914 */ + public interface ForceBoundsVisible_callback extends Callback { + void apply(byte bForce); + }; + public VR_IVRChaperone_FnTable() { + super(); + } + @Override + protected List getFieldOrder() { + return Arrays.asList("GetCalibrationState", "GetPlayAreaSize", "GetPlayAreaRect", "ReloadInfo", "SetSceneColor", "GetBoundsColor", "AreBoundsVisible", "ForceBoundsVisible"); + } /** - * @param GetCalibrationState C type : GetCalibrationState_callback*
- * @param GetPlayAreaSize C type : GetPlayAreaSize_callback*
- * @param GetPlayAreaRect C type : GetPlayAreaRect_callback*
- * @param ReloadInfo C type : ReloadInfo_callback*
- * @param SetSceneColor C type : SetSceneColor_callback*
- * @param GetBoundsColor C type : GetBoundsColor_callback*
- * @param AreBoundsVisible C type : AreBoundsVisible_callback*
- * @param ForceBoundsVisible C type : ForceBoundsVisible_callback* - */ - public VR_IVRChaperone_FnTable(VR_IVRChaperone_FnTable.GetCalibrationState_callback GetCalibrationState, VR_IVRChaperone_FnTable.GetPlayAreaSize_callback GetPlayAreaSize, VR_IVRChaperone_FnTable.GetPlayAreaRect_callback GetPlayAreaRect, VR_IVRChaperone_FnTable.ReloadInfo_callback ReloadInfo, VR_IVRChaperone_FnTable.SetSceneColor_callback SetSceneColor, VR_IVRChaperone_FnTable.GetBoundsColor_callback GetBoundsColor, VR_IVRChaperone_FnTable.AreBoundsVisible_callback AreBoundsVisible, VR_IVRChaperone_FnTable.ForceBoundsVisible_callback ForceBoundsVisible) { - super(); - this.GetCalibrationState = GetCalibrationState; - this.GetPlayAreaSize = GetPlayAreaSize; - this.GetPlayAreaRect = GetPlayAreaRect; - this.ReloadInfo = ReloadInfo; - this.SetSceneColor = SetSceneColor; - this.GetBoundsColor = GetBoundsColor; - this.AreBoundsVisible = AreBoundsVisible; - this.ForceBoundsVisible = ForceBoundsVisible; - } - public VR_IVRChaperone_FnTable(Pointer peer) { - super(peer); - } - public static class ByReference extends VR_IVRChaperone_FnTable implements Structure.ByReference { - - }; - public static class ByValue extends VR_IVRChaperone_FnTable implements Structure.ByValue { - - }; + * @param GetCalibrationState C type : GetCalibrationState_callback*
+ * @param GetPlayAreaSize C type : GetPlayAreaSize_callback*
+ * @param GetPlayAreaRect C type : GetPlayAreaRect_callback*
+ * @param ReloadInfo C type : ReloadInfo_callback*
+ * @param SetSceneColor C type : SetSceneColor_callback*
+ * @param GetBoundsColor C type : GetBoundsColor_callback*
+ * @param AreBoundsVisible C type : AreBoundsVisible_callback*
+ * @param ForceBoundsVisible C type : ForceBoundsVisible_callback* + */ + public VR_IVRChaperone_FnTable(VR_IVRChaperone_FnTable.GetCalibrationState_callback GetCalibrationState, VR_IVRChaperone_FnTable.GetPlayAreaSize_callback GetPlayAreaSize, VR_IVRChaperone_FnTable.GetPlayAreaRect_callback GetPlayAreaRect, VR_IVRChaperone_FnTable.ReloadInfo_callback ReloadInfo, VR_IVRChaperone_FnTable.SetSceneColor_callback SetSceneColor, VR_IVRChaperone_FnTable.GetBoundsColor_callback GetBoundsColor, VR_IVRChaperone_FnTable.AreBoundsVisible_callback AreBoundsVisible, VR_IVRChaperone_FnTable.ForceBoundsVisible_callback ForceBoundsVisible) { + super(); + this.GetCalibrationState = GetCalibrationState; + this.GetPlayAreaSize = GetPlayAreaSize; + this.GetPlayAreaRect = GetPlayAreaRect; + this.ReloadInfo = ReloadInfo; + this.SetSceneColor = SetSceneColor; + this.GetBoundsColor = GetBoundsColor; + this.AreBoundsVisible = AreBoundsVisible; + this.ForceBoundsVisible = ForceBoundsVisible; + } + public VR_IVRChaperone_FnTable(Pointer peer) { + super(peer); + } + public static class ByReference extends VR_IVRChaperone_FnTable implements Structure.ByReference { + + }; + public static class ByValue extends VR_IVRChaperone_FnTable implements Structure.ByValue { + + }; } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRCompositor_FnTable.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRCompositor_FnTable.java index f4154dfdac..53a3039437 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRCompositor_FnTable.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRCompositor_FnTable.java @@ -8,283 +8,284 @@ import java.util.Arrays; import java.util.List; /** - * native declaration : headers\openvr_capi.h:2045
- * This file was autogenerated by JNAerator,
- * a tool written by Olivier Chafik that uses a few opensource projects..
- * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VR_IVRCompositor_FnTable extends Structure { - /** C type : SetTrackingSpace_callback* */ - public VR_IVRCompositor_FnTable.SetTrackingSpace_callback SetTrackingSpace; - /** C type : GetTrackingSpace_callback* */ - public VR_IVRCompositor_FnTable.GetTrackingSpace_callback GetTrackingSpace; - /** C type : WaitGetPoses_callback* */ - public VR_IVRCompositor_FnTable.WaitGetPoses_callback WaitGetPoses; - /** C type : GetLastPoses_callback* */ - public VR_IVRCompositor_FnTable.GetLastPoses_callback GetLastPoses; - /** C type : GetLastPoseForTrackedDeviceIndex_callback* */ - public VR_IVRCompositor_FnTable.GetLastPoseForTrackedDeviceIndex_callback GetLastPoseForTrackedDeviceIndex; - /** C type : Submit_callback* */ - public VR_IVRCompositor_FnTable.Submit_callback Submit; - /** C type : ClearLastSubmittedFrame_callback* */ - public VR_IVRCompositor_FnTable.ClearLastSubmittedFrame_callback ClearLastSubmittedFrame; - /** C type : PostPresentHandoff_callback* */ - public VR_IVRCompositor_FnTable.PostPresentHandoff_callback PostPresentHandoff; - /** C type : GetFrameTiming_callback* */ - public VR_IVRCompositor_FnTable.GetFrameTiming_callback GetFrameTiming; - /** C type : GetFrameTimings_callback* */ - public VR_IVRCompositor_FnTable.GetFrameTimings_callback GetFrameTimings; - /** C type : GetFrameTimeRemaining_callback* */ - public VR_IVRCompositor_FnTable.GetFrameTimeRemaining_callback GetFrameTimeRemaining; - /** C type : GetCumulativeStats_callback* */ - public VR_IVRCompositor_FnTable.GetCumulativeStats_callback GetCumulativeStats; - /** C type : FadeToColor_callback* */ - public VR_IVRCompositor_FnTable.FadeToColor_callback FadeToColor; - /** C type : GetCurrentFadeColor_callback* */ - public VR_IVRCompositor_FnTable.GetCurrentFadeColor_callback GetCurrentFadeColor; - /** C type : FadeGrid_callback* */ - public VR_IVRCompositor_FnTable.FadeGrid_callback FadeGrid; - /** C type : GetCurrentGridAlpha_callback* */ - public VR_IVRCompositor_FnTable.GetCurrentGridAlpha_callback GetCurrentGridAlpha; - /** C type : SetSkyboxOverride_callback* */ - public VR_IVRCompositor_FnTable.SetSkyboxOverride_callback SetSkyboxOverride; - /** C type : ClearSkyboxOverride_callback* */ - public VR_IVRCompositor_FnTable.ClearSkyboxOverride_callback ClearSkyboxOverride; - /** C type : CompositorBringToFront_callback* */ - public VR_IVRCompositor_FnTable.CompositorBringToFront_callback CompositorBringToFront; - /** C type : CompositorGoToBack_callback* */ - public VR_IVRCompositor_FnTable.CompositorGoToBack_callback CompositorGoToBack; - /** C type : CompositorQuit_callback* */ - public VR_IVRCompositor_FnTable.CompositorQuit_callback CompositorQuit; - /** C type : IsFullscreen_callback* */ - public VR_IVRCompositor_FnTable.IsFullscreen_callback IsFullscreen; - /** C type : GetCurrentSceneFocusProcess_callback* */ - public VR_IVRCompositor_FnTable.GetCurrentSceneFocusProcess_callback GetCurrentSceneFocusProcess; - /** C type : GetLastFrameRenderer_callback* */ - public VR_IVRCompositor_FnTable.GetLastFrameRenderer_callback GetLastFrameRenderer; - /** C type : CanRenderScene_callback* */ - public VR_IVRCompositor_FnTable.CanRenderScene_callback CanRenderScene; - /** C type : ShowMirrorWindow_callback* */ - public VR_IVRCompositor_FnTable.ShowMirrorWindow_callback ShowMirrorWindow; - /** C type : HideMirrorWindow_callback* */ - public VR_IVRCompositor_FnTable.HideMirrorWindow_callback HideMirrorWindow; - /** C type : IsMirrorWindowVisible_callback* */ - public VR_IVRCompositor_FnTable.IsMirrorWindowVisible_callback IsMirrorWindowVisible; - /** C type : CompositorDumpImages_callback* */ - public VR_IVRCompositor_FnTable.CompositorDumpImages_callback CompositorDumpImages; - /** C type : ShouldAppRenderWithLowResources_callback* */ - public VR_IVRCompositor_FnTable.ShouldAppRenderWithLowResources_callback ShouldAppRenderWithLowResources; - /** C type : ForceInterleavedReprojectionOn_callback* */ - public VR_IVRCompositor_FnTable.ForceInterleavedReprojectionOn_callback ForceInterleavedReprojectionOn; - /** C type : ForceReconnectProcess_callback* */ - public VR_IVRCompositor_FnTable.ForceReconnectProcess_callback ForceReconnectProcess; - /** C type : SuspendRendering_callback* */ - public VR_IVRCompositor_FnTable.SuspendRendering_callback SuspendRendering; - /** C type : GetMirrorTextureD3D11_callback* */ - public VR_IVRCompositor_FnTable.GetMirrorTextureD3D11_callback GetMirrorTextureD3D11; - /** C type : ReleaseMirrorTextureD3D11_callback* */ - public VR_IVRCompositor_FnTable.ReleaseMirrorTextureD3D11_callback ReleaseMirrorTextureD3D11; - /** C type : GetMirrorTextureGL_callback* */ - public VR_IVRCompositor_FnTable.GetMirrorTextureGL_callback GetMirrorTextureGL; - /** C type : ReleaseSharedGLTexture_callback* */ - public VR_IVRCompositor_FnTable.ReleaseSharedGLTexture_callback ReleaseSharedGLTexture; - /** C type : LockGLSharedTextureForAccess_callback* */ - public VR_IVRCompositor_FnTable.LockGLSharedTextureForAccess_callback LockGLSharedTextureForAccess; - /** C type : UnlockGLSharedTextureForAccess_callback* */ - public VR_IVRCompositor_FnTable.UnlockGLSharedTextureForAccess_callback UnlockGLSharedTextureForAccess; - /** C type : GetVulkanInstanceExtensionsRequired_callback* */ - public VR_IVRCompositor_FnTable.GetVulkanInstanceExtensionsRequired_callback GetVulkanInstanceExtensionsRequired; - /** C type : GetVulkanDeviceExtensionsRequired_callback* */ - public VR_IVRCompositor_FnTable.GetVulkanDeviceExtensionsRequired_callback GetVulkanDeviceExtensionsRequired; - /** C type : SetExplicitTimingMode_callback* */ - public VR_IVRCompositor_FnTable.SetExplicitTimingMode_callback SetExplicitTimingMode; - /** C type : SubmitExplicitTimingData_callback* */ - public VR_IVRCompositor_FnTable.SubmitExplicitTimingData_callback SubmitExplicitTimingData; - /** native declaration : headers\openvr_capi.h:2002 */ - public interface SetTrackingSpace_callback extends Callback { - void apply(int eOrigin); - }; - /** native declaration : headers\openvr_capi.h:2003 */ - public interface GetTrackingSpace_callback extends Callback { - int apply(); - }; - /** native declaration : headers\openvr_capi.h:2004 */ - public interface WaitGetPoses_callback extends Callback { - int apply(TrackedDevicePose_t pRenderPoseArray, int unRenderPoseArrayCount, TrackedDevicePose_t pGamePoseArray, int unGamePoseArrayCount); - }; - /** native declaration : headers\openvr_capi.h:2005 */ - public interface GetLastPoses_callback extends Callback { - int apply(TrackedDevicePose_t pRenderPoseArray, int unRenderPoseArrayCount, TrackedDevicePose_t pGamePoseArray, int unGamePoseArrayCount); - }; - /** native declaration : headers\openvr_capi.h:2006 */ - public interface GetLastPoseForTrackedDeviceIndex_callback extends Callback { - int apply(int unDeviceIndex, TrackedDevicePose_t pOutputPose, TrackedDevicePose_t pOutputGamePose); - }; - /** native declaration : headers\openvr_capi.h:2007 */ - public interface Submit_callback extends Callback { - int apply(int eEye, Texture_t pTexture, VRTextureBounds_t pBounds, int nSubmitFlags); - }; - /** native declaration : headers\openvr_capi.h:2008 */ - public interface ClearLastSubmittedFrame_callback extends Callback { - void apply(); - }; - /** native declaration : headers\openvr_capi.h:2009 */ - public interface PostPresentHandoff_callback extends Callback { - void apply(); - }; - /** native declaration : headers\openvr_capi.h:2010 */ - public interface GetFrameTiming_callback extends Callback { - byte apply(Compositor_FrameTiming pTiming, int unFramesAgo); - }; - /** native declaration : headers\openvr_capi.h:2011 */ - public interface GetFrameTimings_callback extends Callback { - int apply(Compositor_FrameTiming pTiming, int nFrames); - }; - /** native declaration : headers\openvr_capi.h:2012 */ - public interface GetFrameTimeRemaining_callback extends Callback { - float apply(); - }; - /** native declaration : headers\openvr_capi.h:2013 */ - public interface GetCumulativeStats_callback extends Callback { - void apply(Compositor_CumulativeStats pStats, int nStatsSizeInBytes); - }; - /** native declaration : headers\openvr_capi.h:2014 */ - public interface FadeToColor_callback extends Callback { - void apply(float fSeconds, float fRed, float fGreen, float fBlue, float fAlpha, byte bBackground); - }; - /** native declaration : headers\openvr_capi.h:2015 */ - public interface GetCurrentFadeColor_callback extends Callback { - com.jme3.system.jopenvr.HmdColor_t.ByValue apply(byte bBackground); - }; - /** native declaration : headers\openvr_capi.h:2016 */ - public interface FadeGrid_callback extends Callback { - void apply(float fSeconds, byte bFadeIn); - }; - /** native declaration : headers\openvr_capi.h:2017 */ - public interface GetCurrentGridAlpha_callback extends Callback { - float apply(); - }; - /** native declaration : headers\openvr_capi.h:2018 */ - public interface SetSkyboxOverride_callback extends Callback { - int apply(Texture_t pTextures, int unTextureCount); - }; - /** native declaration : headers\openvr_capi.h:2019 */ - public interface ClearSkyboxOverride_callback extends Callback { - void apply(); - }; - /** native declaration : headers\openvr_capi.h:2020 */ - public interface CompositorBringToFront_callback extends Callback { - void apply(); - }; - /** native declaration : headers\openvr_capi.h:2021 */ - public interface CompositorGoToBack_callback extends Callback { - void apply(); - }; - /** native declaration : headers\openvr_capi.h:2022 */ - public interface CompositorQuit_callback extends Callback { - void apply(); - }; - /** native declaration : headers\openvr_capi.h:2023 */ - public interface IsFullscreen_callback extends Callback { - byte apply(); - }; - /** native declaration : headers\openvr_capi.h:2024 */ - public interface GetCurrentSceneFocusProcess_callback extends Callback { - int apply(); - }; - /** native declaration : headers\openvr_capi.h:2025 */ - public interface GetLastFrameRenderer_callback extends Callback { - int apply(); - }; - /** native declaration : headers\openvr_capi.h:2026 */ - public interface CanRenderScene_callback extends Callback { - byte apply(); - }; - /** native declaration : headers\openvr_capi.h:2027 */ - public interface ShowMirrorWindow_callback extends Callback { - void apply(); - }; - /** native declaration : headers\openvr_capi.h:2028 */ - public interface HideMirrorWindow_callback extends Callback { - void apply(); - }; - /** native declaration : headers\openvr_capi.h:2029 */ - public interface IsMirrorWindowVisible_callback extends Callback { - byte apply(); - }; - /** native declaration : headers\openvr_capi.h:2030 */ - public interface CompositorDumpImages_callback extends Callback { - void apply(); - }; - /** native declaration : headers\openvr_capi.h:2031 */ - public interface ShouldAppRenderWithLowResources_callback extends Callback { - byte apply(); - }; - /** native declaration : headers\openvr_capi.h:2032 */ - public interface ForceInterleavedReprojectionOn_callback extends Callback { - void apply(byte bOverride); - }; - /** native declaration : headers\openvr_capi.h:2033 */ - public interface ForceReconnectProcess_callback extends Callback { - void apply(); - }; - /** native declaration : headers\openvr_capi.h:2034 */ - public interface SuspendRendering_callback extends Callback { - void apply(byte bSuspend); - }; - /** native declaration : headers\openvr_capi.h:2035 */ - public interface GetMirrorTextureD3D11_callback extends Callback { - int apply(int eEye, Pointer pD3D11DeviceOrResource, PointerByReference ppD3D11ShaderResourceView); - }; - /** native declaration : headers\openvr_capi.h:2036 */ - public interface ReleaseMirrorTextureD3D11_callback extends Callback { - void apply(Pointer pD3D11ShaderResourceView); - }; - /** native declaration : headers\openvr_capi.h:2037 */ - public interface GetMirrorTextureGL_callback extends Callback { - int apply(int eEye, IntByReference pglTextureId, PointerByReference pglSharedTextureHandle); - }; - /** native declaration : headers\openvr_capi.h:2038 */ - public interface ReleaseSharedGLTexture_callback extends Callback { - byte apply(int glTextureId, Pointer glSharedTextureHandle); - }; - /** native declaration : headers\openvr_capi.h:2039 */ - public interface LockGLSharedTextureForAccess_callback extends Callback { - void apply(Pointer glSharedTextureHandle); - }; - /** native declaration : headers\openvr_capi.h:2040 */ - public interface UnlockGLSharedTextureForAccess_callback extends Callback { - void apply(Pointer glSharedTextureHandle); - }; - /** native declaration : headers\openvr_capi.h:2041 */ - public interface GetVulkanInstanceExtensionsRequired_callback extends Callback { - int apply(Pointer pchValue, int unBufferSize); - }; - /** native declaration : headers\openvr_capi.h:2042 */ - public interface GetVulkanDeviceExtensionsRequired_callback extends Callback { - int apply(VkPhysicalDevice_T pPhysicalDevice, Pointer pchValue, int unBufferSize); - }; - /** native declaration : headers\openvr_capi.h:2043 */ - public interface SetExplicitTimingMode_callback extends Callback { - void apply(int eTimingMode); - }; - /** native declaration : headers\openvr_capi.h:2044 */ - public interface SubmitExplicitTimingData_callback extends Callback { - int apply(); - }; - public VR_IVRCompositor_FnTable() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("SetTrackingSpace", "GetTrackingSpace", "WaitGetPoses", "GetLastPoses", "GetLastPoseForTrackedDeviceIndex", "Submit", "ClearLastSubmittedFrame", "PostPresentHandoff", "GetFrameTiming", "GetFrameTimings", "GetFrameTimeRemaining", "GetCumulativeStats", "FadeToColor", "GetCurrentFadeColor", "FadeGrid", "GetCurrentGridAlpha", "SetSkyboxOverride", "ClearSkyboxOverride", "CompositorBringToFront", "CompositorGoToBack", "CompositorQuit", "IsFullscreen", "GetCurrentSceneFocusProcess", "GetLastFrameRenderer", "CanRenderScene", "ShowMirrorWindow", "HideMirrorWindow", "IsMirrorWindowVisible", "CompositorDumpImages", "ShouldAppRenderWithLowResources", "ForceInterleavedReprojectionOn", "ForceReconnectProcess", "SuspendRendering", "GetMirrorTextureD3D11", "ReleaseMirrorTextureD3D11", "GetMirrorTextureGL", "ReleaseSharedGLTexture", "LockGLSharedTextureForAccess", "UnlockGLSharedTextureForAccess", "GetVulkanInstanceExtensionsRequired", "GetVulkanDeviceExtensionsRequired", "SetExplicitTimingMode", "SubmitExplicitTimingData"); - } - public VR_IVRCompositor_FnTable(Pointer peer) { - super(peer); - } - public static class ByReference extends VR_IVRCompositor_FnTable implements Structure.ByReference { - - }; - public static class ByValue extends VR_IVRCompositor_FnTable implements Structure.ByValue { - - }; + * native declaration : headers\openvr_capi.h:2045
+ * This file was autogenerated by JNAerator,
+ * a tool written by Olivier Chafik that uses a few opensource projects..
+ * For help, please visit NativeLibs4Java , Rococoa, or JNA. + */ +public class VR_IVRCompositor_FnTable extends Structure { + /** C type : SetTrackingSpace_callback* */ + public VR_IVRCompositor_FnTable.SetTrackingSpace_callback SetTrackingSpace; + /** C type : GetTrackingSpace_callback* */ + public VR_IVRCompositor_FnTable.GetTrackingSpace_callback GetTrackingSpace; + /** C type : WaitGetPoses_callback* */ + public VR_IVRCompositor_FnTable.WaitGetPoses_callback WaitGetPoses; + /** C type : GetLastPoses_callback* */ + public VR_IVRCompositor_FnTable.GetLastPoses_callback GetLastPoses; + /** C type : GetLastPoseForTrackedDeviceIndex_callback* */ + public VR_IVRCompositor_FnTable.GetLastPoseForTrackedDeviceIndex_callback GetLastPoseForTrackedDeviceIndex; + /** C type : Submit_callback* */ + public VR_IVRCompositor_FnTable.Submit_callback Submit; + /** C type : ClearLastSubmittedFrame_callback* */ + public VR_IVRCompositor_FnTable.ClearLastSubmittedFrame_callback ClearLastSubmittedFrame; + /** C type : PostPresentHandoff_callback* */ + public VR_IVRCompositor_FnTable.PostPresentHandoff_callback PostPresentHandoff; + /** C type : GetFrameTiming_callback* */ + public VR_IVRCompositor_FnTable.GetFrameTiming_callback GetFrameTiming; + /** C type : GetFrameTimings_callback* */ + public VR_IVRCompositor_FnTable.GetFrameTimings_callback GetFrameTimings; + /** C type : GetFrameTimeRemaining_callback* */ + public VR_IVRCompositor_FnTable.GetFrameTimeRemaining_callback GetFrameTimeRemaining; + /** C type : GetCumulativeStats_callback* */ + public VR_IVRCompositor_FnTable.GetCumulativeStats_callback GetCumulativeStats; + /** C type : FadeToColor_callback* */ + public VR_IVRCompositor_FnTable.FadeToColor_callback FadeToColor; + /** C type : GetCurrentFadeColor_callback* */ + public VR_IVRCompositor_FnTable.GetCurrentFadeColor_callback GetCurrentFadeColor; + /** C type : FadeGrid_callback* */ + public VR_IVRCompositor_FnTable.FadeGrid_callback FadeGrid; + /** C type : GetCurrentGridAlpha_callback* */ + public VR_IVRCompositor_FnTable.GetCurrentGridAlpha_callback GetCurrentGridAlpha; + /** C type : SetSkyboxOverride_callback* */ + public VR_IVRCompositor_FnTable.SetSkyboxOverride_callback SetSkyboxOverride; + /** C type : ClearSkyboxOverride_callback* */ + public VR_IVRCompositor_FnTable.ClearSkyboxOverride_callback ClearSkyboxOverride; + /** C type : CompositorBringToFront_callback* */ + public VR_IVRCompositor_FnTable.CompositorBringToFront_callback CompositorBringToFront; + /** C type : CompositorGoToBack_callback* */ + public VR_IVRCompositor_FnTable.CompositorGoToBack_callback CompositorGoToBack; + /** C type : CompositorQuit_callback* */ + public VR_IVRCompositor_FnTable.CompositorQuit_callback CompositorQuit; + /** C type : IsFullscreen_callback* */ + public VR_IVRCompositor_FnTable.IsFullscreen_callback IsFullscreen; + /** C type : GetCurrentSceneFocusProcess_callback* */ + public VR_IVRCompositor_FnTable.GetCurrentSceneFocusProcess_callback GetCurrentSceneFocusProcess; + /** C type : GetLastFrameRenderer_callback* */ + public VR_IVRCompositor_FnTable.GetLastFrameRenderer_callback GetLastFrameRenderer; + /** C type : CanRenderScene_callback* */ + public VR_IVRCompositor_FnTable.CanRenderScene_callback CanRenderScene; + /** C type : ShowMirrorWindow_callback* */ + public VR_IVRCompositor_FnTable.ShowMirrorWindow_callback ShowMirrorWindow; + /** C type : HideMirrorWindow_callback* */ + public VR_IVRCompositor_FnTable.HideMirrorWindow_callback HideMirrorWindow; + /** C type : IsMirrorWindowVisible_callback* */ + public VR_IVRCompositor_FnTable.IsMirrorWindowVisible_callback IsMirrorWindowVisible; + /** C type : CompositorDumpImages_callback* */ + public VR_IVRCompositor_FnTable.CompositorDumpImages_callback CompositorDumpImages; + /** C type : ShouldAppRenderWithLowResources_callback* */ + public VR_IVRCompositor_FnTable.ShouldAppRenderWithLowResources_callback ShouldAppRenderWithLowResources; + /** C type : ForceInterleavedReprojectionOn_callback* */ + public VR_IVRCompositor_FnTable.ForceInterleavedReprojectionOn_callback ForceInterleavedReprojectionOn; + /** C type : ForceReconnectProcess_callback* */ + public VR_IVRCompositor_FnTable.ForceReconnectProcess_callback ForceReconnectProcess; + /** C type : SuspendRendering_callback* */ + public VR_IVRCompositor_FnTable.SuspendRendering_callback SuspendRendering; + /** C type : GetMirrorTextureD3D11_callback* */ + public VR_IVRCompositor_FnTable.GetMirrorTextureD3D11_callback GetMirrorTextureD3D11; + /** C type : ReleaseMirrorTextureD3D11_callback* */ + public VR_IVRCompositor_FnTable.ReleaseMirrorTextureD3D11_callback ReleaseMirrorTextureD3D11; + /** C type : GetMirrorTextureGL_callback* */ + public VR_IVRCompositor_FnTable.GetMirrorTextureGL_callback GetMirrorTextureGL; + /** C type : ReleaseSharedGLTexture_callback* */ + public VR_IVRCompositor_FnTable.ReleaseSharedGLTexture_callback ReleaseSharedGLTexture; + /** C type : LockGLSharedTextureForAccess_callback* */ + public VR_IVRCompositor_FnTable.LockGLSharedTextureForAccess_callback LockGLSharedTextureForAccess; + /** C type : UnlockGLSharedTextureForAccess_callback* */ + public VR_IVRCompositor_FnTable.UnlockGLSharedTextureForAccess_callback UnlockGLSharedTextureForAccess; + /** C type : GetVulkanInstanceExtensionsRequired_callback* */ + public VR_IVRCompositor_FnTable.GetVulkanInstanceExtensionsRequired_callback GetVulkanInstanceExtensionsRequired; + /** C type : GetVulkanDeviceExtensionsRequired_callback* */ + public VR_IVRCompositor_FnTable.GetVulkanDeviceExtensionsRequired_callback GetVulkanDeviceExtensionsRequired; + /** C type : SetExplicitTimingMode_callback* */ + public VR_IVRCompositor_FnTable.SetExplicitTimingMode_callback SetExplicitTimingMode; + /** C type : SubmitExplicitTimingData_callback* */ + public VR_IVRCompositor_FnTable.SubmitExplicitTimingData_callback SubmitExplicitTimingData; + /** native declaration : headers\openvr_capi.h:2002 */ + public interface SetTrackingSpace_callback extends Callback { + void apply(int eOrigin); + }; + /** native declaration : headers\openvr_capi.h:2003 */ + public interface GetTrackingSpace_callback extends Callback { + int apply(); + }; + /** native declaration : headers\openvr_capi.h:2004 */ + public interface WaitGetPoses_callback extends Callback { + int apply(TrackedDevicePose_t pRenderPoseArray, int unRenderPoseArrayCount, TrackedDevicePose_t pGamePoseArray, int unGamePoseArrayCount); + }; + /** native declaration : headers\openvr_capi.h:2005 */ + public interface GetLastPoses_callback extends Callback { + int apply(TrackedDevicePose_t pRenderPoseArray, int unRenderPoseArrayCount, TrackedDevicePose_t pGamePoseArray, int unGamePoseArrayCount); + }; + /** native declaration : headers\openvr_capi.h:2006 */ + public interface GetLastPoseForTrackedDeviceIndex_callback extends Callback { + int apply(int unDeviceIndex, TrackedDevicePose_t pOutputPose, TrackedDevicePose_t pOutputGamePose); + }; + /** native declaration : headers\openvr_capi.h:2007 */ + public interface Submit_callback extends Callback { + int apply(int eEye, Texture_t pTexture, VRTextureBounds_t pBounds, int nSubmitFlags); + }; + /** native declaration : headers\openvr_capi.h:2008 */ + public interface ClearLastSubmittedFrame_callback extends Callback { + void apply(); + }; + /** native declaration : headers\openvr_capi.h:2009 */ + public interface PostPresentHandoff_callback extends Callback { + void apply(); + }; + /** native declaration : headers\openvr_capi.h:2010 */ + public interface GetFrameTiming_callback extends Callback { + byte apply(Compositor_FrameTiming pTiming, int unFramesAgo); + }; + /** native declaration : headers\openvr_capi.h:2011 */ + public interface GetFrameTimings_callback extends Callback { + int apply(Compositor_FrameTiming pTiming, int nFrames); + }; + /** native declaration : headers\openvr_capi.h:2012 */ + public interface GetFrameTimeRemaining_callback extends Callback { + float apply(); + }; + /** native declaration : headers\openvr_capi.h:2013 */ + public interface GetCumulativeStats_callback extends Callback { + void apply(Compositor_CumulativeStats pStats, int nStatsSizeInBytes); + }; + /** native declaration : headers\openvr_capi.h:2014 */ + public interface FadeToColor_callback extends Callback { + void apply(float fSeconds, float fRed, float fGreen, float fBlue, float fAlpha, byte bBackground); + }; + /** native declaration : headers\openvr_capi.h:2015 */ + public interface GetCurrentFadeColor_callback extends Callback { + com.jme3.system.jopenvr.HmdColor_t.ByValue apply(byte bBackground); + }; + /** native declaration : headers\openvr_capi.h:2016 */ + public interface FadeGrid_callback extends Callback { + void apply(float fSeconds, byte bFadeIn); + }; + /** native declaration : headers\openvr_capi.h:2017 */ + public interface GetCurrentGridAlpha_callback extends Callback { + float apply(); + }; + /** native declaration : headers\openvr_capi.h:2018 */ + public interface SetSkyboxOverride_callback extends Callback { + int apply(Texture_t pTextures, int unTextureCount); + }; + /** native declaration : headers\openvr_capi.h:2019 */ + public interface ClearSkyboxOverride_callback extends Callback { + void apply(); + }; + /** native declaration : headers\openvr_capi.h:2020 */ + public interface CompositorBringToFront_callback extends Callback { + void apply(); + }; + /** native declaration : headers\openvr_capi.h:2021 */ + public interface CompositorGoToBack_callback extends Callback { + void apply(); + }; + /** native declaration : headers\openvr_capi.h:2022 */ + public interface CompositorQuit_callback extends Callback { + void apply(); + }; + /** native declaration : headers\openvr_capi.h:2023 */ + public interface IsFullscreen_callback extends Callback { + byte apply(); + }; + /** native declaration : headers\openvr_capi.h:2024 */ + public interface GetCurrentSceneFocusProcess_callback extends Callback { + int apply(); + }; + /** native declaration : headers\openvr_capi.h:2025 */ + public interface GetLastFrameRenderer_callback extends Callback { + int apply(); + }; + /** native declaration : headers\openvr_capi.h:2026 */ + public interface CanRenderScene_callback extends Callback { + byte apply(); + }; + /** native declaration : headers\openvr_capi.h:2027 */ + public interface ShowMirrorWindow_callback extends Callback { + void apply(); + }; + /** native declaration : headers\openvr_capi.h:2028 */ + public interface HideMirrorWindow_callback extends Callback { + void apply(); + }; + /** native declaration : headers\openvr_capi.h:2029 */ + public interface IsMirrorWindowVisible_callback extends Callback { + byte apply(); + }; + /** native declaration : headers\openvr_capi.h:2030 */ + public interface CompositorDumpImages_callback extends Callback { + void apply(); + }; + /** native declaration : headers\openvr_capi.h:2031 */ + public interface ShouldAppRenderWithLowResources_callback extends Callback { + byte apply(); + }; + /** native declaration : headers\openvr_capi.h:2032 */ + public interface ForceInterleavedReprojectionOn_callback extends Callback { + void apply(byte bOverride); + }; + /** native declaration : headers\openvr_capi.h:2033 */ + public interface ForceReconnectProcess_callback extends Callback { + void apply(); + }; + /** native declaration : headers\openvr_capi.h:2034 */ + public interface SuspendRendering_callback extends Callback { + void apply(byte bSuspend); + }; + /** native declaration : headers\openvr_capi.h:2035 */ + public interface GetMirrorTextureD3D11_callback extends Callback { + int apply(int eEye, Pointer pD3D11DeviceOrResource, PointerByReference ppD3D11ShaderResourceView); + }; + /** native declaration : headers\openvr_capi.h:2036 */ + public interface ReleaseMirrorTextureD3D11_callback extends Callback { + void apply(Pointer pD3D11ShaderResourceView); + }; + /** native declaration : headers\openvr_capi.h:2037 */ + public interface GetMirrorTextureGL_callback extends Callback { + int apply(int eEye, IntByReference pglTextureId, PointerByReference pglSharedTextureHandle); + }; + /** native declaration : headers\openvr_capi.h:2038 */ + public interface ReleaseSharedGLTexture_callback extends Callback { + byte apply(int glTextureId, Pointer glSharedTextureHandle); + }; + /** native declaration : headers\openvr_capi.h:2039 */ + public interface LockGLSharedTextureForAccess_callback extends Callback { + void apply(Pointer glSharedTextureHandle); + }; + /** native declaration : headers\openvr_capi.h:2040 */ + public interface UnlockGLSharedTextureForAccess_callback extends Callback { + void apply(Pointer glSharedTextureHandle); + }; + /** native declaration : headers\openvr_capi.h:2041 */ + public interface GetVulkanInstanceExtensionsRequired_callback extends Callback { + int apply(Pointer pchValue, int unBufferSize); + }; + /** native declaration : headers\openvr_capi.h:2042 */ + public interface GetVulkanDeviceExtensionsRequired_callback extends Callback { + int apply(VkPhysicalDevice_T pPhysicalDevice, Pointer pchValue, int unBufferSize); + }; + /** native declaration : headers\openvr_capi.h:2043 */ + public interface SetExplicitTimingMode_callback extends Callback { + void apply(int eTimingMode); + }; + /** native declaration : headers\openvr_capi.h:2044 */ + public interface SubmitExplicitTimingData_callback extends Callback { + int apply(); + }; + public VR_IVRCompositor_FnTable() { + super(); + } + @Override + protected List getFieldOrder() { + return Arrays.asList("SetTrackingSpace", "GetTrackingSpace", "WaitGetPoses", "GetLastPoses", "GetLastPoseForTrackedDeviceIndex", "Submit", "ClearLastSubmittedFrame", "PostPresentHandoff", "GetFrameTiming", "GetFrameTimings", "GetFrameTimeRemaining", "GetCumulativeStats", "FadeToColor", "GetCurrentFadeColor", "FadeGrid", "GetCurrentGridAlpha", "SetSkyboxOverride", "ClearSkyboxOverride", "CompositorBringToFront", "CompositorGoToBack", "CompositorQuit", "IsFullscreen", "GetCurrentSceneFocusProcess", "GetLastFrameRenderer", "CanRenderScene", "ShowMirrorWindow", "HideMirrorWindow", "IsMirrorWindowVisible", "CompositorDumpImages", "ShouldAppRenderWithLowResources", "ForceInterleavedReprojectionOn", "ForceReconnectProcess", "SuspendRendering", "GetMirrorTextureD3D11", "ReleaseMirrorTextureD3D11", "GetMirrorTextureGL", "ReleaseSharedGLTexture", "LockGLSharedTextureForAccess", "UnlockGLSharedTextureForAccess", "GetVulkanInstanceExtensionsRequired", "GetVulkanDeviceExtensionsRequired", "SetExplicitTimingMode", "SubmitExplicitTimingData"); + } + public VR_IVRCompositor_FnTable(Pointer peer) { + super(peer); + } + public static class ByReference extends VR_IVRCompositor_FnTable implements Structure.ByReference { + + }; + public static class ByValue extends VR_IVRCompositor_FnTable implements Structure.ByValue { + + }; } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRDriverManager_FnTable.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRDriverManager_FnTable.java index f8e926a1c7..13e444730b 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRDriverManager_FnTable.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRDriverManager_FnTable.java @@ -5,54 +5,55 @@ import java.util.Arrays; import java.util.List; /** - * native declaration : headers\openvr_capi.h:2313
- * This file was autogenerated by JNAerator,
- * a tool written by Olivier Chafik that uses a few opensource projects..
- * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VR_IVRDriverManager_FnTable extends Structure { - /** C type : GetDriverCount_callback* */ - public VR_IVRDriverManager_FnTable.GetDriverCount_callback GetDriverCount; - /** C type : GetDriverName_callback* */ - public VR_IVRDriverManager_FnTable.GetDriverName_callback GetDriverName; - /** C type : GetDriverHandle_callback* */ - public VR_IVRDriverManager_FnTable.GetDriverHandle_callback GetDriverHandle; - /** native declaration : headers\openvr_capi.h:2310 */ - public interface GetDriverCount_callback extends Callback { - int apply(); - }; - /** native declaration : headers\openvr_capi.h:2311 */ - public interface GetDriverName_callback extends Callback { - int apply(int nDriver, Pointer pchValue, int unBufferSize); - }; - /** native declaration : headers\openvr_capi.h:2312 */ - public interface GetDriverHandle_callback extends Callback { - long apply(Pointer pchDriverName); - }; - public VR_IVRDriverManager_FnTable() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("GetDriverCount", "GetDriverName", "GetDriverHandle"); - } + * native declaration : headers\openvr_capi.h:2313
+ * This file was autogenerated by JNAerator,
+ * a tool written by Olivier Chafik that uses a few opensource projects..
+ * For help, please visit NativeLibs4Java , Rococoa, or JNA. + */ +public class VR_IVRDriverManager_FnTable extends Structure { + /** C type : GetDriverCount_callback* */ + public VR_IVRDriverManager_FnTable.GetDriverCount_callback GetDriverCount; + /** C type : GetDriverName_callback* */ + public VR_IVRDriverManager_FnTable.GetDriverName_callback GetDriverName; + /** C type : GetDriverHandle_callback* */ + public VR_IVRDriverManager_FnTable.GetDriverHandle_callback GetDriverHandle; + /** native declaration : headers\openvr_capi.h:2310 */ + public interface GetDriverCount_callback extends Callback { + int apply(); + }; + /** native declaration : headers\openvr_capi.h:2311 */ + public interface GetDriverName_callback extends Callback { + int apply(int nDriver, Pointer pchValue, int unBufferSize); + }; + /** native declaration : headers\openvr_capi.h:2312 */ + public interface GetDriverHandle_callback extends Callback { + long apply(Pointer pchDriverName); + }; + public VR_IVRDriverManager_FnTable() { + super(); + } + @Override + protected List getFieldOrder() { + return Arrays.asList("GetDriverCount", "GetDriverName", "GetDriverHandle"); + } /** - * @param GetDriverCount C type : GetDriverCount_callback*
- * @param GetDriverName C type : GetDriverName_callback*
- * @param GetDriverHandle C type : GetDriverHandle_callback* - */ - public VR_IVRDriverManager_FnTable(VR_IVRDriverManager_FnTable.GetDriverCount_callback GetDriverCount, VR_IVRDriverManager_FnTable.GetDriverName_callback GetDriverName, VR_IVRDriverManager_FnTable.GetDriverHandle_callback GetDriverHandle) { - super(); - this.GetDriverCount = GetDriverCount; - this.GetDriverName = GetDriverName; - this.GetDriverHandle = GetDriverHandle; - } - public VR_IVRDriverManager_FnTable(Pointer peer) { - super(peer); - } - public static class ByReference extends VR_IVRDriverManager_FnTable implements Structure.ByReference { - - }; - public static class ByValue extends VR_IVRDriverManager_FnTable implements Structure.ByValue { - - }; + * @param GetDriverCount C type : GetDriverCount_callback*
+ * @param GetDriverName C type : GetDriverName_callback*
+ * @param GetDriverHandle C type : GetDriverHandle_callback* + */ + public VR_IVRDriverManager_FnTable(VR_IVRDriverManager_FnTable.GetDriverCount_callback GetDriverCount, VR_IVRDriverManager_FnTable.GetDriverName_callback GetDriverName, VR_IVRDriverManager_FnTable.GetDriverHandle_callback GetDriverHandle) { + super(); + this.GetDriverCount = GetDriverCount; + this.GetDriverName = GetDriverName; + this.GetDriverHandle = GetDriverHandle; + } + public VR_IVRDriverManager_FnTable(Pointer peer) { + super(peer); + } + public static class ByReference extends VR_IVRDriverManager_FnTable implements Structure.ByReference { + + }; + public static class ByValue extends VR_IVRDriverManager_FnTable implements Structure.ByValue { + + }; } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRExtendedDisplay_FnTable.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRExtendedDisplay_FnTable.java index de9b54af2e..2b04732a73 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRExtendedDisplay_FnTable.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRExtendedDisplay_FnTable.java @@ -6,54 +6,55 @@ import java.util.Arrays; import java.util.List; /** - * native declaration : headers\openvr_capi.h:1807
- * This file was autogenerated by JNAerator,
- * a tool written by Olivier Chafik that uses a few opensource projects..
- * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VR_IVRExtendedDisplay_FnTable extends Structure { - /** C type : GetWindowBounds_callback* */ - public VR_IVRExtendedDisplay_FnTable.GetWindowBounds_callback GetWindowBounds; - /** C type : GetEyeOutputViewport_callback* */ - public VR_IVRExtendedDisplay_FnTable.GetEyeOutputViewport_callback GetEyeOutputViewport; - /** C type : GetDXGIOutputInfo_callback* */ - public VR_IVRExtendedDisplay_FnTable.GetDXGIOutputInfo_callback GetDXGIOutputInfo; - /** native declaration : headers\openvr_capi.h:1804 */ - public interface GetWindowBounds_callback extends Callback { - void apply(IntByReference pnX, IntByReference pnY, IntByReference pnWidth, IntByReference pnHeight); - }; - /** native declaration : headers\openvr_capi.h:1805 */ - public interface GetEyeOutputViewport_callback extends Callback { - void apply(int eEye, IntByReference pnX, IntByReference pnY, IntByReference pnWidth, IntByReference pnHeight); - }; - /** native declaration : headers\openvr_capi.h:1806 */ - public interface GetDXGIOutputInfo_callback extends Callback { - void apply(IntByReference pnAdapterIndex, IntByReference pnAdapterOutputIndex); - }; - public VR_IVRExtendedDisplay_FnTable() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("GetWindowBounds", "GetEyeOutputViewport", "GetDXGIOutputInfo"); - } + * native declaration : headers\openvr_capi.h:1807
+ * This file was autogenerated by JNAerator,
+ * a tool written by Olivier Chafik that uses a few opensource projects..
+ * For help, please visit NativeLibs4Java , Rococoa, or JNA. + */ +public class VR_IVRExtendedDisplay_FnTable extends Structure { + /** C type : GetWindowBounds_callback* */ + public VR_IVRExtendedDisplay_FnTable.GetWindowBounds_callback GetWindowBounds; + /** C type : GetEyeOutputViewport_callback* */ + public VR_IVRExtendedDisplay_FnTable.GetEyeOutputViewport_callback GetEyeOutputViewport; + /** C type : GetDXGIOutputInfo_callback* */ + public VR_IVRExtendedDisplay_FnTable.GetDXGIOutputInfo_callback GetDXGIOutputInfo; + /** native declaration : headers\openvr_capi.h:1804 */ + public interface GetWindowBounds_callback extends Callback { + void apply(IntByReference pnX, IntByReference pnY, IntByReference pnWidth, IntByReference pnHeight); + }; + /** native declaration : headers\openvr_capi.h:1805 */ + public interface GetEyeOutputViewport_callback extends Callback { + void apply(int eEye, IntByReference pnX, IntByReference pnY, IntByReference pnWidth, IntByReference pnHeight); + }; + /** native declaration : headers\openvr_capi.h:1806 */ + public interface GetDXGIOutputInfo_callback extends Callback { + void apply(IntByReference pnAdapterIndex, IntByReference pnAdapterOutputIndex); + }; + public VR_IVRExtendedDisplay_FnTable() { + super(); + } + @Override + protected List getFieldOrder() { + return Arrays.asList("GetWindowBounds", "GetEyeOutputViewport", "GetDXGIOutputInfo"); + } /** - * @param GetWindowBounds C type : GetWindowBounds_callback*
- * @param GetEyeOutputViewport C type : GetEyeOutputViewport_callback*
- * @param GetDXGIOutputInfo C type : GetDXGIOutputInfo_callback* - */ - public VR_IVRExtendedDisplay_FnTable(VR_IVRExtendedDisplay_FnTable.GetWindowBounds_callback GetWindowBounds, VR_IVRExtendedDisplay_FnTable.GetEyeOutputViewport_callback GetEyeOutputViewport, VR_IVRExtendedDisplay_FnTable.GetDXGIOutputInfo_callback GetDXGIOutputInfo) { - super(); - this.GetWindowBounds = GetWindowBounds; - this.GetEyeOutputViewport = GetEyeOutputViewport; - this.GetDXGIOutputInfo = GetDXGIOutputInfo; - } - public VR_IVRExtendedDisplay_FnTable(Pointer peer) { - super(peer); - } - public static class ByReference extends VR_IVRExtendedDisplay_FnTable implements Structure.ByReference { - - }; - public static class ByValue extends VR_IVRExtendedDisplay_FnTable implements Structure.ByValue { - - }; + * @param GetWindowBounds C type : GetWindowBounds_callback*
+ * @param GetEyeOutputViewport C type : GetEyeOutputViewport_callback*
+ * @param GetDXGIOutputInfo C type : GetDXGIOutputInfo_callback* + */ + public VR_IVRExtendedDisplay_FnTable(VR_IVRExtendedDisplay_FnTable.GetWindowBounds_callback GetWindowBounds, VR_IVRExtendedDisplay_FnTable.GetEyeOutputViewport_callback GetEyeOutputViewport, VR_IVRExtendedDisplay_FnTable.GetDXGIOutputInfo_callback GetDXGIOutputInfo) { + super(); + this.GetWindowBounds = GetWindowBounds; + this.GetEyeOutputViewport = GetEyeOutputViewport; + this.GetDXGIOutputInfo = GetDXGIOutputInfo; + } + public VR_IVRExtendedDisplay_FnTable(Pointer peer) { + super(peer); + } + public static class ByReference extends VR_IVRExtendedDisplay_FnTable implements Structure.ByReference { + + }; + public static class ByValue extends VR_IVRExtendedDisplay_FnTable implements Structure.ByValue { + + }; } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRIOBuffer_FnTable.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRIOBuffer_FnTable.java index 7237387299..5a6b9291d0 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRIOBuffer_FnTable.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRIOBuffer_FnTable.java @@ -46,6 +46,7 @@ public interface PropertyContainer_callback extends Callback { public VR_IVRIOBuffer_FnTable() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("Open", "Close", "Read", "Write", "PropertyContainer"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRInput_FnTable.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRInput_FnTable.java index c7fcb0aabd..44987cc991 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRInput_FnTable.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRInput_FnTable.java @@ -124,6 +124,7 @@ public interface ShowBindingsForActionSet_callback extends Callback { public VR_IVRInput_FnTable() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("SetActionManifestPath", "GetActionSetHandle", "GetActionHandle", "GetInputSourceHandle", "UpdateActionState", "GetDigitalActionData", "GetAnalogActionData", "GetPoseActionData", "GetSkeletalActionData", "GetSkeletalBoneData", "GetSkeletalBoneDataCompressed", "DecompressSkeletalBoneData", "TriggerHapticVibrationAction", "GetActionOrigins", "GetOriginLocalizedName", "GetOriginTrackedDeviceInfo", "ShowActionOrigins", "ShowBindingsForActionSet"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRNotifications_FnTable.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRNotifications_FnTable.java index 5456f6f081..7e15f3591d 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRNotifications_FnTable.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRNotifications_FnTable.java @@ -6,46 +6,47 @@ import java.util.Arrays; import java.util.List; /** - * native declaration : headers\openvr_capi.h:2257
- * This file was autogenerated by JNAerator,
- * a tool written by Olivier Chafik that uses a few opensource projects..
- * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VR_IVRNotifications_FnTable extends Structure { - /** C type : CreateNotification_callback* */ - public VR_IVRNotifications_FnTable.CreateNotification_callback CreateNotification; - /** C type : RemoveNotification_callback* */ - public VR_IVRNotifications_FnTable.RemoveNotification_callback RemoveNotification; - /** native declaration : headers\openvr_capi.h:2255 */ - public interface CreateNotification_callback extends Callback { - int apply(long ulOverlayHandle, long ulUserValue, int type, Pointer pchText, int style, NotificationBitmap_t pImage, IntByReference pNotificationId); - }; - /** native declaration : headers\openvr_capi.h:2256 */ - public interface RemoveNotification_callback extends Callback { - int apply(int notificationId); - }; - public VR_IVRNotifications_FnTable() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("CreateNotification", "RemoveNotification"); - } + * native declaration : headers\openvr_capi.h:2257
+ * This file was autogenerated by JNAerator,
+ * a tool written by Olivier Chafik that uses a few opensource projects..
+ * For help, please visit NativeLibs4Java , Rococoa, or JNA. + */ +public class VR_IVRNotifications_FnTable extends Structure { + /** C type : CreateNotification_callback* */ + public VR_IVRNotifications_FnTable.CreateNotification_callback CreateNotification; + /** C type : RemoveNotification_callback* */ + public VR_IVRNotifications_FnTable.RemoveNotification_callback RemoveNotification; + /** native declaration : headers\openvr_capi.h:2255 */ + public interface CreateNotification_callback extends Callback { + int apply(long ulOverlayHandle, long ulUserValue, int type, Pointer pchText, int style, NotificationBitmap_t pImage, IntByReference pNotificationId); + }; + /** native declaration : headers\openvr_capi.h:2256 */ + public interface RemoveNotification_callback extends Callback { + int apply(int notificationId); + }; + public VR_IVRNotifications_FnTable() { + super(); + } + @Override + protected List getFieldOrder() { + return Arrays.asList("CreateNotification", "RemoveNotification"); + } /** - * @param CreateNotification C type : CreateNotification_callback*
- * @param RemoveNotification C type : RemoveNotification_callback* - */ - public VR_IVRNotifications_FnTable(VR_IVRNotifications_FnTable.CreateNotification_callback CreateNotification, VR_IVRNotifications_FnTable.RemoveNotification_callback RemoveNotification) { - super(); - this.CreateNotification = CreateNotification; - this.RemoveNotification = RemoveNotification; - } - public VR_IVRNotifications_FnTable(Pointer peer) { - super(peer); - } - public static class ByReference extends VR_IVRNotifications_FnTable implements Structure.ByReference { - - }; - public static class ByValue extends VR_IVRNotifications_FnTable implements Structure.ByValue { - - }; + * @param CreateNotification C type : CreateNotification_callback*
+ * @param RemoveNotification C type : RemoveNotification_callback* + */ + public VR_IVRNotifications_FnTable(VR_IVRNotifications_FnTable.CreateNotification_callback CreateNotification, VR_IVRNotifications_FnTable.RemoveNotification_callback RemoveNotification) { + super(); + this.CreateNotification = CreateNotification; + this.RemoveNotification = RemoveNotification; + } + public VR_IVRNotifications_FnTable(Pointer peer) { + super(peer); + } + public static class ByReference extends VR_IVRNotifications_FnTable implements Structure.ByReference { + + }; + public static class ByValue extends VR_IVRNotifications_FnTable implements Structure.ByValue { + + }; } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVROverlay_FnTable.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVROverlay_FnTable.java index 7dc6a2d408..f9405bb07d 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVROverlay_FnTable.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVROverlay_FnTable.java @@ -9,517 +9,518 @@ import java.util.Arrays; import java.util.List; /** - * native declaration : headers\openvr_capi.h:2211
- * This file was autogenerated by JNAerator,
- * a tool written by Olivier Chafik that uses a few opensource projects..
- * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VR_IVROverlay_FnTable extends Structure { - /** C type : FindOverlay_callback* */ - public VR_IVROverlay_FnTable.FindOverlay_callback FindOverlay; - /** C type : CreateOverlay_callback* */ - public VR_IVROverlay_FnTable.CreateOverlay_callback CreateOverlay; - /** C type : DestroyOverlay_callback* */ - public VR_IVROverlay_FnTable.DestroyOverlay_callback DestroyOverlay; - /** C type : SetHighQualityOverlay_callback* */ - public VR_IVROverlay_FnTable.SetHighQualityOverlay_callback SetHighQualityOverlay; - /** C type : GetHighQualityOverlay_callback* */ - public VR_IVROverlay_FnTable.GetHighQualityOverlay_callback GetHighQualityOverlay; - /** C type : GetOverlayKey_callback* */ - public VR_IVROverlay_FnTable.GetOverlayKey_callback GetOverlayKey; - /** C type : GetOverlayName_callback* */ - public VR_IVROverlay_FnTable.GetOverlayName_callback GetOverlayName; - /** C type : SetOverlayName_callback* */ - public VR_IVROverlay_FnTable.SetOverlayName_callback SetOverlayName; - /** C type : GetOverlayImageData_callback* */ - public VR_IVROverlay_FnTable.GetOverlayImageData_callback GetOverlayImageData; - /** C type : GetOverlayErrorNameFromEnum_callback* */ - public VR_IVROverlay_FnTable.GetOverlayErrorNameFromEnum_callback GetOverlayErrorNameFromEnum; - /** C type : SetOverlayRenderingPid_callback* */ - public VR_IVROverlay_FnTable.SetOverlayRenderingPid_callback SetOverlayRenderingPid; - /** C type : GetOverlayRenderingPid_callback* */ - public VR_IVROverlay_FnTable.GetOverlayRenderingPid_callback GetOverlayRenderingPid; - /** C type : SetOverlayFlag_callback* */ - public VR_IVROverlay_FnTable.SetOverlayFlag_callback SetOverlayFlag; - /** C type : GetOverlayFlag_callback* */ - public VR_IVROverlay_FnTable.GetOverlayFlag_callback GetOverlayFlag; - /** C type : SetOverlayColor_callback* */ - public VR_IVROverlay_FnTable.SetOverlayColor_callback SetOverlayColor; - /** C type : GetOverlayColor_callback* */ - public VR_IVROverlay_FnTable.GetOverlayColor_callback GetOverlayColor; - /** C type : SetOverlayAlpha_callback* */ - public VR_IVROverlay_FnTable.SetOverlayAlpha_callback SetOverlayAlpha; - /** C type : GetOverlayAlpha_callback* */ - public VR_IVROverlay_FnTable.GetOverlayAlpha_callback GetOverlayAlpha; - /** C type : SetOverlayTexelAspect_callback* */ - public VR_IVROverlay_FnTable.SetOverlayTexelAspect_callback SetOverlayTexelAspect; - /** C type : GetOverlayTexelAspect_callback* */ - public VR_IVROverlay_FnTable.GetOverlayTexelAspect_callback GetOverlayTexelAspect; - /** C type : SetOverlaySortOrder_callback* */ - public VR_IVROverlay_FnTable.SetOverlaySortOrder_callback SetOverlaySortOrder; - /** C type : GetOverlaySortOrder_callback* */ - public VR_IVROverlay_FnTable.GetOverlaySortOrder_callback GetOverlaySortOrder; - /** C type : SetOverlayWidthInMeters_callback* */ - public VR_IVROverlay_FnTable.SetOverlayWidthInMeters_callback SetOverlayWidthInMeters; - /** C type : GetOverlayWidthInMeters_callback* */ - public VR_IVROverlay_FnTable.GetOverlayWidthInMeters_callback GetOverlayWidthInMeters; - /** C type : SetOverlayAutoCurveDistanceRangeInMeters_callback* */ - public VR_IVROverlay_FnTable.SetOverlayAutoCurveDistanceRangeInMeters_callback SetOverlayAutoCurveDistanceRangeInMeters; - /** C type : GetOverlayAutoCurveDistanceRangeInMeters_callback* */ - public VR_IVROverlay_FnTable.GetOverlayAutoCurveDistanceRangeInMeters_callback GetOverlayAutoCurveDistanceRangeInMeters; - /** C type : SetOverlayTextureColorSpace_callback* */ - public VR_IVROverlay_FnTable.SetOverlayTextureColorSpace_callback SetOverlayTextureColorSpace; - /** C type : GetOverlayTextureColorSpace_callback* */ - public VR_IVROverlay_FnTable.GetOverlayTextureColorSpace_callback GetOverlayTextureColorSpace; - /** C type : SetOverlayTextureBounds_callback* */ - public VR_IVROverlay_FnTable.SetOverlayTextureBounds_callback SetOverlayTextureBounds; - /** C type : GetOverlayTextureBounds_callback* */ - public VR_IVROverlay_FnTable.GetOverlayTextureBounds_callback GetOverlayTextureBounds; - /** C type : GetOverlayRenderModel_callback* */ - public VR_IVROverlay_FnTable.GetOverlayRenderModel_callback GetOverlayRenderModel; - /** C type : SetOverlayRenderModel_callback* */ - public VR_IVROverlay_FnTable.SetOverlayRenderModel_callback SetOverlayRenderModel; - /** C type : GetOverlayTransformType_callback* */ - public VR_IVROverlay_FnTable.GetOverlayTransformType_callback GetOverlayTransformType; - /** C type : SetOverlayTransformAbsolute_callback* */ - public VR_IVROverlay_FnTable.SetOverlayTransformAbsolute_callback SetOverlayTransformAbsolute; - /** C type : GetOverlayTransformAbsolute_callback* */ - public VR_IVROverlay_FnTable.GetOverlayTransformAbsolute_callback GetOverlayTransformAbsolute; - /** C type : SetOverlayTransformTrackedDeviceRelative_callback* */ - public VR_IVROverlay_FnTable.SetOverlayTransformTrackedDeviceRelative_callback SetOverlayTransformTrackedDeviceRelative; - /** C type : GetOverlayTransformTrackedDeviceRelative_callback* */ - public VR_IVROverlay_FnTable.GetOverlayTransformTrackedDeviceRelative_callback GetOverlayTransformTrackedDeviceRelative; - /** C type : SetOverlayTransformTrackedDeviceComponent_callback* */ - public VR_IVROverlay_FnTable.SetOverlayTransformTrackedDeviceComponent_callback SetOverlayTransformTrackedDeviceComponent; - /** C type : GetOverlayTransformTrackedDeviceComponent_callback* */ - public VR_IVROverlay_FnTable.GetOverlayTransformTrackedDeviceComponent_callback GetOverlayTransformTrackedDeviceComponent; - /** C type : GetOverlayTransformOverlayRelative_callback* */ - public VR_IVROverlay_FnTable.GetOverlayTransformOverlayRelative_callback GetOverlayTransformOverlayRelative; - /** C type : SetOverlayTransformOverlayRelative_callback* */ - public VR_IVROverlay_FnTable.SetOverlayTransformOverlayRelative_callback SetOverlayTransformOverlayRelative; - /** C type : ShowOverlay_callback* */ - public VR_IVROverlay_FnTable.ShowOverlay_callback ShowOverlay; - /** C type : HideOverlay_callback* */ - public VR_IVROverlay_FnTable.HideOverlay_callback HideOverlay; - /** C type : IsOverlayVisible_callback* */ - public VR_IVROverlay_FnTable.IsOverlayVisible_callback IsOverlayVisible; - /** C type : GetTransformForOverlayCoordinates_callback* */ - public VR_IVROverlay_FnTable.GetTransformForOverlayCoordinates_callback GetTransformForOverlayCoordinates; - /** C type : PollNextOverlayEvent_callback* */ - public VR_IVROverlay_FnTable.PollNextOverlayEvent_callback PollNextOverlayEvent; - /** C type : GetOverlayInputMethod_callback* */ - public VR_IVROverlay_FnTable.GetOverlayInputMethod_callback GetOverlayInputMethod; - /** C type : SetOverlayInputMethod_callback* */ - public VR_IVROverlay_FnTable.SetOverlayInputMethod_callback SetOverlayInputMethod; - /** C type : GetOverlayMouseScale_callback* */ - public VR_IVROverlay_FnTable.GetOverlayMouseScale_callback GetOverlayMouseScale; - /** C type : SetOverlayMouseScale_callback* */ - public VR_IVROverlay_FnTable.SetOverlayMouseScale_callback SetOverlayMouseScale; - /** C type : ComputeOverlayIntersection_callback* */ - public VR_IVROverlay_FnTable.ComputeOverlayIntersection_callback ComputeOverlayIntersection; - /** C type : IsHoverTargetOverlay_callback* */ - public VR_IVROverlay_FnTable.IsHoverTargetOverlay_callback IsHoverTargetOverlay; - /** C type : GetGamepadFocusOverlay_callback* */ - public VR_IVROverlay_FnTable.GetGamepadFocusOverlay_callback GetGamepadFocusOverlay; - /** C type : SetGamepadFocusOverlay_callback* */ - public VR_IVROverlay_FnTable.SetGamepadFocusOverlay_callback SetGamepadFocusOverlay; - /** C type : SetOverlayNeighbor_callback* */ - public VR_IVROverlay_FnTable.SetOverlayNeighbor_callback SetOverlayNeighbor; - /** C type : MoveGamepadFocusToNeighbor_callback* */ - public VR_IVROverlay_FnTable.MoveGamepadFocusToNeighbor_callback MoveGamepadFocusToNeighbor; - /** C type : SetOverlayDualAnalogTransform_callback* */ - public VR_IVROverlay_FnTable.SetOverlayDualAnalogTransform_callback SetOverlayDualAnalogTransform; - /** C type : GetOverlayDualAnalogTransform_callback* */ - public VR_IVROverlay_FnTable.GetOverlayDualAnalogTransform_callback GetOverlayDualAnalogTransform; - /** C type : SetOverlayTexture_callback* */ - public VR_IVROverlay_FnTable.SetOverlayTexture_callback SetOverlayTexture; - /** C type : ClearOverlayTexture_callback* */ - public VR_IVROverlay_FnTable.ClearOverlayTexture_callback ClearOverlayTexture; - /** C type : SetOverlayRaw_callback* */ - public VR_IVROverlay_FnTable.SetOverlayRaw_callback SetOverlayRaw; - /** C type : SetOverlayFromFile_callback* */ - public VR_IVROverlay_FnTable.SetOverlayFromFile_callback SetOverlayFromFile; - /** C type : GetOverlayTexture_callback* */ - public VR_IVROverlay_FnTable.GetOverlayTexture_callback GetOverlayTexture; - /** C type : ReleaseNativeOverlayHandle_callback* */ - public VR_IVROverlay_FnTable.ReleaseNativeOverlayHandle_callback ReleaseNativeOverlayHandle; - /** C type : GetOverlayTextureSize_callback* */ - public VR_IVROverlay_FnTable.GetOverlayTextureSize_callback GetOverlayTextureSize; - /** C type : CreateDashboardOverlay_callback* */ - public VR_IVROverlay_FnTable.CreateDashboardOverlay_callback CreateDashboardOverlay; - /** C type : IsDashboardVisible_callback* */ - public VR_IVROverlay_FnTable.IsDashboardVisible_callback IsDashboardVisible; - /** C type : IsActiveDashboardOverlay_callback* */ - public VR_IVROverlay_FnTable.IsActiveDashboardOverlay_callback IsActiveDashboardOverlay; - /** C type : SetDashboardOverlaySceneProcess_callback* */ - public VR_IVROverlay_FnTable.SetDashboardOverlaySceneProcess_callback SetDashboardOverlaySceneProcess; - /** C type : GetDashboardOverlaySceneProcess_callback* */ - public VR_IVROverlay_FnTable.GetDashboardOverlaySceneProcess_callback GetDashboardOverlaySceneProcess; - /** C type : ShowDashboard_callback* */ - public VR_IVROverlay_FnTable.ShowDashboard_callback ShowDashboard; - /** C type : GetPrimaryDashboardDevice_callback* */ - public VR_IVROverlay_FnTable.GetPrimaryDashboardDevice_callback GetPrimaryDashboardDevice; - /** C type : ShowKeyboard_callback* */ - public VR_IVROverlay_FnTable.ShowKeyboard_callback ShowKeyboard; - /** C type : ShowKeyboardForOverlay_callback* */ - public VR_IVROverlay_FnTable.ShowKeyboardForOverlay_callback ShowKeyboardForOverlay; - /** C type : GetKeyboardText_callback* */ - public VR_IVROverlay_FnTable.GetKeyboardText_callback GetKeyboardText; - /** C type : HideKeyboard_callback* */ - public VR_IVROverlay_FnTable.HideKeyboard_callback HideKeyboard; - /** C type : SetKeyboardTransformAbsolute_callback* */ - public VR_IVROverlay_FnTable.SetKeyboardTransformAbsolute_callback SetKeyboardTransformAbsolute; - /** C type : SetKeyboardPositionForOverlay_callback* */ - public VR_IVROverlay_FnTable.SetKeyboardPositionForOverlay_callback SetKeyboardPositionForOverlay; - /** C type : SetOverlayIntersectionMask_callback* */ - public VR_IVROverlay_FnTable.SetOverlayIntersectionMask_callback SetOverlayIntersectionMask; - /** C type : GetOverlayFlags_callback* */ - public VR_IVROverlay_FnTable.GetOverlayFlags_callback GetOverlayFlags; - /** C type : ShowMessageOverlay_callback* */ - public VR_IVROverlay_FnTable.ShowMessageOverlay_callback ShowMessageOverlay; - /** C type : CloseMessageOverlay_callback* */ - public VR_IVROverlay_FnTable.CloseMessageOverlay_callback CloseMessageOverlay; - /** native declaration : headers\openvr_capi.h:2129 */ - public interface FindOverlay_callback extends Callback { - int apply(Pointer pchOverlayKey, LongByReference pOverlayHandle); - }; - /** native declaration : headers\openvr_capi.h:2130 */ - public interface CreateOverlay_callback extends Callback { - int apply(Pointer pchOverlayKey, Pointer pchOverlayName, LongByReference pOverlayHandle); - }; - /** native declaration : headers\openvr_capi.h:2131 */ - public interface DestroyOverlay_callback extends Callback { - int apply(long ulOverlayHandle); - }; - /** native declaration : headers\openvr_capi.h:2132 */ - public interface SetHighQualityOverlay_callback extends Callback { - int apply(long ulOverlayHandle); - }; - /** native declaration : headers\openvr_capi.h:2133 */ - public interface GetHighQualityOverlay_callback extends Callback { - long apply(); - }; - /** native declaration : headers\openvr_capi.h:2134 */ - public interface GetOverlayKey_callback extends Callback { - int apply(long ulOverlayHandle, Pointer pchValue, int unBufferSize, IntByReference pError); - }; - /** native declaration : headers\openvr_capi.h:2135 */ - public interface GetOverlayName_callback extends Callback { - int apply(long ulOverlayHandle, Pointer pchValue, int unBufferSize, IntByReference pError); - }; - /** native declaration : headers\openvr_capi.h:2136 */ - public interface SetOverlayName_callback extends Callback { - int apply(long ulOverlayHandle, Pointer pchName); - }; - /** native declaration : headers\openvr_capi.h:2137 */ - public interface GetOverlayImageData_callback extends Callback { - int apply(long ulOverlayHandle, Pointer pvBuffer, int unBufferSize, IntByReference punWidth, IntByReference punHeight); - }; - /** native declaration : headers\openvr_capi.h:2138 */ - public interface GetOverlayErrorNameFromEnum_callback extends Callback { - Pointer apply(int error); - }; - /** native declaration : headers\openvr_capi.h:2139 */ - public interface SetOverlayRenderingPid_callback extends Callback { - int apply(long ulOverlayHandle, int unPID); - }; - /** native declaration : headers\openvr_capi.h:2140 */ - public interface GetOverlayRenderingPid_callback extends Callback { - int apply(long ulOverlayHandle); - }; - /** native declaration : headers\openvr_capi.h:2141 */ - public interface SetOverlayFlag_callback extends Callback { - int apply(long ulOverlayHandle, int eOverlayFlag, byte bEnabled); - }; - /** native declaration : headers\openvr_capi.h:2142 */ - public interface GetOverlayFlag_callback extends Callback { - int apply(long ulOverlayHandle, int eOverlayFlag, Pointer pbEnabled); - }; - /** native declaration : headers\openvr_capi.h:2143 */ - public interface SetOverlayColor_callback extends Callback { - int apply(long ulOverlayHandle, float fRed, float fGreen, float fBlue); - }; - /** native declaration : headers\openvr_capi.h:2144 */ - public interface GetOverlayColor_callback extends Callback { - int apply(long ulOverlayHandle, FloatByReference pfRed, FloatByReference pfGreen, FloatByReference pfBlue); - }; - /** native declaration : headers\openvr_capi.h:2145 */ - public interface SetOverlayAlpha_callback extends Callback { - int apply(long ulOverlayHandle, float fAlpha); - }; - /** native declaration : headers\openvr_capi.h:2146 */ - public interface GetOverlayAlpha_callback extends Callback { - int apply(long ulOverlayHandle, FloatByReference pfAlpha); - }; - /** native declaration : headers\openvr_capi.h:2147 */ - public interface SetOverlayTexelAspect_callback extends Callback { - int apply(long ulOverlayHandle, float fTexelAspect); - }; - /** native declaration : headers\openvr_capi.h:2148 */ - public interface GetOverlayTexelAspect_callback extends Callback { - int apply(long ulOverlayHandle, FloatByReference pfTexelAspect); - }; - /** native declaration : headers\openvr_capi.h:2149 */ - public interface SetOverlaySortOrder_callback extends Callback { - int apply(long ulOverlayHandle, int unSortOrder); - }; - /** native declaration : headers\openvr_capi.h:2150 */ - public interface GetOverlaySortOrder_callback extends Callback { - int apply(long ulOverlayHandle, IntByReference punSortOrder); - }; - /** native declaration : headers\openvr_capi.h:2151 */ - public interface SetOverlayWidthInMeters_callback extends Callback { - int apply(long ulOverlayHandle, float fWidthInMeters); - }; - /** native declaration : headers\openvr_capi.h:2152 */ - public interface GetOverlayWidthInMeters_callback extends Callback { - int apply(long ulOverlayHandle, FloatByReference pfWidthInMeters); - }; - /** native declaration : headers\openvr_capi.h:2153 */ - public interface SetOverlayAutoCurveDistanceRangeInMeters_callback extends Callback { - int apply(long ulOverlayHandle, float fMinDistanceInMeters, float fMaxDistanceInMeters); - }; - /** native declaration : headers\openvr_capi.h:2154 */ - public interface GetOverlayAutoCurveDistanceRangeInMeters_callback extends Callback { - int apply(long ulOverlayHandle, FloatByReference pfMinDistanceInMeters, FloatByReference pfMaxDistanceInMeters); - }; - /** native declaration : headers\openvr_capi.h:2155 */ - public interface SetOverlayTextureColorSpace_callback extends Callback { - int apply(long ulOverlayHandle, int eTextureColorSpace); - }; - /** native declaration : headers\openvr_capi.h:2156 */ - public interface GetOverlayTextureColorSpace_callback extends Callback { - int apply(long ulOverlayHandle, IntByReference peTextureColorSpace); - }; - /** native declaration : headers\openvr_capi.h:2157 */ - public interface SetOverlayTextureBounds_callback extends Callback { - int apply(long ulOverlayHandle, VRTextureBounds_t pOverlayTextureBounds); - }; - /** native declaration : headers\openvr_capi.h:2158 */ - public interface GetOverlayTextureBounds_callback extends Callback { - int apply(long ulOverlayHandle, VRTextureBounds_t pOverlayTextureBounds); - }; - /** native declaration : headers\openvr_capi.h:2159 */ - public interface GetOverlayRenderModel_callback extends Callback { - int apply(long ulOverlayHandle, Pointer pchValue, int unBufferSize, HmdColor_t pColor, IntByReference pError); - }; - /** native declaration : headers\openvr_capi.h:2160 */ - public interface SetOverlayRenderModel_callback extends Callback { - int apply(long ulOverlayHandle, Pointer pchRenderModel, HmdColor_t pColor); - }; - /** native declaration : headers\openvr_capi.h:2161 */ - public interface GetOverlayTransformType_callback extends Callback { - int apply(long ulOverlayHandle, IntByReference peTransformType); - }; - /** native declaration : headers\openvr_capi.h:2162 */ - public interface SetOverlayTransformAbsolute_callback extends Callback { - int apply(long ulOverlayHandle, int eTrackingOrigin, HmdMatrix34_t pmatTrackingOriginToOverlayTransform); - }; - /** native declaration : headers\openvr_capi.h:2163 */ - public interface GetOverlayTransformAbsolute_callback extends Callback { - int apply(long ulOverlayHandle, IntByReference peTrackingOrigin, HmdMatrix34_t pmatTrackingOriginToOverlayTransform); - }; - /** native declaration : headers\openvr_capi.h:2164 */ - public interface SetOverlayTransformTrackedDeviceRelative_callback extends Callback { - int apply(long ulOverlayHandle, int unTrackedDevice, HmdMatrix34_t pmatTrackedDeviceToOverlayTransform); - }; - /** native declaration : headers\openvr_capi.h:2165 */ - public interface GetOverlayTransformTrackedDeviceRelative_callback extends Callback { - int apply(long ulOverlayHandle, IntByReference punTrackedDevice, HmdMatrix34_t pmatTrackedDeviceToOverlayTransform); - }; - /** native declaration : headers\openvr_capi.h:2166 */ - public interface SetOverlayTransformTrackedDeviceComponent_callback extends Callback { - int apply(long ulOverlayHandle, int unDeviceIndex, Pointer pchComponentName); - }; - /** native declaration : headers\openvr_capi.h:2167 */ - public interface GetOverlayTransformTrackedDeviceComponent_callback extends Callback { - int apply(long ulOverlayHandle, IntByReference punDeviceIndex, Pointer pchComponentName, int unComponentNameSize); - }; - /** native declaration : headers\openvr_capi.h:2168 */ - public interface GetOverlayTransformOverlayRelative_callback extends Callback { - int apply(long ulOverlayHandle, LongByReference ulOverlayHandleParent, HmdMatrix34_t pmatParentOverlayToOverlayTransform); - }; - /** native declaration : headers\openvr_capi.h:2169 */ - public interface SetOverlayTransformOverlayRelative_callback extends Callback { - int apply(long ulOverlayHandle, long ulOverlayHandleParent, HmdMatrix34_t pmatParentOverlayToOverlayTransform); - }; - /** native declaration : headers\openvr_capi.h:2170 */ - public interface ShowOverlay_callback extends Callback { - int apply(long ulOverlayHandle); - }; - /** native declaration : headers\openvr_capi.h:2171 */ - public interface HideOverlay_callback extends Callback { - int apply(long ulOverlayHandle); - }; - /** native declaration : headers\openvr_capi.h:2172 */ - public interface IsOverlayVisible_callback extends Callback { - byte apply(long ulOverlayHandle); - }; - /** native declaration : headers\openvr_capi.h:2173 */ - public interface GetTransformForOverlayCoordinates_callback extends Callback { - int apply(long ulOverlayHandle, int eTrackingOrigin, HmdVector2_t.ByValue coordinatesInOverlay, HmdMatrix34_t pmatTransform); - }; - /** native declaration : headers\openvr_capi.h:2174 */ - public interface PollNextOverlayEvent_callback extends Callback { - byte apply(long ulOverlayHandle, VREvent_t pEvent, int uncbVREvent); - }; - /** native declaration : headers\openvr_capi.h:2175 */ - public interface GetOverlayInputMethod_callback extends Callback { - int apply(long ulOverlayHandle, IntByReference peInputMethod); - }; - /** native declaration : headers\openvr_capi.h:2176 */ - public interface SetOverlayInputMethod_callback extends Callback { - int apply(long ulOverlayHandle, int eInputMethod); - }; - /** native declaration : headers\openvr_capi.h:2177 */ - public interface GetOverlayMouseScale_callback extends Callback { - int apply(long ulOverlayHandle, HmdVector2_t pvecMouseScale); - }; - /** native declaration : headers\openvr_capi.h:2178 */ - public interface SetOverlayMouseScale_callback extends Callback { - int apply(long ulOverlayHandle, HmdVector2_t pvecMouseScale); - }; - /** native declaration : headers\openvr_capi.h:2179 */ - public interface ComputeOverlayIntersection_callback extends Callback { - byte apply(long ulOverlayHandle, VROverlayIntersectionParams_t pParams, VROverlayIntersectionResults_t pResults); - }; - /** native declaration : headers\openvr_capi.h:2180 */ - public interface IsHoverTargetOverlay_callback extends Callback { - byte apply(long ulOverlayHandle); - }; - /** native declaration : headers\openvr_capi.h:2181 */ - public interface GetGamepadFocusOverlay_callback extends Callback { - long apply(); - }; - /** native declaration : headers\openvr_capi.h:2182 */ - public interface SetGamepadFocusOverlay_callback extends Callback { - int apply(long ulNewFocusOverlay); - }; - /** native declaration : headers\openvr_capi.h:2183 */ - public interface SetOverlayNeighbor_callback extends Callback { - int apply(int eDirection, long ulFrom, long ulTo); - }; - /** native declaration : headers\openvr_capi.h:2184 */ - public interface MoveGamepadFocusToNeighbor_callback extends Callback { - int apply(int eDirection, long ulFrom); - }; - /** native declaration : headers\openvr_capi.h:2185 */ - public interface SetOverlayDualAnalogTransform_callback extends Callback { - int apply(long ulOverlay, int eWhich, HmdVector2_t vCenter, float fRadius); - }; - /** native declaration : headers\openvr_capi.h:2186 */ - public interface GetOverlayDualAnalogTransform_callback extends Callback { - int apply(long ulOverlay, int eWhich, HmdVector2_t pvCenter, FloatByReference pfRadius); - }; - /** native declaration : headers\openvr_capi.h:2187 */ - public interface SetOverlayTexture_callback extends Callback { - int apply(long ulOverlayHandle, Texture_t pTexture); - }; - /** native declaration : headers\openvr_capi.h:2188 */ - public interface ClearOverlayTexture_callback extends Callback { - int apply(long ulOverlayHandle); - }; - /** native declaration : headers\openvr_capi.h:2189 */ - public interface SetOverlayRaw_callback extends Callback { - int apply(long ulOverlayHandle, Pointer pvBuffer, int unWidth, int unHeight, int unDepth); - }; - /** native declaration : headers\openvr_capi.h:2190 */ - public interface SetOverlayFromFile_callback extends Callback { - int apply(long ulOverlayHandle, Pointer pchFilePath); - }; - /** native declaration : headers\openvr_capi.h:2191 */ - public interface GetOverlayTexture_callback extends Callback { - int apply(long ulOverlayHandle, PointerByReference pNativeTextureHandle, Pointer pNativeTextureRef, IntByReference pWidth, IntByReference pHeight, IntByReference pNativeFormat, IntByReference pAPIType, IntByReference pColorSpace, VRTextureBounds_t pTextureBounds); - }; - /** native declaration : headers\openvr_capi.h:2192 */ - public interface ReleaseNativeOverlayHandle_callback extends Callback { - int apply(long ulOverlayHandle, Pointer pNativeTextureHandle); - }; - /** native declaration : headers\openvr_capi.h:2193 */ - public interface GetOverlayTextureSize_callback extends Callback { - int apply(long ulOverlayHandle, IntByReference pWidth, IntByReference pHeight); - }; - /** native declaration : headers\openvr_capi.h:2194 */ - public interface CreateDashboardOverlay_callback extends Callback { - int apply(Pointer pchOverlayKey, Pointer pchOverlayFriendlyName, LongByReference pMainHandle, LongByReference pThumbnailHandle); - }; - /** native declaration : headers\openvr_capi.h:2195 */ - public interface IsDashboardVisible_callback extends Callback { - byte apply(); - }; - /** native declaration : headers\openvr_capi.h:2196 */ - public interface IsActiveDashboardOverlay_callback extends Callback { - byte apply(long ulOverlayHandle); - }; - /** native declaration : headers\openvr_capi.h:2197 */ - public interface SetDashboardOverlaySceneProcess_callback extends Callback { - int apply(long ulOverlayHandle, int unProcessId); - }; - /** native declaration : headers\openvr_capi.h:2198 */ - public interface GetDashboardOverlaySceneProcess_callback extends Callback { - int apply(long ulOverlayHandle, IntByReference punProcessId); - }; - /** native declaration : headers\openvr_capi.h:2199 */ - public interface ShowDashboard_callback extends Callback { - void apply(Pointer pchOverlayToShow); - }; - /** native declaration : headers\openvr_capi.h:2200 */ - public interface GetPrimaryDashboardDevice_callback extends Callback { - int apply(); - }; - /** native declaration : headers\openvr_capi.h:2201 */ - public interface ShowKeyboard_callback extends Callback { - int apply(int eInputMode, int eLineInputMode, Pointer pchDescription, int unCharMax, Pointer pchExistingText, byte bUseMinimalMode, long uUserValue); - }; - /** native declaration : headers\openvr_capi.h:2202 */ - public interface ShowKeyboardForOverlay_callback extends Callback { - int apply(long ulOverlayHandle, int eInputMode, int eLineInputMode, Pointer pchDescription, int unCharMax, Pointer pchExistingText, byte bUseMinimalMode, long uUserValue); - }; - /** native declaration : headers\openvr_capi.h:2203 */ - public interface GetKeyboardText_callback extends Callback { - int apply(Pointer pchText, int cchText); - }; - /** native declaration : headers\openvr_capi.h:2204 */ - public interface HideKeyboard_callback extends Callback { - void apply(); - }; - /** native declaration : headers\openvr_capi.h:2205 */ - public interface SetKeyboardTransformAbsolute_callback extends Callback { - void apply(int eTrackingOrigin, HmdMatrix34_t pmatTrackingOriginToKeyboardTransform); - }; - /** native declaration : headers\openvr_capi.h:2206 */ - public interface SetKeyboardPositionForOverlay_callback extends Callback { - void apply(long ulOverlayHandle, com.jme3.system.jopenvr.HmdRect2_t.ByValue avoidRect); - }; - /** native declaration : headers\openvr_capi.h:2207 */ - public interface SetOverlayIntersectionMask_callback extends Callback { - int apply(long ulOverlayHandle, VROverlayIntersectionMaskPrimitive_t pMaskPrimitives, int unNumMaskPrimitives, int unPrimitiveSize); - }; - /** native declaration : headers\openvr_capi.h:2208 */ - public interface GetOverlayFlags_callback extends Callback { - int apply(long ulOverlayHandle, IntByReference pFlags); - }; - /** native declaration : headers\openvr_capi.h:2209 */ - public interface ShowMessageOverlay_callback extends Callback { - int apply(Pointer pchText, Pointer pchCaption, Pointer pchButton0Text, Pointer pchButton1Text, Pointer pchButton2Text, Pointer pchButton3Text); - }; - /** native declaration : headers\openvr_capi.h:2210 */ - public interface CloseMessageOverlay_callback extends Callback { - void apply(); - }; - public VR_IVROverlay_FnTable() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("FindOverlay", "CreateOverlay", "DestroyOverlay", "SetHighQualityOverlay", "GetHighQualityOverlay", "GetOverlayKey", "GetOverlayName", "SetOverlayName", "GetOverlayImageData", "GetOverlayErrorNameFromEnum", "SetOverlayRenderingPid", "GetOverlayRenderingPid", "SetOverlayFlag", "GetOverlayFlag", "SetOverlayColor", "GetOverlayColor", "SetOverlayAlpha", "GetOverlayAlpha", "SetOverlayTexelAspect", "GetOverlayTexelAspect", "SetOverlaySortOrder", "GetOverlaySortOrder", "SetOverlayWidthInMeters", "GetOverlayWidthInMeters", "SetOverlayAutoCurveDistanceRangeInMeters", "GetOverlayAutoCurveDistanceRangeInMeters", "SetOverlayTextureColorSpace", "GetOverlayTextureColorSpace", "SetOverlayTextureBounds", "GetOverlayTextureBounds", "GetOverlayRenderModel", "SetOverlayRenderModel", "GetOverlayTransformType", "SetOverlayTransformAbsolute", "GetOverlayTransformAbsolute", "SetOverlayTransformTrackedDeviceRelative", "GetOverlayTransformTrackedDeviceRelative", "SetOverlayTransformTrackedDeviceComponent", "GetOverlayTransformTrackedDeviceComponent", "GetOverlayTransformOverlayRelative", "SetOverlayTransformOverlayRelative", "ShowOverlay", "HideOverlay", "IsOverlayVisible", "GetTransformForOverlayCoordinates", "PollNextOverlayEvent", "GetOverlayInputMethod", "SetOverlayInputMethod", "GetOverlayMouseScale", "SetOverlayMouseScale", "ComputeOverlayIntersection", "IsHoverTargetOverlay", "GetGamepadFocusOverlay", "SetGamepadFocusOverlay", "SetOverlayNeighbor", "MoveGamepadFocusToNeighbor", "SetOverlayDualAnalogTransform", "GetOverlayDualAnalogTransform", "SetOverlayTexture", "ClearOverlayTexture", "SetOverlayRaw", "SetOverlayFromFile", "GetOverlayTexture", "ReleaseNativeOverlayHandle", "GetOverlayTextureSize", "CreateDashboardOverlay", "IsDashboardVisible", "IsActiveDashboardOverlay", "SetDashboardOverlaySceneProcess", "GetDashboardOverlaySceneProcess", "ShowDashboard", "GetPrimaryDashboardDevice", "ShowKeyboard", "ShowKeyboardForOverlay", "GetKeyboardText", "HideKeyboard", "SetKeyboardTransformAbsolute", "SetKeyboardPositionForOverlay", "SetOverlayIntersectionMask", "GetOverlayFlags", "ShowMessageOverlay", "CloseMessageOverlay"); - } - public VR_IVROverlay_FnTable(Pointer peer) { - super(peer); - } - public static class ByReference extends VR_IVROverlay_FnTable implements Structure.ByReference { - - }; - public static class ByValue extends VR_IVROverlay_FnTable implements Structure.ByValue { - - }; + * native declaration : headers\openvr_capi.h:2211
+ * This file was autogenerated by JNAerator,
+ * a tool written by Olivier Chafik that uses a few opensource projects..
+ * For help, please visit NativeLibs4Java , Rococoa, or JNA. + */ +public class VR_IVROverlay_FnTable extends Structure { + /** C type : FindOverlay_callback* */ + public VR_IVROverlay_FnTable.FindOverlay_callback FindOverlay; + /** C type : CreateOverlay_callback* */ + public VR_IVROverlay_FnTable.CreateOverlay_callback CreateOverlay; + /** C type : DestroyOverlay_callback* */ + public VR_IVROverlay_FnTable.DestroyOverlay_callback DestroyOverlay; + /** C type : SetHighQualityOverlay_callback* */ + public VR_IVROverlay_FnTable.SetHighQualityOverlay_callback SetHighQualityOverlay; + /** C type : GetHighQualityOverlay_callback* */ + public VR_IVROverlay_FnTable.GetHighQualityOverlay_callback GetHighQualityOverlay; + /** C type : GetOverlayKey_callback* */ + public VR_IVROverlay_FnTable.GetOverlayKey_callback GetOverlayKey; + /** C type : GetOverlayName_callback* */ + public VR_IVROverlay_FnTable.GetOverlayName_callback GetOverlayName; + /** C type : SetOverlayName_callback* */ + public VR_IVROverlay_FnTable.SetOverlayName_callback SetOverlayName; + /** C type : GetOverlayImageData_callback* */ + public VR_IVROverlay_FnTable.GetOverlayImageData_callback GetOverlayImageData; + /** C type : GetOverlayErrorNameFromEnum_callback* */ + public VR_IVROverlay_FnTable.GetOverlayErrorNameFromEnum_callback GetOverlayErrorNameFromEnum; + /** C type : SetOverlayRenderingPid_callback* */ + public VR_IVROverlay_FnTable.SetOverlayRenderingPid_callback SetOverlayRenderingPid; + /** C type : GetOverlayRenderingPid_callback* */ + public VR_IVROverlay_FnTable.GetOverlayRenderingPid_callback GetOverlayRenderingPid; + /** C type : SetOverlayFlag_callback* */ + public VR_IVROverlay_FnTable.SetOverlayFlag_callback SetOverlayFlag; + /** C type : GetOverlayFlag_callback* */ + public VR_IVROverlay_FnTable.GetOverlayFlag_callback GetOverlayFlag; + /** C type : SetOverlayColor_callback* */ + public VR_IVROverlay_FnTable.SetOverlayColor_callback SetOverlayColor; + /** C type : GetOverlayColor_callback* */ + public VR_IVROverlay_FnTable.GetOverlayColor_callback GetOverlayColor; + /** C type : SetOverlayAlpha_callback* */ + public VR_IVROverlay_FnTable.SetOverlayAlpha_callback SetOverlayAlpha; + /** C type : GetOverlayAlpha_callback* */ + public VR_IVROverlay_FnTable.GetOverlayAlpha_callback GetOverlayAlpha; + /** C type : SetOverlayTexelAspect_callback* */ + public VR_IVROverlay_FnTable.SetOverlayTexelAspect_callback SetOverlayTexelAspect; + /** C type : GetOverlayTexelAspect_callback* */ + public VR_IVROverlay_FnTable.GetOverlayTexelAspect_callback GetOverlayTexelAspect; + /** C type : SetOverlaySortOrder_callback* */ + public VR_IVROverlay_FnTable.SetOverlaySortOrder_callback SetOverlaySortOrder; + /** C type : GetOverlaySortOrder_callback* */ + public VR_IVROverlay_FnTable.GetOverlaySortOrder_callback GetOverlaySortOrder; + /** C type : SetOverlayWidthInMeters_callback* */ + public VR_IVROverlay_FnTable.SetOverlayWidthInMeters_callback SetOverlayWidthInMeters; + /** C type : GetOverlayWidthInMeters_callback* */ + public VR_IVROverlay_FnTable.GetOverlayWidthInMeters_callback GetOverlayWidthInMeters; + /** C type : SetOverlayAutoCurveDistanceRangeInMeters_callback* */ + public VR_IVROverlay_FnTable.SetOverlayAutoCurveDistanceRangeInMeters_callback SetOverlayAutoCurveDistanceRangeInMeters; + /** C type : GetOverlayAutoCurveDistanceRangeInMeters_callback* */ + public VR_IVROverlay_FnTable.GetOverlayAutoCurveDistanceRangeInMeters_callback GetOverlayAutoCurveDistanceRangeInMeters; + /** C type : SetOverlayTextureColorSpace_callback* */ + public VR_IVROverlay_FnTable.SetOverlayTextureColorSpace_callback SetOverlayTextureColorSpace; + /** C type : GetOverlayTextureColorSpace_callback* */ + public VR_IVROverlay_FnTable.GetOverlayTextureColorSpace_callback GetOverlayTextureColorSpace; + /** C type : SetOverlayTextureBounds_callback* */ + public VR_IVROverlay_FnTable.SetOverlayTextureBounds_callback SetOverlayTextureBounds; + /** C type : GetOverlayTextureBounds_callback* */ + public VR_IVROverlay_FnTable.GetOverlayTextureBounds_callback GetOverlayTextureBounds; + /** C type : GetOverlayRenderModel_callback* */ + public VR_IVROverlay_FnTable.GetOverlayRenderModel_callback GetOverlayRenderModel; + /** C type : SetOverlayRenderModel_callback* */ + public VR_IVROverlay_FnTable.SetOverlayRenderModel_callback SetOverlayRenderModel; + /** C type : GetOverlayTransformType_callback* */ + public VR_IVROverlay_FnTable.GetOverlayTransformType_callback GetOverlayTransformType; + /** C type : SetOverlayTransformAbsolute_callback* */ + public VR_IVROverlay_FnTable.SetOverlayTransformAbsolute_callback SetOverlayTransformAbsolute; + /** C type : GetOverlayTransformAbsolute_callback* */ + public VR_IVROverlay_FnTable.GetOverlayTransformAbsolute_callback GetOverlayTransformAbsolute; + /** C type : SetOverlayTransformTrackedDeviceRelative_callback* */ + public VR_IVROverlay_FnTable.SetOverlayTransformTrackedDeviceRelative_callback SetOverlayTransformTrackedDeviceRelative; + /** C type : GetOverlayTransformTrackedDeviceRelative_callback* */ + public VR_IVROverlay_FnTable.GetOverlayTransformTrackedDeviceRelative_callback GetOverlayTransformTrackedDeviceRelative; + /** C type : SetOverlayTransformTrackedDeviceComponent_callback* */ + public VR_IVROverlay_FnTable.SetOverlayTransformTrackedDeviceComponent_callback SetOverlayTransformTrackedDeviceComponent; + /** C type : GetOverlayTransformTrackedDeviceComponent_callback* */ + public VR_IVROverlay_FnTable.GetOverlayTransformTrackedDeviceComponent_callback GetOverlayTransformTrackedDeviceComponent; + /** C type : GetOverlayTransformOverlayRelative_callback* */ + public VR_IVROverlay_FnTable.GetOverlayTransformOverlayRelative_callback GetOverlayTransformOverlayRelative; + /** C type : SetOverlayTransformOverlayRelative_callback* */ + public VR_IVROverlay_FnTable.SetOverlayTransformOverlayRelative_callback SetOverlayTransformOverlayRelative; + /** C type : ShowOverlay_callback* */ + public VR_IVROverlay_FnTable.ShowOverlay_callback ShowOverlay; + /** C type : HideOverlay_callback* */ + public VR_IVROverlay_FnTable.HideOverlay_callback HideOverlay; + /** C type : IsOverlayVisible_callback* */ + public VR_IVROverlay_FnTable.IsOverlayVisible_callback IsOverlayVisible; + /** C type : GetTransformForOverlayCoordinates_callback* */ + public VR_IVROverlay_FnTable.GetTransformForOverlayCoordinates_callback GetTransformForOverlayCoordinates; + /** C type : PollNextOverlayEvent_callback* */ + public VR_IVROverlay_FnTable.PollNextOverlayEvent_callback PollNextOverlayEvent; + /** C type : GetOverlayInputMethod_callback* */ + public VR_IVROverlay_FnTable.GetOverlayInputMethod_callback GetOverlayInputMethod; + /** C type : SetOverlayInputMethod_callback* */ + public VR_IVROverlay_FnTable.SetOverlayInputMethod_callback SetOverlayInputMethod; + /** C type : GetOverlayMouseScale_callback* */ + public VR_IVROverlay_FnTable.GetOverlayMouseScale_callback GetOverlayMouseScale; + /** C type : SetOverlayMouseScale_callback* */ + public VR_IVROverlay_FnTable.SetOverlayMouseScale_callback SetOverlayMouseScale; + /** C type : ComputeOverlayIntersection_callback* */ + public VR_IVROverlay_FnTable.ComputeOverlayIntersection_callback ComputeOverlayIntersection; + /** C type : IsHoverTargetOverlay_callback* */ + public VR_IVROverlay_FnTable.IsHoverTargetOverlay_callback IsHoverTargetOverlay; + /** C type : GetGamepadFocusOverlay_callback* */ + public VR_IVROverlay_FnTable.GetGamepadFocusOverlay_callback GetGamepadFocusOverlay; + /** C type : SetGamepadFocusOverlay_callback* */ + public VR_IVROverlay_FnTable.SetGamepadFocusOverlay_callback SetGamepadFocusOverlay; + /** C type : SetOverlayNeighbor_callback* */ + public VR_IVROverlay_FnTable.SetOverlayNeighbor_callback SetOverlayNeighbor; + /** C type : MoveGamepadFocusToNeighbor_callback* */ + public VR_IVROverlay_FnTable.MoveGamepadFocusToNeighbor_callback MoveGamepadFocusToNeighbor; + /** C type : SetOverlayDualAnalogTransform_callback* */ + public VR_IVROverlay_FnTable.SetOverlayDualAnalogTransform_callback SetOverlayDualAnalogTransform; + /** C type : GetOverlayDualAnalogTransform_callback* */ + public VR_IVROverlay_FnTable.GetOverlayDualAnalogTransform_callback GetOverlayDualAnalogTransform; + /** C type : SetOverlayTexture_callback* */ + public VR_IVROverlay_FnTable.SetOverlayTexture_callback SetOverlayTexture; + /** C type : ClearOverlayTexture_callback* */ + public VR_IVROverlay_FnTable.ClearOverlayTexture_callback ClearOverlayTexture; + /** C type : SetOverlayRaw_callback* */ + public VR_IVROverlay_FnTable.SetOverlayRaw_callback SetOverlayRaw; + /** C type : SetOverlayFromFile_callback* */ + public VR_IVROverlay_FnTable.SetOverlayFromFile_callback SetOverlayFromFile; + /** C type : GetOverlayTexture_callback* */ + public VR_IVROverlay_FnTable.GetOverlayTexture_callback GetOverlayTexture; + /** C type : ReleaseNativeOverlayHandle_callback* */ + public VR_IVROverlay_FnTable.ReleaseNativeOverlayHandle_callback ReleaseNativeOverlayHandle; + /** C type : GetOverlayTextureSize_callback* */ + public VR_IVROverlay_FnTable.GetOverlayTextureSize_callback GetOverlayTextureSize; + /** C type : CreateDashboardOverlay_callback* */ + public VR_IVROverlay_FnTable.CreateDashboardOverlay_callback CreateDashboardOverlay; + /** C type : IsDashboardVisible_callback* */ + public VR_IVROverlay_FnTable.IsDashboardVisible_callback IsDashboardVisible; + /** C type : IsActiveDashboardOverlay_callback* */ + public VR_IVROverlay_FnTable.IsActiveDashboardOverlay_callback IsActiveDashboardOverlay; + /** C type : SetDashboardOverlaySceneProcess_callback* */ + public VR_IVROverlay_FnTable.SetDashboardOverlaySceneProcess_callback SetDashboardOverlaySceneProcess; + /** C type : GetDashboardOverlaySceneProcess_callback* */ + public VR_IVROverlay_FnTable.GetDashboardOverlaySceneProcess_callback GetDashboardOverlaySceneProcess; + /** C type : ShowDashboard_callback* */ + public VR_IVROverlay_FnTable.ShowDashboard_callback ShowDashboard; + /** C type : GetPrimaryDashboardDevice_callback* */ + public VR_IVROverlay_FnTable.GetPrimaryDashboardDevice_callback GetPrimaryDashboardDevice; + /** C type : ShowKeyboard_callback* */ + public VR_IVROverlay_FnTable.ShowKeyboard_callback ShowKeyboard; + /** C type : ShowKeyboardForOverlay_callback* */ + public VR_IVROverlay_FnTable.ShowKeyboardForOverlay_callback ShowKeyboardForOverlay; + /** C type : GetKeyboardText_callback* */ + public VR_IVROverlay_FnTable.GetKeyboardText_callback GetKeyboardText; + /** C type : HideKeyboard_callback* */ + public VR_IVROverlay_FnTable.HideKeyboard_callback HideKeyboard; + /** C type : SetKeyboardTransformAbsolute_callback* */ + public VR_IVROverlay_FnTable.SetKeyboardTransformAbsolute_callback SetKeyboardTransformAbsolute; + /** C type : SetKeyboardPositionForOverlay_callback* */ + public VR_IVROverlay_FnTable.SetKeyboardPositionForOverlay_callback SetKeyboardPositionForOverlay; + /** C type : SetOverlayIntersectionMask_callback* */ + public VR_IVROverlay_FnTable.SetOverlayIntersectionMask_callback SetOverlayIntersectionMask; + /** C type : GetOverlayFlags_callback* */ + public VR_IVROverlay_FnTable.GetOverlayFlags_callback GetOverlayFlags; + /** C type : ShowMessageOverlay_callback* */ + public VR_IVROverlay_FnTable.ShowMessageOverlay_callback ShowMessageOverlay; + /** C type : CloseMessageOverlay_callback* */ + public VR_IVROverlay_FnTable.CloseMessageOverlay_callback CloseMessageOverlay; + /** native declaration : headers\openvr_capi.h:2129 */ + public interface FindOverlay_callback extends Callback { + int apply(Pointer pchOverlayKey, LongByReference pOverlayHandle); + }; + /** native declaration : headers\openvr_capi.h:2130 */ + public interface CreateOverlay_callback extends Callback { + int apply(Pointer pchOverlayKey, Pointer pchOverlayName, LongByReference pOverlayHandle); + }; + /** native declaration : headers\openvr_capi.h:2131 */ + public interface DestroyOverlay_callback extends Callback { + int apply(long ulOverlayHandle); + }; + /** native declaration : headers\openvr_capi.h:2132 */ + public interface SetHighQualityOverlay_callback extends Callback { + int apply(long ulOverlayHandle); + }; + /** native declaration : headers\openvr_capi.h:2133 */ + public interface GetHighQualityOverlay_callback extends Callback { + long apply(); + }; + /** native declaration : headers\openvr_capi.h:2134 */ + public interface GetOverlayKey_callback extends Callback { + int apply(long ulOverlayHandle, Pointer pchValue, int unBufferSize, IntByReference pError); + }; + /** native declaration : headers\openvr_capi.h:2135 */ + public interface GetOverlayName_callback extends Callback { + int apply(long ulOverlayHandle, Pointer pchValue, int unBufferSize, IntByReference pError); + }; + /** native declaration : headers\openvr_capi.h:2136 */ + public interface SetOverlayName_callback extends Callback { + int apply(long ulOverlayHandle, Pointer pchName); + }; + /** native declaration : headers\openvr_capi.h:2137 */ + public interface GetOverlayImageData_callback extends Callback { + int apply(long ulOverlayHandle, Pointer pvBuffer, int unBufferSize, IntByReference punWidth, IntByReference punHeight); + }; + /** native declaration : headers\openvr_capi.h:2138 */ + public interface GetOverlayErrorNameFromEnum_callback extends Callback { + Pointer apply(int error); + }; + /** native declaration : headers\openvr_capi.h:2139 */ + public interface SetOverlayRenderingPid_callback extends Callback { + int apply(long ulOverlayHandle, int unPID); + }; + /** native declaration : headers\openvr_capi.h:2140 */ + public interface GetOverlayRenderingPid_callback extends Callback { + int apply(long ulOverlayHandle); + }; + /** native declaration : headers\openvr_capi.h:2141 */ + public interface SetOverlayFlag_callback extends Callback { + int apply(long ulOverlayHandle, int eOverlayFlag, byte bEnabled); + }; + /** native declaration : headers\openvr_capi.h:2142 */ + public interface GetOverlayFlag_callback extends Callback { + int apply(long ulOverlayHandle, int eOverlayFlag, Pointer pbEnabled); + }; + /** native declaration : headers\openvr_capi.h:2143 */ + public interface SetOverlayColor_callback extends Callback { + int apply(long ulOverlayHandle, float fRed, float fGreen, float fBlue); + }; + /** native declaration : headers\openvr_capi.h:2144 */ + public interface GetOverlayColor_callback extends Callback { + int apply(long ulOverlayHandle, FloatByReference pfRed, FloatByReference pfGreen, FloatByReference pfBlue); + }; + /** native declaration : headers\openvr_capi.h:2145 */ + public interface SetOverlayAlpha_callback extends Callback { + int apply(long ulOverlayHandle, float fAlpha); + }; + /** native declaration : headers\openvr_capi.h:2146 */ + public interface GetOverlayAlpha_callback extends Callback { + int apply(long ulOverlayHandle, FloatByReference pfAlpha); + }; + /** native declaration : headers\openvr_capi.h:2147 */ + public interface SetOverlayTexelAspect_callback extends Callback { + int apply(long ulOverlayHandle, float fTexelAspect); + }; + /** native declaration : headers\openvr_capi.h:2148 */ + public interface GetOverlayTexelAspect_callback extends Callback { + int apply(long ulOverlayHandle, FloatByReference pfTexelAspect); + }; + /** native declaration : headers\openvr_capi.h:2149 */ + public interface SetOverlaySortOrder_callback extends Callback { + int apply(long ulOverlayHandle, int unSortOrder); + }; + /** native declaration : headers\openvr_capi.h:2150 */ + public interface GetOverlaySortOrder_callback extends Callback { + int apply(long ulOverlayHandle, IntByReference punSortOrder); + }; + /** native declaration : headers\openvr_capi.h:2151 */ + public interface SetOverlayWidthInMeters_callback extends Callback { + int apply(long ulOverlayHandle, float fWidthInMeters); + }; + /** native declaration : headers\openvr_capi.h:2152 */ + public interface GetOverlayWidthInMeters_callback extends Callback { + int apply(long ulOverlayHandle, FloatByReference pfWidthInMeters); + }; + /** native declaration : headers\openvr_capi.h:2153 */ + public interface SetOverlayAutoCurveDistanceRangeInMeters_callback extends Callback { + int apply(long ulOverlayHandle, float fMinDistanceInMeters, float fMaxDistanceInMeters); + }; + /** native declaration : headers\openvr_capi.h:2154 */ + public interface GetOverlayAutoCurveDistanceRangeInMeters_callback extends Callback { + int apply(long ulOverlayHandle, FloatByReference pfMinDistanceInMeters, FloatByReference pfMaxDistanceInMeters); + }; + /** native declaration : headers\openvr_capi.h:2155 */ + public interface SetOverlayTextureColorSpace_callback extends Callback { + int apply(long ulOverlayHandle, int eTextureColorSpace); + }; + /** native declaration : headers\openvr_capi.h:2156 */ + public interface GetOverlayTextureColorSpace_callback extends Callback { + int apply(long ulOverlayHandle, IntByReference peTextureColorSpace); + }; + /** native declaration : headers\openvr_capi.h:2157 */ + public interface SetOverlayTextureBounds_callback extends Callback { + int apply(long ulOverlayHandle, VRTextureBounds_t pOverlayTextureBounds); + }; + /** native declaration : headers\openvr_capi.h:2158 */ + public interface GetOverlayTextureBounds_callback extends Callback { + int apply(long ulOverlayHandle, VRTextureBounds_t pOverlayTextureBounds); + }; + /** native declaration : headers\openvr_capi.h:2159 */ + public interface GetOverlayRenderModel_callback extends Callback { + int apply(long ulOverlayHandle, Pointer pchValue, int unBufferSize, HmdColor_t pColor, IntByReference pError); + }; + /** native declaration : headers\openvr_capi.h:2160 */ + public interface SetOverlayRenderModel_callback extends Callback { + int apply(long ulOverlayHandle, Pointer pchRenderModel, HmdColor_t pColor); + }; + /** native declaration : headers\openvr_capi.h:2161 */ + public interface GetOverlayTransformType_callback extends Callback { + int apply(long ulOverlayHandle, IntByReference peTransformType); + }; + /** native declaration : headers\openvr_capi.h:2162 */ + public interface SetOverlayTransformAbsolute_callback extends Callback { + int apply(long ulOverlayHandle, int eTrackingOrigin, HmdMatrix34_t pmatTrackingOriginToOverlayTransform); + }; + /** native declaration : headers\openvr_capi.h:2163 */ + public interface GetOverlayTransformAbsolute_callback extends Callback { + int apply(long ulOverlayHandle, IntByReference peTrackingOrigin, HmdMatrix34_t pmatTrackingOriginToOverlayTransform); + }; + /** native declaration : headers\openvr_capi.h:2164 */ + public interface SetOverlayTransformTrackedDeviceRelative_callback extends Callback { + int apply(long ulOverlayHandle, int unTrackedDevice, HmdMatrix34_t pmatTrackedDeviceToOverlayTransform); + }; + /** native declaration : headers\openvr_capi.h:2165 */ + public interface GetOverlayTransformTrackedDeviceRelative_callback extends Callback { + int apply(long ulOverlayHandle, IntByReference punTrackedDevice, HmdMatrix34_t pmatTrackedDeviceToOverlayTransform); + }; + /** native declaration : headers\openvr_capi.h:2166 */ + public interface SetOverlayTransformTrackedDeviceComponent_callback extends Callback { + int apply(long ulOverlayHandle, int unDeviceIndex, Pointer pchComponentName); + }; + /** native declaration : headers\openvr_capi.h:2167 */ + public interface GetOverlayTransformTrackedDeviceComponent_callback extends Callback { + int apply(long ulOverlayHandle, IntByReference punDeviceIndex, Pointer pchComponentName, int unComponentNameSize); + }; + /** native declaration : headers\openvr_capi.h:2168 */ + public interface GetOverlayTransformOverlayRelative_callback extends Callback { + int apply(long ulOverlayHandle, LongByReference ulOverlayHandleParent, HmdMatrix34_t pmatParentOverlayToOverlayTransform); + }; + /** native declaration : headers\openvr_capi.h:2169 */ + public interface SetOverlayTransformOverlayRelative_callback extends Callback { + int apply(long ulOverlayHandle, long ulOverlayHandleParent, HmdMatrix34_t pmatParentOverlayToOverlayTransform); + }; + /** native declaration : headers\openvr_capi.h:2170 */ + public interface ShowOverlay_callback extends Callback { + int apply(long ulOverlayHandle); + }; + /** native declaration : headers\openvr_capi.h:2171 */ + public interface HideOverlay_callback extends Callback { + int apply(long ulOverlayHandle); + }; + /** native declaration : headers\openvr_capi.h:2172 */ + public interface IsOverlayVisible_callback extends Callback { + byte apply(long ulOverlayHandle); + }; + /** native declaration : headers\openvr_capi.h:2173 */ + public interface GetTransformForOverlayCoordinates_callback extends Callback { + int apply(long ulOverlayHandle, int eTrackingOrigin, HmdVector2_t.ByValue coordinatesInOverlay, HmdMatrix34_t pmatTransform); + }; + /** native declaration : headers\openvr_capi.h:2174 */ + public interface PollNextOverlayEvent_callback extends Callback { + byte apply(long ulOverlayHandle, VREvent_t pEvent, int uncbVREvent); + }; + /** native declaration : headers\openvr_capi.h:2175 */ + public interface GetOverlayInputMethod_callback extends Callback { + int apply(long ulOverlayHandle, IntByReference peInputMethod); + }; + /** native declaration : headers\openvr_capi.h:2176 */ + public interface SetOverlayInputMethod_callback extends Callback { + int apply(long ulOverlayHandle, int eInputMethod); + }; + /** native declaration : headers\openvr_capi.h:2177 */ + public interface GetOverlayMouseScale_callback extends Callback { + int apply(long ulOverlayHandle, HmdVector2_t pvecMouseScale); + }; + /** native declaration : headers\openvr_capi.h:2178 */ + public interface SetOverlayMouseScale_callback extends Callback { + int apply(long ulOverlayHandle, HmdVector2_t pvecMouseScale); + }; + /** native declaration : headers\openvr_capi.h:2179 */ + public interface ComputeOverlayIntersection_callback extends Callback { + byte apply(long ulOverlayHandle, VROverlayIntersectionParams_t pParams, VROverlayIntersectionResults_t pResults); + }; + /** native declaration : headers\openvr_capi.h:2180 */ + public interface IsHoverTargetOverlay_callback extends Callback { + byte apply(long ulOverlayHandle); + }; + /** native declaration : headers\openvr_capi.h:2181 */ + public interface GetGamepadFocusOverlay_callback extends Callback { + long apply(); + }; + /** native declaration : headers\openvr_capi.h:2182 */ + public interface SetGamepadFocusOverlay_callback extends Callback { + int apply(long ulNewFocusOverlay); + }; + /** native declaration : headers\openvr_capi.h:2183 */ + public interface SetOverlayNeighbor_callback extends Callback { + int apply(int eDirection, long ulFrom, long ulTo); + }; + /** native declaration : headers\openvr_capi.h:2184 */ + public interface MoveGamepadFocusToNeighbor_callback extends Callback { + int apply(int eDirection, long ulFrom); + }; + /** native declaration : headers\openvr_capi.h:2185 */ + public interface SetOverlayDualAnalogTransform_callback extends Callback { + int apply(long ulOverlay, int eWhich, HmdVector2_t vCenter, float fRadius); + }; + /** native declaration : headers\openvr_capi.h:2186 */ + public interface GetOverlayDualAnalogTransform_callback extends Callback { + int apply(long ulOverlay, int eWhich, HmdVector2_t pvCenter, FloatByReference pfRadius); + }; + /** native declaration : headers\openvr_capi.h:2187 */ + public interface SetOverlayTexture_callback extends Callback { + int apply(long ulOverlayHandle, Texture_t pTexture); + }; + /** native declaration : headers\openvr_capi.h:2188 */ + public interface ClearOverlayTexture_callback extends Callback { + int apply(long ulOverlayHandle); + }; + /** native declaration : headers\openvr_capi.h:2189 */ + public interface SetOverlayRaw_callback extends Callback { + int apply(long ulOverlayHandle, Pointer pvBuffer, int unWidth, int unHeight, int unDepth); + }; + /** native declaration : headers\openvr_capi.h:2190 */ + public interface SetOverlayFromFile_callback extends Callback { + int apply(long ulOverlayHandle, Pointer pchFilePath); + }; + /** native declaration : headers\openvr_capi.h:2191 */ + public interface GetOverlayTexture_callback extends Callback { + int apply(long ulOverlayHandle, PointerByReference pNativeTextureHandle, Pointer pNativeTextureRef, IntByReference pWidth, IntByReference pHeight, IntByReference pNativeFormat, IntByReference pAPIType, IntByReference pColorSpace, VRTextureBounds_t pTextureBounds); + }; + /** native declaration : headers\openvr_capi.h:2192 */ + public interface ReleaseNativeOverlayHandle_callback extends Callback { + int apply(long ulOverlayHandle, Pointer pNativeTextureHandle); + }; + /** native declaration : headers\openvr_capi.h:2193 */ + public interface GetOverlayTextureSize_callback extends Callback { + int apply(long ulOverlayHandle, IntByReference pWidth, IntByReference pHeight); + }; + /** native declaration : headers\openvr_capi.h:2194 */ + public interface CreateDashboardOverlay_callback extends Callback { + int apply(Pointer pchOverlayKey, Pointer pchOverlayFriendlyName, LongByReference pMainHandle, LongByReference pThumbnailHandle); + }; + /** native declaration : headers\openvr_capi.h:2195 */ + public interface IsDashboardVisible_callback extends Callback { + byte apply(); + }; + /** native declaration : headers\openvr_capi.h:2196 */ + public interface IsActiveDashboardOverlay_callback extends Callback { + byte apply(long ulOverlayHandle); + }; + /** native declaration : headers\openvr_capi.h:2197 */ + public interface SetDashboardOverlaySceneProcess_callback extends Callback { + int apply(long ulOverlayHandle, int unProcessId); + }; + /** native declaration : headers\openvr_capi.h:2198 */ + public interface GetDashboardOverlaySceneProcess_callback extends Callback { + int apply(long ulOverlayHandle, IntByReference punProcessId); + }; + /** native declaration : headers\openvr_capi.h:2199 */ + public interface ShowDashboard_callback extends Callback { + void apply(Pointer pchOverlayToShow); + }; + /** native declaration : headers\openvr_capi.h:2200 */ + public interface GetPrimaryDashboardDevice_callback extends Callback { + int apply(); + }; + /** native declaration : headers\openvr_capi.h:2201 */ + public interface ShowKeyboard_callback extends Callback { + int apply(int eInputMode, int eLineInputMode, Pointer pchDescription, int unCharMax, Pointer pchExistingText, byte bUseMinimalMode, long uUserValue); + }; + /** native declaration : headers\openvr_capi.h:2202 */ + public interface ShowKeyboardForOverlay_callback extends Callback { + int apply(long ulOverlayHandle, int eInputMode, int eLineInputMode, Pointer pchDescription, int unCharMax, Pointer pchExistingText, byte bUseMinimalMode, long uUserValue); + }; + /** native declaration : headers\openvr_capi.h:2203 */ + public interface GetKeyboardText_callback extends Callback { + int apply(Pointer pchText, int cchText); + }; + /** native declaration : headers\openvr_capi.h:2204 */ + public interface HideKeyboard_callback extends Callback { + void apply(); + }; + /** native declaration : headers\openvr_capi.h:2205 */ + public interface SetKeyboardTransformAbsolute_callback extends Callback { + void apply(int eTrackingOrigin, HmdMatrix34_t pmatTrackingOriginToKeyboardTransform); + }; + /** native declaration : headers\openvr_capi.h:2206 */ + public interface SetKeyboardPositionForOverlay_callback extends Callback { + void apply(long ulOverlayHandle, com.jme3.system.jopenvr.HmdRect2_t.ByValue avoidRect); + }; + /** native declaration : headers\openvr_capi.h:2207 */ + public interface SetOverlayIntersectionMask_callback extends Callback { + int apply(long ulOverlayHandle, VROverlayIntersectionMaskPrimitive_t pMaskPrimitives, int unNumMaskPrimitives, int unPrimitiveSize); + }; + /** native declaration : headers\openvr_capi.h:2208 */ + public interface GetOverlayFlags_callback extends Callback { + int apply(long ulOverlayHandle, IntByReference pFlags); + }; + /** native declaration : headers\openvr_capi.h:2209 */ + public interface ShowMessageOverlay_callback extends Callback { + int apply(Pointer pchText, Pointer pchCaption, Pointer pchButton0Text, Pointer pchButton1Text, Pointer pchButton2Text, Pointer pchButton3Text); + }; + /** native declaration : headers\openvr_capi.h:2210 */ + public interface CloseMessageOverlay_callback extends Callback { + void apply(); + }; + public VR_IVROverlay_FnTable() { + super(); + } + @Override + protected List getFieldOrder() { + return Arrays.asList("FindOverlay", "CreateOverlay", "DestroyOverlay", "SetHighQualityOverlay", "GetHighQualityOverlay", "GetOverlayKey", "GetOverlayName", "SetOverlayName", "GetOverlayImageData", "GetOverlayErrorNameFromEnum", "SetOverlayRenderingPid", "GetOverlayRenderingPid", "SetOverlayFlag", "GetOverlayFlag", "SetOverlayColor", "GetOverlayColor", "SetOverlayAlpha", "GetOverlayAlpha", "SetOverlayTexelAspect", "GetOverlayTexelAspect", "SetOverlaySortOrder", "GetOverlaySortOrder", "SetOverlayWidthInMeters", "GetOverlayWidthInMeters", "SetOverlayAutoCurveDistanceRangeInMeters", "GetOverlayAutoCurveDistanceRangeInMeters", "SetOverlayTextureColorSpace", "GetOverlayTextureColorSpace", "SetOverlayTextureBounds", "GetOverlayTextureBounds", "GetOverlayRenderModel", "SetOverlayRenderModel", "GetOverlayTransformType", "SetOverlayTransformAbsolute", "GetOverlayTransformAbsolute", "SetOverlayTransformTrackedDeviceRelative", "GetOverlayTransformTrackedDeviceRelative", "SetOverlayTransformTrackedDeviceComponent", "GetOverlayTransformTrackedDeviceComponent", "GetOverlayTransformOverlayRelative", "SetOverlayTransformOverlayRelative", "ShowOverlay", "HideOverlay", "IsOverlayVisible", "GetTransformForOverlayCoordinates", "PollNextOverlayEvent", "GetOverlayInputMethod", "SetOverlayInputMethod", "GetOverlayMouseScale", "SetOverlayMouseScale", "ComputeOverlayIntersection", "IsHoverTargetOverlay", "GetGamepadFocusOverlay", "SetGamepadFocusOverlay", "SetOverlayNeighbor", "MoveGamepadFocusToNeighbor", "SetOverlayDualAnalogTransform", "GetOverlayDualAnalogTransform", "SetOverlayTexture", "ClearOverlayTexture", "SetOverlayRaw", "SetOverlayFromFile", "GetOverlayTexture", "ReleaseNativeOverlayHandle", "GetOverlayTextureSize", "CreateDashboardOverlay", "IsDashboardVisible", "IsActiveDashboardOverlay", "SetDashboardOverlaySceneProcess", "GetDashboardOverlaySceneProcess", "ShowDashboard", "GetPrimaryDashboardDevice", "ShowKeyboard", "ShowKeyboardForOverlay", "GetKeyboardText", "HideKeyboard", "SetKeyboardTransformAbsolute", "SetKeyboardPositionForOverlay", "SetOverlayIntersectionMask", "GetOverlayFlags", "ShowMessageOverlay", "CloseMessageOverlay"); + } + public VR_IVROverlay_FnTable(Pointer peer) { + super(peer); + } + public static class ByReference extends VR_IVROverlay_FnTable implements Structure.ByReference { + + }; + public static class ByValue extends VR_IVROverlay_FnTable implements Structure.ByValue { + + }; } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRRenderModels_FnTable.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRRenderModels_FnTable.java index a025a415ec..3d448c307e 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRRenderModels_FnTable.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRRenderModels_FnTable.java @@ -7,139 +7,140 @@ import java.util.Arrays; import java.util.List; /** - * native declaration : headers\openvr_capi.h:2251
- * This file was autogenerated by JNAerator,
- * a tool written by Olivier Chafik that uses a few opensource projects..
- * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VR_IVRRenderModels_FnTable extends Structure { - /** C type : LoadRenderModel_Async_callback* */ - public VR_IVRRenderModels_FnTable.LoadRenderModel_Async_callback LoadRenderModel_Async; - /** C type : FreeRenderModel_callback* */ - public VR_IVRRenderModels_FnTable.FreeRenderModel_callback FreeRenderModel; - /** C type : LoadTexture_Async_callback* */ - public VR_IVRRenderModels_FnTable.LoadTexture_Async_callback LoadTexture_Async; - /** C type : FreeTexture_callback* */ - public VR_IVRRenderModels_FnTable.FreeTexture_callback FreeTexture; - /** C type : LoadTextureD3D11_Async_callback* */ - public VR_IVRRenderModels_FnTable.LoadTextureD3D11_Async_callback LoadTextureD3D11_Async; - /** C type : LoadIntoTextureD3D11_Async_callback* */ - public VR_IVRRenderModels_FnTable.LoadIntoTextureD3D11_Async_callback LoadIntoTextureD3D11_Async; - /** C type : FreeTextureD3D11_callback* */ - public VR_IVRRenderModels_FnTable.FreeTextureD3D11_callback FreeTextureD3D11; - /** C type : GetRenderModelName_callback* */ - public VR_IVRRenderModels_FnTable.GetRenderModelName_callback GetRenderModelName; - /** C type : GetRenderModelCount_callback* */ - public VR_IVRRenderModels_FnTable.GetRenderModelCount_callback GetRenderModelCount; - /** C type : GetComponentCount_callback* */ - public VR_IVRRenderModels_FnTable.GetComponentCount_callback GetComponentCount; - /** C type : GetComponentName_callback* */ - public VR_IVRRenderModels_FnTable.GetComponentName_callback GetComponentName; - /** C type : GetComponentButtonMask_callback* */ - public VR_IVRRenderModels_FnTable.GetComponentButtonMask_callback GetComponentButtonMask; - /** C type : GetComponentRenderModelName_callback* */ - public VR_IVRRenderModels_FnTable.GetComponentRenderModelName_callback GetComponentRenderModelName; - /** C type : GetComponentStateForDevicePath_callback* */ - public VR_IVRRenderModels_FnTable.GetComponentStateForDevicePath_callback GetComponentStateForDevicePath; - /** C type : GetComponentState_callback* */ - public VR_IVRRenderModels_FnTable.GetComponentState_callback GetComponentState; - /** C type : RenderModelHasComponent_callback* */ - public VR_IVRRenderModels_FnTable.RenderModelHasComponent_callback RenderModelHasComponent; - /** C type : GetRenderModelThumbnailURL_callback* */ - public VR_IVRRenderModels_FnTable.GetRenderModelThumbnailURL_callback GetRenderModelThumbnailURL; - /** C type : GetRenderModelOriginalPath_callback* */ - public VR_IVRRenderModels_FnTable.GetRenderModelOriginalPath_callback GetRenderModelOriginalPath; - /** C type : GetRenderModelErrorNameFromEnum_callback* */ - public VR_IVRRenderModels_FnTable.GetRenderModelErrorNameFromEnum_callback GetRenderModelErrorNameFromEnum; - /** native declaration : headers\openvr_capi.h:2232 */ - public interface LoadRenderModel_Async_callback extends Callback { - int apply(Pointer pchRenderModelName, PointerByReference ppRenderModel); - }; - /** native declaration : headers\openvr_capi.h:2233 */ - public interface FreeRenderModel_callback extends Callback { - void apply(RenderModel_t pRenderModel); - }; - /** native declaration : headers\openvr_capi.h:2234 */ - public interface LoadTexture_Async_callback extends Callback { - int apply(int textureId, PointerByReference ppTexture); - }; - /** native declaration : headers\openvr_capi.h:2235 */ - public interface FreeTexture_callback extends Callback { - void apply(RenderModel_TextureMap_t pTexture); - }; - /** native declaration : headers\openvr_capi.h:2236 */ - public interface LoadTextureD3D11_Async_callback extends Callback { - int apply(int textureId, Pointer pD3D11Device, PointerByReference ppD3D11Texture2D); - }; - /** native declaration : headers\openvr_capi.h:2237 */ - public interface LoadIntoTextureD3D11_Async_callback extends Callback { - int apply(int textureId, Pointer pDstTexture); - }; - /** native declaration : headers\openvr_capi.h:2238 */ - public interface FreeTextureD3D11_callback extends Callback { - void apply(Pointer pD3D11Texture2D); - }; - /** native declaration : headers\openvr_capi.h:2239 */ - public interface GetRenderModelName_callback extends Callback { - int apply(int unRenderModelIndex, Pointer pchRenderModelName, int unRenderModelNameLen); - }; - /** native declaration : headers\openvr_capi.h:2240 */ - public interface GetRenderModelCount_callback extends Callback { - int apply(); - }; - /** native declaration : headers\openvr_capi.h:2241 */ - public interface GetComponentCount_callback extends Callback { - int apply(Pointer pchRenderModelName); - }; - /** native declaration : headers\openvr_capi.h:2242 */ - public interface GetComponentName_callback extends Callback { - int apply(Pointer pchRenderModelName, int unComponentIndex, Pointer pchComponentName, int unComponentNameLen); - }; - /** native declaration : headers\openvr_capi.h:2243 */ - public interface GetComponentButtonMask_callback extends Callback { - long apply(Pointer pchRenderModelName, Pointer pchComponentName); - }; - /** native declaration : headers\openvr_capi.h:2244 */ - public interface GetComponentRenderModelName_callback extends Callback { - int apply(Pointer pchRenderModelName, Pointer pchComponentName, Pointer pchComponentRenderModelName, int unComponentRenderModelNameLen); - }; - /** native declaration : headers\openvr_capi.h:2245 */ - public interface GetComponentStateForDevicePath_callback extends Callback { - byte apply(Pointer pchRenderModelName, Pointer pchComponentName, long devicePath, RenderModel_ControllerMode_State_t pState, RenderModel_ComponentState_t pComponentState); - }; - /** native declaration : headers\openvr_capi.h:2246 */ - public interface GetComponentState_callback extends Callback { - byte apply(Pointer pchRenderModelName, Pointer pchComponentName, VRControllerState_t pControllerState, RenderModel_ControllerMode_State_t pState, RenderModel_ComponentState_t pComponentState); - }; - /** native declaration : headers\openvr_capi.h:2247 */ - public interface RenderModelHasComponent_callback extends Callback { - byte apply(Pointer pchRenderModelName, Pointer pchComponentName); - }; - /** native declaration : headers\openvr_capi.h:2248 */ - public interface GetRenderModelThumbnailURL_callback extends Callback { - int apply(Pointer pchRenderModelName, Pointer pchThumbnailURL, int unThumbnailURLLen, IntByReference peError); - }; - /** native declaration : headers\openvr_capi.h:2249 */ - public interface GetRenderModelOriginalPath_callback extends Callback { - int apply(Pointer pchRenderModelName, Pointer pchOriginalPath, int unOriginalPathLen, IntByReference peError); - }; - /** native declaration : headers\openvr_capi.h:2250 */ - public interface GetRenderModelErrorNameFromEnum_callback extends Callback { - Pointer apply(int error); - }; - public VR_IVRRenderModels_FnTable() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("LoadRenderModel_Async", "FreeRenderModel", "LoadTexture_Async", "FreeTexture", "LoadTextureD3D11_Async", "LoadIntoTextureD3D11_Async", "FreeTextureD3D11", "GetRenderModelName", "GetRenderModelCount", "GetComponentCount", "GetComponentName", "GetComponentButtonMask", "GetComponentRenderModelName", "GetComponentStateForDevicePath", "GetComponentState", "RenderModelHasComponent", "GetRenderModelThumbnailURL", "GetRenderModelOriginalPath", "GetRenderModelErrorNameFromEnum"); - } - public VR_IVRRenderModels_FnTable(Pointer peer) { - super(peer); - } - public static class ByReference extends VR_IVRRenderModels_FnTable implements Structure.ByReference { - - }; - public static class ByValue extends VR_IVRRenderModels_FnTable implements Structure.ByValue { - - }; + * native declaration : headers\openvr_capi.h:2251
+ * This file was autogenerated by JNAerator,
+ * a tool written by Olivier Chafik that uses a few opensource projects..
+ * For help, please visit NativeLibs4Java , Rococoa, or JNA. + */ +public class VR_IVRRenderModels_FnTable extends Structure { + /** C type : LoadRenderModel_Async_callback* */ + public VR_IVRRenderModels_FnTable.LoadRenderModel_Async_callback LoadRenderModel_Async; + /** C type : FreeRenderModel_callback* */ + public VR_IVRRenderModels_FnTable.FreeRenderModel_callback FreeRenderModel; + /** C type : LoadTexture_Async_callback* */ + public VR_IVRRenderModels_FnTable.LoadTexture_Async_callback LoadTexture_Async; + /** C type : FreeTexture_callback* */ + public VR_IVRRenderModels_FnTable.FreeTexture_callback FreeTexture; + /** C type : LoadTextureD3D11_Async_callback* */ + public VR_IVRRenderModels_FnTable.LoadTextureD3D11_Async_callback LoadTextureD3D11_Async; + /** C type : LoadIntoTextureD3D11_Async_callback* */ + public VR_IVRRenderModels_FnTable.LoadIntoTextureD3D11_Async_callback LoadIntoTextureD3D11_Async; + /** C type : FreeTextureD3D11_callback* */ + public VR_IVRRenderModels_FnTable.FreeTextureD3D11_callback FreeTextureD3D11; + /** C type : GetRenderModelName_callback* */ + public VR_IVRRenderModels_FnTable.GetRenderModelName_callback GetRenderModelName; + /** C type : GetRenderModelCount_callback* */ + public VR_IVRRenderModels_FnTable.GetRenderModelCount_callback GetRenderModelCount; + /** C type : GetComponentCount_callback* */ + public VR_IVRRenderModels_FnTable.GetComponentCount_callback GetComponentCount; + /** C type : GetComponentName_callback* */ + public VR_IVRRenderModels_FnTable.GetComponentName_callback GetComponentName; + /** C type : GetComponentButtonMask_callback* */ + public VR_IVRRenderModels_FnTable.GetComponentButtonMask_callback GetComponentButtonMask; + /** C type : GetComponentRenderModelName_callback* */ + public VR_IVRRenderModels_FnTable.GetComponentRenderModelName_callback GetComponentRenderModelName; + /** C type : GetComponentStateForDevicePath_callback* */ + public VR_IVRRenderModels_FnTable.GetComponentStateForDevicePath_callback GetComponentStateForDevicePath; + /** C type : GetComponentState_callback* */ + public VR_IVRRenderModels_FnTable.GetComponentState_callback GetComponentState; + /** C type : RenderModelHasComponent_callback* */ + public VR_IVRRenderModels_FnTable.RenderModelHasComponent_callback RenderModelHasComponent; + /** C type : GetRenderModelThumbnailURL_callback* */ + public VR_IVRRenderModels_FnTable.GetRenderModelThumbnailURL_callback GetRenderModelThumbnailURL; + /** C type : GetRenderModelOriginalPath_callback* */ + public VR_IVRRenderModels_FnTable.GetRenderModelOriginalPath_callback GetRenderModelOriginalPath; + /** C type : GetRenderModelErrorNameFromEnum_callback* */ + public VR_IVRRenderModels_FnTable.GetRenderModelErrorNameFromEnum_callback GetRenderModelErrorNameFromEnum; + /** native declaration : headers\openvr_capi.h:2232 */ + public interface LoadRenderModel_Async_callback extends Callback { + int apply(Pointer pchRenderModelName, PointerByReference ppRenderModel); + }; + /** native declaration : headers\openvr_capi.h:2233 */ + public interface FreeRenderModel_callback extends Callback { + void apply(RenderModel_t pRenderModel); + }; + /** native declaration : headers\openvr_capi.h:2234 */ + public interface LoadTexture_Async_callback extends Callback { + int apply(int textureId, PointerByReference ppTexture); + }; + /** native declaration : headers\openvr_capi.h:2235 */ + public interface FreeTexture_callback extends Callback { + void apply(RenderModel_TextureMap_t pTexture); + }; + /** native declaration : headers\openvr_capi.h:2236 */ + public interface LoadTextureD3D11_Async_callback extends Callback { + int apply(int textureId, Pointer pD3D11Device, PointerByReference ppD3D11Texture2D); + }; + /** native declaration : headers\openvr_capi.h:2237 */ + public interface LoadIntoTextureD3D11_Async_callback extends Callback { + int apply(int textureId, Pointer pDstTexture); + }; + /** native declaration : headers\openvr_capi.h:2238 */ + public interface FreeTextureD3D11_callback extends Callback { + void apply(Pointer pD3D11Texture2D); + }; + /** native declaration : headers\openvr_capi.h:2239 */ + public interface GetRenderModelName_callback extends Callback { + int apply(int unRenderModelIndex, Pointer pchRenderModelName, int unRenderModelNameLen); + }; + /** native declaration : headers\openvr_capi.h:2240 */ + public interface GetRenderModelCount_callback extends Callback { + int apply(); + }; + /** native declaration : headers\openvr_capi.h:2241 */ + public interface GetComponentCount_callback extends Callback { + int apply(Pointer pchRenderModelName); + }; + /** native declaration : headers\openvr_capi.h:2242 */ + public interface GetComponentName_callback extends Callback { + int apply(Pointer pchRenderModelName, int unComponentIndex, Pointer pchComponentName, int unComponentNameLen); + }; + /** native declaration : headers\openvr_capi.h:2243 */ + public interface GetComponentButtonMask_callback extends Callback { + long apply(Pointer pchRenderModelName, Pointer pchComponentName); + }; + /** native declaration : headers\openvr_capi.h:2244 */ + public interface GetComponentRenderModelName_callback extends Callback { + int apply(Pointer pchRenderModelName, Pointer pchComponentName, Pointer pchComponentRenderModelName, int unComponentRenderModelNameLen); + }; + /** native declaration : headers\openvr_capi.h:2245 */ + public interface GetComponentStateForDevicePath_callback extends Callback { + byte apply(Pointer pchRenderModelName, Pointer pchComponentName, long devicePath, RenderModel_ControllerMode_State_t pState, RenderModel_ComponentState_t pComponentState); + }; + /** native declaration : headers\openvr_capi.h:2246 */ + public interface GetComponentState_callback extends Callback { + byte apply(Pointer pchRenderModelName, Pointer pchComponentName, VRControllerState_t pControllerState, RenderModel_ControllerMode_State_t pState, RenderModel_ComponentState_t pComponentState); + }; + /** native declaration : headers\openvr_capi.h:2247 */ + public interface RenderModelHasComponent_callback extends Callback { + byte apply(Pointer pchRenderModelName, Pointer pchComponentName); + }; + /** native declaration : headers\openvr_capi.h:2248 */ + public interface GetRenderModelThumbnailURL_callback extends Callback { + int apply(Pointer pchRenderModelName, Pointer pchThumbnailURL, int unThumbnailURLLen, IntByReference peError); + }; + /** native declaration : headers\openvr_capi.h:2249 */ + public interface GetRenderModelOriginalPath_callback extends Callback { + int apply(Pointer pchRenderModelName, Pointer pchOriginalPath, int unOriginalPathLen, IntByReference peError); + }; + /** native declaration : headers\openvr_capi.h:2250 */ + public interface GetRenderModelErrorNameFromEnum_callback extends Callback { + Pointer apply(int error); + }; + public VR_IVRRenderModels_FnTable() { + super(); + } + @Override + protected List getFieldOrder() { + return Arrays.asList("LoadRenderModel_Async", "FreeRenderModel", "LoadTexture_Async", "FreeTexture", "LoadTextureD3D11_Async", "LoadIntoTextureD3D11_Async", "FreeTextureD3D11", "GetRenderModelName", "GetRenderModelCount", "GetComponentCount", "GetComponentName", "GetComponentButtonMask", "GetComponentRenderModelName", "GetComponentStateForDevicePath", "GetComponentState", "RenderModelHasComponent", "GetRenderModelThumbnailURL", "GetRenderModelOriginalPath", "GetRenderModelErrorNameFromEnum"); + } + public VR_IVRRenderModels_FnTable(Pointer peer) { + super(peer); + } + public static class ByReference extends VR_IVRRenderModels_FnTable implements Structure.ByReference { + + }; + public static class ByValue extends VR_IVRRenderModels_FnTable implements Structure.ByValue { + + }; } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRResources_FnTable.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRResources_FnTable.java index 889feb9822..1533e094c8 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRResources_FnTable.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRResources_FnTable.java @@ -5,46 +5,47 @@ import java.util.Arrays; import java.util.List; /** - * native declaration : headers\openvr_capi.h:2305
- * This file was autogenerated by JNAerator,
- * a tool written by Olivier Chafik that uses a few opensource projects..
- * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VR_IVRResources_FnTable extends Structure { - /** C type : LoadSharedResource_callback* */ - public VR_IVRResources_FnTable.LoadSharedResource_callback LoadSharedResource; - /** C type : GetResourceFullPath_callback* */ - public VR_IVRResources_FnTable.GetResourceFullPath_callback GetResourceFullPath; - /** native declaration : headers\openvr_capi.h:2303 */ - public interface LoadSharedResource_callback extends Callback { - int apply(Pointer pchResourceName, Pointer pchBuffer, int unBufferLen); - }; - /** native declaration : headers\openvr_capi.h:2304 */ - public interface GetResourceFullPath_callback extends Callback { - int apply(Pointer pchResourceName, Pointer pchResourceTypeDirectory, Pointer pchPathBuffer, int unBufferLen); - }; - public VR_IVRResources_FnTable() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("LoadSharedResource", "GetResourceFullPath"); - } + * native declaration : headers\openvr_capi.h:2305
+ * This file was autogenerated by JNAerator,
+ * a tool written by Olivier Chafik that uses a few opensource projects..
+ * For help, please visit NativeLibs4Java , Rococoa, or JNA. + */ +public class VR_IVRResources_FnTable extends Structure { + /** C type : LoadSharedResource_callback* */ + public VR_IVRResources_FnTable.LoadSharedResource_callback LoadSharedResource; + /** C type : GetResourceFullPath_callback* */ + public VR_IVRResources_FnTable.GetResourceFullPath_callback GetResourceFullPath; + /** native declaration : headers\openvr_capi.h:2303 */ + public interface LoadSharedResource_callback extends Callback { + int apply(Pointer pchResourceName, Pointer pchBuffer, int unBufferLen); + }; + /** native declaration : headers\openvr_capi.h:2304 */ + public interface GetResourceFullPath_callback extends Callback { + int apply(Pointer pchResourceName, Pointer pchResourceTypeDirectory, Pointer pchPathBuffer, int unBufferLen); + }; + public VR_IVRResources_FnTable() { + super(); + } + @Override + protected List getFieldOrder() { + return Arrays.asList("LoadSharedResource", "GetResourceFullPath"); + } /** - * @param LoadSharedResource C type : LoadSharedResource_callback*
- * @param GetResourceFullPath C type : GetResourceFullPath_callback* - */ - public VR_IVRResources_FnTable(VR_IVRResources_FnTable.LoadSharedResource_callback LoadSharedResource, VR_IVRResources_FnTable.GetResourceFullPath_callback GetResourceFullPath) { - super(); - this.LoadSharedResource = LoadSharedResource; - this.GetResourceFullPath = GetResourceFullPath; - } - public VR_IVRResources_FnTable(Pointer peer) { - super(peer); - } - public static class ByReference extends VR_IVRResources_FnTable implements Structure.ByReference { - - }; - public static class ByValue extends VR_IVRResources_FnTable implements Structure.ByValue { - - }; + * @param LoadSharedResource C type : LoadSharedResource_callback*
+ * @param GetResourceFullPath C type : GetResourceFullPath_callback* + */ + public VR_IVRResources_FnTable(VR_IVRResources_FnTable.LoadSharedResource_callback LoadSharedResource, VR_IVRResources_FnTable.GetResourceFullPath_callback GetResourceFullPath) { + super(); + this.LoadSharedResource = LoadSharedResource; + this.GetResourceFullPath = GetResourceFullPath; + } + public VR_IVRResources_FnTable(Pointer peer) { + super(peer); + } + public static class ByReference extends VR_IVRResources_FnTable implements Structure.ByReference { + + }; + public static class ByValue extends VR_IVRResources_FnTable implements Structure.ByValue { + + }; } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRScreenshots_FnTable.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRScreenshots_FnTable.java index 888c3ce2d9..058637d0d4 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRScreenshots_FnTable.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRScreenshots_FnTable.java @@ -6,86 +6,87 @@ import java.util.Arrays; import java.util.List; /** - * native declaration : headers\openvr_capi.h:2299
- * This file was autogenerated by JNAerator,
- * a tool written by Olivier Chafik that uses a few opensource projects..
- * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VR_IVRScreenshots_FnTable extends Structure { - /** C type : RequestScreenshot_callback* */ - public VR_IVRScreenshots_FnTable.RequestScreenshot_callback RequestScreenshot; - /** C type : HookScreenshot_callback* */ - public VR_IVRScreenshots_FnTable.HookScreenshot_callback HookScreenshot; - /** C type : GetScreenshotPropertyType_callback* */ - public VR_IVRScreenshots_FnTable.GetScreenshotPropertyType_callback GetScreenshotPropertyType; - /** C type : GetScreenshotPropertyFilename_callback* */ - public VR_IVRScreenshots_FnTable.GetScreenshotPropertyFilename_callback GetScreenshotPropertyFilename; - /** C type : UpdateScreenshotProgress_callback* */ - public VR_IVRScreenshots_FnTable.UpdateScreenshotProgress_callback UpdateScreenshotProgress; - /** C type : TakeStereoScreenshot_callback* */ - public VR_IVRScreenshots_FnTable.TakeStereoScreenshot_callback TakeStereoScreenshot; - /** C type : SubmitScreenshot_callback* */ - public VR_IVRScreenshots_FnTable.SubmitScreenshot_callback SubmitScreenshot; - /** native declaration : headers\openvr_capi.h:2292 */ - public interface RequestScreenshot_callback extends Callback { - int apply(IntByReference pOutScreenshotHandle, int type, Pointer pchPreviewFilename, Pointer pchVRFilename); - }; - /** native declaration : headers\openvr_capi.h:2293 */ - public interface HookScreenshot_callback extends Callback { - int apply(IntByReference pSupportedTypes, int numTypes); - }; - /** native declaration : headers\openvr_capi.h:2294 */ - public interface GetScreenshotPropertyType_callback extends Callback { - int apply(int screenshotHandle, IntByReference pError); - }; - /** native declaration : headers\openvr_capi.h:2295 */ - public interface GetScreenshotPropertyFilename_callback extends Callback { - int apply(int screenshotHandle, int filenameType, Pointer pchFilename, int cchFilename, IntByReference pError); - }; - /** native declaration : headers\openvr_capi.h:2296 */ - public interface UpdateScreenshotProgress_callback extends Callback { - int apply(int screenshotHandle, float flProgress); - }; - /** native declaration : headers\openvr_capi.h:2297 */ - public interface TakeStereoScreenshot_callback extends Callback { - int apply(IntByReference pOutScreenshotHandle, Pointer pchPreviewFilename, Pointer pchVRFilename); - }; - /** native declaration : headers\openvr_capi.h:2298 */ - public interface SubmitScreenshot_callback extends Callback { - int apply(int screenshotHandle, int type, Pointer pchSourcePreviewFilename, Pointer pchSourceVRFilename); - }; - public VR_IVRScreenshots_FnTable() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("RequestScreenshot", "HookScreenshot", "GetScreenshotPropertyType", "GetScreenshotPropertyFilename", "UpdateScreenshotProgress", "TakeStereoScreenshot", "SubmitScreenshot"); - } + * native declaration : headers\openvr_capi.h:2299
+ * This file was autogenerated by JNAerator,
+ * a tool written by Olivier Chafik that uses a few opensource projects..
+ * For help, please visit NativeLibs4Java , Rococoa, or JNA. + */ +public class VR_IVRScreenshots_FnTable extends Structure { + /** C type : RequestScreenshot_callback* */ + public VR_IVRScreenshots_FnTable.RequestScreenshot_callback RequestScreenshot; + /** C type : HookScreenshot_callback* */ + public VR_IVRScreenshots_FnTable.HookScreenshot_callback HookScreenshot; + /** C type : GetScreenshotPropertyType_callback* */ + public VR_IVRScreenshots_FnTable.GetScreenshotPropertyType_callback GetScreenshotPropertyType; + /** C type : GetScreenshotPropertyFilename_callback* */ + public VR_IVRScreenshots_FnTable.GetScreenshotPropertyFilename_callback GetScreenshotPropertyFilename; + /** C type : UpdateScreenshotProgress_callback* */ + public VR_IVRScreenshots_FnTable.UpdateScreenshotProgress_callback UpdateScreenshotProgress; + /** C type : TakeStereoScreenshot_callback* */ + public VR_IVRScreenshots_FnTable.TakeStereoScreenshot_callback TakeStereoScreenshot; + /** C type : SubmitScreenshot_callback* */ + public VR_IVRScreenshots_FnTable.SubmitScreenshot_callback SubmitScreenshot; + /** native declaration : headers\openvr_capi.h:2292 */ + public interface RequestScreenshot_callback extends Callback { + int apply(IntByReference pOutScreenshotHandle, int type, Pointer pchPreviewFilename, Pointer pchVRFilename); + }; + /** native declaration : headers\openvr_capi.h:2293 */ + public interface HookScreenshot_callback extends Callback { + int apply(IntByReference pSupportedTypes, int numTypes); + }; + /** native declaration : headers\openvr_capi.h:2294 */ + public interface GetScreenshotPropertyType_callback extends Callback { + int apply(int screenshotHandle, IntByReference pError); + }; + /** native declaration : headers\openvr_capi.h:2295 */ + public interface GetScreenshotPropertyFilename_callback extends Callback { + int apply(int screenshotHandle, int filenameType, Pointer pchFilename, int cchFilename, IntByReference pError); + }; + /** native declaration : headers\openvr_capi.h:2296 */ + public interface UpdateScreenshotProgress_callback extends Callback { + int apply(int screenshotHandle, float flProgress); + }; + /** native declaration : headers\openvr_capi.h:2297 */ + public interface TakeStereoScreenshot_callback extends Callback { + int apply(IntByReference pOutScreenshotHandle, Pointer pchPreviewFilename, Pointer pchVRFilename); + }; + /** native declaration : headers\openvr_capi.h:2298 */ + public interface SubmitScreenshot_callback extends Callback { + int apply(int screenshotHandle, int type, Pointer pchSourcePreviewFilename, Pointer pchSourceVRFilename); + }; + public VR_IVRScreenshots_FnTable() { + super(); + } + @Override + protected List getFieldOrder() { + return Arrays.asList("RequestScreenshot", "HookScreenshot", "GetScreenshotPropertyType", "GetScreenshotPropertyFilename", "UpdateScreenshotProgress", "TakeStereoScreenshot", "SubmitScreenshot"); + } /** - * @param RequestScreenshot C type : RequestScreenshot_callback*
- * @param HookScreenshot C type : HookScreenshot_callback*
- * @param GetScreenshotPropertyType C type : GetScreenshotPropertyType_callback*
- * @param GetScreenshotPropertyFilename C type : GetScreenshotPropertyFilename_callback*
- * @param UpdateScreenshotProgress C type : UpdateScreenshotProgress_callback*
- * @param TakeStereoScreenshot C type : TakeStereoScreenshot_callback*
- * @param SubmitScreenshot C type : SubmitScreenshot_callback* - */ - public VR_IVRScreenshots_FnTable(VR_IVRScreenshots_FnTable.RequestScreenshot_callback RequestScreenshot, VR_IVRScreenshots_FnTable.HookScreenshot_callback HookScreenshot, VR_IVRScreenshots_FnTable.GetScreenshotPropertyType_callback GetScreenshotPropertyType, VR_IVRScreenshots_FnTable.GetScreenshotPropertyFilename_callback GetScreenshotPropertyFilename, VR_IVRScreenshots_FnTable.UpdateScreenshotProgress_callback UpdateScreenshotProgress, VR_IVRScreenshots_FnTable.TakeStereoScreenshot_callback TakeStereoScreenshot, VR_IVRScreenshots_FnTable.SubmitScreenshot_callback SubmitScreenshot) { - super(); - this.RequestScreenshot = RequestScreenshot; - this.HookScreenshot = HookScreenshot; - this.GetScreenshotPropertyType = GetScreenshotPropertyType; - this.GetScreenshotPropertyFilename = GetScreenshotPropertyFilename; - this.UpdateScreenshotProgress = UpdateScreenshotProgress; - this.TakeStereoScreenshot = TakeStereoScreenshot; - this.SubmitScreenshot = SubmitScreenshot; - } - public VR_IVRScreenshots_FnTable(Pointer peer) { - super(peer); - } - public static class ByReference extends VR_IVRScreenshots_FnTable implements Structure.ByReference { - - }; - public static class ByValue extends VR_IVRScreenshots_FnTable implements Structure.ByValue { - - }; + * @param RequestScreenshot C type : RequestScreenshot_callback*
+ * @param HookScreenshot C type : HookScreenshot_callback*
+ * @param GetScreenshotPropertyType C type : GetScreenshotPropertyType_callback*
+ * @param GetScreenshotPropertyFilename C type : GetScreenshotPropertyFilename_callback*
+ * @param UpdateScreenshotProgress C type : UpdateScreenshotProgress_callback*
+ * @param TakeStereoScreenshot C type : TakeStereoScreenshot_callback*
+ * @param SubmitScreenshot C type : SubmitScreenshot_callback* + */ + public VR_IVRScreenshots_FnTable(VR_IVRScreenshots_FnTable.RequestScreenshot_callback RequestScreenshot, VR_IVRScreenshots_FnTable.HookScreenshot_callback HookScreenshot, VR_IVRScreenshots_FnTable.GetScreenshotPropertyType_callback GetScreenshotPropertyType, VR_IVRScreenshots_FnTable.GetScreenshotPropertyFilename_callback GetScreenshotPropertyFilename, VR_IVRScreenshots_FnTable.UpdateScreenshotProgress_callback UpdateScreenshotProgress, VR_IVRScreenshots_FnTable.TakeStereoScreenshot_callback TakeStereoScreenshot, VR_IVRScreenshots_FnTable.SubmitScreenshot_callback SubmitScreenshot) { + super(); + this.RequestScreenshot = RequestScreenshot; + this.HookScreenshot = HookScreenshot; + this.GetScreenshotPropertyType = GetScreenshotPropertyType; + this.GetScreenshotPropertyFilename = GetScreenshotPropertyFilename; + this.UpdateScreenshotProgress = UpdateScreenshotProgress; + this.TakeStereoScreenshot = TakeStereoScreenshot; + this.SubmitScreenshot = SubmitScreenshot; + } + public VR_IVRScreenshots_FnTable(Pointer peer) { + super(peer); + } + public static class ByReference extends VR_IVRScreenshots_FnTable implements Structure.ByReference { + + }; + public static class ByValue extends VR_IVRScreenshots_FnTable implements Structure.ByValue { + + }; } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRSettings_FnTable.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRSettings_FnTable.java index a3704ec539..ebbe247fb9 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRSettings_FnTable.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRSettings_FnTable.java @@ -6,97 +6,98 @@ import java.util.Arrays; import java.util.List; /** - * native declaration : headers\openvr_capi.h:2283
- * This file was autogenerated by JNAerator,
- * a tool written by Olivier Chafik that uses a few opensource projects..
- * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VR_IVRSettings_FnTable extends Structure { - /** C type : GetSettingsErrorNameFromEnum_callback* */ - public VR_IVRSettings_FnTable.GetSettingsErrorNameFromEnum_callback GetSettingsErrorNameFromEnum; - /** C type : Sync_callback* */ - public VR_IVRSettings_FnTable.Sync_callback Sync; - /** C type : SetBool_callback* */ - public VR_IVRSettings_FnTable.SetBool_callback SetBool; - /** C type : SetInt32_callback* */ - public VR_IVRSettings_FnTable.SetInt32_callback SetInt32; - /** C type : SetFloat_callback* */ - public VR_IVRSettings_FnTable.SetFloat_callback SetFloat; - /** C type : SetString_callback* */ - public VR_IVRSettings_FnTable.SetString_callback SetString; - /** C type : GetBool_callback* */ - public VR_IVRSettings_FnTable.GetBool_callback GetBool; - /** C type : GetInt32_callback* */ - public VR_IVRSettings_FnTable.GetInt32_callback GetInt32; - /** C type : GetFloat_callback* */ - public VR_IVRSettings_FnTable.GetFloat_callback GetFloat; - /** C type : GetString_callback* */ - public VR_IVRSettings_FnTable.GetString_callback GetString; - /** C type : RemoveSection_callback* */ - public VR_IVRSettings_FnTable.RemoveSection_callback RemoveSection; - /** C type : RemoveKeyInSection_callback* */ - public VR_IVRSettings_FnTable.RemoveKeyInSection_callback RemoveKeyInSection; - /** native declaration : headers\openvr_capi.h:2271 */ - public interface GetSettingsErrorNameFromEnum_callback extends Callback { - Pointer apply(int eError); - }; - /** native declaration : headers\openvr_capi.h:2272 */ - public interface Sync_callback extends Callback { - byte apply(byte bForce, IntByReference peError); - }; - /** native declaration : headers\openvr_capi.h:2273 */ - public interface SetBool_callback extends Callback { - void apply(Pointer pchSection, Pointer pchSettingsKey, byte bValue, IntByReference peError); - }; - /** native declaration : headers\openvr_capi.h:2274 */ - public interface SetInt32_callback extends Callback { - void apply(Pointer pchSection, Pointer pchSettingsKey, int nValue, IntByReference peError); - }; - /** native declaration : headers\openvr_capi.h:2275 */ - public interface SetFloat_callback extends Callback { - void apply(Pointer pchSection, Pointer pchSettingsKey, float flValue, IntByReference peError); - }; - /** native declaration : headers\openvr_capi.h:2276 */ - public interface SetString_callback extends Callback { - void apply(Pointer pchSection, Pointer pchSettingsKey, Pointer pchValue, IntByReference peError); - }; - /** native declaration : headers\openvr_capi.h:2277 */ - public interface GetBool_callback extends Callback { - byte apply(Pointer pchSection, Pointer pchSettingsKey, IntByReference peError); - }; - /** native declaration : headers\openvr_capi.h:2278 */ - public interface GetInt32_callback extends Callback { - int apply(Pointer pchSection, Pointer pchSettingsKey, IntByReference peError); - }; - /** native declaration : headers\openvr_capi.h:2279 */ - public interface GetFloat_callback extends Callback { - float apply(Pointer pchSection, Pointer pchSettingsKey, IntByReference peError); - }; - /** native declaration : headers\openvr_capi.h:2280 */ - public interface GetString_callback extends Callback { - void apply(Pointer pchSection, Pointer pchSettingsKey, Pointer pchValue, int unValueLen, IntByReference peError); - }; - /** native declaration : headers\openvr_capi.h:2281 */ - public interface RemoveSection_callback extends Callback { - void apply(Pointer pchSection, IntByReference peError); - }; - /** native declaration : headers\openvr_capi.h:2282 */ - public interface RemoveKeyInSection_callback extends Callback { - void apply(Pointer pchSection, Pointer pchSettingsKey, IntByReference peError); - }; - public VR_IVRSettings_FnTable() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("GetSettingsErrorNameFromEnum", "Sync", "SetBool", "SetInt32", "SetFloat", "SetString", "GetBool", "GetInt32", "GetFloat", "GetString", "RemoveSection", "RemoveKeyInSection"); - } - public VR_IVRSettings_FnTable(Pointer peer) { - super(peer); - } - public static class ByReference extends VR_IVRSettings_FnTable implements Structure.ByReference { - - }; - public static class ByValue extends VR_IVRSettings_FnTable implements Structure.ByValue { - - }; + * native declaration : headers\openvr_capi.h:2283
+ * This file was autogenerated by JNAerator,
+ * a tool written by Olivier Chafik that uses a few opensource projects..
+ * For help, please visit NativeLibs4Java , Rococoa, or JNA. + */ +public class VR_IVRSettings_FnTable extends Structure { + /** C type : GetSettingsErrorNameFromEnum_callback* */ + public VR_IVRSettings_FnTable.GetSettingsErrorNameFromEnum_callback GetSettingsErrorNameFromEnum; + /** C type : Sync_callback* */ + public VR_IVRSettings_FnTable.Sync_callback Sync; + /** C type : SetBool_callback* */ + public VR_IVRSettings_FnTable.SetBool_callback SetBool; + /** C type : SetInt32_callback* */ + public VR_IVRSettings_FnTable.SetInt32_callback SetInt32; + /** C type : SetFloat_callback* */ + public VR_IVRSettings_FnTable.SetFloat_callback SetFloat; + /** C type : SetString_callback* */ + public VR_IVRSettings_FnTable.SetString_callback SetString; + /** C type : GetBool_callback* */ + public VR_IVRSettings_FnTable.GetBool_callback GetBool; + /** C type : GetInt32_callback* */ + public VR_IVRSettings_FnTable.GetInt32_callback GetInt32; + /** C type : GetFloat_callback* */ + public VR_IVRSettings_FnTable.GetFloat_callback GetFloat; + /** C type : GetString_callback* */ + public VR_IVRSettings_FnTable.GetString_callback GetString; + /** C type : RemoveSection_callback* */ + public VR_IVRSettings_FnTable.RemoveSection_callback RemoveSection; + /** C type : RemoveKeyInSection_callback* */ + public VR_IVRSettings_FnTable.RemoveKeyInSection_callback RemoveKeyInSection; + /** native declaration : headers\openvr_capi.h:2271 */ + public interface GetSettingsErrorNameFromEnum_callback extends Callback { + Pointer apply(int eError); + }; + /** native declaration : headers\openvr_capi.h:2272 */ + public interface Sync_callback extends Callback { + byte apply(byte bForce, IntByReference peError); + }; + /** native declaration : headers\openvr_capi.h:2273 */ + public interface SetBool_callback extends Callback { + void apply(Pointer pchSection, Pointer pchSettingsKey, byte bValue, IntByReference peError); + }; + /** native declaration : headers\openvr_capi.h:2274 */ + public interface SetInt32_callback extends Callback { + void apply(Pointer pchSection, Pointer pchSettingsKey, int nValue, IntByReference peError); + }; + /** native declaration : headers\openvr_capi.h:2275 */ + public interface SetFloat_callback extends Callback { + void apply(Pointer pchSection, Pointer pchSettingsKey, float flValue, IntByReference peError); + }; + /** native declaration : headers\openvr_capi.h:2276 */ + public interface SetString_callback extends Callback { + void apply(Pointer pchSection, Pointer pchSettingsKey, Pointer pchValue, IntByReference peError); + }; + /** native declaration : headers\openvr_capi.h:2277 */ + public interface GetBool_callback extends Callback { + byte apply(Pointer pchSection, Pointer pchSettingsKey, IntByReference peError); + }; + /** native declaration : headers\openvr_capi.h:2278 */ + public interface GetInt32_callback extends Callback { + int apply(Pointer pchSection, Pointer pchSettingsKey, IntByReference peError); + }; + /** native declaration : headers\openvr_capi.h:2279 */ + public interface GetFloat_callback extends Callback { + float apply(Pointer pchSection, Pointer pchSettingsKey, IntByReference peError); + }; + /** native declaration : headers\openvr_capi.h:2280 */ + public interface GetString_callback extends Callback { + void apply(Pointer pchSection, Pointer pchSettingsKey, Pointer pchValue, int unValueLen, IntByReference peError); + }; + /** native declaration : headers\openvr_capi.h:2281 */ + public interface RemoveSection_callback extends Callback { + void apply(Pointer pchSection, IntByReference peError); + }; + /** native declaration : headers\openvr_capi.h:2282 */ + public interface RemoveKeyInSection_callback extends Callback { + void apply(Pointer pchSection, Pointer pchSettingsKey, IntByReference peError); + }; + public VR_IVRSettings_FnTable() { + super(); + } + @Override + protected List getFieldOrder() { + return Arrays.asList("GetSettingsErrorNameFromEnum", "Sync", "SetBool", "SetInt32", "SetFloat", "SetString", "GetBool", "GetInt32", "GetFloat", "GetString", "RemoveSection", "RemoveKeyInSection"); + } + public VR_IVRSettings_FnTable(Pointer peer) { + super(peer); + } + public static class ByReference extends VR_IVRSettings_FnTable implements Structure.ByReference { + + }; + public static class ByValue extends VR_IVRSettings_FnTable implements Structure.ByValue { + + }; } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRSpatialAnchors_FnTable.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRSpatialAnchors_FnTable.java index 17d7892695..3b28c8da19 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRSpatialAnchors_FnTable.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRSpatialAnchors_FnTable.java @@ -39,6 +39,7 @@ public interface GetSpatialAnchorDescriptor_callback extends Callback { public VR_IVRSpatialAnchors_FnTable() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("CreateSpatialAnchorFromDescriptor", "CreateSpatialAnchorFromPose", "GetSpatialAnchorPose", "GetSpatialAnchorDescriptor"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRSystem_FnTable.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRSystem_FnTable.java index 315ca22cdc..8257d23a4f 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRSystem_FnTable.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRSystem_FnTable.java @@ -9,308 +9,309 @@ import java.util.Arrays; import java.util.List; /** - * OpenVR Function Pointer Tables
- * native declaration : headers\openvr_capi.h:1799
- * This file was autogenerated by JNAerator,
- * a tool written by Olivier Chafik that uses a few opensource projects..
- * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VR_IVRSystem_FnTable extends Structure { - /** C type : GetRecommendedRenderTargetSize_callback* */ - public VR_IVRSystem_FnTable.GetRecommendedRenderTargetSize_callback GetRecommendedRenderTargetSize; - /** C type : GetProjectionMatrix_callback* */ - public VR_IVRSystem_FnTable.GetProjectionMatrix_callback GetProjectionMatrix; - /** C type : GetProjectionRaw_callback* */ - public VR_IVRSystem_FnTable.GetProjectionRaw_callback GetProjectionRaw; - /** C type : ComputeDistortion_callback* */ - public VR_IVRSystem_FnTable.ComputeDistortion_callback ComputeDistortion; - /** C type : GetEyeToHeadTransform_callback* */ - public VR_IVRSystem_FnTable.GetEyeToHeadTransform_callback GetEyeToHeadTransform; - /** C type : GetTimeSinceLastVsync_callback* */ - public VR_IVRSystem_FnTable.GetTimeSinceLastVsync_callback GetTimeSinceLastVsync; - /** C type : GetD3D9AdapterIndex_callback* */ - public VR_IVRSystem_FnTable.GetD3D9AdapterIndex_callback GetD3D9AdapterIndex; - /** C type : GetDXGIOutputInfo_callback* */ - public com.jme3.system.jopenvr.VR_IVRExtendedDisplay_FnTable.GetDXGIOutputInfo_callback GetDXGIOutputInfo; - /** C type : GetOutputDevice_callback* */ - public VR_IVRSystem_FnTable.GetOutputDevice_callback GetOutputDevice; - /** C type : IsDisplayOnDesktop_callback* */ - public VR_IVRSystem_FnTable.IsDisplayOnDesktop_callback IsDisplayOnDesktop; - /** C type : SetDisplayVisibility_callback* */ - public VR_IVRSystem_FnTable.SetDisplayVisibility_callback SetDisplayVisibility; - /** C type : GetDeviceToAbsoluteTrackingPose_callback* */ - public VR_IVRSystem_FnTable.GetDeviceToAbsoluteTrackingPose_callback GetDeviceToAbsoluteTrackingPose; - /** C type : ResetSeatedZeroPose_callback* */ - public VR_IVRSystem_FnTable.ResetSeatedZeroPose_callback ResetSeatedZeroPose; - /** C type : GetSeatedZeroPoseToStandingAbsoluteTrackingPose_callback* */ - public VR_IVRSystem_FnTable.GetSeatedZeroPoseToStandingAbsoluteTrackingPose_callback GetSeatedZeroPoseToStandingAbsoluteTrackingPose; - /** C type : GetRawZeroPoseToStandingAbsoluteTrackingPose_callback* */ - public VR_IVRSystem_FnTable.GetRawZeroPoseToStandingAbsoluteTrackingPose_callback GetRawZeroPoseToStandingAbsoluteTrackingPose; - /** C type : GetSortedTrackedDeviceIndicesOfClass_callback* */ - public VR_IVRSystem_FnTable.GetSortedTrackedDeviceIndicesOfClass_callback GetSortedTrackedDeviceIndicesOfClass; - /** C type : GetTrackedDeviceActivityLevel_callback* */ - public VR_IVRSystem_FnTable.GetTrackedDeviceActivityLevel_callback GetTrackedDeviceActivityLevel; - /** C type : ApplyTransform_callback* */ - public VR_IVRSystem_FnTable.ApplyTransform_callback ApplyTransform; - /** C type : GetTrackedDeviceIndexForControllerRole_callback* */ - public VR_IVRSystem_FnTable.GetTrackedDeviceIndexForControllerRole_callback GetTrackedDeviceIndexForControllerRole; - /** C type : GetControllerRoleForTrackedDeviceIndex_callback* */ - public VR_IVRSystem_FnTable.GetControllerRoleForTrackedDeviceIndex_callback GetControllerRoleForTrackedDeviceIndex; - /** C type : GetTrackedDeviceClass_callback* */ - public VR_IVRSystem_FnTable.GetTrackedDeviceClass_callback GetTrackedDeviceClass; - /** C type : IsTrackedDeviceConnected_callback* */ - public VR_IVRSystem_FnTable.IsTrackedDeviceConnected_callback IsTrackedDeviceConnected; - /** C type : GetBoolTrackedDeviceProperty_callback* */ - public VR_IVRSystem_FnTable.GetBoolTrackedDeviceProperty_callback GetBoolTrackedDeviceProperty; - /** C type : GetFloatTrackedDeviceProperty_callback* */ - public VR_IVRSystem_FnTable.GetFloatTrackedDeviceProperty_callback GetFloatTrackedDeviceProperty; - /** C type : GetInt32TrackedDeviceProperty_callback* */ - public VR_IVRSystem_FnTable.GetInt32TrackedDeviceProperty_callback GetInt32TrackedDeviceProperty; - /** C type : GetUint64TrackedDeviceProperty_callback* */ - public VR_IVRSystem_FnTable.GetUint64TrackedDeviceProperty_callback GetUint64TrackedDeviceProperty; - /** C type : GetMatrix34TrackedDeviceProperty_callback* */ - public VR_IVRSystem_FnTable.GetMatrix34TrackedDeviceProperty_callback GetMatrix34TrackedDeviceProperty; - /** C type : GetArrayTrackedDeviceProperty_callback* */ - public VR_IVRSystem_FnTable.GetArrayTrackedDeviceProperty_callback GetArrayTrackedDeviceProperty; - /** C type : GetStringTrackedDeviceProperty_callback* */ - public VR_IVRSystem_FnTable.GetStringTrackedDeviceProperty_callback GetStringTrackedDeviceProperty; - /** C type : GetPropErrorNameFromEnum_callback* */ - public VR_IVRSystem_FnTable.GetPropErrorNameFromEnum_callback GetPropErrorNameFromEnum; - /** C type : PollNextEvent_callback* */ - public VR_IVRSystem_FnTable.PollNextEvent_callback PollNextEvent; - /** C type : PollNextEventWithPose_callback* */ - public VR_IVRSystem_FnTable.PollNextEventWithPose_callback PollNextEventWithPose; - /** C type : GetEventTypeNameFromEnum_callback* */ - public VR_IVRSystem_FnTable.GetEventTypeNameFromEnum_callback GetEventTypeNameFromEnum; - /** C type : GetHiddenAreaMesh_callback* */ - public VR_IVRSystem_FnTable.GetHiddenAreaMesh_callback GetHiddenAreaMesh; - /** C type : GetControllerState_callback* */ - public VR_IVRSystem_FnTable.GetControllerState_callback GetControllerState; - /** C type : GetControllerStateWithPose_callback* */ - public VR_IVRSystem_FnTable.GetControllerStateWithPose_callback GetControllerStateWithPose; - /** C type : TriggerHapticPulse_callback* */ - public VR_IVRSystem_FnTable.TriggerHapticPulse_callback TriggerHapticPulse; - /** C type : GetButtonIdNameFromEnum_callback* */ - public VR_IVRSystem_FnTable.GetButtonIdNameFromEnum_callback GetButtonIdNameFromEnum; - /** C type : GetControllerAxisTypeNameFromEnum_callback* */ - public VR_IVRSystem_FnTable.GetControllerAxisTypeNameFromEnum_callback GetControllerAxisTypeNameFromEnum; - /** C type : IsInputAvailable_callback* */ - public VR_IVRSystem_FnTable.IsInputAvailable_callback IsInputAvailable; - /** C type : IsSteamVRDrawingControllers_callback* */ - public VR_IVRSystem_FnTable.IsSteamVRDrawingControllers_callback IsSteamVRDrawingControllers; - /** C type : ShouldApplicationPause_callback* */ - public VR_IVRSystem_FnTable.ShouldApplicationPause_callback ShouldApplicationPause; - /** C type : ShouldApplicationReduceRenderingWork_callback* */ - public VR_IVRSystem_FnTable.ShouldApplicationReduceRenderingWork_callback ShouldApplicationReduceRenderingWork; - /** C type : DriverDebugRequest_callback* */ - public VR_IVRSystem_FnTable.DriverDebugRequest_callback DriverDebugRequest; - /** C type : PerformFirmwareUpdate_callback* */ - public VR_IVRSystem_FnTable.PerformFirmwareUpdate_callback PerformFirmwareUpdate; - /** C type : AcknowledgeQuit_Exiting_callback* */ - public VR_IVRSystem_FnTable.AcknowledgeQuit_Exiting_callback AcknowledgeQuit_Exiting; - /** C type : AcknowledgeQuit_UserPrompt_callback* */ - public VR_IVRSystem_FnTable.AcknowledgeQuit_UserPrompt_callback AcknowledgeQuit_UserPrompt; - /** native declaration : headers\openvr_capi.h:1752 */ - public interface GetRecommendedRenderTargetSize_callback extends Callback { - void apply(IntByReference pnWidth, IntByReference pnHeight); - }; - /** native declaration : headers\openvr_capi.h:1753 */ - public interface GetProjectionMatrix_callback extends Callback { - com.jme3.system.jopenvr.HmdMatrix44_t.ByValue apply(int eEye, float fNearZ, float fFarZ); - }; - /** native declaration : headers\openvr_capi.h:1754 */ - public interface GetProjectionRaw_callback extends Callback { - void apply(int eEye, FloatByReference pfLeft, FloatByReference pfRight, FloatByReference pfTop, FloatByReference pfBottom); - }; - /** native declaration : headers\openvr_capi.h:1755 */ - public interface ComputeDistortion_callback extends Callback { - byte apply(int eEye, float fU, float fV, DistortionCoordinates_t pDistortionCoordinates); - }; - /** native declaration : headers\openvr_capi.h:1756 */ - public interface GetEyeToHeadTransform_callback extends Callback { - HmdMatrix34_t.ByValue apply(int eEye); - }; - /** native declaration : headers\openvr_capi.h:1757 */ - public interface GetTimeSinceLastVsync_callback extends Callback { - byte apply(FloatByReference pfSecondsSinceLastVsync, LongByReference pulFrameCounter); - }; - /** native declaration : headers\openvr_capi.h:1758 */ - public interface GetD3D9AdapterIndex_callback extends Callback { - int apply(); - }; - /** native declaration : headers\openvr_capi.h:1759 */ - public interface GetDXGIOutputInfo_callback extends Callback { - void apply(IntByReference pnAdapterIndex); - }; - /** native declaration : headers\openvr_capi.h:1760 */ - public interface GetOutputDevice_callback extends Callback { - void apply(LongByReference pnDevice, int textureType, VkInstance_T pInstance); - }; - /** native declaration : headers\openvr_capi.h:1761 */ - public interface IsDisplayOnDesktop_callback extends Callback { - byte apply(); - }; - /** native declaration : headers\openvr_capi.h:1762 */ - public interface SetDisplayVisibility_callback extends Callback { - byte apply(byte bIsVisibleOnDesktop); - }; - /** native declaration : headers\openvr_capi.h:1763 */ - public interface GetDeviceToAbsoluteTrackingPose_callback extends Callback { - void apply(int eOrigin, float fPredictedSecondsToPhotonsFromNow, TrackedDevicePose_t pTrackedDevicePoseArray, int unTrackedDevicePoseArrayCount); - }; - /** native declaration : headers\openvr_capi.h:1764 */ - public interface ResetSeatedZeroPose_callback extends Callback { - void apply(); - }; - /** native declaration : headers\openvr_capi.h:1765 */ - public interface GetSeatedZeroPoseToStandingAbsoluteTrackingPose_callback extends Callback { - HmdMatrix34_t.ByValue apply(); - }; - /** native declaration : headers\openvr_capi.h:1766 */ - public interface GetRawZeroPoseToStandingAbsoluteTrackingPose_callback extends Callback { - HmdMatrix34_t.ByValue apply(); - }; - /** native declaration : headers\openvr_capi.h:1767 */ - public interface GetSortedTrackedDeviceIndicesOfClass_callback extends Callback { - int apply(int eTrackedDeviceClass, IntByReference punTrackedDeviceIndexArray, int unTrackedDeviceIndexArrayCount, int unRelativeToTrackedDeviceIndex); - }; - /** native declaration : headers\openvr_capi.h:1768 */ - public interface GetTrackedDeviceActivityLevel_callback extends Callback { - int apply(int unDeviceId); - }; - /** native declaration : headers\openvr_capi.h:1769 */ - public interface ApplyTransform_callback extends Callback { - void apply(TrackedDevicePose_t pOutputPose, TrackedDevicePose_t pTrackedDevicePose, HmdMatrix34_t pTransform); - }; - /** native declaration : headers\openvr_capi.h:1770 */ - public interface GetTrackedDeviceIndexForControllerRole_callback extends Callback { - int apply(int unDeviceType); - }; - /** native declaration : headers\openvr_capi.h:1771 */ - public interface GetControllerRoleForTrackedDeviceIndex_callback extends Callback { - int apply(int unDeviceIndex); - }; - /** native declaration : headers\openvr_capi.h:1772 */ - public interface GetTrackedDeviceClass_callback extends Callback { - int apply(int unDeviceIndex); - }; - /** native declaration : headers\openvr_capi.h:1773 */ - public interface IsTrackedDeviceConnected_callback extends Callback { - byte apply(int unDeviceIndex); - }; - /** native declaration : headers\openvr_capi.h:1774 */ - public interface GetBoolTrackedDeviceProperty_callback extends Callback { - byte apply(int unDeviceIndex, int prop, IntByReference pError); - }; - /** native declaration : headers\openvr_capi.h:1775 */ - public interface GetFloatTrackedDeviceProperty_callback extends Callback { - float apply(int unDeviceIndex, int prop, IntByReference pError); - }; - /** native declaration : headers\openvr_capi.h:1776 */ - public interface GetInt32TrackedDeviceProperty_callback extends Callback { - int apply(int unDeviceIndex, int prop, IntByReference pError); - }; - /** native declaration : headers\openvr_capi.h:1777 */ - public interface GetUint64TrackedDeviceProperty_callback extends Callback { - long apply(int unDeviceIndex, int prop, IntByReference pError); - }; - /** native declaration : headers\openvr_capi.h:1778 */ - public interface GetMatrix34TrackedDeviceProperty_callback extends Callback { - HmdMatrix34_t.ByValue apply(int unDeviceIndex, int prop, IntByReference pError); - }; - /** native declaration : headers\openvr_capi.h:1779 */ - public interface GetArrayTrackedDeviceProperty_callback extends Callback { - int apply(int unDeviceIndex, int prop, int propType, Pointer pBuffer, int unBufferSize, IntByReference pError); - }; - /** native declaration : headers\openvr_capi.h:1780 */ - public interface GetStringTrackedDeviceProperty_callback extends Callback { - int apply(int unDeviceIndex, int prop, Pointer pchValue, int unBufferSize, IntByReference pError); - }; - /** native declaration : headers\openvr_capi.h:1781 */ - public interface GetPropErrorNameFromEnum_callback extends Callback { - Pointer apply(int error); - }; - /** native declaration : headers\openvr_capi.h:1782 */ - public interface PollNextEvent_callback extends Callback { - byte apply(VREvent_t pEvent, int uncbVREvent); - }; - /** native declaration : headers\openvr_capi.h:1783 */ - public interface PollNextEventWithPose_callback extends Callback { - byte apply(int eOrigin, VREvent_t pEvent, int uncbVREvent, TrackedDevicePose_t pTrackedDevicePose); - }; - /** native declaration : headers\openvr_capi.h:1784 */ - public interface GetEventTypeNameFromEnum_callback extends Callback { - Pointer apply(int eType); - }; - /** native declaration : headers\openvr_capi.h:1785 */ - public interface GetHiddenAreaMesh_callback extends Callback { - com.jme3.system.jopenvr.HiddenAreaMesh_t.ByValue apply(int eEye, int type); - }; - /** native declaration : headers\openvr_capi.h:1786 */ - public interface GetControllerState_callback extends Callback { - byte apply(int unControllerDeviceIndex, VRControllerState_t pControllerState, int unControllerStateSize); - }; - /** native declaration : headers\openvr_capi.h:1787 */ - public interface GetControllerStateWithPose_callback extends Callback { - byte apply(int eOrigin, int unControllerDeviceIndex, VRControllerState_t pControllerState, int unControllerStateSize, TrackedDevicePose_t pTrackedDevicePose); - }; - /** native declaration : headers\openvr_capi.h:1788 */ - public interface TriggerHapticPulse_callback extends Callback { - void apply(int unControllerDeviceIndex, int unAxisId, short usDurationMicroSec); - }; - /** native declaration : headers\openvr_capi.h:1789 */ - public interface GetButtonIdNameFromEnum_callback extends Callback { - Pointer apply(int eButtonId); - }; - /** native declaration : headers\openvr_capi.h:1790 */ - public interface GetControllerAxisTypeNameFromEnum_callback extends Callback { - Pointer apply(int eAxisType); - }; - /** native declaration : headers\openvr_capi.h:1791 */ - public interface IsInputAvailable_callback extends Callback { - byte apply(); - }; - /** native declaration : headers\openvr_capi.h:1792 */ - public interface IsSteamVRDrawingControllers_callback extends Callback { - byte apply(); - }; - /** native declaration : headers\openvr_capi.h:1793 */ - public interface ShouldApplicationPause_callback extends Callback { - byte apply(); - }; - /** native declaration : headers\openvr_capi.h:1794 */ - public interface ShouldApplicationReduceRenderingWork_callback extends Callback { - byte apply(); - }; - /** native declaration : headers\openvr_capi.h:1795 */ - public interface DriverDebugRequest_callback extends Callback { - int apply(int unDeviceIndex, Pointer pchRequest, Pointer pchResponseBuffer, int unResponseBufferSize); - }; - /** native declaration : headers\openvr_capi.h:1796 */ - public interface PerformFirmwareUpdate_callback extends Callback { - int apply(int unDeviceIndex); - }; - /** native declaration : headers\openvr_capi.h:1797 */ - public interface AcknowledgeQuit_Exiting_callback extends Callback { - void apply(); - }; - /** native declaration : headers\openvr_capi.h:1798 */ - public interface AcknowledgeQuit_UserPrompt_callback extends Callback { - void apply(); - }; - public VR_IVRSystem_FnTable() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("GetRecommendedRenderTargetSize", "GetProjectionMatrix", "GetProjectionRaw", "ComputeDistortion", "GetEyeToHeadTransform", "GetTimeSinceLastVsync", "GetD3D9AdapterIndex", "GetDXGIOutputInfo", "GetOutputDevice", "IsDisplayOnDesktop", "SetDisplayVisibility", "GetDeviceToAbsoluteTrackingPose", "ResetSeatedZeroPose", "GetSeatedZeroPoseToStandingAbsoluteTrackingPose", "GetRawZeroPoseToStandingAbsoluteTrackingPose", "GetSortedTrackedDeviceIndicesOfClass", "GetTrackedDeviceActivityLevel", "ApplyTransform", "GetTrackedDeviceIndexForControllerRole", "GetControllerRoleForTrackedDeviceIndex", "GetTrackedDeviceClass", "IsTrackedDeviceConnected", "GetBoolTrackedDeviceProperty", "GetFloatTrackedDeviceProperty", "GetInt32TrackedDeviceProperty", "GetUint64TrackedDeviceProperty", "GetMatrix34TrackedDeviceProperty", "GetArrayTrackedDeviceProperty", "GetStringTrackedDeviceProperty", "GetPropErrorNameFromEnum", "PollNextEvent", "PollNextEventWithPose", "GetEventTypeNameFromEnum", "GetHiddenAreaMesh", "GetControllerState", "GetControllerStateWithPose", "TriggerHapticPulse", "GetButtonIdNameFromEnum", "GetControllerAxisTypeNameFromEnum", "IsInputAvailable", "IsSteamVRDrawingControllers", "ShouldApplicationPause", "ShouldApplicationReduceRenderingWork", "DriverDebugRequest", "PerformFirmwareUpdate", "AcknowledgeQuit_Exiting", "AcknowledgeQuit_UserPrompt"); - } - public VR_IVRSystem_FnTable(Pointer peer) { - super(peer); - } - public static class ByReference extends VR_IVRSystem_FnTable implements Structure.ByReference { - - }; - public static class ByValue extends VR_IVRSystem_FnTable implements Structure.ByValue { - - }; + * OpenVR Function Pointer Tables
+ * native declaration : headers\openvr_capi.h:1799
+ * This file was autogenerated by JNAerator,
+ * a tool written by Olivier Chafik that uses a few opensource projects..
+ * For help, please visit NativeLibs4Java , Rococoa, or JNA. + */ +public class VR_IVRSystem_FnTable extends Structure { + /** C type : GetRecommendedRenderTargetSize_callback* */ + public VR_IVRSystem_FnTable.GetRecommendedRenderTargetSize_callback GetRecommendedRenderTargetSize; + /** C type : GetProjectionMatrix_callback* */ + public VR_IVRSystem_FnTable.GetProjectionMatrix_callback GetProjectionMatrix; + /** C type : GetProjectionRaw_callback* */ + public VR_IVRSystem_FnTable.GetProjectionRaw_callback GetProjectionRaw; + /** C type : ComputeDistortion_callback* */ + public VR_IVRSystem_FnTable.ComputeDistortion_callback ComputeDistortion; + /** C type : GetEyeToHeadTransform_callback* */ + public VR_IVRSystem_FnTable.GetEyeToHeadTransform_callback GetEyeToHeadTransform; + /** C type : GetTimeSinceLastVsync_callback* */ + public VR_IVRSystem_FnTable.GetTimeSinceLastVsync_callback GetTimeSinceLastVsync; + /** C type : GetD3D9AdapterIndex_callback* */ + public VR_IVRSystem_FnTable.GetD3D9AdapterIndex_callback GetD3D9AdapterIndex; + /** C type : GetDXGIOutputInfo_callback* */ + public com.jme3.system.jopenvr.VR_IVRExtendedDisplay_FnTable.GetDXGIOutputInfo_callback GetDXGIOutputInfo; + /** C type : GetOutputDevice_callback* */ + public VR_IVRSystem_FnTable.GetOutputDevice_callback GetOutputDevice; + /** C type : IsDisplayOnDesktop_callback* */ + public VR_IVRSystem_FnTable.IsDisplayOnDesktop_callback IsDisplayOnDesktop; + /** C type : SetDisplayVisibility_callback* */ + public VR_IVRSystem_FnTable.SetDisplayVisibility_callback SetDisplayVisibility; + /** C type : GetDeviceToAbsoluteTrackingPose_callback* */ + public VR_IVRSystem_FnTable.GetDeviceToAbsoluteTrackingPose_callback GetDeviceToAbsoluteTrackingPose; + /** C type : ResetSeatedZeroPose_callback* */ + public VR_IVRSystem_FnTable.ResetSeatedZeroPose_callback ResetSeatedZeroPose; + /** C type : GetSeatedZeroPoseToStandingAbsoluteTrackingPose_callback* */ + public VR_IVRSystem_FnTable.GetSeatedZeroPoseToStandingAbsoluteTrackingPose_callback GetSeatedZeroPoseToStandingAbsoluteTrackingPose; + /** C type : GetRawZeroPoseToStandingAbsoluteTrackingPose_callback* */ + public VR_IVRSystem_FnTable.GetRawZeroPoseToStandingAbsoluteTrackingPose_callback GetRawZeroPoseToStandingAbsoluteTrackingPose; + /** C type : GetSortedTrackedDeviceIndicesOfClass_callback* */ + public VR_IVRSystem_FnTable.GetSortedTrackedDeviceIndicesOfClass_callback GetSortedTrackedDeviceIndicesOfClass; + /** C type : GetTrackedDeviceActivityLevel_callback* */ + public VR_IVRSystem_FnTable.GetTrackedDeviceActivityLevel_callback GetTrackedDeviceActivityLevel; + /** C type : ApplyTransform_callback* */ + public VR_IVRSystem_FnTable.ApplyTransform_callback ApplyTransform; + /** C type : GetTrackedDeviceIndexForControllerRole_callback* */ + public VR_IVRSystem_FnTable.GetTrackedDeviceIndexForControllerRole_callback GetTrackedDeviceIndexForControllerRole; + /** C type : GetControllerRoleForTrackedDeviceIndex_callback* */ + public VR_IVRSystem_FnTable.GetControllerRoleForTrackedDeviceIndex_callback GetControllerRoleForTrackedDeviceIndex; + /** C type : GetTrackedDeviceClass_callback* */ + public VR_IVRSystem_FnTable.GetTrackedDeviceClass_callback GetTrackedDeviceClass; + /** C type : IsTrackedDeviceConnected_callback* */ + public VR_IVRSystem_FnTable.IsTrackedDeviceConnected_callback IsTrackedDeviceConnected; + /** C type : GetBoolTrackedDeviceProperty_callback* */ + public VR_IVRSystem_FnTable.GetBoolTrackedDeviceProperty_callback GetBoolTrackedDeviceProperty; + /** C type : GetFloatTrackedDeviceProperty_callback* */ + public VR_IVRSystem_FnTable.GetFloatTrackedDeviceProperty_callback GetFloatTrackedDeviceProperty; + /** C type : GetInt32TrackedDeviceProperty_callback* */ + public VR_IVRSystem_FnTable.GetInt32TrackedDeviceProperty_callback GetInt32TrackedDeviceProperty; + /** C type : GetUint64TrackedDeviceProperty_callback* */ + public VR_IVRSystem_FnTable.GetUint64TrackedDeviceProperty_callback GetUint64TrackedDeviceProperty; + /** C type : GetMatrix34TrackedDeviceProperty_callback* */ + public VR_IVRSystem_FnTable.GetMatrix34TrackedDeviceProperty_callback GetMatrix34TrackedDeviceProperty; + /** C type : GetArrayTrackedDeviceProperty_callback* */ + public VR_IVRSystem_FnTable.GetArrayTrackedDeviceProperty_callback GetArrayTrackedDeviceProperty; + /** C type : GetStringTrackedDeviceProperty_callback* */ + public VR_IVRSystem_FnTable.GetStringTrackedDeviceProperty_callback GetStringTrackedDeviceProperty; + /** C type : GetPropErrorNameFromEnum_callback* */ + public VR_IVRSystem_FnTable.GetPropErrorNameFromEnum_callback GetPropErrorNameFromEnum; + /** C type : PollNextEvent_callback* */ + public VR_IVRSystem_FnTable.PollNextEvent_callback PollNextEvent; + /** C type : PollNextEventWithPose_callback* */ + public VR_IVRSystem_FnTable.PollNextEventWithPose_callback PollNextEventWithPose; + /** C type : GetEventTypeNameFromEnum_callback* */ + public VR_IVRSystem_FnTable.GetEventTypeNameFromEnum_callback GetEventTypeNameFromEnum; + /** C type : GetHiddenAreaMesh_callback* */ + public VR_IVRSystem_FnTable.GetHiddenAreaMesh_callback GetHiddenAreaMesh; + /** C type : GetControllerState_callback* */ + public VR_IVRSystem_FnTable.GetControllerState_callback GetControllerState; + /** C type : GetControllerStateWithPose_callback* */ + public VR_IVRSystem_FnTable.GetControllerStateWithPose_callback GetControllerStateWithPose; + /** C type : TriggerHapticPulse_callback* */ + public VR_IVRSystem_FnTable.TriggerHapticPulse_callback TriggerHapticPulse; + /** C type : GetButtonIdNameFromEnum_callback* */ + public VR_IVRSystem_FnTable.GetButtonIdNameFromEnum_callback GetButtonIdNameFromEnum; + /** C type : GetControllerAxisTypeNameFromEnum_callback* */ + public VR_IVRSystem_FnTable.GetControllerAxisTypeNameFromEnum_callback GetControllerAxisTypeNameFromEnum; + /** C type : IsInputAvailable_callback* */ + public VR_IVRSystem_FnTable.IsInputAvailable_callback IsInputAvailable; + /** C type : IsSteamVRDrawingControllers_callback* */ + public VR_IVRSystem_FnTable.IsSteamVRDrawingControllers_callback IsSteamVRDrawingControllers; + /** C type : ShouldApplicationPause_callback* */ + public VR_IVRSystem_FnTable.ShouldApplicationPause_callback ShouldApplicationPause; + /** C type : ShouldApplicationReduceRenderingWork_callback* */ + public VR_IVRSystem_FnTable.ShouldApplicationReduceRenderingWork_callback ShouldApplicationReduceRenderingWork; + /** C type : DriverDebugRequest_callback* */ + public VR_IVRSystem_FnTable.DriverDebugRequest_callback DriverDebugRequest; + /** C type : PerformFirmwareUpdate_callback* */ + public VR_IVRSystem_FnTable.PerformFirmwareUpdate_callback PerformFirmwareUpdate; + /** C type : AcknowledgeQuit_Exiting_callback* */ + public VR_IVRSystem_FnTable.AcknowledgeQuit_Exiting_callback AcknowledgeQuit_Exiting; + /** C type : AcknowledgeQuit_UserPrompt_callback* */ + public VR_IVRSystem_FnTable.AcknowledgeQuit_UserPrompt_callback AcknowledgeQuit_UserPrompt; + /** native declaration : headers\openvr_capi.h:1752 */ + public interface GetRecommendedRenderTargetSize_callback extends Callback { + void apply(IntByReference pnWidth, IntByReference pnHeight); + }; + /** native declaration : headers\openvr_capi.h:1753 */ + public interface GetProjectionMatrix_callback extends Callback { + com.jme3.system.jopenvr.HmdMatrix44_t.ByValue apply(int eEye, float fNearZ, float fFarZ); + }; + /** native declaration : headers\openvr_capi.h:1754 */ + public interface GetProjectionRaw_callback extends Callback { + void apply(int eEye, FloatByReference pfLeft, FloatByReference pfRight, FloatByReference pfTop, FloatByReference pfBottom); + }; + /** native declaration : headers\openvr_capi.h:1755 */ + public interface ComputeDistortion_callback extends Callback { + byte apply(int eEye, float fU, float fV, DistortionCoordinates_t pDistortionCoordinates); + }; + /** native declaration : headers\openvr_capi.h:1756 */ + public interface GetEyeToHeadTransform_callback extends Callback { + HmdMatrix34_t.ByValue apply(int eEye); + }; + /** native declaration : headers\openvr_capi.h:1757 */ + public interface GetTimeSinceLastVsync_callback extends Callback { + byte apply(FloatByReference pfSecondsSinceLastVsync, LongByReference pulFrameCounter); + }; + /** native declaration : headers\openvr_capi.h:1758 */ + public interface GetD3D9AdapterIndex_callback extends Callback { + int apply(); + }; + /** native declaration : headers\openvr_capi.h:1759 */ + public interface GetDXGIOutputInfo_callback extends Callback { + void apply(IntByReference pnAdapterIndex); + }; + /** native declaration : headers\openvr_capi.h:1760 */ + public interface GetOutputDevice_callback extends Callback { + void apply(LongByReference pnDevice, int textureType, VkInstance_T pInstance); + }; + /** native declaration : headers\openvr_capi.h:1761 */ + public interface IsDisplayOnDesktop_callback extends Callback { + byte apply(); + }; + /** native declaration : headers\openvr_capi.h:1762 */ + public interface SetDisplayVisibility_callback extends Callback { + byte apply(byte bIsVisibleOnDesktop); + }; + /** native declaration : headers\openvr_capi.h:1763 */ + public interface GetDeviceToAbsoluteTrackingPose_callback extends Callback { + void apply(int eOrigin, float fPredictedSecondsToPhotonsFromNow, TrackedDevicePose_t pTrackedDevicePoseArray, int unTrackedDevicePoseArrayCount); + }; + /** native declaration : headers\openvr_capi.h:1764 */ + public interface ResetSeatedZeroPose_callback extends Callback { + void apply(); + }; + /** native declaration : headers\openvr_capi.h:1765 */ + public interface GetSeatedZeroPoseToStandingAbsoluteTrackingPose_callback extends Callback { + HmdMatrix34_t.ByValue apply(); + }; + /** native declaration : headers\openvr_capi.h:1766 */ + public interface GetRawZeroPoseToStandingAbsoluteTrackingPose_callback extends Callback { + HmdMatrix34_t.ByValue apply(); + }; + /** native declaration : headers\openvr_capi.h:1767 */ + public interface GetSortedTrackedDeviceIndicesOfClass_callback extends Callback { + int apply(int eTrackedDeviceClass, IntByReference punTrackedDeviceIndexArray, int unTrackedDeviceIndexArrayCount, int unRelativeToTrackedDeviceIndex); + }; + /** native declaration : headers\openvr_capi.h:1768 */ + public interface GetTrackedDeviceActivityLevel_callback extends Callback { + int apply(int unDeviceId); + }; + /** native declaration : headers\openvr_capi.h:1769 */ + public interface ApplyTransform_callback extends Callback { + void apply(TrackedDevicePose_t pOutputPose, TrackedDevicePose_t pTrackedDevicePose, HmdMatrix34_t pTransform); + }; + /** native declaration : headers\openvr_capi.h:1770 */ + public interface GetTrackedDeviceIndexForControllerRole_callback extends Callback { + int apply(int unDeviceType); + }; + /** native declaration : headers\openvr_capi.h:1771 */ + public interface GetControllerRoleForTrackedDeviceIndex_callback extends Callback { + int apply(int unDeviceIndex); + }; + /** native declaration : headers\openvr_capi.h:1772 */ + public interface GetTrackedDeviceClass_callback extends Callback { + int apply(int unDeviceIndex); + }; + /** native declaration : headers\openvr_capi.h:1773 */ + public interface IsTrackedDeviceConnected_callback extends Callback { + byte apply(int unDeviceIndex); + }; + /** native declaration : headers\openvr_capi.h:1774 */ + public interface GetBoolTrackedDeviceProperty_callback extends Callback { + byte apply(int unDeviceIndex, int prop, IntByReference pError); + }; + /** native declaration : headers\openvr_capi.h:1775 */ + public interface GetFloatTrackedDeviceProperty_callback extends Callback { + float apply(int unDeviceIndex, int prop, IntByReference pError); + }; + /** native declaration : headers\openvr_capi.h:1776 */ + public interface GetInt32TrackedDeviceProperty_callback extends Callback { + int apply(int unDeviceIndex, int prop, IntByReference pError); + }; + /** native declaration : headers\openvr_capi.h:1777 */ + public interface GetUint64TrackedDeviceProperty_callback extends Callback { + long apply(int unDeviceIndex, int prop, IntByReference pError); + }; + /** native declaration : headers\openvr_capi.h:1778 */ + public interface GetMatrix34TrackedDeviceProperty_callback extends Callback { + HmdMatrix34_t.ByValue apply(int unDeviceIndex, int prop, IntByReference pError); + }; + /** native declaration : headers\openvr_capi.h:1779 */ + public interface GetArrayTrackedDeviceProperty_callback extends Callback { + int apply(int unDeviceIndex, int prop, int propType, Pointer pBuffer, int unBufferSize, IntByReference pError); + }; + /** native declaration : headers\openvr_capi.h:1780 */ + public interface GetStringTrackedDeviceProperty_callback extends Callback { + int apply(int unDeviceIndex, int prop, Pointer pchValue, int unBufferSize, IntByReference pError); + }; + /** native declaration : headers\openvr_capi.h:1781 */ + public interface GetPropErrorNameFromEnum_callback extends Callback { + Pointer apply(int error); + }; + /** native declaration : headers\openvr_capi.h:1782 */ + public interface PollNextEvent_callback extends Callback { + byte apply(VREvent_t pEvent, int uncbVREvent); + }; + /** native declaration : headers\openvr_capi.h:1783 */ + public interface PollNextEventWithPose_callback extends Callback { + byte apply(int eOrigin, VREvent_t pEvent, int uncbVREvent, TrackedDevicePose_t pTrackedDevicePose); + }; + /** native declaration : headers\openvr_capi.h:1784 */ + public interface GetEventTypeNameFromEnum_callback extends Callback { + Pointer apply(int eType); + }; + /** native declaration : headers\openvr_capi.h:1785 */ + public interface GetHiddenAreaMesh_callback extends Callback { + com.jme3.system.jopenvr.HiddenAreaMesh_t.ByValue apply(int eEye, int type); + }; + /** native declaration : headers\openvr_capi.h:1786 */ + public interface GetControllerState_callback extends Callback { + byte apply(int unControllerDeviceIndex, VRControllerState_t pControllerState, int unControllerStateSize); + }; + /** native declaration : headers\openvr_capi.h:1787 */ + public interface GetControllerStateWithPose_callback extends Callback { + byte apply(int eOrigin, int unControllerDeviceIndex, VRControllerState_t pControllerState, int unControllerStateSize, TrackedDevicePose_t pTrackedDevicePose); + }; + /** native declaration : headers\openvr_capi.h:1788 */ + public interface TriggerHapticPulse_callback extends Callback { + void apply(int unControllerDeviceIndex, int unAxisId, short usDurationMicroSec); + }; + /** native declaration : headers\openvr_capi.h:1789 */ + public interface GetButtonIdNameFromEnum_callback extends Callback { + Pointer apply(int eButtonId); + }; + /** native declaration : headers\openvr_capi.h:1790 */ + public interface GetControllerAxisTypeNameFromEnum_callback extends Callback { + Pointer apply(int eAxisType); + }; + /** native declaration : headers\openvr_capi.h:1791 */ + public interface IsInputAvailable_callback extends Callback { + byte apply(); + }; + /** native declaration : headers\openvr_capi.h:1792 */ + public interface IsSteamVRDrawingControllers_callback extends Callback { + byte apply(); + }; + /** native declaration : headers\openvr_capi.h:1793 */ + public interface ShouldApplicationPause_callback extends Callback { + byte apply(); + }; + /** native declaration : headers\openvr_capi.h:1794 */ + public interface ShouldApplicationReduceRenderingWork_callback extends Callback { + byte apply(); + }; + /** native declaration : headers\openvr_capi.h:1795 */ + public interface DriverDebugRequest_callback extends Callback { + int apply(int unDeviceIndex, Pointer pchRequest, Pointer pchResponseBuffer, int unResponseBufferSize); + }; + /** native declaration : headers\openvr_capi.h:1796 */ + public interface PerformFirmwareUpdate_callback extends Callback { + int apply(int unDeviceIndex); + }; + /** native declaration : headers\openvr_capi.h:1797 */ + public interface AcknowledgeQuit_Exiting_callback extends Callback { + void apply(); + }; + /** native declaration : headers\openvr_capi.h:1798 */ + public interface AcknowledgeQuit_UserPrompt_callback extends Callback { + void apply(); + }; + public VR_IVRSystem_FnTable() { + super(); + } + @Override + protected List getFieldOrder() { + return Arrays.asList("GetRecommendedRenderTargetSize", "GetProjectionMatrix", "GetProjectionRaw", "ComputeDistortion", "GetEyeToHeadTransform", "GetTimeSinceLastVsync", "GetD3D9AdapterIndex", "GetDXGIOutputInfo", "GetOutputDevice", "IsDisplayOnDesktop", "SetDisplayVisibility", "GetDeviceToAbsoluteTrackingPose", "ResetSeatedZeroPose", "GetSeatedZeroPoseToStandingAbsoluteTrackingPose", "GetRawZeroPoseToStandingAbsoluteTrackingPose", "GetSortedTrackedDeviceIndicesOfClass", "GetTrackedDeviceActivityLevel", "ApplyTransform", "GetTrackedDeviceIndexForControllerRole", "GetControllerRoleForTrackedDeviceIndex", "GetTrackedDeviceClass", "IsTrackedDeviceConnected", "GetBoolTrackedDeviceProperty", "GetFloatTrackedDeviceProperty", "GetInt32TrackedDeviceProperty", "GetUint64TrackedDeviceProperty", "GetMatrix34TrackedDeviceProperty", "GetArrayTrackedDeviceProperty", "GetStringTrackedDeviceProperty", "GetPropErrorNameFromEnum", "PollNextEvent", "PollNextEventWithPose", "GetEventTypeNameFromEnum", "GetHiddenAreaMesh", "GetControllerState", "GetControllerStateWithPose", "TriggerHapticPulse", "GetButtonIdNameFromEnum", "GetControllerAxisTypeNameFromEnum", "IsInputAvailable", "IsSteamVRDrawingControllers", "ShouldApplicationPause", "ShouldApplicationReduceRenderingWork", "DriverDebugRequest", "PerformFirmwareUpdate", "AcknowledgeQuit_Exiting", "AcknowledgeQuit_UserPrompt"); + } + public VR_IVRSystem_FnTable(Pointer peer) { + super(peer); + } + public static class ByReference extends VR_IVRSystem_FnTable implements Structure.ByReference { + + }; + public static class ByValue extends VR_IVRSystem_FnTable implements Structure.ByValue { + + }; } diff --git a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRTrackedCamera_FnTable.java b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRTrackedCamera_FnTable.java index 1fc5d469a6..42ba86816b 100644 --- a/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRTrackedCamera_FnTable.java +++ b/jme3-vr/src/main/java/com/jme3/system/jopenvr/VR_IVRTrackedCamera_FnTable.java @@ -8,97 +8,98 @@ import java.util.Arrays; import java.util.List; /** - * native declaration : headers\openvr_capi.h:1833
- * This file was autogenerated by JNAerator,
- * a tool written by Olivier Chafik that uses a few opensource projects..
- * For help, please visit NativeLibs4Java , Rococoa, or JNA. - */ -public class VR_IVRTrackedCamera_FnTable extends Structure { - /** C type : GetCameraErrorNameFromEnum_callback* */ - public VR_IVRTrackedCamera_FnTable.GetCameraErrorNameFromEnum_callback GetCameraErrorNameFromEnum; - /** C type : HasCamera_callback* */ - public VR_IVRTrackedCamera_FnTable.HasCamera_callback HasCamera; - /** C type : GetCameraFrameSize_callback* */ - public VR_IVRTrackedCamera_FnTable.GetCameraFrameSize_callback GetCameraFrameSize; - /** C type : GetCameraIntrinsics_callback* */ - public VR_IVRTrackedCamera_FnTable.GetCameraIntrinsics_callback GetCameraIntrinsics; - /** C type : GetCameraProjection_callback* */ - public VR_IVRTrackedCamera_FnTable.GetCameraProjection_callback GetCameraProjection; - /** C type : AcquireVideoStreamingService_callback* */ - public VR_IVRTrackedCamera_FnTable.AcquireVideoStreamingService_callback AcquireVideoStreamingService; - /** C type : ReleaseVideoStreamingService_callback* */ - public VR_IVRTrackedCamera_FnTable.ReleaseVideoStreamingService_callback ReleaseVideoStreamingService; - /** C type : GetVideoStreamFrameBuffer_callback* */ - public VR_IVRTrackedCamera_FnTable.GetVideoStreamFrameBuffer_callback GetVideoStreamFrameBuffer; - /** C type : GetVideoStreamTextureSize_callback* */ - public VR_IVRTrackedCamera_FnTable.GetVideoStreamTextureSize_callback GetVideoStreamTextureSize; - /** C type : GetVideoStreamTextureD3D11_callback* */ - public VR_IVRTrackedCamera_FnTable.GetVideoStreamTextureD3D11_callback GetVideoStreamTextureD3D11; - /** C type : GetVideoStreamTextureGL_callback* */ - public VR_IVRTrackedCamera_FnTable.GetVideoStreamTextureGL_callback GetVideoStreamTextureGL; - /** C type : ReleaseVideoStreamTextureGL_callback* */ - public VR_IVRTrackedCamera_FnTable.ReleaseVideoStreamTextureGL_callback ReleaseVideoStreamTextureGL; - /** native declaration : headers\openvr_capi.h:1821 */ - public interface GetCameraErrorNameFromEnum_callback extends Callback { - Pointer apply(int eCameraError); - }; - /** native declaration : headers\openvr_capi.h:1822 */ - public interface HasCamera_callback extends Callback { - int apply(int nDeviceIndex, Pointer pHasCamera); - }; - /** native declaration : headers\openvr_capi.h:1823 */ - public interface GetCameraFrameSize_callback extends Callback { - int apply(int nDeviceIndex, int eFrameType, IntByReference pnWidth, IntByReference pnHeight, IntByReference pnFrameBufferSize); - }; - /** native declaration : headers\openvr_capi.h:1824 */ - public interface GetCameraIntrinsics_callback extends Callback { - int apply(int nDeviceIndex, int eFrameType, HmdVector2_t pFocalLength, HmdVector2_t pCenter); - }; - /** native declaration : headers\openvr_capi.h:1825 */ - public interface GetCameraProjection_callback extends Callback { - int apply(int nDeviceIndex, int eFrameType, float flZNear, float flZFar, HmdMatrix44_t pProjection); - }; - /** native declaration : headers\openvr_capi.h:1826 */ - public interface AcquireVideoStreamingService_callback extends Callback { - int apply(int nDeviceIndex, LongByReference pHandle); - }; - /** native declaration : headers\openvr_capi.h:1827 */ - public interface ReleaseVideoStreamingService_callback extends Callback { - int apply(long hTrackedCamera); - }; - /** native declaration : headers\openvr_capi.h:1828 */ - public interface GetVideoStreamFrameBuffer_callback extends Callback { - int apply(long hTrackedCamera, int eFrameType, Pointer pFrameBuffer, int nFrameBufferSize, CameraVideoStreamFrameHeader_t pFrameHeader, int nFrameHeaderSize); - }; - /** native declaration : headers\openvr_capi.h:1829 */ - public interface GetVideoStreamTextureSize_callback extends Callback { - int apply(int nDeviceIndex, int eFrameType, VRTextureBounds_t pTextureBounds, IntByReference pnWidth, IntByReference pnHeight); - }; - /** native declaration : headers\openvr_capi.h:1830 */ - public interface GetVideoStreamTextureD3D11_callback extends Callback { - int apply(long hTrackedCamera, int eFrameType, Pointer pD3D11DeviceOrResource, PointerByReference ppD3D11ShaderResourceView, CameraVideoStreamFrameHeader_t pFrameHeader, int nFrameHeaderSize); - }; - /** native declaration : headers\openvr_capi.h:1831 */ - public interface GetVideoStreamTextureGL_callback extends Callback { - int apply(long hTrackedCamera, int eFrameType, IntByReference pglTextureId, CameraVideoStreamFrameHeader_t pFrameHeader, int nFrameHeaderSize); - }; - /** native declaration : headers\openvr_capi.h:1832 */ - public interface ReleaseVideoStreamTextureGL_callback extends Callback { - int apply(long hTrackedCamera, int glTextureId); - }; - public VR_IVRTrackedCamera_FnTable() { - super(); - } - protected List getFieldOrder() { - return Arrays.asList("GetCameraErrorNameFromEnum", "HasCamera", "GetCameraFrameSize", "GetCameraIntrinsics", "GetCameraProjection", "AcquireVideoStreamingService", "ReleaseVideoStreamingService", "GetVideoStreamFrameBuffer", "GetVideoStreamTextureSize", "GetVideoStreamTextureD3D11", "GetVideoStreamTextureGL", "ReleaseVideoStreamTextureGL"); - } - public VR_IVRTrackedCamera_FnTable(Pointer peer) { - super(peer); - } - public static class ByReference extends VR_IVRTrackedCamera_FnTable implements Structure.ByReference { - - }; - public static class ByValue extends VR_IVRTrackedCamera_FnTable implements Structure.ByValue { - - }; + * native declaration : headers\openvr_capi.h:1833
+ * This file was autogenerated by JNAerator,
+ * a tool written by Olivier Chafik that uses a few opensource projects..
+ * For help, please visit NativeLibs4Java , Rococoa, or JNA. + */ +public class VR_IVRTrackedCamera_FnTable extends Structure { + /** C type : GetCameraErrorNameFromEnum_callback* */ + public VR_IVRTrackedCamera_FnTable.GetCameraErrorNameFromEnum_callback GetCameraErrorNameFromEnum; + /** C type : HasCamera_callback* */ + public VR_IVRTrackedCamera_FnTable.HasCamera_callback HasCamera; + /** C type : GetCameraFrameSize_callback* */ + public VR_IVRTrackedCamera_FnTable.GetCameraFrameSize_callback GetCameraFrameSize; + /** C type : GetCameraIntrinsics_callback* */ + public VR_IVRTrackedCamera_FnTable.GetCameraIntrinsics_callback GetCameraIntrinsics; + /** C type : GetCameraProjection_callback* */ + public VR_IVRTrackedCamera_FnTable.GetCameraProjection_callback GetCameraProjection; + /** C type : AcquireVideoStreamingService_callback* */ + public VR_IVRTrackedCamera_FnTable.AcquireVideoStreamingService_callback AcquireVideoStreamingService; + /** C type : ReleaseVideoStreamingService_callback* */ + public VR_IVRTrackedCamera_FnTable.ReleaseVideoStreamingService_callback ReleaseVideoStreamingService; + /** C type : GetVideoStreamFrameBuffer_callback* */ + public VR_IVRTrackedCamera_FnTable.GetVideoStreamFrameBuffer_callback GetVideoStreamFrameBuffer; + /** C type : GetVideoStreamTextureSize_callback* */ + public VR_IVRTrackedCamera_FnTable.GetVideoStreamTextureSize_callback GetVideoStreamTextureSize; + /** C type : GetVideoStreamTextureD3D11_callback* */ + public VR_IVRTrackedCamera_FnTable.GetVideoStreamTextureD3D11_callback GetVideoStreamTextureD3D11; + /** C type : GetVideoStreamTextureGL_callback* */ + public VR_IVRTrackedCamera_FnTable.GetVideoStreamTextureGL_callback GetVideoStreamTextureGL; + /** C type : ReleaseVideoStreamTextureGL_callback* */ + public VR_IVRTrackedCamera_FnTable.ReleaseVideoStreamTextureGL_callback ReleaseVideoStreamTextureGL; + /** native declaration : headers\openvr_capi.h:1821 */ + public interface GetCameraErrorNameFromEnum_callback extends Callback { + Pointer apply(int eCameraError); + }; + /** native declaration : headers\openvr_capi.h:1822 */ + public interface HasCamera_callback extends Callback { + int apply(int nDeviceIndex, Pointer pHasCamera); + }; + /** native declaration : headers\openvr_capi.h:1823 */ + public interface GetCameraFrameSize_callback extends Callback { + int apply(int nDeviceIndex, int eFrameType, IntByReference pnWidth, IntByReference pnHeight, IntByReference pnFrameBufferSize); + }; + /** native declaration : headers\openvr_capi.h:1824 */ + public interface GetCameraIntrinsics_callback extends Callback { + int apply(int nDeviceIndex, int eFrameType, HmdVector2_t pFocalLength, HmdVector2_t pCenter); + }; + /** native declaration : headers\openvr_capi.h:1825 */ + public interface GetCameraProjection_callback extends Callback { + int apply(int nDeviceIndex, int eFrameType, float flZNear, float flZFar, HmdMatrix44_t pProjection); + }; + /** native declaration : headers\openvr_capi.h:1826 */ + public interface AcquireVideoStreamingService_callback extends Callback { + int apply(int nDeviceIndex, LongByReference pHandle); + }; + /** native declaration : headers\openvr_capi.h:1827 */ + public interface ReleaseVideoStreamingService_callback extends Callback { + int apply(long hTrackedCamera); + }; + /** native declaration : headers\openvr_capi.h:1828 */ + public interface GetVideoStreamFrameBuffer_callback extends Callback { + int apply(long hTrackedCamera, int eFrameType, Pointer pFrameBuffer, int nFrameBufferSize, CameraVideoStreamFrameHeader_t pFrameHeader, int nFrameHeaderSize); + }; + /** native declaration : headers\openvr_capi.h:1829 */ + public interface GetVideoStreamTextureSize_callback extends Callback { + int apply(int nDeviceIndex, int eFrameType, VRTextureBounds_t pTextureBounds, IntByReference pnWidth, IntByReference pnHeight); + }; + /** native declaration : headers\openvr_capi.h:1830 */ + public interface GetVideoStreamTextureD3D11_callback extends Callback { + int apply(long hTrackedCamera, int eFrameType, Pointer pD3D11DeviceOrResource, PointerByReference ppD3D11ShaderResourceView, CameraVideoStreamFrameHeader_t pFrameHeader, int nFrameHeaderSize); + }; + /** native declaration : headers\openvr_capi.h:1831 */ + public interface GetVideoStreamTextureGL_callback extends Callback { + int apply(long hTrackedCamera, int eFrameType, IntByReference pglTextureId, CameraVideoStreamFrameHeader_t pFrameHeader, int nFrameHeaderSize); + }; + /** native declaration : headers\openvr_capi.h:1832 */ + public interface ReleaseVideoStreamTextureGL_callback extends Callback { + int apply(long hTrackedCamera, int glTextureId); + }; + public VR_IVRTrackedCamera_FnTable() { + super(); + } + @Override + protected List getFieldOrder() { + return Arrays.asList("GetCameraErrorNameFromEnum", "HasCamera", "GetCameraFrameSize", "GetCameraIntrinsics", "GetCameraProjection", "AcquireVideoStreamingService", "ReleaseVideoStreamingService", "GetVideoStreamFrameBuffer", "GetVideoStreamTextureSize", "GetVideoStreamTextureD3D11", "GetVideoStreamTextureGL", "ReleaseVideoStreamTextureGL"); + } + public VR_IVRTrackedCamera_FnTable(Pointer peer) { + super(peer); + } + public static class ByReference extends VR_IVRTrackedCamera_FnTable implements Structure.ByReference { + + }; + public static class ByValue extends VR_IVRTrackedCamera_FnTable implements Structure.ByValue { + + }; } diff --git a/jme3-vr/src/main/java/com/jme3/system/lwjgl/LwjglContextVR.java b/jme3-vr/src/main/java/com/jme3/system/lwjgl/LwjglContextVR.java index 1c461e6f36..d5a585d468 100644 --- a/jme3-vr/src/main/java/com/jme3/system/lwjgl/LwjglContextVR.java +++ b/jme3-vr/src/main/java/com/jme3/system/lwjgl/LwjglContextVR.java @@ -1,7 +1,7 @@ package com.jme3.system.lwjgl; /* - * Copyright (c) 2009-2012 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -79,6 +79,7 @@ public abstract class LwjglContextVR implements JmeContext { protected Timer timer; protected SystemListener listener; + @Override public void setSystemListener(SystemListener listener) { this.listener = listener; } diff --git a/jme3-vr/src/main/java/com/jme3/system/lwjgl/LwjglWindowVR.java b/jme3-vr/src/main/java/com/jme3/system/lwjgl/LwjglWindowVR.java index 4bcad18766..41c416530e 100644 --- a/jme3-vr/src/main/java/com/jme3/system/lwjgl/LwjglWindowVR.java +++ b/jme3-vr/src/main/java/com/jme3/system/lwjgl/LwjglWindowVR.java @@ -1,7 +1,7 @@ package com.jme3.system.lwjgl; /* - * Copyright (c) 2009-2018 jMonkeyEngine + * Copyright (c) 2009-2020 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -96,6 +96,7 @@ public LwjglWindowVR(final JmeContext.Type type) { /** * @return Type.Display or Type.Canvas */ + @Override public JmeContext.Type getType() { return type; } @@ -105,6 +106,7 @@ public JmeContext.Type getType() { * * @param title the title to set */ + @Override public void setTitle(final String title) { if (created.get() && window != NULL) { glfwSetWindowTitle(window, title); @@ -114,6 +116,7 @@ public void setTitle(final String title) { /** * Restart if it's a windowed or full-screen display. */ + @Override public void restart() { if (created.get()) { needRestart.set(true); @@ -476,6 +479,7 @@ public void run() { deinitInThread(); } + @Override public JoyInput getJoyInput() { if (joyInput == null) { joyInput = new GlfwJoystickInput(); @@ -483,6 +487,7 @@ public JoyInput getJoyInput() { return joyInput; } + @Override public MouseInput getMouseInput() { if (mouseInput == null) { mouseInput = new GlfwMouseInputVR(this); @@ -490,6 +495,7 @@ public MouseInput getMouseInput() { return mouseInput; } + @Override public KeyInput getKeyInput() { if (keyInput == null) { keyInput = new GlfwKeyInputVR(this); @@ -498,14 +504,17 @@ public KeyInput getKeyInput() { return keyInput; } + @Override public TouchInput getTouchInput() { return null; } + @Override public void setAutoFlushFrames(boolean enabled) { this.autoFlush = enabled; } + @Override public void destroy(boolean waitFor) { needClose.set(true); if (mainThread == Thread.currentThread()) { diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_AccelerationReport.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_AccelerationReport.java index 61592a5b3e..c6ba614d1d 100644 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_AccelerationReport.java +++ b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_AccelerationReport.java @@ -15,6 +15,7 @@ public class OSVR_AccelerationReport extends Structure { public OSVR_AccelerationReport() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("sensor", "state"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_AccelerationState.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_AccelerationState.java index ccf4837ced..379a7972b4 100644 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_AccelerationState.java +++ b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_AccelerationState.java @@ -20,6 +20,7 @@ public class OSVR_AccelerationState extends Structure { public OSVR_AccelerationState() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("linearAcceleration", "linearAccelerationValid", "angularAcceleration", "angularAccelerationValid"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_AnalogReport.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_AnalogReport.java index 0f84cdfeac..8b5aca7d1c 100644 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_AnalogReport.java +++ b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_AnalogReport.java @@ -15,6 +15,7 @@ public class OSVR_AnalogReport extends Structure { public OSVR_AnalogReport() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("sensor", "state"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_AngularAccelerationReport.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_AngularAccelerationReport.java index 1afbe795b9..c7a3821dd7 100644 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_AngularAccelerationReport.java +++ b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_AngularAccelerationReport.java @@ -15,6 +15,7 @@ public class OSVR_AngularAccelerationReport extends Structure { public OSVR_AngularAccelerationReport() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("sensor", "state"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_AngularVelocityReport.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_AngularVelocityReport.java index 5926ec7456..bb526b7b1c 100644 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_AngularVelocityReport.java +++ b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_AngularVelocityReport.java @@ -15,6 +15,7 @@ public class OSVR_AngularVelocityReport extends Structure { public OSVR_AngularVelocityReport() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("sensor", "state"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_ButtonReport.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_ButtonReport.java index ad3ab53be6..4988433679 100644 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_ButtonReport.java +++ b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_ButtonReport.java @@ -15,6 +15,7 @@ public class OSVR_ButtonReport extends Structure { public OSVR_ButtonReport() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("sensor", "state"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_DirectionReport.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_DirectionReport.java index 78ca84a396..70af9a36ba 100644 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_DirectionReport.java +++ b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_DirectionReport.java @@ -16,6 +16,7 @@ public class OSVR_DirectionReport extends Structure { public OSVR_DirectionReport() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("sensor", "direction"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_EyeTracker2DReport.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_EyeTracker2DReport.java index fab1548e2b..f72a176f70 100644 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_EyeTracker2DReport.java +++ b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_EyeTracker2DReport.java @@ -16,6 +16,7 @@ public class OSVR_EyeTracker2DReport extends Structure { public OSVR_EyeTracker2DReport() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("sensor", "state"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_EyeTracker3DReport.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_EyeTracker3DReport.java index a42192be8b..93af317c37 100644 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_EyeTracker3DReport.java +++ b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_EyeTracker3DReport.java @@ -16,6 +16,7 @@ public class OSVR_EyeTracker3DReport extends Structure { public OSVR_EyeTracker3DReport() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("sensor", "state"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_EyeTracker3DState.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_EyeTracker3DState.java index 07eb1d8806..29da57b206 100644 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_EyeTracker3DState.java +++ b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_EyeTracker3DState.java @@ -20,6 +20,7 @@ public class OSVR_EyeTracker3DState extends Structure { public OSVR_EyeTracker3DState() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("directionValid", "direction", "basePointValid", "basePoint"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_EyeTrackerBlinkReport.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_EyeTrackerBlinkReport.java index 4d051bbd23..0ad5f64361 100644 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_EyeTrackerBlinkReport.java +++ b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_EyeTrackerBlinkReport.java @@ -16,6 +16,7 @@ public class OSVR_EyeTrackerBlinkReport extends Structure { public OSVR_EyeTrackerBlinkReport() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("sensor", "state"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_IncrementalQuaternion.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_IncrementalQuaternion.java index 66f04ba4e4..07cb64c949 100644 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_IncrementalQuaternion.java +++ b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_IncrementalQuaternion.java @@ -15,6 +15,7 @@ public class OSVR_IncrementalQuaternion extends Structure { public OSVR_IncrementalQuaternion() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("incrementalRotation", "dt"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_LinearAccelerationReport.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_LinearAccelerationReport.java index e93333f59d..4baffbd65d 100644 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_LinearAccelerationReport.java +++ b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_LinearAccelerationReport.java @@ -15,6 +15,7 @@ public class OSVR_LinearAccelerationReport extends Structure { public OSVR_LinearAccelerationReport() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("sensor", "state"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_LinearVelocityReport.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_LinearVelocityReport.java index daca276bc4..c40b3e74ae 100644 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_LinearVelocityReport.java +++ b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_LinearVelocityReport.java @@ -15,6 +15,7 @@ public class OSVR_LinearVelocityReport extends Structure { public OSVR_LinearVelocityReport() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("sensor", "state"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_Location2DReport.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_Location2DReport.java index 75e9ea1e36..8c05d755a8 100644 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_Location2DReport.java +++ b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_Location2DReport.java @@ -16,6 +16,7 @@ public class OSVR_Location2DReport extends Structure { public OSVR_Location2DReport() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("sensor", "location"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_NaviPositionReport.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_NaviPositionReport.java index 641018a972..47cb3d563a 100644 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_NaviPositionReport.java +++ b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_NaviPositionReport.java @@ -16,6 +16,7 @@ public class OSVR_NaviPositionReport extends Structure { public OSVR_NaviPositionReport() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("sensor", "state"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_NaviVelocityReport.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_NaviVelocityReport.java index 89dcef2508..ff07a8a0a2 100644 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_NaviVelocityReport.java +++ b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_NaviVelocityReport.java @@ -16,6 +16,7 @@ public class OSVR_NaviVelocityReport extends Structure { public OSVR_NaviVelocityReport() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("sensor", "state"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_OrientationReport.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_OrientationReport.java index 2699487f15..7b8dc7bde0 100644 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_OrientationReport.java +++ b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_OrientationReport.java @@ -15,6 +15,7 @@ public class OSVR_OrientationReport extends Structure { public OSVR_OrientationReport() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("sensor", "rotation"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_Pose3.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_Pose3.java index a9ce1c2021..5dacd27388 100644 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_Pose3.java +++ b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_Pose3.java @@ -16,6 +16,7 @@ public class OSVR_Pose3 extends Structure { public OSVR_Pose3() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("translation", "rotation"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_PoseReport.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_PoseReport.java index f80bfd06b1..e39eea50f6 100644 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_PoseReport.java +++ b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_PoseReport.java @@ -15,6 +15,7 @@ public class OSVR_PoseReport extends Structure { public OSVR_PoseReport() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("sensor", "pose"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_PositionReport.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_PositionReport.java index 7186828354..d93fc4a1fe 100644 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_PositionReport.java +++ b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_PositionReport.java @@ -15,6 +15,7 @@ public class OSVR_PositionReport extends Structure { public OSVR_PositionReport() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("sensor", "xyz"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_Quaternion.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_Quaternion.java index 48f83f6077..72952297a1 100644 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_Quaternion.java +++ b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_Quaternion.java @@ -14,6 +14,7 @@ public class OSVR_Quaternion extends Structure { public OSVR_Quaternion() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("data"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_Vec2.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_Vec2.java index 28a5453a23..7427d14461 100644 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_Vec2.java +++ b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_Vec2.java @@ -14,6 +14,7 @@ public class OSVR_Vec2 extends Structure { public OSVR_Vec2() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("data"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_Vec3.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_Vec3.java index 96c81a65c4..b3b2ed8893 100644 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_Vec3.java +++ b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_Vec3.java @@ -14,6 +14,7 @@ public class OSVR_Vec3 extends Structure { public OSVR_Vec3() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("data"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_VelocityReport.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_VelocityReport.java index 103f351d81..da65aaf62c 100644 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_VelocityReport.java +++ b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_VelocityReport.java @@ -15,6 +15,7 @@ public class OSVR_VelocityReport extends Structure { public OSVR_VelocityReport() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("sensor", "state"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_VelocityState.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_VelocityState.java index de34de0cd2..4a4589a077 100644 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_VelocityState.java +++ b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OSVR_VelocityState.java @@ -20,6 +20,7 @@ public class OSVR_VelocityState extends Structure { public OSVR_VelocityState() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("linearVelocity", "linearVelocityValid", "angularVelocity", "angularVelocityValid"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OsvrClientReportTypesLibrary.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OsvrClientReportTypesLibrary.java index 9f8f1ea765..4289cb200f 100644 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OsvrClientReportTypesLibrary.java +++ b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrclientreporttypes/OsvrClientReportTypesLibrary.java @@ -14,12 +14,12 @@ public class OsvrClientReportTypesLibrary implements Library { static { Native.register(OsvrClientReportTypesLibrary.class, OsvrClientReportTypesLibrary.JNA_NATIVE_LIB); } - public static final int OSVR_TRUE = (int)(1); - public static final int OSVR_FALSE = (int)(0); - public static final int OSVR_BUTTON_PRESSED = (int)(1); - public static final int OSVR_BUTTON_NOT_PRESSED = (int)(0); - public static final int OSVR_EYE_BLINK = (int)(1); - public static final int OSVR_EYE_NO_BLINK = (int)(0); + public static final int OSVR_TRUE = 1; + public static final int OSVR_FALSE = 0; + public static final int OSVR_BUTTON_PRESSED = 1; + public static final int OSVR_BUTTON_NOT_PRESSED = 0; + public static final int OSVR_EYE_BLINK = 1; + public static final int OSVR_EYE_NO_BLINK = 0; /** Original signature : double osvrVec3GetX(const OSVR_Vec3*) */ public static native double osvrVec3GetX(OSVR_Vec3 v); /** Original signature : void osvrVec3SetX(OSVR_Vec3*, double) */ diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrmatrixconventions/OSVR_Pose3.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrmatrixconventions/OSVR_Pose3.java index 8925e2c6e2..8ec8f7cfa4 100644 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrmatrixconventions/OSVR_Pose3.java +++ b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrmatrixconventions/OSVR_Pose3.java @@ -16,6 +16,7 @@ public class OSVR_Pose3 extends Structure { public OSVR_Pose3() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("translation", "rotation"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrmatrixconventions/OSVR_Quaternion.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrmatrixconventions/OSVR_Quaternion.java index 04c9145941..4627040206 100644 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrmatrixconventions/OSVR_Quaternion.java +++ b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrmatrixconventions/OSVR_Quaternion.java @@ -14,6 +14,7 @@ public class OSVR_Quaternion extends Structure { public OSVR_Quaternion() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("data"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrmatrixconventions/OSVR_Vec3.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrmatrixconventions/OSVR_Vec3.java index 31db1607ae..7aa44a9793 100644 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrmatrixconventions/OSVR_Vec3.java +++ b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrmatrixconventions/OSVR_Vec3.java @@ -14,6 +14,7 @@ public class OSVR_Vec3 extends Structure { public OSVR_Vec3() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("data"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrmatrixconventions/OsvrMatrixConventionsLibrary.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrmatrixconventions/OsvrMatrixConventionsLibrary.java index dde9fe4102..384dd827ce 100644 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrmatrixconventions/OsvrMatrixConventionsLibrary.java +++ b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrmatrixconventions/OsvrMatrixConventionsLibrary.java @@ -30,26 +30,26 @@ public static interface OSVR_MatrixMasks { /** enum values */ public static interface OSVR_MatrixOrderingFlags { public static final int OSVR_MATRIX_COLMAJOR = 0x0; - public static final int OSVR_MATRIX_ROWMAJOR = (int)OsvrMatrixConventionsLibrary.OSVR_MatrixMasks.OSVR_MATRIX_MASK_ROWMAJOR; + public static final int OSVR_MATRIX_ROWMAJOR = OsvrMatrixConventionsLibrary.OSVR_MatrixMasks.OSVR_MATRIX_MASK_ROWMAJOR; }; /** enum values */ public static interface OSVR_MatrixVectorFlags { public static final int OSVR_MATRIX_COLVECTORS = 0x0; - public static final int OSVR_MATRIX_ROWVECTORS = (int)OsvrMatrixConventionsLibrary.OSVR_MatrixMasks.OSVR_MATRIX_MASK_ROWVECTORS; + public static final int OSVR_MATRIX_ROWVECTORS = OsvrMatrixConventionsLibrary.OSVR_MatrixMasks.OSVR_MATRIX_MASK_ROWVECTORS; }; /** enum values */ public static interface OSVR_ProjectionMatrixInputFlags { public static final int OSVR_MATRIX_RHINPUT = 0x0; - public static final int OSVR_MATRIX_LHINPUT = (int)OsvrMatrixConventionsLibrary.OSVR_MatrixMasks.OSVR_MATRIX_MASK_LHINPUT; + public static final int OSVR_MATRIX_LHINPUT = OsvrMatrixConventionsLibrary.OSVR_MatrixMasks.OSVR_MATRIX_MASK_LHINPUT; }; /** enum values */ public static interface OSVR_ProjectionMatrixZFlags { public static final int OSVR_MATRIX_SIGNEDZ = 0x0; - public static final int OSVR_MATRIX_UNSIGNEDZ = (int)OsvrMatrixConventionsLibrary.OSVR_MatrixMasks.OSVR_MATRIX_MASK_UNSIGNEDZ; + public static final int OSVR_MATRIX_UNSIGNEDZ = OsvrMatrixConventionsLibrary.OSVR_MatrixMasks.OSVR_MATRIX_MASK_UNSIGNEDZ; }; public static final int OSVR_MATRIX_SIZE = 16; - public static final int OSVR_RETURN_SUCCESS = (int)(0); - public static final int OSVR_RETURN_FAILURE = (int)(1); + public static final int OSVR_RETURN_SUCCESS = 0; + public static final int OSVR_RETURN_FAILURE = 1; /** Original signature : double osvrVec3GetX(const OSVR_Vec3*) */ public static native double osvrVec3GetX(OSVR_Vec3 v); /** Original signature : void osvrVec3SetX(OSVR_Vec3*, double) */ diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanager/OSVR_ProjectionMatrix.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanager/OSVR_ProjectionMatrix.java index 7b9d66e3fe..2ebeb8f2fe 100644 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanager/OSVR_ProjectionMatrix.java +++ b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanager/OSVR_ProjectionMatrix.java @@ -19,6 +19,7 @@ public class OSVR_ProjectionMatrix extends Structure { public OSVR_ProjectionMatrix() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("left", "right", "top", "bottom", "nearClip", "farClip"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanager/OSVR_RGB.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanager/OSVR_RGB.java index 09695a57b8..4fca69fc4c 100644 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanager/OSVR_RGB.java +++ b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanager/OSVR_RGB.java @@ -15,6 +15,7 @@ public class OSVR_RGB extends Structure { public OSVR_RGB() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("r", "g", "b"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanager/OSVR_RenderParams.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanager/OSVR_RenderParams.java index 262b7ddb28..ea094d4f3e 100644 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanager/OSVR_RenderParams.java +++ b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanager/OSVR_RenderParams.java @@ -24,6 +24,7 @@ public class OSVR_RenderParams extends Structure { public OSVR_RenderParams() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("worldFromRoomAppend", "roomFromHeadReplace", "nearClipDistanceMeters", "farClipDistanceMeters"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanager/OSVR_ViewportDescription.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanager/OSVR_ViewportDescription.java index 11f05bda7c..2e38658290 100644 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanager/OSVR_ViewportDescription.java +++ b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanager/OSVR_ViewportDescription.java @@ -20,6 +20,7 @@ public class OSVR_ViewportDescription extends Structure { public OSVR_ViewportDescription() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("left", "lower", "width", "height"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_GraphicsLibraryOpenGL.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_GraphicsLibraryOpenGL.java index 626609e081..f52a83387b 100644 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_GraphicsLibraryOpenGL.java +++ b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_GraphicsLibraryOpenGL.java @@ -14,6 +14,7 @@ public class OSVR_GraphicsLibraryOpenGL extends Structure { public OSVR_GraphicsLibraryOpenGL() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("toolkit"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_OpenGLContextParams.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_OpenGLContextParams.java index 71a67ee1a0..185a2d5bb8 100644 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_OpenGLContextParams.java +++ b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_OpenGLContextParams.java @@ -24,6 +24,7 @@ public class OSVR_OpenGLContextParams extends Structure { public OSVR_OpenGLContextParams() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("windowTitle", "fullScreen", "width", "height", "xPos", "yPos", "bitsPerPixel", "numBuffers", "visible"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_OpenGLToolkitFunctions.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_OpenGLToolkitFunctions.java index 0b996bcecd..e32b3901f3 100644 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_OpenGLToolkitFunctions.java +++ b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_OpenGLToolkitFunctions.java @@ -58,6 +58,7 @@ public interface getDisplaySizeOverride_callback extends Callback { public OSVR_OpenGLToolkitFunctions() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("size", "data", "create", "destroy", "handleEvents", "getDisplayFrameBuffer", "getDisplaySizeOverride"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_OpenResultsOpenGL.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_OpenResultsOpenGL.java index e4da1e6da8..85e020f6e7 100644 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_OpenResultsOpenGL.java +++ b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_OpenResultsOpenGL.java @@ -20,6 +20,7 @@ public class OSVR_OpenResultsOpenGL extends Structure { public OSVR_OpenResultsOpenGL() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("status", "library", "buffers"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_ProjectionMatrix.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_ProjectionMatrix.java index 21df22bdba..94d2248543 100644 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_ProjectionMatrix.java +++ b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_ProjectionMatrix.java @@ -19,6 +19,7 @@ public class OSVR_ProjectionMatrix extends Structure { public OSVR_ProjectionMatrix() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("left", "right", "top", "bottom", "nearClip", "farClip"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_RGB.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_RGB.java index fb5a925b35..c74e15643b 100644 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_RGB.java +++ b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_RGB.java @@ -15,6 +15,7 @@ public class OSVR_RGB extends Structure { public OSVR_RGB() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("r", "g", "b"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_RenderBufferOpenGL.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_RenderBufferOpenGL.java index d2488eff9e..7f502dd053 100644 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_RenderBufferOpenGL.java +++ b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_RenderBufferOpenGL.java @@ -14,6 +14,7 @@ public class OSVR_RenderBufferOpenGL extends Structure { public OSVR_RenderBufferOpenGL() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("colorBufferName", "depthStencilBufferName"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_RenderInfoOpenGL.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_RenderInfoOpenGL.java index 3b0e1a79f2..997215f3cb 100644 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_RenderInfoOpenGL.java +++ b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_RenderInfoOpenGL.java @@ -20,6 +20,7 @@ public OSVR_RenderInfoOpenGL() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("library", "viewport", "pose", "projection"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_RenderParams.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_RenderParams.java index 2b63b7b3cf..6df55bdc88 100644 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_RenderParams.java +++ b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_RenderParams.java @@ -24,6 +24,7 @@ public class OSVR_RenderParams extends Structure { public OSVR_RenderParams() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("worldFromRoomAppend", "roomFromHeadReplace", "nearClipDistanceMeters", "farClipDistanceMeters"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_ViewportDescription.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_ViewportDescription.java index 0df38e45f5..f504476e4c 100644 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_ViewportDescription.java +++ b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrrendermanageropengl/OSVR_ViewportDescription.java @@ -20,6 +20,7 @@ public class OSVR_ViewportDescription extends Structure { public OSVR_ViewportDescription() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("left", "lower", "width", "height"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrtimevalue/OSVR_TimeValue.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrtimevalue/OSVR_TimeValue.java index db60f043d8..e500f89b17 100644 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrtimevalue/OSVR_TimeValue.java +++ b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrtimevalue/OSVR_TimeValue.java @@ -16,6 +16,7 @@ public class OSVR_TimeValue extends Structure { public OSVR_TimeValue() { super(); } + @Override protected List getFieldOrder() { return Arrays.asList("seconds", "microseconds"); } diff --git a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrtimevalue/OsvrTimeValueLibrary.java b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrtimevalue/OsvrTimeValueLibrary.java index 9af6a39af2..eb2731b5c0 100644 --- a/jme3-vr/src/main/java/com/jme3/system/osvr/osvrtimevalue/OsvrTimeValueLibrary.java +++ b/jme3-vr/src/main/java/com/jme3/system/osvr/osvrtimevalue/OsvrTimeValueLibrary.java @@ -16,8 +16,8 @@ public class OsvrTimeValueLibrary implements Library { static { Native.register(OsvrTimeValueLibrary.class, OsvrTimeValueLibrary.JNA_NATIVE_LIB); } - public static final int OSVR_TRUE = (int)(1); - public static final int OSVR_FALSE = (int)(0); + public static final int OSVR_TRUE = 1; + public static final int OSVR_FALSE = 0; /** * Gets the current time in the TimeValue. Parallel to gettimeofday. * Original signature : void osvrTimeValueGetNow(OSVR_TimeValue*) diff --git a/natives-snapshot.properties b/natives-snapshot.properties index 50b135bd14..ece067b2ba 100644 --- a/natives-snapshot.properties +++ b/natives-snapshot.properties @@ -1 +1 @@ -natives.snapshot=128e079a22413f63b430ffe4ad2ec7ebe7f50f3c +natives.snapshot=f6525912817fed374ad0a68b831a25cea6487b81 diff --git a/version.gradle b/version.gradle index 80972003af..637b5ff72a 100644 --- a/version.gradle +++ b/version.gradle @@ -24,36 +24,108 @@ ext { task configureVersionInfo { try { + // Users can configure behavior by setting properties on the command + // line: + // + // jmeVersionName: + // If set this will override all automatic version detection. + // + // useCommitHashAsVersionName: + // If there is no jmeVersionName set and the current commit has no + // specific tag then setting this to 'true' will cause the version to + // be the full commit ID. + // + // includeBranchInVersion: + // Set to true if a non-master branch name should be included in the automatically + // generated version. + def grgit = Grgit.open(project.file('.')) def head = grgit.head() jmeRevision = grgit.log(includes: [head]).size() jmeGitHash = head.id jmeShortGitHash = head.abbreviatedId jmeBranchName = grgit.branch.current.name + + // This code will find an exact-match tag if the current + // commit is the same as the tag commit. jmeGitTag = grgit.tag.list().find { it.commit == head } + def latestTag; + if( jmeGitTag ) { + // Just use the name. We keep jmeGitTag separate because there + // is some logic that wants to know if this specific commit has + // a tag versus 'whatever tag we are a child of'... which is what + // 'latestTag' will be. + jmeGitTag = jmeGitTag.name + latestTag = jmeGitTag; + } else { + // Use describe to find the most recent tag. Unfortunately, + // in this version of grgit, we don't have the 'always' options + // so we can't make as many assumptions about the format of the + // string. + // If the commit is an exact match then it will return just the + // tag name... else it will be tagName-commitCount-abbreviatedId + // We'll use some groovy regex magic to get the tag either way. + def describe = grgit.describe() + def fullDescribe = (describe =~/(.*?)-(\d+)-g$jmeShortGitHash/) + latestTag = fullDescribe ? fullDescribe[0][1] : describe + println "Latest tag:" + latestTag + } + + // We could enhance this with some more regex if we wanted to sanity + // check that it was formatted like our versions. + def tagVersion = (latestTag =~/v?(.*)/)[0][1]; + // If the branch is not master then use the tag. + if( jmeBranchName != "master" ) { + jmeVersion = tagVersion + } - if(jmeVersionName==""){ - if (jmeGitTag != null) { - jmeGitTag = jmeGitTag.name - jmeFullVersion = jmeGitTag + // Parse out just the base version part. -SNAPSHOT versions + // shouldn't really include our release suffixes + def baseVersion = (jmeVersion =~/(\d+\.\d+.\d+)/) + baseVersion = baseVersion.size() > 0 ? baseVersion[0][0] : jmeVersion + + if( !jmeVersionName ) { + // If there is a specific tag for the top commit then we always + // use that. + if( jmeGitTag ) { + println "Using GIT tag as version" + jmeFullVersion = tagVersion; // already cleaned up + jmeVersionTag = "" // and no SNAPSHOT suffix for an exact version tag + + // Note: this will not automatically add SNAPSHOT if the user has + // local changes that they haven't committed. Technically, only + // real CI builds should be using non-SNAPSHOT versions so we may + // eventually want to change the script to always use -SNAPSHOT with + // a CI option to turn it off. + // We could also check the grgit.status for unstaged modified/removed files. + // def unstaged = grgit.status().unstaged; + // def modCount = unstaged.modified.size() + unstaged.removed.size() + // ...but that seems like a wasteful check considering only official + // version builds should not have a -SNAPSHOT. + + } else if( useCommitHashAsVersionName == "true" && jmeGitHash ) { + // The user has opted to use the hash... and we actually have + // a hash. + println "Using commit ID as version" + jmeFullVersion = jmeGitHash; jmeVersionTag = "" } else { - if(useCommitHashAsVersionName=="true"&&jmeGitHash!=null&&!jmeGitHash.equals("")){ - jmeFullVersion = jmeGitHash - jmeVersionTag = "" - }else{ - jmeFullVersion="${jmeVersion}-"; - if(jmeBranchName!="master")jmeFullVersion+="${jmeBranchName}-"; - jmeFullVersion+="SNAPSHOT" - jmeVersionTag="SNAPSHOT" + println "Auto-detecting version" + jmeVersionTag = "SNAPSHOT" + + if( includeBranchInVersion == "true" && jmeBranchName != "master" ) { + jmeFullVersion = baseVersion + "-" + jmeBranchName + "-" + jmeVersionTag; + } else { + jmeFullVersion = baseVersion + "-" + jmeVersionTag; } } - }else{ - jmeVersionTag="" + } else { + // Just use defaults + println "Using user-defined version" jmeFullVersion=jmeVersionName + jmeVersionTag = "SNAPSHOT" } - println("Revision: ${jmeRevision}") println("Hash: ${jmeGitHash}") println("Short Hash: ${jmeShortGitHash}") @@ -61,7 +133,8 @@ task configureVersionInfo { println("Build Date: ${jmeBuildDate}") println("Build Branch: ${jmeBranchName}") println("Use commit hash as version ${useCommitHashAsVersionName}") - println("Build Tag: ${jmeVersionTag}") + println("Base Version: ${baseVersion}") + println("Build Suffix: ${jmeVersionTag}") println("Build Version: ${jmeFullVersion}") } catch (ex) {