Add missing @Override annotations (#1270)
* jme3-core: add the missing @Override annotations * jme3-desktop: add the missing @Override annotations * jme3-bullet and jme3-jbullet: add the missing @Override annotations * jme3-effects: add the missing @Override annotations * jme3-terrain: add the missing @Override annotations * jme3-examples: add the missing @Override annotations * jme3-android: add the missing @Override annotations * jme3-blender: add the missing @Override annotations * jme3-ios: add the missing @Override annotations * jme3-jogg and jme3-jogl: add the missing @Override annotations * jme3-plugind: add the missing @Override annotations * jme3-lwjgl and jme3-lwjgl3: add the missing @Override annotations * jme3-networking: add the missing @Override annotations * jme3-vr: add the missing @Override annotations
This commit is contained in:
parent
427ae0a28b
commit
0fd70b81c9
@ -362,6 +362,7 @@ public class AndroidHarness extends Activity implements TouchListener, DialogInt
|
|||||||
* @param dialog
|
* @param dialog
|
||||||
* @param whichButton
|
* @param whichButton
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int whichButton) {
|
public void onClick(DialogInterface dialog, int whichButton) {
|
||||||
if (whichButton != -2) {
|
if (whichButton != -2) {
|
||||||
if (app != null) {
|
if (app != null) {
|
||||||
@ -473,6 +474,7 @@ public class AndroidHarness extends Activity implements TouchListener, DialogInt
|
|||||||
handler.setLevel(Level.ALL);
|
handler.setLevel(Level.ALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
app.initialize();
|
app.initialize();
|
||||||
if (handleExitHook) {
|
if (handleExitHook) {
|
||||||
@ -488,10 +490,12 @@ public class AndroidHarness extends Activity implements TouchListener, DialogInt
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void reshape(int width, int height) {
|
public void reshape(int width, int height) {
|
||||||
app.reshape(width, height);
|
app.reshape(width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void update() {
|
public void update() {
|
||||||
app.update();
|
app.update();
|
||||||
// call to remove the splash screen, if present.
|
// call to remove the splash screen, if present.
|
||||||
@ -503,10 +507,12 @@ public class AndroidHarness extends Activity implements TouchListener, DialogInt
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void requestClose(boolean esc) {
|
public void requestClose(boolean esc) {
|
||||||
app.requestClose(esc);
|
app.requestClose(esc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void destroy() {
|
public void destroy() {
|
||||||
if (app != null) {
|
if (app != null) {
|
||||||
app.destroy();
|
app.destroy();
|
||||||
@ -516,6 +522,7 @@ public class AndroidHarness extends Activity implements TouchListener, DialogInt
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void gainFocus() {
|
public void gainFocus() {
|
||||||
logger.fine("gainFocus");
|
logger.fine("gainFocus");
|
||||||
if (view != null) {
|
if (view != null) {
|
||||||
@ -547,6 +554,7 @@ public class AndroidHarness extends Activity implements TouchListener, DialogInt
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void loseFocus() {
|
public void loseFocus() {
|
||||||
logger.fine("loseFocus");
|
logger.fine("loseFocus");
|
||||||
if (app != null) {
|
if (app != null) {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2014 jMonkeyEngine
|
* Copyright (c) 2014-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -82,6 +82,7 @@ import com.jme3.renderer.queue.RenderQueue;
|
|||||||
public class DefaultAndroidProfiler implements AppProfiler {
|
public class DefaultAndroidProfiler implements AppProfiler {
|
||||||
private int androidApiLevel = Build.VERSION.SDK_INT;
|
private int androidApiLevel = Build.VERSION.SDK_INT;
|
||||||
|
|
||||||
|
@Override
|
||||||
public void appStep(AppStep appStep) {
|
public void appStep(AppStep appStep) {
|
||||||
if (androidApiLevel >= 18) {
|
if (androidApiLevel >= 18) {
|
||||||
switch(appStep) {
|
switch(appStep) {
|
||||||
@ -140,6 +141,7 @@ public class DefaultAndroidProfiler implements AppProfiler {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void vpStep(VpStep vpStep, ViewPort vp, RenderQueue.Bucket bucket) {
|
public void vpStep(VpStep vpStep, ViewPort vp, RenderQueue.Bucket bucket) {
|
||||||
if (androidApiLevel >= 18) {
|
if (androidApiLevel >= 18) {
|
||||||
switch (vpStep) {
|
switch (vpStep) {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2019 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -73,6 +73,7 @@ public class VideoRecorderAppState extends AbstractAppState {
|
|||||||
private Application app;
|
private Application app;
|
||||||
private ExecutorService executor = Executors.newCachedThreadPool(new ThreadFactory() {
|
private ExecutorService executor = Executors.newCachedThreadPool(new ThreadFactory() {
|
||||||
|
|
||||||
|
@Override
|
||||||
public Thread newThread(Runnable r) {
|
public Thread newThread(Runnable r) {
|
||||||
Thread th = new Thread(r);
|
Thread th = new Thread(r);
|
||||||
th.setName("jME3 Video Processor");
|
th.setName("jME3 Video Processor");
|
||||||
@ -239,6 +240,7 @@ public class VideoRecorderAppState extends AbstractAppState {
|
|||||||
renderer.readFrameBufferWithFormat(out, item.buffer, Image.Format.BGRA8);
|
renderer.readFrameBufferWithFormat(out, item.buffer, Image.Format.BGRA8);
|
||||||
executor.submit(new Callable<Void>() {
|
executor.submit(new Callable<Void>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
public Void call() throws Exception {
|
public Void call() throws Exception {
|
||||||
if (fastMode) {
|
if (fastMode) {
|
||||||
item.data = item.buffer.array();
|
item.data = item.buffer.array();
|
||||||
@ -260,6 +262,7 @@ public class VideoRecorderAppState extends AbstractAppState {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void initialize(RenderManager rm, ViewPort viewPort) {
|
public void initialize(RenderManager rm, ViewPort viewPort) {
|
||||||
logger.log(Level.INFO, "initialize in VideoProcessor");
|
logger.log(Level.INFO, "initialize in VideoProcessor");
|
||||||
this.camera = viewPort.getCamera();
|
this.camera = viewPort.getCamera();
|
||||||
@ -275,13 +278,16 @@ public class VideoRecorderAppState extends AbstractAppState {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void reshape(ViewPort vp, int w, int h) {
|
public void reshape(ViewPort vp, int w, int h) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean isInitialized() {
|
public boolean isInitialized() {
|
||||||
return this.isInitilized;
|
return this.isInitilized;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void preFrame(float tpf) {
|
public void preFrame(float tpf) {
|
||||||
if (null == writer) {
|
if (null == writer) {
|
||||||
try {
|
try {
|
||||||
@ -292,14 +298,17 @@ public class VideoRecorderAppState extends AbstractAppState {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void postQueue(RenderQueue rq) {
|
public void postQueue(RenderQueue rq) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void postFrame(FrameBuffer out) {
|
public void postFrame(FrameBuffer out) {
|
||||||
numFrames++;
|
numFrames++;
|
||||||
addImage(renderManager.getRenderer(), out);
|
addImage(renderManager.getRenderer(), out);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void cleanup() {
|
public void cleanup() {
|
||||||
logger.log(Level.INFO, "cleanup in VideoProcessor");
|
logger.log(Level.INFO, "cleanup in VideoProcessor");
|
||||||
logger.log(Level.INFO, "VideoProcessor numFrames: {0}", numFrames);
|
logger.log(Level.INFO, "VideoProcessor numFrames: {0}", numFrames);
|
||||||
@ -332,22 +341,27 @@ public class VideoRecorderAppState extends AbstractAppState {
|
|||||||
this.ticks = 0;
|
this.ticks = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public long getTime() {
|
public long getTime() {
|
||||||
return (long) (this.ticks * (1.0f / this.framerate) * 1000f);
|
return (long) (this.ticks * (1.0f / this.framerate) * 1000f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public long getResolution() {
|
public long getResolution() {
|
||||||
return 1000L;
|
return 1000L;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public float getFrameRate() {
|
public float getFrameRate() {
|
||||||
return this.framerate;
|
return this.framerate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public float getTimePerFrame() {
|
public float getTimePerFrame() {
|
||||||
return (float) (1.0f / this.framerate);
|
return (float) (1.0f / this.framerate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void update() {
|
public void update() {
|
||||||
long time = System.currentTimeMillis();
|
long time = System.currentTimeMillis();
|
||||||
long difference = time - lastTime;
|
long difference = time - lastTime;
|
||||||
@ -364,6 +378,7 @@ public class VideoRecorderAppState extends AbstractAppState {
|
|||||||
this.ticks++;
|
this.ticks++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void reset() {
|
public void reset() {
|
||||||
this.ticks = 0;
|
this.ticks = 0;
|
||||||
}
|
}
|
||||||
|
@ -17,6 +17,7 @@ public class AndroidLocator implements AssetLocator {
|
|||||||
public AndroidLocator() {
|
public AndroidLocator() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setRootPath(String rootPath) {
|
public void setRootPath(String rootPath) {
|
||||||
this.rootPath = rootPath;
|
this.rootPath = rootPath;
|
||||||
}
|
}
|
||||||
|
@ -10,44 +10,64 @@ public final class AndroidAL implements AL {
|
|||||||
public AndroidAL() {
|
public AndroidAL() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public native String alGetString(int parameter);
|
public native String alGetString(int parameter);
|
||||||
|
|
||||||
|
@Override
|
||||||
public native int alGenSources();
|
public native int alGenSources();
|
||||||
|
|
||||||
|
@Override
|
||||||
public native int alGetError();
|
public native int alGetError();
|
||||||
|
|
||||||
|
@Override
|
||||||
public native void alDeleteSources(int numSources, IntBuffer sources);
|
public native void alDeleteSources(int numSources, IntBuffer sources);
|
||||||
|
|
||||||
|
@Override
|
||||||
public native void alGenBuffers(int numBuffers, IntBuffer buffers);
|
public native void alGenBuffers(int numBuffers, IntBuffer buffers);
|
||||||
|
|
||||||
|
@Override
|
||||||
public native void alDeleteBuffers(int numBuffers, IntBuffer buffers);
|
public native void alDeleteBuffers(int numBuffers, IntBuffer buffers);
|
||||||
|
|
||||||
|
@Override
|
||||||
public native void alSourceStop(int source);
|
public native void alSourceStop(int source);
|
||||||
|
|
||||||
|
@Override
|
||||||
public native void alSourcei(int source, int param, int value);
|
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);
|
public native void alBufferData(int buffer, int format, ByteBuffer data, int size, int frequency);
|
||||||
|
|
||||||
|
@Override
|
||||||
public native void alSourcePlay(int source);
|
public native void alSourcePlay(int source);
|
||||||
|
|
||||||
|
@Override
|
||||||
public native void alSourcePause(int source);
|
public native void alSourcePause(int source);
|
||||||
|
|
||||||
|
@Override
|
||||||
public native void alSourcef(int source, int param, float value);
|
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);
|
public native void alSource3f(int source, int param, float value1, float value2, float value3);
|
||||||
|
|
||||||
|
@Override
|
||||||
public native int alGetSourcei(int source, int param);
|
public native int alGetSourcei(int source, int param);
|
||||||
|
|
||||||
|
@Override
|
||||||
public native void alSourceUnqueueBuffers(int source, int numBuffers, IntBuffer buffers);
|
public native void alSourceUnqueueBuffers(int source, int numBuffers, IntBuffer buffers);
|
||||||
|
|
||||||
|
@Override
|
||||||
public native void alSourceQueueBuffers(int source, int numBuffers, IntBuffer buffers);
|
public native void alSourceQueueBuffers(int source, int numBuffers, IntBuffer buffers);
|
||||||
|
|
||||||
|
@Override
|
||||||
public native void alListener(int param, FloatBuffer data);
|
public native void alListener(int param, FloatBuffer data);
|
||||||
|
|
||||||
|
@Override
|
||||||
public native void alListenerf(int param, float value);
|
public native void alListenerf(int param, float value);
|
||||||
|
|
||||||
|
@Override
|
||||||
public native void alListener3f(int param, float value1, float value2, float value3);
|
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);
|
public native void alSource3i(int source, int param, int value1, int value2, int value3);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -12,19 +12,27 @@ public final class AndroidALC implements ALC {
|
|||||||
public AndroidALC() {
|
public AndroidALC() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public native void createALC();
|
public native void createALC();
|
||||||
|
|
||||||
|
@Override
|
||||||
public native void destroyALC();
|
public native void destroyALC();
|
||||||
|
|
||||||
|
@Override
|
||||||
public native boolean isCreated();
|
public native boolean isCreated();
|
||||||
|
|
||||||
|
@Override
|
||||||
public native String alcGetString(int parameter);
|
public native String alcGetString(int parameter);
|
||||||
|
|
||||||
|
@Override
|
||||||
public native boolean alcIsExtensionPresent(String extension);
|
public native boolean alcIsExtensionPresent(String extension);
|
||||||
|
|
||||||
|
@Override
|
||||||
public native void alcGetInteger(int param, IntBuffer buffer, int size);
|
public native void alcGetInteger(int param, IntBuffer buffer, int size);
|
||||||
|
|
||||||
|
@Override
|
||||||
public native void alcDevicePauseSOFT();
|
public native void alcDevicePauseSOFT();
|
||||||
|
|
||||||
|
@Override
|
||||||
public native void alcDeviceResumeSOFT();
|
public native void alcDeviceResumeSOFT();
|
||||||
}
|
}
|
||||||
|
@ -8,25 +8,36 @@ public class AndroidEFX implements EFX {
|
|||||||
public AndroidEFX() {
|
public AndroidEFX() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public native void alGenAuxiliaryEffectSlots(int numSlots, IntBuffer buffers);
|
public native void alGenAuxiliaryEffectSlots(int numSlots, IntBuffer buffers);
|
||||||
|
|
||||||
|
@Override
|
||||||
public native void alGenEffects(int numEffects, IntBuffer buffers);
|
public native void alGenEffects(int numEffects, IntBuffer buffers);
|
||||||
|
|
||||||
|
@Override
|
||||||
public native void alEffecti(int effect, int param, int value);
|
public native void alEffecti(int effect, int param, int value);
|
||||||
|
|
||||||
|
@Override
|
||||||
public native void alAuxiliaryEffectSloti(int effectSlot, int param, int value);
|
public native void alAuxiliaryEffectSloti(int effectSlot, int param, int value);
|
||||||
|
|
||||||
|
@Override
|
||||||
public native void alDeleteEffects(int numEffects, IntBuffer buffers);
|
public native void alDeleteEffects(int numEffects, IntBuffer buffers);
|
||||||
|
|
||||||
|
@Override
|
||||||
public native void alDeleteAuxiliaryEffectSlots(int numEffectSlots, IntBuffer buffers);
|
public native void alDeleteAuxiliaryEffectSlots(int numEffectSlots, IntBuffer buffers);
|
||||||
|
|
||||||
|
@Override
|
||||||
public native void alGenFilters(int numFilters, IntBuffer buffers);
|
public native void alGenFilters(int numFilters, IntBuffer buffers);
|
||||||
|
|
||||||
|
@Override
|
||||||
public native void alFilteri(int filter, int param, int value);
|
public native void alFilteri(int filter, int param, int value);
|
||||||
|
|
||||||
|
@Override
|
||||||
public native void alFilterf(int filter, int param, float value);
|
public native void alFilterf(int filter, int param, float value);
|
||||||
|
|
||||||
|
@Override
|
||||||
public native void alDeleteFilters(int numFilters, IntBuffer buffers);
|
public native void alDeleteFilters(int numFilters, IntBuffer buffers);
|
||||||
|
|
||||||
|
@Override
|
||||||
public native void alEffectf(int effect, int param, float value);
|
public native void alEffectf(int effect, int param, float value);
|
||||||
}
|
}
|
||||||
|
@ -46,6 +46,7 @@ public class NativeVorbisLoader implements AssetLoader {
|
|||||||
throw new IOException("Not supported for audio streams");
|
throw new IOException("Not supported for audio streams");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setTime(float time) {
|
public void setTime(float time) {
|
||||||
try {
|
try {
|
||||||
file.seekTime(time);
|
file.seekTime(time);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2015 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* 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);
|
IntBuffer tmpBuff = BufferUtils.createIntBuffer(1);
|
||||||
|
|
||||||
|
@Override
|
||||||
public void resetStats() {
|
public void resetStats() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -86,10 +87,12 @@ public class AndroidGL implements GL, GL2, GLES_30, GLExt, GLFbo {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glActiveTexture(int texture) {
|
public void glActiveTexture(int texture) {
|
||||||
GLES20.glActiveTexture(texture);
|
GLES20.glActiveTexture(texture);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glAttachShader(int program, int shader) {
|
public void glAttachShader(int program, int shader) {
|
||||||
GLES20.glAttachShader(program, shader);
|
GLES20.glAttachShader(program, shader);
|
||||||
}
|
}
|
||||||
@ -99,144 +102,179 @@ public class AndroidGL implements GL, GL2, GLES_30, GLExt, GLFbo {
|
|||||||
GLES30.glBeginQuery(target, query);
|
GLES30.glBeginQuery(target, query);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glBindBuffer(int target, int buffer) {
|
public void glBindBuffer(int target, int buffer) {
|
||||||
GLES20.glBindBuffer(target, buffer);
|
GLES20.glBindBuffer(target, buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glBindTexture(int target, int texture) {
|
public void glBindTexture(int target, int texture) {
|
||||||
GLES20.glBindTexture(target, texture);
|
GLES20.glBindTexture(target, texture);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glBlendFunc(int sfactor, int dfactor) {
|
public void glBlendFunc(int sfactor, int dfactor) {
|
||||||
GLES20.glBlendFunc(sfactor, dfactor);
|
GLES20.glBlendFunc(sfactor, dfactor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glBlendFuncSeparate(int sfactorRGB, int dfactorRGB, int sfactorAlpha, int dfactorAlpha) {
|
public void glBlendFuncSeparate(int sfactorRGB, int dfactorRGB, int sfactorAlpha, int dfactorAlpha) {
|
||||||
GLES20.glBlendFuncSeparate(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha);
|
GLES20.glBlendFuncSeparate(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glBufferData(int target, FloatBuffer data, int usage) {
|
public void glBufferData(int target, FloatBuffer data, int usage) {
|
||||||
GLES20.glBufferData(target, getLimitBytes(data), data, usage);
|
GLES20.glBufferData(target, getLimitBytes(data), data, usage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glBufferData(int target, ShortBuffer data, int usage) {
|
public void glBufferData(int target, ShortBuffer data, int usage) {
|
||||||
GLES20.glBufferData(target, getLimitBytes(data), data, usage);
|
GLES20.glBufferData(target, getLimitBytes(data), data, usage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glBufferData(int target, ByteBuffer data, int usage) {
|
public void glBufferData(int target, ByteBuffer data, int usage) {
|
||||||
GLES20.glBufferData(target, getLimitBytes(data), data, usage);
|
GLES20.glBufferData(target, getLimitBytes(data), data, usage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glBufferData(int target, long data_size, int usage) {
|
public void glBufferData(int target, long data_size, int usage) {
|
||||||
GLES20.glBufferData(target, (int) data_size, null, usage);
|
GLES20.glBufferData(target, (int) data_size, null, usage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glBufferSubData(int target, long offset, FloatBuffer data) {
|
public void glBufferSubData(int target, long offset, FloatBuffer data) {
|
||||||
GLES20.glBufferSubData(target, (int) offset, getLimitBytes(data), data);
|
GLES20.glBufferSubData(target, (int) offset, getLimitBytes(data), data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glBufferSubData(int target, long offset, ShortBuffer data) {
|
public void glBufferSubData(int target, long offset, ShortBuffer data) {
|
||||||
GLES20.glBufferSubData(target, (int) offset, getLimitBytes(data), data);
|
GLES20.glBufferSubData(target, (int) offset, getLimitBytes(data), data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glBufferSubData(int target, long offset, ByteBuffer data) {
|
public void glBufferSubData(int target, long offset, ByteBuffer data) {
|
||||||
GLES20.glBufferSubData(target, (int) offset, getLimitBytes(data), data);
|
GLES20.glBufferSubData(target, (int) offset, getLimitBytes(data), data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glGetBufferSubData(int target, long offset, ByteBuffer data) {
|
public void glGetBufferSubData(int target, long offset, ByteBuffer data) {
|
||||||
throw new UnsupportedOperationException("OpenGL ES 2 does not support glGetBufferSubData");
|
throw new UnsupportedOperationException("OpenGL ES 2 does not support glGetBufferSubData");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glClear(int mask) {
|
public void glClear(int mask) {
|
||||||
GLES20.glClear(mask);
|
GLES20.glClear(mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glClearColor(float red, float green, float blue, float alpha) {
|
public void glClearColor(float red, float green, float blue, float alpha) {
|
||||||
GLES20.glClearColor(red, green, blue, alpha);
|
GLES20.glClearColor(red, green, blue, alpha);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glColorMask(boolean red, boolean green, boolean blue, boolean alpha) {
|
public void glColorMask(boolean red, boolean green, boolean blue, boolean alpha) {
|
||||||
GLES20.glColorMask(red, green, blue, alpha);
|
GLES20.glColorMask(red, green, blue, alpha);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glCompileShader(int shader) {
|
public void glCompileShader(int shader) {
|
||||||
GLES20.glCompileShader(shader);
|
GLES20.glCompileShader(shader);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glCompressedTexImage2D(int target, int level, int internalformat, int width, int height, int border, ByteBuffer data) {
|
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);
|
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) {
|
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);
|
GLES20.glCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, getLimitBytes(data), data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int glCreateProgram() {
|
public int glCreateProgram() {
|
||||||
return GLES20.glCreateProgram();
|
return GLES20.glCreateProgram();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int glCreateShader(int shaderType) {
|
public int glCreateShader(int shaderType) {
|
||||||
return GLES20.glCreateShader(shaderType);
|
return GLES20.glCreateShader(shaderType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glCullFace(int mode) {
|
public void glCullFace(int mode) {
|
||||||
GLES20.glCullFace(mode);
|
GLES20.glCullFace(mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glDeleteBuffers(IntBuffer buffers) {
|
public void glDeleteBuffers(IntBuffer buffers) {
|
||||||
checkLimit(buffers);
|
checkLimit(buffers);
|
||||||
GLES20.glDeleteBuffers(buffers.limit(), buffers);
|
GLES20.glDeleteBuffers(buffers.limit(), buffers);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glDeleteProgram(int program) {
|
public void glDeleteProgram(int program) {
|
||||||
GLES20.glDeleteProgram(program);
|
GLES20.glDeleteProgram(program);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glDeleteShader(int shader) {
|
public void glDeleteShader(int shader) {
|
||||||
GLES20.glDeleteShader(shader);
|
GLES20.glDeleteShader(shader);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glDeleteTextures(IntBuffer textures) {
|
public void glDeleteTextures(IntBuffer textures) {
|
||||||
checkLimit(textures);
|
checkLimit(textures);
|
||||||
GLES20.glDeleteTextures(textures.limit(), textures);
|
GLES20.glDeleteTextures(textures.limit(), textures);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glDepthFunc(int func) {
|
public void glDepthFunc(int func) {
|
||||||
GLES20.glDepthFunc(func);
|
GLES20.glDepthFunc(func);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glDepthMask(boolean flag) {
|
public void glDepthMask(boolean flag) {
|
||||||
GLES20.glDepthMask(flag);
|
GLES20.glDepthMask(flag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glDepthRange(double nearVal, double farVal) {
|
public void glDepthRange(double nearVal, double farVal) {
|
||||||
GLES20.glDepthRangef((float)nearVal, (float)farVal);
|
GLES20.glDepthRangef((float)nearVal, (float)farVal);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glDetachShader(int program, int shader) {
|
public void glDetachShader(int program, int shader) {
|
||||||
GLES20.glDetachShader(program, shader);
|
GLES20.glDetachShader(program, shader);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glDisable(int cap) {
|
public void glDisable(int cap) {
|
||||||
GLES20.glDisable(cap);
|
GLES20.glDisable(cap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glDisableVertexAttribArray(int index) {
|
public void glDisableVertexAttribArray(int index) {
|
||||||
GLES20.glDisableVertexAttribArray(index);
|
GLES20.glDisableVertexAttribArray(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glDrawArrays(int mode, int first, int count) {
|
public void glDrawArrays(int mode, int first, int count) {
|
||||||
GLES20.glDrawArrays(mode, first, count);
|
GLES20.glDrawArrays(mode, first, count);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glDrawRangeElements(int mode, int start, int end, int count, int type, long indices) {
|
public void glDrawRangeElements(int mode, int start, int end, int count, int type, long indices) {
|
||||||
GLES20.glDrawElements(mode, count, type, (int)indices);
|
GLES20.glDrawElements(mode, count, type, (int)indices);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glEnable(int cap) {
|
public void glEnable(int cap) {
|
||||||
GLES20.glEnable(cap);
|
GLES20.glEnable(cap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glEnableVertexAttribArray(int index) {
|
public void glEnableVertexAttribArray(int index) {
|
||||||
GLES20.glEnableVertexAttribArray(index);
|
GLES20.glEnableVertexAttribArray(index);
|
||||||
}
|
}
|
||||||
@ -246,11 +284,13 @@ public class AndroidGL implements GL, GL2, GLES_30, GLExt, GLFbo {
|
|||||||
GLES30.glEndQuery(target);
|
GLES30.glEndQuery(target);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glGenBuffers(IntBuffer buffers) {
|
public void glGenBuffers(IntBuffer buffers) {
|
||||||
checkLimit(buffers);
|
checkLimit(buffers);
|
||||||
GLES20.glGenBuffers(buffers.limit(), buffers);
|
GLES20.glGenBuffers(buffers.limit(), buffers);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glGenTextures(IntBuffer textures) {
|
public void glGenTextures(IntBuffer textures) {
|
||||||
checkLimit(textures);
|
checkLimit(textures);
|
||||||
GLES20.glGenTextures(textures.limit(), textures);
|
GLES20.glGenTextures(textures.limit(), textures);
|
||||||
@ -261,29 +301,35 @@ public class AndroidGL implements GL, GL2, GLES_30, GLExt, GLFbo {
|
|||||||
GLES30.glGenQueries(num, buff);
|
GLES30.glGenQueries(num, buff);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int glGetAttribLocation(int program, String name) {
|
public int glGetAttribLocation(int program, String name) {
|
||||||
return GLES20.glGetAttribLocation(program, name);
|
return GLES20.glGetAttribLocation(program, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glGetBoolean(int pname, ByteBuffer params) {
|
public void glGetBoolean(int pname, ByteBuffer params) {
|
||||||
// GLES20.glGetBoolean(pname, params);
|
// GLES20.glGetBoolean(pname, params);
|
||||||
throw new UnsupportedOperationException("Today is not a good day for this");
|
throw new UnsupportedOperationException("Today is not a good day for this");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int glGetError() {
|
public int glGetError() {
|
||||||
return GLES20.glGetError();
|
return GLES20.glGetError();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glGetInteger(int pname, IntBuffer params) {
|
public void glGetInteger(int pname, IntBuffer params) {
|
||||||
checkLimit(params);
|
checkLimit(params);
|
||||||
GLES20.glGetIntegerv(pname, params);
|
GLES20.glGetIntegerv(pname, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glGetProgram(int program, int pname, IntBuffer params) {
|
public void glGetProgram(int program, int pname, IntBuffer params) {
|
||||||
checkLimit(params);
|
checkLimit(params);
|
||||||
GLES20.glGetProgramiv(program, pname, params);
|
GLES20.glGetProgramiv(program, pname, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String glGetProgramInfoLog(int program, int maxLength) {
|
public String glGetProgramInfoLog(int program, int maxLength) {
|
||||||
return GLES20.glGetProgramInfoLog(program);
|
return GLES20.glGetProgramInfoLog(program);
|
||||||
}
|
}
|
||||||
@ -303,51 +349,63 @@ public class AndroidGL implements GL, GL2, GLES_30, GLExt, GLFbo {
|
|||||||
return buff.get(0);
|
return buff.get(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glGetShader(int shader, int pname, IntBuffer params) {
|
public void glGetShader(int shader, int pname, IntBuffer params) {
|
||||||
checkLimit(params);
|
checkLimit(params);
|
||||||
GLES20.glGetShaderiv(shader, pname, params);
|
GLES20.glGetShaderiv(shader, pname, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String glGetShaderInfoLog(int shader, int maxLength) {
|
public String glGetShaderInfoLog(int shader, int maxLength) {
|
||||||
return GLES20.glGetShaderInfoLog(shader);
|
return GLES20.glGetShaderInfoLog(shader);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String glGetString(int name) {
|
public String glGetString(int name) {
|
||||||
return GLES20.glGetString(name);
|
return GLES20.glGetString(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int glGetUniformLocation(int program, String name) {
|
public int glGetUniformLocation(int program, String name) {
|
||||||
return GLES20.glGetUniformLocation(program, name);
|
return GLES20.glGetUniformLocation(program, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean glIsEnabled(int cap) {
|
public boolean glIsEnabled(int cap) {
|
||||||
return GLES20.glIsEnabled(cap);
|
return GLES20.glIsEnabled(cap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glLineWidth(float width) {
|
public void glLineWidth(float width) {
|
||||||
GLES20.glLineWidth(width);
|
GLES20.glLineWidth(width);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glLinkProgram(int program) {
|
public void glLinkProgram(int program) {
|
||||||
GLES20.glLinkProgram(program);
|
GLES20.glLinkProgram(program);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glPixelStorei(int pname, int param) {
|
public void glPixelStorei(int pname, int param) {
|
||||||
GLES20.glPixelStorei(pname, param);
|
GLES20.glPixelStorei(pname, param);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glPolygonOffset(float factor, float units) {
|
public void glPolygonOffset(float factor, float units) {
|
||||||
GLES20.glPolygonOffset(factor, units);
|
GLES20.glPolygonOffset(factor, units);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glReadPixels(int x, int y, int width, int height, int format, int type, ByteBuffer data) {
|
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);
|
GLES20.glReadPixels(x, y, width, height, format, type, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glScissor(int x, int y, int width, int height) {
|
public void glScissor(int x, int y, int width, int height) {
|
||||||
GLES20.glScissor(x, y, width, height);
|
GLES20.glScissor(x, y, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glShaderSource(int shader, String[] string, IntBuffer length) {
|
public void glShaderSource(int shader, String[] string, IntBuffer length) {
|
||||||
if (string.length != 1) {
|
if (string.length != 1) {
|
||||||
throw new UnsupportedOperationException("Today is not a good day");
|
throw new UnsupportedOperationException("Today is not a good day");
|
||||||
@ -355,186 +413,231 @@ public class AndroidGL implements GL, GL2, GLES_30, GLExt, GLFbo {
|
|||||||
GLES20.glShaderSource(shader, string[0]);
|
GLES20.glShaderSource(shader, string[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glStencilFuncSeparate(int face, int func, int ref, int mask) {
|
public void glStencilFuncSeparate(int face, int func, int ref, int mask) {
|
||||||
GLES20.glStencilFuncSeparate(face, func, ref, mask);
|
GLES20.glStencilFuncSeparate(face, func, ref, mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glStencilOpSeparate(int face, int sfail, int dpfail, int dppass) {
|
public void glStencilOpSeparate(int face, int sfail, int dpfail, int dppass) {
|
||||||
GLES20.glStencilOpSeparate(face, sfail, dpfail, 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) {
|
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);
|
GLES20.glTexImage2D(target, level, internalFormat, width, height, 0, format, type, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glTexParameterf(int target, int pname, float param) {
|
public void glTexParameterf(int target, int pname, float param) {
|
||||||
GLES20.glTexParameterf(target, pname, param);
|
GLES20.glTexParameterf(target, pname, param);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glTexParameteri(int target, int pname, int param) {
|
public void glTexParameteri(int target, int pname, int param) {
|
||||||
GLES20.glTexParameteri(target, pname, 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) {
|
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);
|
GLES20.glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glUniform1(int location, FloatBuffer value) {
|
public void glUniform1(int location, FloatBuffer value) {
|
||||||
GLES20.glUniform1fv(location, getLimitCount(value, 1), value);
|
GLES20.glUniform1fv(location, getLimitCount(value, 1), value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glUniform1(int location, IntBuffer value) {
|
public void glUniform1(int location, IntBuffer value) {
|
||||||
GLES20.glUniform1iv(location, getLimitCount(value, 1), value);
|
GLES20.glUniform1iv(location, getLimitCount(value, 1), value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glUniform1f(int location, float v0) {
|
public void glUniform1f(int location, float v0) {
|
||||||
GLES20.glUniform1f(location, v0);
|
GLES20.glUniform1f(location, v0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glUniform1i(int location, int v0) {
|
public void glUniform1i(int location, int v0) {
|
||||||
GLES20.glUniform1i(location, v0);
|
GLES20.glUniform1i(location, v0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glUniform2(int location, IntBuffer value) {
|
public void glUniform2(int location, IntBuffer value) {
|
||||||
GLES20.glUniform2iv(location, getLimitCount(value, 2), value);
|
GLES20.glUniform2iv(location, getLimitCount(value, 2), value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glUniform2(int location, FloatBuffer value) {
|
public void glUniform2(int location, FloatBuffer value) {
|
||||||
GLES20.glUniform2fv(location, getLimitCount(value, 2), value);
|
GLES20.glUniform2fv(location, getLimitCount(value, 2), value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glUniform2f(int location, float v0, float v1) {
|
public void glUniform2f(int location, float v0, float v1) {
|
||||||
GLES20.glUniform2f(location, v0, v1);
|
GLES20.glUniform2f(location, v0, v1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glUniform3(int location, IntBuffer value) {
|
public void glUniform3(int location, IntBuffer value) {
|
||||||
GLES20.glUniform3iv(location, getLimitCount(value, 3), value);
|
GLES20.glUniform3iv(location, getLimitCount(value, 3), value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glUniform3(int location, FloatBuffer value) {
|
public void glUniform3(int location, FloatBuffer value) {
|
||||||
GLES20.glUniform3fv(location, getLimitCount(value, 3), value);
|
GLES20.glUniform3fv(location, getLimitCount(value, 3), value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glUniform3f(int location, float v0, float v1, float v2) {
|
public void glUniform3f(int location, float v0, float v1, float v2) {
|
||||||
GLES20.glUniform3f(location, v0, v1, v2);
|
GLES20.glUniform3f(location, v0, v1, v2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glUniform4(int location, FloatBuffer value) {
|
public void glUniform4(int location, FloatBuffer value) {
|
||||||
GLES20.glUniform4fv(location, getLimitCount(value, 4), value);
|
GLES20.glUniform4fv(location, getLimitCount(value, 4), value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glUniform4(int location, IntBuffer value) {
|
public void glUniform4(int location, IntBuffer value) {
|
||||||
GLES20.glUniform4iv(location, getLimitCount(value, 4), value);
|
GLES20.glUniform4iv(location, getLimitCount(value, 4), value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glUniform4f(int location, float v0, float v1, float v2, float v3) {
|
public void glUniform4f(int location, float v0, float v1, float v2, float v3) {
|
||||||
GLES20.glUniform4f(location, v0, v1, v2, v3);
|
GLES20.glUniform4f(location, v0, v1, v2, v3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glUniformMatrix3(int location, boolean transpose, FloatBuffer value) {
|
public void glUniformMatrix3(int location, boolean transpose, FloatBuffer value) {
|
||||||
GLES20.glUniformMatrix3fv(location, getLimitCount(value, 3 * 3), transpose, value);
|
GLES20.glUniformMatrix3fv(location, getLimitCount(value, 3 * 3), transpose, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glUniformMatrix4(int location, boolean transpose, FloatBuffer value) {
|
public void glUniformMatrix4(int location, boolean transpose, FloatBuffer value) {
|
||||||
GLES20.glUniformMatrix4fv(location, getLimitCount(value, 4 * 4), transpose, value);
|
GLES20.glUniformMatrix4fv(location, getLimitCount(value, 4 * 4), transpose, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glUseProgram(int program) {
|
public void glUseProgram(int program) {
|
||||||
GLES20.glUseProgram(program);
|
GLES20.glUseProgram(program);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glVertexAttribPointer(int index, int size, int type, boolean normalized, int stride, long pointer) {
|
public void glVertexAttribPointer(int index, int size, int type, boolean normalized, int stride, long pointer) {
|
||||||
GLES20.glVertexAttribPointer(index, size, type, normalized, stride, (int)pointer);
|
GLES20.glVertexAttribPointer(index, size, type, normalized, stride, (int)pointer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glViewport(int x, int y, int width, int height) {
|
public void glViewport(int x, int y, int width, int height) {
|
||||||
GLES20.glViewport(x, y, width, 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) {
|
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);
|
GLES30.glBlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glBufferData(int target, IntBuffer data, int usage) {
|
public void glBufferData(int target, IntBuffer data, int usage) {
|
||||||
GLES20.glBufferData(target, getLimitBytes(data), data, usage);
|
GLES20.glBufferData(target, getLimitBytes(data), data, usage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glBufferSubData(int target, long offset, IntBuffer data) {
|
public void glBufferSubData(int target, long offset, IntBuffer data) {
|
||||||
GLES20.glBufferSubData(target, (int)offset, getLimitBytes(data), data);
|
GLES20.glBufferSubData(target, (int)offset, getLimitBytes(data), data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glDrawArraysInstancedARB(int mode, int first, int count, int primcount) {
|
public void glDrawArraysInstancedARB(int mode, int first, int count, int primcount) {
|
||||||
GLES30.glDrawArraysInstanced(mode, first, count, primcount);
|
GLES30.glDrawArraysInstanced(mode, first, count, primcount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glDrawBuffers(IntBuffer bufs) {
|
public void glDrawBuffers(IntBuffer bufs) {
|
||||||
GLES30.glDrawBuffers(bufs.limit(), bufs);
|
GLES30.glDrawBuffers(bufs.limit(), bufs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glDrawElementsInstancedARB(int mode, int indices_count, int type, long indices_buffer_offset, int primcount) {
|
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);
|
GLES30.glDrawElementsInstanced(mode, indices_count, type, (int)indices_buffer_offset, primcount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glGetMultisample(int pname, int index, FloatBuffer val) {
|
public void glGetMultisample(int pname, int index, FloatBuffer val) {
|
||||||
GLES31.glGetMultisamplefv(pname, index, val);
|
GLES31.glGetMultisamplefv(pname, index, val);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glRenderbufferStorageMultisampleEXT(int target, int samples, int internalformat, int width, int height) {
|
public void glRenderbufferStorageMultisampleEXT(int target, int samples, int internalformat, int width, int height) {
|
||||||
GLES30.glRenderbufferStorageMultisample(target, samples, internalformat, width, height);
|
GLES30.glRenderbufferStorageMultisample(target, samples, internalformat, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glTexImage2DMultisample(int target, int samples, int internalformat, int width, int height, boolean fixedsamplelocations) {
|
public void glTexImage2DMultisample(int target, int samples, int internalformat, int width, int height, boolean fixedsamplelocations) {
|
||||||
GLES31.glTexStorage2DMultisample(target, samples, internalformat, width, height, fixedsamplelocations);
|
GLES31.glTexStorage2DMultisample(target, samples, internalformat, width, height, fixedsamplelocations);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glVertexAttribDivisorARB(int index, int divisor) {
|
public void glVertexAttribDivisorARB(int index, int divisor) {
|
||||||
GLES30.glVertexAttribDivisor(index, divisor);
|
GLES30.glVertexAttribDivisor(index, divisor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glBindFramebufferEXT(int param1, int param2) {
|
public void glBindFramebufferEXT(int param1, int param2) {
|
||||||
GLES20.glBindFramebuffer(param1, param2);
|
GLES20.glBindFramebuffer(param1, param2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glBindRenderbufferEXT(int param1, int param2) {
|
public void glBindRenderbufferEXT(int param1, int param2) {
|
||||||
GLES20.glBindRenderbuffer(param1, param2);
|
GLES20.glBindRenderbuffer(param1, param2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int glCheckFramebufferStatusEXT(int param1) {
|
public int glCheckFramebufferStatusEXT(int param1) {
|
||||||
return GLES20.glCheckFramebufferStatus(param1);
|
return GLES20.glCheckFramebufferStatus(param1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glDeleteFramebuffersEXT(IntBuffer param1) {
|
public void glDeleteFramebuffersEXT(IntBuffer param1) {
|
||||||
checkLimit(param1);
|
checkLimit(param1);
|
||||||
GLES20.glDeleteFramebuffers(param1.limit(), param1);
|
GLES20.glDeleteFramebuffers(param1.limit(), param1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glDeleteRenderbuffersEXT(IntBuffer param1) {
|
public void glDeleteRenderbuffersEXT(IntBuffer param1) {
|
||||||
checkLimit(param1);
|
checkLimit(param1);
|
||||||
GLES20.glDeleteRenderbuffers(param1.limit(), param1);
|
GLES20.glDeleteRenderbuffers(param1.limit(), param1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glFramebufferRenderbufferEXT(int param1, int param2, int param3, int param4) {
|
public void glFramebufferRenderbufferEXT(int param1, int param2, int param3, int param4) {
|
||||||
GLES20.glFramebufferRenderbuffer(param1, param2, param3, param4);
|
GLES20.glFramebufferRenderbuffer(param1, param2, param3, param4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glFramebufferTexture2DEXT(int param1, int param2, int param3, int param4, int param5) {
|
public void glFramebufferTexture2DEXT(int param1, int param2, int param3, int param4, int param5) {
|
||||||
GLES20.glFramebufferTexture2D(param1, param2, param3, param4, param5);
|
GLES20.glFramebufferTexture2D(param1, param2, param3, param4, param5);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glGenFramebuffersEXT(IntBuffer param1) {
|
public void glGenFramebuffersEXT(IntBuffer param1) {
|
||||||
checkLimit(param1);
|
checkLimit(param1);
|
||||||
GLES20.glGenFramebuffers(param1.limit(), param1);
|
GLES20.glGenFramebuffers(param1.limit(), param1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glGenRenderbuffersEXT(IntBuffer param1) {
|
public void glGenRenderbuffersEXT(IntBuffer param1) {
|
||||||
checkLimit(param1);
|
checkLimit(param1);
|
||||||
GLES20.glGenRenderbuffers(param1.limit(), param1);
|
GLES20.glGenRenderbuffers(param1.limit(), param1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glGenerateMipmapEXT(int param1) {
|
public void glGenerateMipmapEXT(int param1) {
|
||||||
GLES20.glGenerateMipmap(param1);
|
GLES20.glGenerateMipmap(param1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glRenderbufferStorageEXT(int param1, int param2, int param3, int param4) {
|
public void glRenderbufferStorageEXT(int param1, int param2, int param3, int param4) {
|
||||||
GLES20.glRenderbufferStorage(param1, param2, param3, param4);
|
GLES20.glRenderbufferStorage(param1, param2, param3, param4);
|
||||||
}
|
}
|
||||||
@ -570,16 +673,20 @@ public class AndroidGL implements GL, GL2, GLES_30, GLExt, GLFbo {
|
|||||||
GLES30.glFramebufferTextureLayer(target, attachment, texture, level, layer);
|
GLES30.glFramebufferTextureLayer(target, attachment, texture, level, layer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glAlphaFunc(int func, float ref) {
|
public void glAlphaFunc(int func, float ref) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glPointSize(float size) {
|
public void glPointSize(float size) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glPolygonMode(int face, int mode) {
|
public void glPolygonMode(int face, int mode) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Wrapper to DrawBuffers as there's no DrawBuffer method in GLES
|
// Wrapper to DrawBuffers as there's no DrawBuffer method in GLES
|
||||||
|
@Override
|
||||||
public void glDrawBuffer(int mode) {
|
public void glDrawBuffer(int mode) {
|
||||||
tmpBuff.clear();
|
tmpBuff.clear();
|
||||||
tmpBuff.put(0, mode);
|
tmpBuff.put(0, mode);
|
||||||
@ -587,25 +694,30 @@ public class AndroidGL implements GL, GL2, GLES_30, GLExt, GLFbo {
|
|||||||
glDrawBuffers(tmpBuff);
|
glDrawBuffers(tmpBuff);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glReadBuffer(int mode) {
|
public void glReadBuffer(int mode) {
|
||||||
GLES30.glReadBuffer(mode);
|
GLES30.glReadBuffer(mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void glCompressedTexImage3D(int target, int level, int internalFormat, int width, int height, int depth,
|
public void glCompressedTexImage3D(int target, int level, int internalFormat, int width, int height, int depth,
|
||||||
int border, ByteBuffer data) {
|
int border, ByteBuffer data) {
|
||||||
GLES30.glCompressedTexImage3D(target, level, internalFormat, width, height, depth, border, getLimitBytes(data), 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,
|
public void glCompressedTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width,
|
||||||
int height, int depth, int format, ByteBuffer data) {
|
int height, int depth, int format, ByteBuffer data) {
|
||||||
GLES30.glCompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, getLimitBytes(data), 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,
|
public void glTexImage3D(int target, int level, int internalFormat, int width, int height, int depth, int border,
|
||||||
int format, int type, ByteBuffer data) {
|
int format, int type, ByteBuffer data) {
|
||||||
GLES30.glTexImage3D(target, level, internalFormat, width, height, depth, border, format, type, 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,
|
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) {
|
int depth, int format, int type, ByteBuffer data) {
|
||||||
GLES30.glTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, data);
|
GLES30.glTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, data);
|
||||||
|
@ -204,6 +204,7 @@ public class JmeAndroidSystem extends JmeSystemDelegate {
|
|||||||
public void showSoftKeyboard(final boolean show) {
|
public void showSoftKeyboard(final boolean show) {
|
||||||
view.getHandler().post(new Runnable() {
|
view.getHandler().post(new Runnable() {
|
||||||
|
|
||||||
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
InputMethodManager manager =
|
InputMethodManager manager =
|
||||||
(InputMethodManager)view.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
|
(InputMethodManager)view.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2018 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -202,6 +202,7 @@ public class OGLESContext implements JmeContext, GLSurfaceView.Renderer, SoftTex
|
|||||||
|
|
||||||
// Setup unhandled Exception Handler
|
// Setup unhandled Exception Handler
|
||||||
Thread.currentThread().setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
|
Thread.currentThread().setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
|
||||||
|
@Override
|
||||||
public void uncaughtException(Thread thread, Throwable thrown) {
|
public void uncaughtException(Thread thread, Throwable thrown) {
|
||||||
listener.handleError("Exception thrown in " + thread.toString(), thrown);
|
listener.handleError("Exception thrown in " + thread.toString(), thrown);
|
||||||
}
|
}
|
||||||
@ -414,6 +415,7 @@ public class OGLESContext implements JmeContext, GLSurfaceView.Renderer, SoftTex
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void requestDialog(final int id, final String title, final String initialValue, final SoftTextDialogInputListener listener) {
|
public void requestDialog(final int id, final String title, final String initialValue, final SoftTextDialogInputListener listener) {
|
||||||
logger.log(Level.FINE, "requestDialog: title: {0}, initialValue: {1}",
|
logger.log(Level.FINE, "requestDialog: title: {0}, initialValue: {1}",
|
||||||
new Object[]{title, initialValue});
|
new Object[]{title, initialValue});
|
||||||
@ -457,6 +459,7 @@ public class OGLESContext implements JmeContext, GLSurfaceView.Renderer, SoftTex
|
|||||||
|
|
||||||
AlertDialog dialogTextInput = new AlertDialog.Builder(view.getContext()).setTitle(title).setView(layoutTextDialogInput).setPositiveButton("OK",
|
AlertDialog dialogTextInput = new AlertDialog.Builder(view.getContext()).setTitle(title).setView(layoutTextDialogInput).setPositiveButton("OK",
|
||||||
new DialogInterface.OnClickListener() {
|
new DialogInterface.OnClickListener() {
|
||||||
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int whichButton) {
|
public void onClick(DialogInterface dialog, int whichButton) {
|
||||||
/* User clicked OK, send COMPLETE action
|
/* User clicked OK, send COMPLETE action
|
||||||
* and text */
|
* and text */
|
||||||
@ -464,6 +467,7 @@ public class OGLESContext implements JmeContext, GLSurfaceView.Renderer, SoftTex
|
|||||||
}
|
}
|
||||||
}).setNegativeButton("Cancel",
|
}).setNegativeButton("Cancel",
|
||||||
new DialogInterface.OnClickListener() {
|
new DialogInterface.OnClickListener() {
|
||||||
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int whichButton) {
|
public void onClick(DialogInterface dialog, int whichButton) {
|
||||||
/* User clicked CANCEL, send CANCEL action
|
/* User clicked CANCEL, send CANCEL action
|
||||||
* and text */
|
* and text */
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2014 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -67,6 +67,7 @@ public class AndroidBufferImageLoader implements AssetLoader {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object load(AssetInfo assetInfo) throws IOException {
|
public Object load(AssetInfo assetInfo) throws IOException {
|
||||||
Bitmap bitmap = null;
|
Bitmap bitmap = null;
|
||||||
Image.Format format;
|
Image.Format format;
|
||||||
|
@ -25,6 +25,7 @@ public class AndroidNativeImageLoader implements AssetLoader {
|
|||||||
|
|
||||||
private static native Image load(InputStream in, boolean flipY, byte[] tmpArray) throws IOException;
|
private static native Image load(InputStream in, boolean flipY, byte[] tmpArray) throws IOException;
|
||||||
|
|
||||||
|
@Override
|
||||||
public Image load(AssetInfo info) throws IOException {
|
public Image load(AssetInfo info) throws IOException {
|
||||||
boolean flip = ((TextureKey) info.getKey()).isFlipY();
|
boolean flip = ((TextureKey) info.getKey()).isFlipY();
|
||||||
InputStream in = null;
|
InputStream in = null;
|
||||||
|
@ -49,6 +49,7 @@ public class RingBuffer<T> implements Iterable<T> {
|
|||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Iterator<T> iterator() {
|
public Iterator<T> iterator() {
|
||||||
return new RingBufferIterator();
|
return new RingBufferIterator();
|
||||||
}
|
}
|
||||||
@ -58,14 +59,17 @@ public class RingBuffer<T> implements Iterable<T> {
|
|||||||
|
|
||||||
private int i = 0;
|
private int i = 0;
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean hasNext() {
|
public boolean hasNext() {
|
||||||
return i < count;
|
return i < count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void remove() {
|
public void remove() {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public T next() {
|
public T next() {
|
||||||
if (!hasNext()) {
|
if (!hasNext()) {
|
||||||
throw new NoSuchElementException();
|
throw new NoSuchElementException();
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2012 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -100,9 +100,11 @@ public class MaterialHelper extends AbstractBlenderHelper {
|
|||||||
super(blenderVersion, blenderContext);
|
super(blenderVersion, blenderContext);
|
||||||
// setting alpha masks
|
// setting alpha masks
|
||||||
alphaMasks.put(ALPHA_MASK_NONE, new IAlphaMask() {
|
alphaMasks.put(ALPHA_MASK_NONE, new IAlphaMask() {
|
||||||
|
@Override
|
||||||
public void setImageSize(int width, int height) {
|
public void setImageSize(int width, int height) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public byte getAlpha(float x, float y) {
|
public byte getAlpha(float x, float y) {
|
||||||
return (byte) 255;
|
return (byte) 255;
|
||||||
}
|
}
|
||||||
@ -111,11 +113,13 @@ public class MaterialHelper extends AbstractBlenderHelper {
|
|||||||
private float r;
|
private float r;
|
||||||
private float[] center;
|
private float[] center;
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setImageSize(int width, int height) {
|
public void setImageSize(int width, int height) {
|
||||||
r = Math.min(width, height) * 0.5f;
|
r = Math.min(width, height) * 0.5f;
|
||||||
center = new float[] { width * 0.5f, height * 0.5f };
|
center = new float[] { width * 0.5f, height * 0.5f };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public byte getAlpha(float x, float y) {
|
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])));
|
float d = FastMath.abs(FastMath.sqrt((x - center[0]) * (x - center[0]) + (y - center[1]) * (y - center[1])));
|
||||||
return (byte) (d >= r ? 0 : 255);
|
return (byte) (d >= r ? 0 : 255);
|
||||||
@ -125,11 +129,13 @@ public class MaterialHelper extends AbstractBlenderHelper {
|
|||||||
private float r;
|
private float r;
|
||||||
private float[] center;
|
private float[] center;
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setImageSize(int width, int height) {
|
public void setImageSize(int width, int height) {
|
||||||
r = Math.min(width, height) * 0.5f;
|
r = Math.min(width, height) * 0.5f;
|
||||||
center = new float[] { width * 0.5f, height * 0.5f };
|
center = new float[] { width * 0.5f, height * 0.5f };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public byte getAlpha(float x, float y) {
|
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])));
|
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);
|
return (byte) (d >= r ? 0 : -255.0f * d / r + 255.0f);
|
||||||
@ -139,11 +145,13 @@ public class MaterialHelper extends AbstractBlenderHelper {
|
|||||||
private float r;
|
private float r;
|
||||||
private float[] center;
|
private float[] center;
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setImageSize(int width, int height) {
|
public void setImageSize(int width, int height) {
|
||||||
r = Math.min(width, height) * 0.5f;
|
r = Math.min(width, height) * 0.5f;
|
||||||
center = new float[] { width * 0.5f, height * 0.5f };
|
center = new float[] { width * 0.5f, height * 0.5f };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public byte getAlpha(float x, float y) {
|
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;
|
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);
|
return d >= 1.0f ? 0 : (byte) ((-FastMath.sqrt((2.0f - d) * d) + 1.0f) * 255.0f);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2012 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -554,6 +554,7 @@ public final class DQuaternion implements Savable, Cloneable, java.io.Serializab
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JmeExporter e) throws IOException {
|
public void write(JmeExporter e) throws IOException {
|
||||||
OutputCapsule cap = e.getCapsule(this);
|
OutputCapsule cap = e.getCapsule(this);
|
||||||
cap.write(x, "x", 0);
|
cap.write(x, "x", 0);
|
||||||
@ -562,6 +563,7 @@ public final class DQuaternion implements Savable, Cloneable, java.io.Serializab
|
|||||||
cap.write(w, "w", 1);
|
cap.write(w, "w", 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void read(JmeImporter e) throws IOException {
|
public void read(JmeImporter e) throws IOException {
|
||||||
InputCapsule cap = e.getCapsule(this);
|
InputCapsule cap = e.getCapsule(this);
|
||||||
x = cap.readFloat("x", 0);
|
x = cap.readFloat("x", 0);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2012 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -158,6 +158,7 @@ public final class DTransform implements Savable, Cloneable, java.io.Serializabl
|
|||||||
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 + "]";
|
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 {
|
public void write(JmeExporter e) throws IOException {
|
||||||
OutputCapsule capsule = e.getCapsule(this);
|
OutputCapsule capsule = e.getCapsule(this);
|
||||||
capsule.write(rotation, "rot", new DQuaternion());
|
capsule.write(rotation, "rot", new DQuaternion());
|
||||||
@ -165,6 +166,7 @@ public final class DTransform implements Savable, Cloneable, java.io.Serializabl
|
|||||||
capsule.write(scale, "scale", Vector3d.UNIT_XYZ);
|
capsule.write(scale, "scale", Vector3d.UNIT_XYZ);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void read(JmeImporter e) throws IOException {
|
public void read(JmeImporter e) throws IOException {
|
||||||
InputCapsule capsule = e.getCapsule(this);
|
InputCapsule capsule = e.getCapsule(this);
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2019 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -851,6 +851,7 @@ public final class Vector3d implements Savable, Cloneable, Serializable {
|
|||||||
return "(" + x + ", " + y + ", " + z + ")";
|
return "(" + x + ", " + y + ", " + z + ")";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JmeExporter e) throws IOException {
|
public void write(JmeExporter e) throws IOException {
|
||||||
OutputCapsule capsule = e.getCapsule(this);
|
OutputCapsule capsule = e.getCapsule(this);
|
||||||
capsule.write(x, "x", 0);
|
capsule.write(x, "x", 0);
|
||||||
@ -858,6 +859,7 @@ public final class Vector3d implements Savable, Cloneable, Serializable {
|
|||||||
capsule.write(z, "z", 0);
|
capsule.write(z, "z", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void read(JmeImporter e) throws IOException {
|
public void read(JmeImporter e) throws IOException {
|
||||||
InputCapsule capsule = e.getCapsule(this);
|
InputCapsule capsule = e.getCapsule(this);
|
||||||
x = capsule.readDouble("x", 0);
|
x = capsule.readDouble("x", 0);
|
||||||
|
@ -160,6 +160,7 @@ import com.jme3.util.TempVars;
|
|||||||
Vector3f[] uvsArray = uvs.toArray(new Vector3f[uvs.size()]);
|
Vector3f[] uvsArray = uvs.toArray(new Vector3f[uvs.size()]);
|
||||||
BoundingBox boundingBox = UVCoordinatesGenerator.getBoundingBox(geometries);
|
BoundingBox boundingBox = UVCoordinatesGenerator.getBoundingBox(geometries);
|
||||||
Set<TriangleTextureElement> triangleTextureElements = new TreeSet<TriangleTextureElement>(new Comparator<TriangleTextureElement>() {
|
Set<TriangleTextureElement> triangleTextureElements = new TreeSet<TriangleTextureElement>(new Comparator<TriangleTextureElement>() {
|
||||||
|
@Override
|
||||||
public int compare(TriangleTextureElement o1, TriangleTextureElement o2) {
|
public int compare(TriangleTextureElement o1, TriangleTextureElement o2) {
|
||||||
return o1.faceIndex - o2.faceIndex;
|
return o1.faceIndex - o2.faceIndex;
|
||||||
}
|
}
|
||||||
|
@ -70,6 +70,7 @@ import com.jme3.util.BufferUtils;
|
|||||||
public TriangulatedTexture(Texture2D texture2d, List<Vector2f> uvs, BlenderContext blenderContext) {
|
public TriangulatedTexture(Texture2D texture2d, List<Vector2f> uvs, BlenderContext blenderContext) {
|
||||||
maxTextureSize = blenderContext.getBlenderKey().getMaxTextureSize();
|
maxTextureSize = blenderContext.getBlenderKey().getMaxTextureSize();
|
||||||
faceTextures = new TreeSet<TriangleTextureElement>(new Comparator<TriangleTextureElement>() {
|
faceTextures = new TreeSet<TriangleTextureElement>(new Comparator<TriangleTextureElement>() {
|
||||||
|
@Override
|
||||||
public int compare(TriangleTextureElement o1, TriangleTextureElement o2) {
|
public int compare(TriangleTextureElement o1, TriangleTextureElement o2) {
|
||||||
return o1.faceIndex - o2.faceIndex;
|
return o1.faceIndex - o2.faceIndex;
|
||||||
}
|
}
|
||||||
@ -184,6 +185,7 @@ import com.jme3.util.BufferUtils;
|
|||||||
// sorting the parts by their height (from highest to the lowest)
|
// sorting the parts by their height (from highest to the lowest)
|
||||||
List<TriangleTextureElement> list = new ArrayList<TriangleTextureElement>(faceTextures);
|
List<TriangleTextureElement> list = new ArrayList<TriangleTextureElement>(faceTextures);
|
||||||
Collections.sort(list, new Comparator<TriangleTextureElement>() {
|
Collections.sort(list, new Comparator<TriangleTextureElement>() {
|
||||||
|
@Override
|
||||||
public int compare(TriangleTextureElement o1, TriangleTextureElement o2) {
|
public int compare(TriangleTextureElement o1, TriangleTextureElement o2) {
|
||||||
return o2.image.getHeight() - o1.image.getHeight();
|
return o2.image.getHeight() - o1.image.getHeight();
|
||||||
}
|
}
|
||||||
|
@ -103,6 +103,7 @@ import com.jme3.texture.Image;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void copyBlendingData(TextureBlender textureBlender) {
|
public void copyBlendingData(TextureBlender textureBlender) {
|
||||||
if (textureBlender instanceof AbstractTextureBlender) {
|
if (textureBlender instanceof AbstractTextureBlender) {
|
||||||
flag = ((AbstractTextureBlender) textureBlender).flag;
|
flag = ((AbstractTextureBlender) textureBlender).flag;
|
||||||
|
@ -43,6 +43,7 @@ public class TextureBlenderLuminance extends AbstractTextureBlender {
|
|||||||
super(flag, negateTexture, blendType, materialColor, color, blendFactor);
|
super(flag, negateTexture, blendType, materialColor, color, blendFactor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Image blend(Image image, Image baseImage, BlenderContext blenderContext) {
|
public Image blend(Image image, Image baseImage, BlenderContext blenderContext) {
|
||||||
this.prepareImagesForBlending(image, baseImage);
|
this.prepareImagesForBlending(image, baseImage);
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2012 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -109,30 +109,36 @@ import com.jme3.scene.plugins.blender.textures.generating.TextureGeneratorMusgra
|
|||||||
static {
|
static {
|
||||||
noiseFunctions.put(Integer.valueOf(0), new NoiseFunction() {
|
noiseFunctions.put(Integer.valueOf(0), new NoiseFunction() {
|
||||||
// originalBlenderNoise
|
// originalBlenderNoise
|
||||||
|
@Override
|
||||||
public float execute(float x, float y, float z) {
|
public float execute(float x, float y, float z) {
|
||||||
return NoiseFunctions.originalBlenderNoise(x, y, z);
|
return NoiseFunctions.originalBlenderNoise(x, y, z);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public float executeSigned(float x, float y, float z) {
|
public float executeSigned(float x, float y, float z) {
|
||||||
return 2.0f * NoiseFunctions.originalBlenderNoise(x, y, z) - 1.0f;
|
return 2.0f * NoiseFunctions.originalBlenderNoise(x, y, z) - 1.0f;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
noiseFunctions.put(Integer.valueOf(1), new NoiseFunction() {
|
noiseFunctions.put(Integer.valueOf(1), new NoiseFunction() {
|
||||||
// orgPerlinNoise
|
// orgPerlinNoise
|
||||||
|
@Override
|
||||||
public float execute(float x, float y, float z) {
|
public float execute(float x, float y, float z) {
|
||||||
return 0.5f + 0.5f * NoiseFunctions.noise3Perlin(x, y, z);
|
return 0.5f + 0.5f * NoiseFunctions.noise3Perlin(x, y, z);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public float executeSigned(float x, float y, float z) {
|
public float executeSigned(float x, float y, float z) {
|
||||||
return NoiseFunctions.noise3Perlin(x, y, z);
|
return NoiseFunctions.noise3Perlin(x, y, z);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
noiseFunctions.put(Integer.valueOf(2), new NoiseFunction() {
|
noiseFunctions.put(Integer.valueOf(2), new NoiseFunction() {
|
||||||
// newPerlin
|
// newPerlin
|
||||||
|
@Override
|
||||||
public float execute(float x, float y, float z) {
|
public float execute(float x, float y, float z) {
|
||||||
return 0.5f + 0.5f * NoiseFunctions.newPerlin(x, y, z);
|
return 0.5f + 0.5f * NoiseFunctions.newPerlin(x, y, z);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public float executeSigned(float x, float y, float z) {
|
public float executeSigned(float x, float y, float z) {
|
||||||
return this.execute(x, y, z);
|
return this.execute(x, y, z);
|
||||||
}
|
}
|
||||||
@ -142,11 +148,13 @@ import com.jme3.scene.plugins.blender.textures.generating.TextureGeneratorMusgra
|
|||||||
private final float[] pa = new float[12];
|
private final float[] pa = new float[12];
|
||||||
|
|
||||||
// voronoi_F1
|
// voronoi_F1
|
||||||
|
@Override
|
||||||
public float execute(float x, float y, float z) {
|
public float execute(float x, float y, float z) {
|
||||||
NoiseFunctions.voronoi(x, y, z, da, pa, 1, NATURAL_DISTANCE_FUNCTION);
|
NoiseFunctions.voronoi(x, y, z, da, pa, 1, NATURAL_DISTANCE_FUNCTION);
|
||||||
return da[0];
|
return da[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public float executeSigned(float x, float y, float z) {
|
public float executeSigned(float x, float y, float z) {
|
||||||
NoiseFunctions.voronoi(x, y, z, da, pa, 1, NATURAL_DISTANCE_FUNCTION);
|
NoiseFunctions.voronoi(x, y, z, da, pa, 1, NATURAL_DISTANCE_FUNCTION);
|
||||||
return 2.0f * da[0] - 1.0f;
|
return 2.0f * da[0] - 1.0f;
|
||||||
@ -157,11 +165,13 @@ import com.jme3.scene.plugins.blender.textures.generating.TextureGeneratorMusgra
|
|||||||
private final float[] pa = new float[12];
|
private final float[] pa = new float[12];
|
||||||
|
|
||||||
// voronoi_F2
|
// voronoi_F2
|
||||||
|
@Override
|
||||||
public float execute(float x, float y, float z) {
|
public float execute(float x, float y, float z) {
|
||||||
NoiseFunctions.voronoi(x, y, z, da, pa, 1, NATURAL_DISTANCE_FUNCTION);
|
NoiseFunctions.voronoi(x, y, z, da, pa, 1, NATURAL_DISTANCE_FUNCTION);
|
||||||
return da[1];
|
return da[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public float executeSigned(float x, float y, float z) {
|
public float executeSigned(float x, float y, float z) {
|
||||||
NoiseFunctions.voronoi(x, y, z, da, pa, 1, NATURAL_DISTANCE_FUNCTION);
|
NoiseFunctions.voronoi(x, y, z, da, pa, 1, NATURAL_DISTANCE_FUNCTION);
|
||||||
return 2.0f * da[1] - 1.0f;
|
return 2.0f * da[1] - 1.0f;
|
||||||
@ -172,11 +182,13 @@ import com.jme3.scene.plugins.blender.textures.generating.TextureGeneratorMusgra
|
|||||||
private final float[] pa = new float[12];
|
private final float[] pa = new float[12];
|
||||||
|
|
||||||
// voronoi_F3
|
// voronoi_F3
|
||||||
|
@Override
|
||||||
public float execute(float x, float y, float z) {
|
public float execute(float x, float y, float z) {
|
||||||
NoiseFunctions.voronoi(x, y, z, da, pa, 1, NATURAL_DISTANCE_FUNCTION);
|
NoiseFunctions.voronoi(x, y, z, da, pa, 1, NATURAL_DISTANCE_FUNCTION);
|
||||||
return da[2];
|
return da[2];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public float executeSigned(float x, float y, float z) {
|
public float executeSigned(float x, float y, float z) {
|
||||||
NoiseFunctions.voronoi(x, y, z, da, pa, 1, NATURAL_DISTANCE_FUNCTION);
|
NoiseFunctions.voronoi(x, y, z, da, pa, 1, NATURAL_DISTANCE_FUNCTION);
|
||||||
return 2.0f * da[2] - 1.0f;
|
return 2.0f * da[2] - 1.0f;
|
||||||
@ -187,11 +199,13 @@ import com.jme3.scene.plugins.blender.textures.generating.TextureGeneratorMusgra
|
|||||||
private final float[] pa = new float[12];
|
private final float[] pa = new float[12];
|
||||||
|
|
||||||
// voronoi_F4
|
// voronoi_F4
|
||||||
|
@Override
|
||||||
public float execute(float x, float y, float z) {
|
public float execute(float x, float y, float z) {
|
||||||
NoiseFunctions.voronoi(x, y, z, da, pa, 1, NATURAL_DISTANCE_FUNCTION);
|
NoiseFunctions.voronoi(x, y, z, da, pa, 1, NATURAL_DISTANCE_FUNCTION);
|
||||||
return da[3];
|
return da[3];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public float executeSigned(float x, float y, float z) {
|
public float executeSigned(float x, float y, float z) {
|
||||||
NoiseFunctions.voronoi(x, y, z, da, pa, 1, NATURAL_DISTANCE_FUNCTION);
|
NoiseFunctions.voronoi(x, y, z, da, pa, 1, NATURAL_DISTANCE_FUNCTION);
|
||||||
return 2.0f * da[3] - 1.0f;
|
return 2.0f * da[3] - 1.0f;
|
||||||
@ -202,11 +216,13 @@ import com.jme3.scene.plugins.blender.textures.generating.TextureGeneratorMusgra
|
|||||||
private final float[] pa = new float[12];
|
private final float[] pa = new float[12];
|
||||||
|
|
||||||
// voronoi_F1F2
|
// voronoi_F1F2
|
||||||
|
@Override
|
||||||
public float execute(float x, float y, float z) {
|
public float execute(float x, float y, float z) {
|
||||||
NoiseFunctions.voronoi(x, y, z, da, pa, 1, NATURAL_DISTANCE_FUNCTION);
|
NoiseFunctions.voronoi(x, y, z, da, pa, 1, NATURAL_DISTANCE_FUNCTION);
|
||||||
return da[1] - da[0];
|
return da[1] - da[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public float executeSigned(float x, float y, float z) {
|
public float executeSigned(float x, float y, float z) {
|
||||||
NoiseFunctions.voronoi(x, y, z, da, pa, 1, NATURAL_DISTANCE_FUNCTION);
|
NoiseFunctions.voronoi(x, y, z, da, pa, 1, NATURAL_DISTANCE_FUNCTION);
|
||||||
return 2.0f * (da[1] - da[0]) - 1.0f;
|
return 2.0f * (da[1] - da[0]) - 1.0f;
|
||||||
@ -216,11 +232,13 @@ import com.jme3.scene.plugins.blender.textures.generating.TextureGeneratorMusgra
|
|||||||
private final NoiseFunction voronoiF1F2NoiseFunction = noiseFunctions.get(Integer.valueOf(7));
|
private final NoiseFunction voronoiF1F2NoiseFunction = noiseFunctions.get(Integer.valueOf(7));
|
||||||
|
|
||||||
// voronoi_Cr
|
// voronoi_Cr
|
||||||
|
@Override
|
||||||
public float execute(float x, float y, float z) {
|
public float execute(float x, float y, float z) {
|
||||||
float t = 10 * voronoiF1F2NoiseFunction.execute(x, y, z);
|
float t = 10 * voronoiF1F2NoiseFunction.execute(x, y, z);
|
||||||
return t > 1.0f ? 1.0f : t;
|
return t > 1.0f ? 1.0f : t;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public float executeSigned(float x, float y, float z) {
|
public float executeSigned(float x, float y, float z) {
|
||||||
float t = 10.0f * voronoiF1F2NoiseFunction.execute(x, y, z);
|
float t = 10.0f * voronoiF1F2NoiseFunction.execute(x, y, z);
|
||||||
return t > 1.0f ? 1.0f : 2.0f * t - 1.0f;
|
return t > 1.0f ? 1.0f : 2.0f * t - 1.0f;
|
||||||
@ -228,6 +246,7 @@ import com.jme3.scene.plugins.blender.textures.generating.TextureGeneratorMusgra
|
|||||||
});
|
});
|
||||||
noiseFunctions.put(Integer.valueOf(14), new NoiseFunction() {
|
noiseFunctions.put(Integer.valueOf(14), new NoiseFunction() {
|
||||||
// cellNoise
|
// cellNoise
|
||||||
|
@Override
|
||||||
public float execute(float x, float y, float z) {
|
public float execute(float x, float y, float z) {
|
||||||
int xi = (int) FastMath.floor(x);
|
int xi = (int) FastMath.floor(x);
|
||||||
int yi = (int) FastMath.floor(y);
|
int yi = (int) FastMath.floor(y);
|
||||||
@ -237,6 +256,7 @@ import com.jme3.scene.plugins.blender.textures.generating.TextureGeneratorMusgra
|
|||||||
return (n * (n * n * 15731 + 789221) + 1376312589) / 4294967296.0f;
|
return (n * (n * n * 15731 + 789221) + 1376312589) / 4294967296.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public float executeSigned(float x, float y, float z) {
|
public float executeSigned(float x, float y, float z) {
|
||||||
return 2.0f * this.execute(x, y, z) - 1.0f;
|
return 2.0f * this.execute(x, y, z) - 1.0f;
|
||||||
}
|
}
|
||||||
@ -248,24 +268,28 @@ import com.jme3.scene.plugins.blender.textures.generating.TextureGeneratorMusgra
|
|||||||
static {
|
static {
|
||||||
distanceFunctions.put(Integer.valueOf(0), new DistanceFunction() {
|
distanceFunctions.put(Integer.valueOf(0), new DistanceFunction() {
|
||||||
// real distance
|
// real distance
|
||||||
|
@Override
|
||||||
public float execute(float x, float y, float z, float e) {
|
public float execute(float x, float y, float z, float e) {
|
||||||
return (float) Math.sqrt(x * x + y * y + z * z);
|
return (float) Math.sqrt(x * x + y * y + z * z);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
distanceFunctions.put(Integer.valueOf(1), new DistanceFunction() {
|
distanceFunctions.put(Integer.valueOf(1), new DistanceFunction() {
|
||||||
// distance squared
|
// distance squared
|
||||||
|
@Override
|
||||||
public float execute(float x, float y, float z, float e) {
|
public float execute(float x, float y, float z, float e) {
|
||||||
return x * x + y * y + z * z;
|
return x * x + y * y + z * z;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
distanceFunctions.put(Integer.valueOf(2), new DistanceFunction() {
|
distanceFunctions.put(Integer.valueOf(2), new DistanceFunction() {
|
||||||
// manhattan/taxicab/cityblock distance
|
// manhattan/taxicab/cityblock distance
|
||||||
|
@Override
|
||||||
public float execute(float x, float y, float z, float e) {
|
public float execute(float x, float y, float z, float e) {
|
||||||
return FastMath.abs(x) + FastMath.abs(y) + FastMath.abs(z);
|
return FastMath.abs(x) + FastMath.abs(y) + FastMath.abs(z);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
distanceFunctions.put(Integer.valueOf(3), new DistanceFunction() {
|
distanceFunctions.put(Integer.valueOf(3), new DistanceFunction() {
|
||||||
// Chebychev
|
// Chebychev
|
||||||
|
@Override
|
||||||
public float execute(float x, float y, float z, float e) {
|
public float execute(float x, float y, float z, float e) {
|
||||||
x = FastMath.abs(x);
|
x = FastMath.abs(x);
|
||||||
y = FastMath.abs(y);
|
y = FastMath.abs(y);
|
||||||
@ -276,6 +300,7 @@ import com.jme3.scene.plugins.blender.textures.generating.TextureGeneratorMusgra
|
|||||||
});
|
});
|
||||||
distanceFunctions.put(Integer.valueOf(4), new DistanceFunction() {
|
distanceFunctions.put(Integer.valueOf(4), new DistanceFunction() {
|
||||||
// Minkovsky, preset exponent 0.5 (MinkovskyH)
|
// Minkovsky, preset exponent 0.5 (MinkovskyH)
|
||||||
|
@Override
|
||||||
public float execute(float x, float y, float z, float e) {
|
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)));
|
float d = (float) (Math.sqrt(FastMath.abs(x)) + Math.sqrt(FastMath.abs(y)) + Math.sqrt(FastMath.abs(z)));
|
||||||
return d * d;
|
return d * d;
|
||||||
@ -283,6 +308,7 @@ import com.jme3.scene.plugins.blender.textures.generating.TextureGeneratorMusgra
|
|||||||
});
|
});
|
||||||
distanceFunctions.put(Integer.valueOf(5), new DistanceFunction() {
|
distanceFunctions.put(Integer.valueOf(5), new DistanceFunction() {
|
||||||
// Minkovsky, preset exponent 0.25 (Minkovsky4)
|
// Minkovsky, preset exponent 0.25 (Minkovsky4)
|
||||||
|
@Override
|
||||||
public float execute(float x, float y, float z, float e) {
|
public float execute(float x, float y, float z, float e) {
|
||||||
x *= x;
|
x *= x;
|
||||||
y *= y;
|
y *= y;
|
||||||
@ -292,6 +318,7 @@ import com.jme3.scene.plugins.blender.textures.generating.TextureGeneratorMusgra
|
|||||||
});
|
});
|
||||||
distanceFunctions.put(Integer.valueOf(6), new DistanceFunction() {
|
distanceFunctions.put(Integer.valueOf(6), new DistanceFunction() {
|
||||||
// Minkovsky, general case
|
// Minkovsky, general case
|
||||||
|
@Override
|
||||||
public float execute(float x, float y, float z, float e) {
|
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);
|
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 @@ import com.jme3.scene.plugins.blender.textures.generating.TextureGeneratorMusgra
|
|||||||
static {
|
static {
|
||||||
musgraveFunctions.put(Integer.valueOf(TEX_MFRACTAL), new MusgraveFunction() {
|
musgraveFunctions.put(Integer.valueOf(TEX_MFRACTAL), new MusgraveFunction() {
|
||||||
|
|
||||||
|
@Override
|
||||||
public float execute(MusgraveData musgraveData, float x, float y, float z) {
|
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);
|
float rmd, value = 1.0f, pwr = 1.0f, pwHL = (float) Math.pow(musgraveData.lacunarity, -musgraveData.h);
|
||||||
|
|
||||||
@ -322,6 +350,7 @@ import com.jme3.scene.plugins.blender.textures.generating.TextureGeneratorMusgra
|
|||||||
});
|
});
|
||||||
musgraveFunctions.put(Integer.valueOf(TEX_RIDGEDMF), new MusgraveFunction() {
|
musgraveFunctions.put(Integer.valueOf(TEX_RIDGEDMF), new MusgraveFunction() {
|
||||||
|
|
||||||
|
@Override
|
||||||
public float execute(MusgraveData musgraveData, float x, float y, float z) {
|
public float execute(MusgraveData musgraveData, float x, float y, float z) {
|
||||||
float result, signal, weight;
|
float result, signal, weight;
|
||||||
float pwHL = (float) Math.pow(musgraveData.lacunarity, -musgraveData.h);
|
float pwHL = (float) Math.pow(musgraveData.lacunarity, -musgraveData.h);
|
||||||
@ -353,6 +382,7 @@ import com.jme3.scene.plugins.blender.textures.generating.TextureGeneratorMusgra
|
|||||||
});
|
});
|
||||||
musgraveFunctions.put(Integer.valueOf(TEX_HYBRIDMF), new MusgraveFunction() {
|
musgraveFunctions.put(Integer.valueOf(TEX_HYBRIDMF), new MusgraveFunction() {
|
||||||
|
|
||||||
|
@Override
|
||||||
public float execute(MusgraveData musgraveData, float x, float y, float z) {
|
public float execute(MusgraveData musgraveData, float x, float y, float z) {
|
||||||
float result, signal, weight, rmd;
|
float result, signal, weight, rmd;
|
||||||
float pwHL = (float) Math.pow(musgraveData.lacunarity, -musgraveData.h);
|
float pwHL = (float) Math.pow(musgraveData.lacunarity, -musgraveData.h);
|
||||||
@ -386,6 +416,7 @@ import com.jme3.scene.plugins.blender.textures.generating.TextureGeneratorMusgra
|
|||||||
});
|
});
|
||||||
musgraveFunctions.put(Integer.valueOf(TEX_FBM), new MusgraveFunction() {
|
musgraveFunctions.put(Integer.valueOf(TEX_FBM), new MusgraveFunction() {
|
||||||
|
|
||||||
|
@Override
|
||||||
public float execute(MusgraveData musgraveData, float x, float y, float z) {
|
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);
|
float rmd, value = 0.0f, pwr = 1.0f, pwHL = (float) Math.pow(musgraveData.lacunarity, -musgraveData.h);
|
||||||
|
|
||||||
@ -406,6 +437,7 @@ import com.jme3.scene.plugins.blender.textures.generating.TextureGeneratorMusgra
|
|||||||
});
|
});
|
||||||
musgraveFunctions.put(Integer.valueOf(TEX_HTERRAIN), new MusgraveFunction() {
|
musgraveFunctions.put(Integer.valueOf(TEX_HTERRAIN), new MusgraveFunction() {
|
||||||
|
|
||||||
|
@Override
|
||||||
public float execute(MusgraveData musgraveData, float x, float y, float z) {
|
public float execute(MusgraveData musgraveData, float x, float y, float z) {
|
||||||
float value, increment, rmd;
|
float value, increment, rmd;
|
||||||
float pwHL = (float) Math.pow(musgraveData.lacunarity, -musgraveData.h);
|
float pwHL = (float) Math.pow(musgraveData.lacunarity, -musgraveData.h);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2012 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* 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];
|
private static final IntensityFunction INTENSITY_FUNCTION[] = new IntensityFunction[7];
|
||||||
static {
|
static {
|
||||||
INTENSITY_FUNCTION[0] = new IntensityFunction() {// Linear: stype = 0 (TEX_LIN)
|
INTENSITY_FUNCTION[0] = new IntensityFunction() {// Linear: stype = 0 (TEX_LIN)
|
||||||
|
@Override
|
||||||
public float getIntensity(float x, float y, float z) {
|
public float getIntensity(float x, float y, float z) {
|
||||||
return (1.0f + x) * 0.5f;
|
return (1.0f + x) * 0.5f;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
INTENSITY_FUNCTION[1] = new IntensityFunction() {// Quad: stype = 1 (TEX_QUAD)
|
INTENSITY_FUNCTION[1] = new IntensityFunction() {// Quad: stype = 1 (TEX_QUAD)
|
||||||
|
@Override
|
||||||
public float getIntensity(float x, float y, float z) {
|
public float getIntensity(float x, float y, float z) {
|
||||||
float result = (1.0f + x) * 0.5f;
|
float result = (1.0f + x) * 0.5f;
|
||||||
return result * result;
|
return result * result;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
INTENSITY_FUNCTION[2] = new IntensityFunction() {// Ease: stype = 2 (TEX_EASE)
|
INTENSITY_FUNCTION[2] = new IntensityFunction() {// Ease: stype = 2 (TEX_EASE)
|
||||||
|
@Override
|
||||||
public float getIntensity(float x, float y, float z) {
|
public float getIntensity(float x, float y, float z) {
|
||||||
float result = (1.0f + x) * 0.5f;
|
float result = (1.0f + x) * 0.5f;
|
||||||
if (result <= 0.0f) {
|
if (result <= 0.0f) {
|
||||||
@ -69,23 +72,27 @@ public final class TextureGeneratorBlend extends TextureGenerator {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
INTENSITY_FUNCTION[3] = new IntensityFunction() {// Diagonal: stype = 3 (TEX_DIAG)
|
INTENSITY_FUNCTION[3] = new IntensityFunction() {// Diagonal: stype = 3 (TEX_DIAG)
|
||||||
|
@Override
|
||||||
public float getIntensity(float x, float y, float z) {
|
public float getIntensity(float x, float y, float z) {
|
||||||
return (2.0f + x + y) * 0.25f;
|
return (2.0f + x + y) * 0.25f;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
INTENSITY_FUNCTION[4] = new IntensityFunction() {// Sphere: stype = 4 (TEX_SPHERE)
|
INTENSITY_FUNCTION[4] = new IntensityFunction() {// Sphere: stype = 4 (TEX_SPHERE)
|
||||||
|
@Override
|
||||||
public float getIntensity(float x, float y, float z) {
|
public float getIntensity(float x, float y, float z) {
|
||||||
float result = 1.0f - (float) Math.sqrt(x * x + y * y + z * z);
|
float result = 1.0f - (float) Math.sqrt(x * x + y * y + z * z);
|
||||||
return result < 0.0f ? 0.0f : result;
|
return result < 0.0f ? 0.0f : result;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
INTENSITY_FUNCTION[5] = new IntensityFunction() {// Halo: stype = 5 (TEX_HALO)
|
INTENSITY_FUNCTION[5] = new IntensityFunction() {// Halo: stype = 5 (TEX_HALO)
|
||||||
|
@Override
|
||||||
public float getIntensity(float x, float y, float z) {
|
public float getIntensity(float x, float y, float z) {
|
||||||
float result = 1.0f - (float) Math.sqrt(x * x + y * y + z * z);
|
float result = 1.0f - (float) Math.sqrt(x * x + y * y + z * z);
|
||||||
return result <= 0.0f ? 0.0f : result * result;
|
return result <= 0.0f ? 0.0f : result * result;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
INTENSITY_FUNCTION[6] = new IntensityFunction() {// Radial: stype = 6 (TEX_RAD)
|
INTENSITY_FUNCTION[6] = new IntensityFunction() {// Radial: stype = 6 (TEX_RAD)
|
||||||
|
@Override
|
||||||
public float getIntensity(float x, float y, float z) {
|
public float getIntensity(float x, float y, float z) {
|
||||||
return (float) Math.atan2(y, x) * FastMath.INV_TWO_PI + 0.5f;
|
return (float) Math.atan2(y, x) * FastMath.INV_TWO_PI + 0.5f;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2012 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* 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];
|
private static NoiseDepthFunction[] noiseDepthFunctions = new NoiseDepthFunction[10];
|
||||||
static {
|
static {
|
||||||
noiseDepthFunctions[0] = new NoiseDepthFunction() {
|
noiseDepthFunctions[0] = new NoiseDepthFunction() {
|
||||||
|
@Override
|
||||||
public void compute(float[] xyz, float turbulence) {
|
public void compute(float[] xyz, float turbulence) {
|
||||||
xyz[1] = -(float) Math.cos(xyz[0] - xyz[1] + xyz[2]) * turbulence;
|
xyz[1] = -(float) Math.cos(xyz[0] - xyz[1] + xyz[2]) * turbulence;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
noiseDepthFunctions[1] = new NoiseDepthFunction() {
|
noiseDepthFunctions[1] = new NoiseDepthFunction() {
|
||||||
|
@Override
|
||||||
public void compute(float[] xyz, float turbulence) {
|
public void compute(float[] xyz, float turbulence) {
|
||||||
xyz[0] = (float) Math.cos(xyz[0] - xyz[1] - xyz[2]) * turbulence;
|
xyz[0] = (float) Math.cos(xyz[0] - xyz[1] - xyz[2]) * turbulence;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
noiseDepthFunctions[2] = new NoiseDepthFunction() {
|
noiseDepthFunctions[2] = new NoiseDepthFunction() {
|
||||||
|
@Override
|
||||||
public void compute(float[] xyz, float turbulence) {
|
public void compute(float[] xyz, float turbulence) {
|
||||||
xyz[2] = (float) Math.sin(-xyz[0] - xyz[1] - xyz[2]) * turbulence;
|
xyz[2] = (float) Math.sin(-xyz[0] - xyz[1] - xyz[2]) * turbulence;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
noiseDepthFunctions[3] = new NoiseDepthFunction() {
|
noiseDepthFunctions[3] = new NoiseDepthFunction() {
|
||||||
|
@Override
|
||||||
public void compute(float[] xyz, float turbulence) {
|
public void compute(float[] xyz, float turbulence) {
|
||||||
xyz[0] = -(float) Math.cos(-xyz[0] + xyz[1] - xyz[2]) * turbulence;
|
xyz[0] = -(float) Math.cos(-xyz[0] + xyz[1] - xyz[2]) * turbulence;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
noiseDepthFunctions[4] = new NoiseDepthFunction() {
|
noiseDepthFunctions[4] = new NoiseDepthFunction() {
|
||||||
|
@Override
|
||||||
public void compute(float[] xyz, float turbulence) {
|
public void compute(float[] xyz, float turbulence) {
|
||||||
xyz[1] = -(float) Math.sin(-xyz[0] + xyz[1] + xyz[2]) * turbulence;
|
xyz[1] = -(float) Math.sin(-xyz[0] + xyz[1] + xyz[2]) * turbulence;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
noiseDepthFunctions[5] = new NoiseDepthFunction() {
|
noiseDepthFunctions[5] = new NoiseDepthFunction() {
|
||||||
|
@Override
|
||||||
public void compute(float[] xyz, float turbulence) {
|
public void compute(float[] xyz, float turbulence) {
|
||||||
xyz[1] = -(float) Math.cos(-xyz[0] + xyz[1] + xyz[2]) * turbulence;
|
xyz[1] = -(float) Math.cos(-xyz[0] + xyz[1] + xyz[2]) * turbulence;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
noiseDepthFunctions[6] = new NoiseDepthFunction() {
|
noiseDepthFunctions[6] = new NoiseDepthFunction() {
|
||||||
|
@Override
|
||||||
public void compute(float[] xyz, float turbulence) {
|
public void compute(float[] xyz, float turbulence) {
|
||||||
xyz[0] = (float) Math.cos(xyz[0] + xyz[1] + xyz[2]) * turbulence;
|
xyz[0] = (float) Math.cos(xyz[0] + xyz[1] + xyz[2]) * turbulence;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
noiseDepthFunctions[7] = new NoiseDepthFunction() {
|
noiseDepthFunctions[7] = new NoiseDepthFunction() {
|
||||||
|
@Override
|
||||||
public void compute(float[] xyz, float turbulence) {
|
public void compute(float[] xyz, float turbulence) {
|
||||||
xyz[2] = (float) Math.sin(xyz[0] + xyz[1] - xyz[2]) * turbulence;
|
xyz[2] = (float) Math.sin(xyz[0] + xyz[1] - xyz[2]) * turbulence;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
noiseDepthFunctions[8] = new NoiseDepthFunction() {
|
noiseDepthFunctions[8] = new NoiseDepthFunction() {
|
||||||
|
@Override
|
||||||
public void compute(float[] xyz, float turbulence) {
|
public void compute(float[] xyz, float turbulence) {
|
||||||
xyz[0] = -(float) Math.cos(-xyz[0] - xyz[1] + xyz[2]) * turbulence;
|
xyz[0] = -(float) Math.cos(-xyz[0] - xyz[1] + xyz[2]) * turbulence;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
noiseDepthFunctions[9] = new NoiseDepthFunction() {
|
noiseDepthFunctions[9] = new NoiseDepthFunction() {
|
||||||
|
@Override
|
||||||
public void compute(float[] xyz, float turbulence) {
|
public void compute(float[] xyz, float turbulence) {
|
||||||
xyz[1] = -(float) Math.sin(xyz[0] - xyz[1] + xyz[2]) * turbulence;
|
xyz[1] = -(float) Math.sin(xyz[0] - xyz[1] + xyz[2]) * turbulence;
|
||||||
}
|
}
|
||||||
|
@ -95,12 +95,14 @@ public class TextureGeneratorWood extends TextureGenerator {
|
|||||||
static {
|
static {
|
||||||
waveformFunctions[0] = new WaveForm() {// sinus (TEX_SIN)
|
waveformFunctions[0] = new WaveForm() {// sinus (TEX_SIN)
|
||||||
|
|
||||||
|
@Override
|
||||||
public float execute(float x) {
|
public float execute(float x) {
|
||||||
return 0.5f + 0.5f * (float) Math.sin(x);
|
return 0.5f + 0.5f * (float) Math.sin(x);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
waveformFunctions[1] = new WaveForm() {// saw (TEX_SAW)
|
waveformFunctions[1] = new WaveForm() {// saw (TEX_SAW)
|
||||||
|
|
||||||
|
@Override
|
||||||
public float execute(float x) {
|
public float execute(float x) {
|
||||||
int n = (int) (x * FastMath.INV_TWO_PI);
|
int n = (int) (x * FastMath.INV_TWO_PI);
|
||||||
x -= n * FastMath.TWO_PI;
|
x -= n * FastMath.TWO_PI;
|
||||||
@ -112,6 +114,7 @@ public class TextureGeneratorWood extends TextureGenerator {
|
|||||||
};
|
};
|
||||||
waveformFunctions[2] = new WaveForm() {// triangle (TEX_TRI)
|
waveformFunctions[2] = new WaveForm() {// triangle (TEX_TRI)
|
||||||
|
|
||||||
|
@Override
|
||||||
public float execute(float x) {
|
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);
|
return 1.0f - 2.0f * FastMath.abs((float) Math.floor(x * FastMath.INV_TWO_PI + 0.5f) - x * FastMath.INV_TWO_PI);
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,7 @@ import jme3tools.converters.RGB565;
|
|||||||
* @author Marcin Roguski (Kaelthas)
|
* @author Marcin Roguski (Kaelthas)
|
||||||
*/
|
*/
|
||||||
/* package */class AWTPixelInputOutput implements PixelInputOutput {
|
/* package */class AWTPixelInputOutput implements PixelInputOutput {
|
||||||
|
@Override
|
||||||
public void read(Image image, int layer, TexturePixel pixel, int index) {
|
public void read(Image image, int layer, TexturePixel pixel, int index) {
|
||||||
ByteBuffer data = image.getData(layer);
|
ByteBuffer data = image.getData(layer);
|
||||||
switch (image.getFormat()) {
|
switch (image.getFormat()) {
|
||||||
@ -64,11 +65,13 @@ import jme3tools.converters.RGB565;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void read(Image image, int layer, TexturePixel pixel, int x, int y) {
|
public void read(Image image, int layer, TexturePixel pixel, int x, int y) {
|
||||||
int index = (y * image.getWidth() + x) * (image.getFormat().getBitsPerPixel() >> 3);
|
int index = (y * image.getWidth() + x) * (image.getFormat().getBitsPerPixel() >> 3);
|
||||||
this.read(image, layer, pixel, index);
|
this.read(image, layer, pixel, index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(Image image, int layer, TexturePixel pixel, int index) {
|
public void write(Image image, int layer, TexturePixel pixel, int index) {
|
||||||
ByteBuffer data = image.getData(layer);
|
ByteBuffer data = image.getData(layer);
|
||||||
switch (image.getFormat()) {
|
switch (image.getFormat()) {
|
||||||
@ -149,6 +152,7 @@ import jme3tools.converters.RGB565;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(Image image, int layer, TexturePixel pixel, int x, int y) {
|
public void write(Image image, int layer, TexturePixel pixel, int x, int y) {
|
||||||
int index = (y * image.getWidth() + x) * (image.getFormat().getBitsPerPixel() >> 3);
|
int index = (y * image.getWidth() + x) * (image.getFormat().getBitsPerPixel() >> 3);
|
||||||
this.write(image, layer, pixel, index);
|
this.write(image, layer, pixel, index);
|
||||||
|
@ -15,10 +15,12 @@ import jme3tools.converters.RGB565;
|
|||||||
/**
|
/**
|
||||||
* For this class the index should be considered as a pixel index in AWT image format.
|
* 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) {
|
public void read(Image image, int layer, TexturePixel pixel, int index) {
|
||||||
this.read(image, layer, pixel, index % image.getWidth(), index / image.getWidth());
|
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) {
|
public void read(Image image, int layer, TexturePixel pixel, int x, int y) {
|
||||||
int xTexetlIndex = x % image.getWidth() >> 2;
|
int xTexetlIndex = x % image.getWidth() >> 2;
|
||||||
int yTexelIndex = y % image.getHeight() >> 2;
|
int yTexelIndex = y % image.getHeight() >> 2;
|
||||||
@ -161,10 +163,12 @@ import jme3tools.converters.RGB565;
|
|||||||
pixel.alpha = alpha;
|
pixel.alpha = alpha;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(Image image, int layer, TexturePixel pixel, int index) {
|
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!");
|
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) {
|
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!");
|
throw new UnsupportedOperationException("Writing to DDS texture pixel by pixel is not yet supported!");
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,7 @@ import java.nio.ByteBuffer;
|
|||||||
* @author Marcin Roguski (Kaelthas)
|
* @author Marcin Roguski (Kaelthas)
|
||||||
*/
|
*/
|
||||||
/* package */class LuminancePixelInputOutput implements PixelInputOutput {
|
/* package */class LuminancePixelInputOutput implements PixelInputOutput {
|
||||||
|
@Override
|
||||||
public void read(Image image, int layer, TexturePixel pixel, int index) {
|
public void read(Image image, int layer, TexturePixel pixel, int index) {
|
||||||
ByteBuffer data = image.getData(layer);
|
ByteBuffer data = image.getData(layer);
|
||||||
switch (image.getFormat()) {
|
switch (image.getFormat()) {
|
||||||
@ -36,11 +37,13 @@ import java.nio.ByteBuffer;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void read(Image image, int layer, TexturePixel pixel, int x, int y) {
|
public void read(Image image, int layer, TexturePixel pixel, int x, int y) {
|
||||||
int index = y * image.getWidth() + x;
|
int index = y * image.getWidth() + x;
|
||||||
this.read(image, layer, pixel, index);
|
this.read(image, layer, pixel, index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(Image image, int layer, TexturePixel pixel, int index) {
|
public void write(Image image, int layer, TexturePixel pixel, int index) {
|
||||||
ByteBuffer data = image.getData(layer);
|
ByteBuffer data = image.getData(layer);
|
||||||
data.put(index, pixel.getInt());
|
data.put(index, pixel.getInt());
|
||||||
@ -67,6 +70,7 @@ import java.nio.ByteBuffer;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(Image image, int layer, TexturePixel pixel, int x, int y) {
|
public void write(Image image, int layer, TexturePixel pixel, int x, int y) {
|
||||||
int index = y * image.getWidth() + x;
|
int index = y * image.getWidth() + x;
|
||||||
this.write(image, layer, pixel, index);
|
this.write(image, layer, pixel, index);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2019 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -182,6 +182,7 @@ public class BulletAppState
|
|||||||
executor = new ScheduledThreadPoolExecutor(1);
|
executor = new ScheduledThreadPoolExecutor(1);
|
||||||
final BulletAppState app = this;
|
final BulletAppState app = this;
|
||||||
Callable<Boolean> call = new Callable<Boolean>() {
|
Callable<Boolean> call = new Callable<Boolean>() {
|
||||||
|
@Override
|
||||||
public Boolean call() throws Exception {
|
public Boolean call() throws Exception {
|
||||||
detachedPhysicsLastUpdate = System.currentTimeMillis();
|
detachedPhysicsLastUpdate = System.currentTimeMillis();
|
||||||
pSpace = new PhysicsSpace(worldMin, worldMax, broadphaseType);
|
pSpace = new PhysicsSpace(worldMin, worldMax, broadphaseType);
|
||||||
@ -200,6 +201,7 @@ public class BulletAppState
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
private Callable<Boolean> parallelPhysicsUpdate = new Callable<Boolean>() {
|
private Callable<Boolean> parallelPhysicsUpdate = new Callable<Boolean>() {
|
||||||
|
@Override
|
||||||
public Boolean call() throws Exception {
|
public Boolean call() throws Exception {
|
||||||
pSpace.update(tpf * getSpeed());
|
pSpace.update(tpf * getSpeed());
|
||||||
return true;
|
return true;
|
||||||
@ -207,6 +209,7 @@ public class BulletAppState
|
|||||||
};
|
};
|
||||||
long detachedPhysicsLastUpdate = 0;
|
long detachedPhysicsLastUpdate = 0;
|
||||||
private Callable<Boolean> detachedPhysicsUpdate = new Callable<Boolean>() {
|
private Callable<Boolean> detachedPhysicsUpdate = new Callable<Boolean>() {
|
||||||
|
@Override
|
||||||
public Boolean call() throws Exception {
|
public Boolean call() throws Exception {
|
||||||
pSpace.update(getPhysicsSpace().getAccuracy() * getSpeed());
|
pSpace.update(getPhysicsSpace().getAccuracy() * getSpeed());
|
||||||
pSpace.distributeEvents();
|
pSpace.distributeEvents();
|
||||||
@ -484,6 +487,7 @@ public class BulletAppState
|
|||||||
* @param space the space that is about to be stepped (not null)
|
* @param space the space that is about to be stepped (not null)
|
||||||
* @param f the time per physics step (in seconds, ≥0)
|
* @param f the time per physics step (in seconds, ≥0)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void prePhysicsTick(PhysicsSpace space, float f) {
|
public void prePhysicsTick(PhysicsSpace space, float f) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -494,6 +498,7 @@ public class BulletAppState
|
|||||||
* @param space the space that is about to be stepped (not null)
|
* @param space the space that is about to be stepped (not null)
|
||||||
* @param f the time per physics step (in seconds, ≥0)
|
* @param f the time per physics step (in seconds, ≥0)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void physicsTick(PhysicsSpace space, float f) {
|
public void physicsTick(PhysicsSpace space, float f) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2019 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -89,6 +89,7 @@ public class ChildCollisionShape implements Savable {
|
|||||||
* @param ex exporter (not null)
|
* @param ex exporter (not null)
|
||||||
* @throws IOException from exporter
|
* @throws IOException from exporter
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void write(JmeExporter ex) throws IOException {
|
public void write(JmeExporter ex) throws IOException {
|
||||||
OutputCapsule capsule = ex.getCapsule(this);
|
OutputCapsule capsule = ex.getCapsule(this);
|
||||||
capsule.write(location, "location", new Vector3f());
|
capsule.write(location, "location", new Vector3f());
|
||||||
@ -102,6 +103,7 @@ public class ChildCollisionShape implements Savable {
|
|||||||
* @param im importer (not null)
|
* @param im importer (not null)
|
||||||
* @throws IOException from importer
|
* @throws IOException from importer
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void read(JmeImporter im) throws IOException {
|
public void read(JmeImporter im) throws IOException {
|
||||||
InputCapsule capsule = im.getCapsule(this);
|
InputCapsule capsule = im.getCapsule(this);
|
||||||
location = (Vector3f) capsule.readSavable("location", new Vector3f());
|
location = (Vector3f) capsule.readSavable("location", new Vector3f());
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2018 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -231,6 +231,7 @@ public abstract class AbstractPhysicsControl implements PhysicsControl, JmeClone
|
|||||||
*
|
*
|
||||||
* @param spatial the spatial to control (or null)
|
* @param spatial the spatial to control (or null)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setSpatial(Spatial spatial) {
|
public void setSpatial(Spatial spatial) {
|
||||||
if (this.spatial != null && this.spatial != spatial) {
|
if (this.spatial != null && this.spatial != spatial) {
|
||||||
removeSpatialData(this.spatial);
|
removeSpatialData(this.spatial);
|
||||||
@ -262,6 +263,7 @@ public abstract class AbstractPhysicsControl implements PhysicsControl, JmeClone
|
|||||||
*
|
*
|
||||||
* @param enabled true→enable the control, false→disable it
|
* @param enabled true→enable the control, false→disable it
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setEnabled(boolean enabled) {
|
public void setEnabled(boolean enabled) {
|
||||||
this.enabled = enabled;
|
this.enabled = enabled;
|
||||||
if (space != null) {
|
if (space != null) {
|
||||||
@ -284,13 +286,16 @@ public abstract class AbstractPhysicsControl implements PhysicsControl, JmeClone
|
|||||||
*
|
*
|
||||||
* @return true if enabled, otherwise false
|
* @return true if enabled, otherwise false
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isEnabled() {
|
public boolean isEnabled() {
|
||||||
return enabled;
|
return enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void update(float tpf) {
|
public void update(float tpf) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void render(RenderManager rm, ViewPort vp) {
|
public void render(RenderManager rm, ViewPort vp) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -326,6 +331,7 @@ public abstract class AbstractPhysicsControl implements PhysicsControl, JmeClone
|
|||||||
*
|
*
|
||||||
* @return the pre-existing space, or null for none
|
* @return the pre-existing space, or null for none
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public PhysicsSpace getPhysicsSpace() {
|
public PhysicsSpace getPhysicsSpace() {
|
||||||
return space;
|
return space;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2019 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -194,6 +194,7 @@ public class BetterCharacterControl extends AbstractPhysicsControl implements Ph
|
|||||||
* @param space the space that is about to be stepped (not null)
|
* @param space the space that is about to be stepped (not null)
|
||||||
* @param tpf the time per physics step (in seconds, ≥0)
|
* @param tpf the time per physics step (in seconds, ≥0)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void prePhysicsTick(PhysicsSpace space, float tpf) {
|
public void prePhysicsTick(PhysicsSpace space, float tpf) {
|
||||||
checkOnGround();
|
checkOnGround();
|
||||||
if (wantToUnDuck && checkCanUnDuck()) {
|
if (wantToUnDuck && checkCanUnDuck()) {
|
||||||
@ -245,6 +246,7 @@ public class BetterCharacterControl extends AbstractPhysicsControl implements Ph
|
|||||||
* @param space the space that was just stepped (not null)
|
* @param space the space that was just stepped (not null)
|
||||||
* @param tpf the time per physics step (in seconds, ≥0)
|
* @param tpf the time per physics step (in seconds, ≥0)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void physicsTick(PhysicsSpace space, float tpf) {
|
public void physicsTick(PhysicsSpace space, float tpf) {
|
||||||
rigidBody.getLinearVelocity(velocity);
|
rigidBody.getLinearVelocity(velocity);
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2018 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -120,6 +120,7 @@ public class CharacterControl extends PhysicsCharacter implements PhysicsControl
|
|||||||
this.spatial = cloner.clone(spatial);
|
this.spatial = cloner.clone(spatial);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setSpatial(Spatial spatial) {
|
public void setSpatial(Spatial spatial) {
|
||||||
this.spatial = spatial;
|
this.spatial = spatial;
|
||||||
setUserObject(spatial);
|
setUserObject(spatial);
|
||||||
@ -136,6 +137,7 @@ public class CharacterControl extends PhysicsCharacter implements PhysicsControl
|
|||||||
return this.spatial;
|
return this.spatial;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setEnabled(boolean enabled) {
|
public void setEnabled(boolean enabled) {
|
||||||
this.enabled = enabled;
|
this.enabled = enabled;
|
||||||
if (space != null) {
|
if (space != null) {
|
||||||
@ -152,6 +154,7 @@ public class CharacterControl extends PhysicsCharacter implements PhysicsControl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean isEnabled() {
|
public boolean isEnabled() {
|
||||||
return enabled;
|
return enabled;
|
||||||
}
|
}
|
||||||
@ -172,6 +175,7 @@ public class CharacterControl extends PhysicsCharacter implements PhysicsControl
|
|||||||
this.useViewDirection = viewDirectionEnabled;
|
this.useViewDirection = viewDirectionEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void update(float tpf) {
|
public void update(float tpf) {
|
||||||
if (enabled && spatial != null) {
|
if (enabled && spatial != null) {
|
||||||
Quaternion localRotationQuat = spatial.getLocalRotation();
|
Quaternion localRotationQuat = spatial.getLocalRotation();
|
||||||
@ -195,6 +199,7 @@ public class CharacterControl extends PhysicsCharacter implements PhysicsControl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void render(RenderManager rm, ViewPort vp) {
|
public void render(RenderManager rm, ViewPort vp) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -225,6 +230,7 @@ public class CharacterControl extends PhysicsCharacter implements PhysicsControl
|
|||||||
space = newSpace;
|
space = newSpace;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public PhysicsSpace getPhysicsSpace() {
|
public PhysicsSpace getPhysicsSpace() {
|
||||||
return space;
|
return space;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2019 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -196,6 +196,7 @@ public class GhostControl extends PhysicsGhostObject implements PhysicsControl,
|
|||||||
*
|
*
|
||||||
* @param spatial the spatial to control (or null)
|
* @param spatial the spatial to control (or null)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setSpatial(Spatial spatial) {
|
public void setSpatial(Spatial spatial) {
|
||||||
this.spatial = spatial;
|
this.spatial = spatial;
|
||||||
setUserObject(spatial);
|
setUserObject(spatial);
|
||||||
@ -222,6 +223,7 @@ public class GhostControl extends PhysicsGhostObject implements PhysicsControl,
|
|||||||
*
|
*
|
||||||
* @param enabled true→enable the control, false→disable it
|
* @param enabled true→enable the control, false→disable it
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setEnabled(boolean enabled) {
|
public void setEnabled(boolean enabled) {
|
||||||
this.enabled = enabled;
|
this.enabled = enabled;
|
||||||
if (space != null) {
|
if (space != null) {
|
||||||
@ -244,6 +246,7 @@ public class GhostControl extends PhysicsGhostObject implements PhysicsControl,
|
|||||||
*
|
*
|
||||||
* @return true if enabled, otherwise false
|
* @return true if enabled, otherwise false
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isEnabled() {
|
public boolean isEnabled() {
|
||||||
return enabled;
|
return enabled;
|
||||||
}
|
}
|
||||||
@ -255,6 +258,7 @@ public class GhostControl extends PhysicsGhostObject implements PhysicsControl,
|
|||||||
*
|
*
|
||||||
* @param tpf the time interval between frames (in seconds, ≥0)
|
* @param tpf the time interval between frames (in seconds, ≥0)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void update(float tpf) {
|
public void update(float tpf) {
|
||||||
if (!enabled) {
|
if (!enabled) {
|
||||||
return;
|
return;
|
||||||
@ -271,6 +275,7 @@ public class GhostControl extends PhysicsGhostObject implements PhysicsControl,
|
|||||||
* @param rm the render manager (not null)
|
* @param rm the render manager (not null)
|
||||||
* @param vp the view port to render (not null)
|
* @param vp the view port to render (not null)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void render(RenderManager rm, ViewPort vp) {
|
public void render(RenderManager rm, ViewPort vp) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -307,6 +312,7 @@ public class GhostControl extends PhysicsGhostObject implements PhysicsControl,
|
|||||||
*
|
*
|
||||||
* @return the pre-existing space, or null for none
|
* @return the pre-existing space, or null for none
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public PhysicsSpace getPhysicsSpace() {
|
public PhysicsSpace getPhysicsSpace() {
|
||||||
return space;
|
return space;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2018 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -817,6 +817,7 @@ public class KinematicRagdollControl extends AbstractPhysicsControl implements P
|
|||||||
*
|
*
|
||||||
* @param event (not null)
|
* @param event (not null)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void collision(PhysicsCollisionEvent event) {
|
public void collision(PhysicsCollisionEvent event) {
|
||||||
PhysicsCollisionObject objA = event.getObjectA();
|
PhysicsCollisionObject objA = event.getObjectA();
|
||||||
PhysicsCollisionObject objB = event.getObjectB();
|
PhysicsCollisionObject objB = event.getObjectB();
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2019 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -193,6 +193,7 @@ public class RigidBodyControl extends PhysicsRigidBody implements PhysicsControl
|
|||||||
*
|
*
|
||||||
* @param spatial the spatial to control (or null)
|
* @param spatial the spatial to control (or null)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setSpatial(Spatial spatial) {
|
public void setSpatial(Spatial spatial) {
|
||||||
this.spatial = spatial;
|
this.spatial = spatial;
|
||||||
setUserObject(spatial);
|
setUserObject(spatial);
|
||||||
@ -249,6 +250,7 @@ public class RigidBodyControl extends PhysicsRigidBody implements PhysicsControl
|
|||||||
*
|
*
|
||||||
* @param enabled true→enable the control, false→disable it
|
* @param enabled true→enable the control, false→disable it
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setEnabled(boolean enabled) {
|
public void setEnabled(boolean enabled) {
|
||||||
this.enabled = enabled;
|
this.enabled = enabled;
|
||||||
if (space != null) {
|
if (space != null) {
|
||||||
@ -271,6 +273,7 @@ public class RigidBodyControl extends PhysicsRigidBody implements PhysicsControl
|
|||||||
*
|
*
|
||||||
* @return true if enabled, otherwise false
|
* @return true if enabled, otherwise false
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isEnabled() {
|
public boolean isEnabled() {
|
||||||
return enabled;
|
return enabled;
|
||||||
}
|
}
|
||||||
@ -347,6 +350,7 @@ public class RigidBodyControl extends PhysicsRigidBody implements PhysicsControl
|
|||||||
*
|
*
|
||||||
* @param tpf the time interval between frames (in seconds, ≥0)
|
* @param tpf the time interval between frames (in seconds, ≥0)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void update(float tpf) {
|
public void update(float tpf) {
|
||||||
if (enabled && spatial != null) {
|
if (enabled && spatial != null) {
|
||||||
if (isKinematic() && kinematicSpatial) {
|
if (isKinematic() && kinematicSpatial) {
|
||||||
@ -366,6 +370,7 @@ public class RigidBodyControl extends PhysicsRigidBody implements PhysicsControl
|
|||||||
* @param rm the render manager (not null)
|
* @param rm the render manager (not null)
|
||||||
* @param vp the view port to render (not null)
|
* @param vp the view port to render (not null)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void render(RenderManager rm, ViewPort vp) {
|
public void render(RenderManager rm, ViewPort vp) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -401,6 +406,7 @@ public class RigidBodyControl extends PhysicsRigidBody implements PhysicsControl
|
|||||||
*
|
*
|
||||||
* @return the pre-existing space, or null for none
|
* @return the pre-existing space, or null for none
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public PhysicsSpace getPhysicsSpace() {
|
public PhysicsSpace getPhysicsSpace() {
|
||||||
return space;
|
return space;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2019 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -159,6 +159,7 @@ public class VehicleControl extends PhysicsVehicle implements PhysicsControl, Jm
|
|||||||
*
|
*
|
||||||
* @return a new control (not null)
|
* @return a new control (not null)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Object jmeClone() {
|
public Object jmeClone() {
|
||||||
VehicleControl control = new VehicleControl(collisionShape, mass);
|
VehicleControl control = new VehicleControl(collisionShape, mass);
|
||||||
control.setAngularFactor(getAngularFactor());
|
control.setAngularFactor(getAngularFactor());
|
||||||
@ -231,6 +232,7 @@ public class VehicleControl extends PhysicsVehicle implements PhysicsControl, Jm
|
|||||||
*
|
*
|
||||||
* @param spatial spatial to control (or null)
|
* @param spatial spatial to control (or null)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setSpatial(Spatial spatial) {
|
public void setSpatial(Spatial spatial) {
|
||||||
this.spatial = spatial;
|
this.spatial = spatial;
|
||||||
setUserObject(spatial);
|
setUserObject(spatial);
|
||||||
@ -250,6 +252,7 @@ public class VehicleControl extends PhysicsVehicle implements PhysicsControl, Jm
|
|||||||
*
|
*
|
||||||
* @param enabled true→enable the control, false→disable it
|
* @param enabled true→enable the control, false→disable it
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setEnabled(boolean enabled) {
|
public void setEnabled(boolean enabled) {
|
||||||
this.enabled = enabled;
|
this.enabled = enabled;
|
||||||
if (space != null) {
|
if (space != null) {
|
||||||
@ -272,6 +275,7 @@ public class VehicleControl extends PhysicsVehicle implements PhysicsControl, Jm
|
|||||||
*
|
*
|
||||||
* @return true if enabled, otherwise false
|
* @return true if enabled, otherwise false
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isEnabled() {
|
public boolean isEnabled() {
|
||||||
return enabled;
|
return enabled;
|
||||||
}
|
}
|
||||||
@ -282,6 +286,7 @@ public class VehicleControl extends PhysicsVehicle implements PhysicsControl, Jm
|
|||||||
*
|
*
|
||||||
* @param tpf the time interval between frames (in seconds, ≥0)
|
* @param tpf the time interval between frames (in seconds, ≥0)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void update(float tpf) {
|
public void update(float tpf) {
|
||||||
if (enabled && spatial != null) {
|
if (enabled && spatial != null) {
|
||||||
if (getMotionState().applyTransform(spatial)) {
|
if (getMotionState().applyTransform(spatial)) {
|
||||||
@ -301,6 +306,7 @@ public class VehicleControl extends PhysicsVehicle implements PhysicsControl, Jm
|
|||||||
* @param rm the render manager (not null)
|
* @param rm the render manager (not null)
|
||||||
* @param vp the view port to render (not null)
|
* @param vp the view port to render (not null)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void render(RenderManager rm, ViewPort vp) {
|
public void render(RenderManager rm, ViewPort vp) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -336,6 +342,7 @@ public class VehicleControl extends PhysicsVehicle implements PhysicsControl, Jm
|
|||||||
*
|
*
|
||||||
* @return the pre-existing space, or null for none
|
* @return the pre-existing space, or null for none
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public PhysicsSpace getPhysicsSpace() {
|
public PhysicsSpace getPhysicsSpace() {
|
||||||
return space;
|
return space;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2019 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -86,6 +86,7 @@ public class BoxCollisionShape extends CollisionShape {
|
|||||||
* @param ex exporter (not null)
|
* @param ex exporter (not null)
|
||||||
* @throws IOException from exporter
|
* @throws IOException from exporter
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void write(JmeExporter ex) throws IOException {
|
public void write(JmeExporter ex) throws IOException {
|
||||||
super.write(ex);
|
super.write(ex);
|
||||||
OutputCapsule capsule = ex.getCapsule(this);
|
OutputCapsule capsule = ex.getCapsule(this);
|
||||||
@ -98,6 +99,7 @@ public class BoxCollisionShape extends CollisionShape {
|
|||||||
* @param im importer (not null)
|
* @param im importer (not null)
|
||||||
* @throws IOException from importer
|
* @throws IOException from importer
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void read(JmeImporter im) throws IOException {
|
public void read(JmeImporter im) throws IOException {
|
||||||
super.read(im);
|
super.read(im);
|
||||||
InputCapsule capsule = im.getCapsule(this);
|
InputCapsule capsule = im.getCapsule(this);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2019 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -141,6 +141,7 @@ public class CapsuleCollisionShape extends CollisionShape{
|
|||||||
* @param ex exporter (not null)
|
* @param ex exporter (not null)
|
||||||
* @throws IOException from exporter
|
* @throws IOException from exporter
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void write(JmeExporter ex) throws IOException {
|
public void write(JmeExporter ex) throws IOException {
|
||||||
super.write(ex);
|
super.write(ex);
|
||||||
OutputCapsule capsule = ex.getCapsule(this);
|
OutputCapsule capsule = ex.getCapsule(this);
|
||||||
@ -155,6 +156,7 @@ public class CapsuleCollisionShape extends CollisionShape{
|
|||||||
* @param im importer (not null)
|
* @param im importer (not null)
|
||||||
* @throws IOException from importer
|
* @throws IOException from importer
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void read(JmeImporter im) throws IOException {
|
public void read(JmeImporter im) throws IOException {
|
||||||
super.read(im);
|
super.read(im);
|
||||||
InputCapsule capsule = im.getCapsule(this);
|
InputCapsule capsule = im.getCapsule(this);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2019 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -201,6 +201,7 @@ public abstract class CollisionShape implements Savable {
|
|||||||
* @param ex exporter (not null)
|
* @param ex exporter (not null)
|
||||||
* @throws IOException from exporter
|
* @throws IOException from exporter
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void write(JmeExporter ex) throws IOException {
|
public void write(JmeExporter ex) throws IOException {
|
||||||
OutputCapsule capsule = ex.getCapsule(this);
|
OutputCapsule capsule = ex.getCapsule(this);
|
||||||
capsule.write(scale, "scale", new Vector3f(1, 1, 1));
|
capsule.write(scale, "scale", new Vector3f(1, 1, 1));
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2018 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -152,6 +152,7 @@ public class CompoundCollisionShape extends CollisionShape {
|
|||||||
* @param ex exporter (not null)
|
* @param ex exporter (not null)
|
||||||
* @throws IOException from exporter
|
* @throws IOException from exporter
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void write(JmeExporter ex) throws IOException {
|
public void write(JmeExporter ex) throws IOException {
|
||||||
super.write(ex);
|
super.write(ex);
|
||||||
OutputCapsule capsule = ex.getCapsule(this);
|
OutputCapsule capsule = ex.getCapsule(this);
|
||||||
@ -164,6 +165,7 @@ public class CompoundCollisionShape extends CollisionShape {
|
|||||||
* @param im importer (not null)
|
* @param im importer (not null)
|
||||||
* @throws IOException from importer
|
* @throws IOException from importer
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void read(JmeImporter im) throws IOException {
|
public void read(JmeImporter im) throws IOException {
|
||||||
super.read(im);
|
super.read(im);
|
||||||
InputCapsule capsule = im.getCapsule(this);
|
InputCapsule capsule = im.getCapsule(this);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2019 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -119,6 +119,7 @@ public class ConeCollisionShape extends CollisionShape {
|
|||||||
* @param ex exporter (not null)
|
* @param ex exporter (not null)
|
||||||
* @throws IOException from exporter
|
* @throws IOException from exporter
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void write(JmeExporter ex) throws IOException {
|
public void write(JmeExporter ex) throws IOException {
|
||||||
super.write(ex);
|
super.write(ex);
|
||||||
OutputCapsule capsule = ex.getCapsule(this);
|
OutputCapsule capsule = ex.getCapsule(this);
|
||||||
@ -133,6 +134,7 @@ public class ConeCollisionShape extends CollisionShape {
|
|||||||
* @param im importer (not null)
|
* @param im importer (not null)
|
||||||
* @throws IOException from importer
|
* @throws IOException from importer
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void read(JmeImporter im) throws IOException {
|
public void read(JmeImporter im) throws IOException {
|
||||||
super.read(im);
|
super.read(im);
|
||||||
InputCapsule capsule = im.getCapsule(this);
|
InputCapsule capsule = im.getCapsule(this);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2019 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -128,6 +128,7 @@ public class CylinderCollisionShape extends CollisionShape {
|
|||||||
* @param ex exporter (not null)
|
* @param ex exporter (not null)
|
||||||
* @throws IOException from exporter
|
* @throws IOException from exporter
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void write(JmeExporter ex) throws IOException {
|
public void write(JmeExporter ex) throws IOException {
|
||||||
super.write(ex);
|
super.write(ex);
|
||||||
OutputCapsule capsule = ex.getCapsule(this);
|
OutputCapsule capsule = ex.getCapsule(this);
|
||||||
@ -141,6 +142,7 @@ public class CylinderCollisionShape extends CollisionShape {
|
|||||||
* @param im importer (not null)
|
* @param im importer (not null)
|
||||||
* @throws IOException from importer
|
* @throws IOException from importer
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void read(JmeImporter im) throws IOException {
|
public void read(JmeImporter im) throws IOException {
|
||||||
super.read(im);
|
super.read(im);
|
||||||
InputCapsule capsule = im.getCapsule(this);
|
InputCapsule capsule = im.getCapsule(this);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2019 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -122,6 +122,7 @@ public class GImpactCollisionShape extends CollisionShape {
|
|||||||
* @param ex exporter (not null)
|
* @param ex exporter (not null)
|
||||||
* @throws IOException from exporter
|
* @throws IOException from exporter
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void write(JmeExporter ex) throws IOException {
|
public void write(JmeExporter ex) throws IOException {
|
||||||
super.write(ex);
|
super.write(ex);
|
||||||
OutputCapsule capsule = ex.getCapsule(this);
|
OutputCapsule capsule = ex.getCapsule(this);
|
||||||
@ -141,6 +142,7 @@ public class GImpactCollisionShape extends CollisionShape {
|
|||||||
* @param im importer (not null)
|
* @param im importer (not null)
|
||||||
* @throws IOException from importer
|
* @throws IOException from importer
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void read(JmeImporter im) throws IOException {
|
public void read(JmeImporter im) throws IOException {
|
||||||
super.read(im);
|
super.read(im);
|
||||||
InputCapsule capsule = im.getCapsule(this);
|
InputCapsule capsule = im.getCapsule(this);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2019 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -193,6 +193,7 @@ public class HeightfieldCollisionShape extends CollisionShape {
|
|||||||
* @param ex exporter (not null)
|
* @param ex exporter (not null)
|
||||||
* @throws IOException from exporter
|
* @throws IOException from exporter
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void write(JmeExporter ex) throws IOException {
|
public void write(JmeExporter ex) throws IOException {
|
||||||
super.write(ex);
|
super.write(ex);
|
||||||
OutputCapsule capsule = ex.getCapsule(this);
|
OutputCapsule capsule = ex.getCapsule(this);
|
||||||
@ -212,6 +213,7 @@ public class HeightfieldCollisionShape extends CollisionShape {
|
|||||||
* @param im importer (not null)
|
* @param im importer (not null)
|
||||||
* @throws IOException from importer
|
* @throws IOException from importer
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void read(JmeImporter im) throws IOException {
|
public void read(JmeImporter im) throws IOException {
|
||||||
super.read(im);
|
super.read(im);
|
||||||
InputCapsule capsule = im.getCapsule(this);
|
InputCapsule capsule = im.getCapsule(this);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2019 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -84,6 +84,7 @@ public class PlaneCollisionShape extends CollisionShape{
|
|||||||
* @param ex exporter (not null)
|
* @param ex exporter (not null)
|
||||||
* @throws IOException from exporter
|
* @throws IOException from exporter
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void write(JmeExporter ex) throws IOException {
|
public void write(JmeExporter ex) throws IOException {
|
||||||
super.write(ex);
|
super.write(ex);
|
||||||
OutputCapsule capsule = ex.getCapsule(this);
|
OutputCapsule capsule = ex.getCapsule(this);
|
||||||
@ -96,6 +97,7 @@ public class PlaneCollisionShape extends CollisionShape{
|
|||||||
* @param im importer (not null)
|
* @param im importer (not null)
|
||||||
* @throws IOException from importer
|
* @throws IOException from importer
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void read(JmeImporter im) throws IOException {
|
public void read(JmeImporter im) throws IOException {
|
||||||
super.read(im);
|
super.read(im);
|
||||||
InputCapsule capsule = im.getCapsule(this);
|
InputCapsule capsule = im.getCapsule(this);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2019 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -118,6 +118,7 @@ public class SimplexCollisionShape extends CollisionShape {
|
|||||||
* @param ex exporter (not null)
|
* @param ex exporter (not null)
|
||||||
* @throws IOException from exporter
|
* @throws IOException from exporter
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void write(JmeExporter ex) throws IOException {
|
public void write(JmeExporter ex) throws IOException {
|
||||||
super.write(ex);
|
super.write(ex);
|
||||||
OutputCapsule capsule = ex.getCapsule(this);
|
OutputCapsule capsule = ex.getCapsule(this);
|
||||||
@ -133,6 +134,7 @@ public class SimplexCollisionShape extends CollisionShape {
|
|||||||
* @param im importer (not null)
|
* @param im importer (not null)
|
||||||
* @throws IOException from importer
|
* @throws IOException from importer
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void read(JmeImporter im) throws IOException {
|
public void read(JmeImporter im) throws IOException {
|
||||||
super.read(im);
|
super.read(im);
|
||||||
InputCapsule capsule = im.getCapsule(this);
|
InputCapsule capsule = im.getCapsule(this);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2019 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -85,6 +85,7 @@ public class SphereCollisionShape extends CollisionShape {
|
|||||||
* @param ex exporter (not null)
|
* @param ex exporter (not null)
|
||||||
* @throws IOException from exporter
|
* @throws IOException from exporter
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void write(JmeExporter ex) throws IOException {
|
public void write(JmeExporter ex) throws IOException {
|
||||||
super.write(ex);
|
super.write(ex);
|
||||||
OutputCapsule capsule = ex.getCapsule(this);
|
OutputCapsule capsule = ex.getCapsule(this);
|
||||||
@ -97,6 +98,7 @@ public class SphereCollisionShape extends CollisionShape {
|
|||||||
* @param im importer (not null)
|
* @param im importer (not null)
|
||||||
* @throws IOException from importer
|
* @throws IOException from importer
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void read(JmeImporter im) throws IOException {
|
public void read(JmeImporter im) throws IOException {
|
||||||
super.read(im);
|
super.read(im);
|
||||||
InputCapsule capsule = im.getCapsule(this);
|
InputCapsule capsule = im.getCapsule(this);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2019 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -242,6 +242,7 @@ public class HingeJoint extends PhysicsJoint {
|
|||||||
* @param ex exporter (not null)
|
* @param ex exporter (not null)
|
||||||
* @throws IOException from exporter
|
* @throws IOException from exporter
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void write(JmeExporter ex) throws IOException {
|
public void write(JmeExporter ex) throws IOException {
|
||||||
super.write(ex);
|
super.write(ex);
|
||||||
OutputCapsule capsule = ex.getCapsule(this);
|
OutputCapsule capsule = ex.getCapsule(this);
|
||||||
@ -268,6 +269,7 @@ public class HingeJoint extends PhysicsJoint {
|
|||||||
* @param im importer (not null)
|
* @param im importer (not null)
|
||||||
* @throws IOException from importer
|
* @throws IOException from importer
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void read(JmeImporter im) throws IOException {
|
public void read(JmeImporter im) throws IOException {
|
||||||
super.read(im);
|
super.read(im);
|
||||||
InputCapsule capsule = im.getCapsule(this);
|
InputCapsule capsule = im.getCapsule(this);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2019 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -192,6 +192,7 @@ public abstract class PhysicsJoint implements Savable {
|
|||||||
* @param ex exporter (not null)
|
* @param ex exporter (not null)
|
||||||
* @throws IOException from exporter
|
* @throws IOException from exporter
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void write(JmeExporter ex) throws IOException {
|
public void write(JmeExporter ex) throws IOException {
|
||||||
OutputCapsule capsule = ex.getCapsule(this);
|
OutputCapsule capsule = ex.getCapsule(this);
|
||||||
capsule.write(nodeA, "nodeA", null);
|
capsule.write(nodeA, "nodeA", null);
|
||||||
@ -206,6 +207,7 @@ public abstract class PhysicsJoint implements Savable {
|
|||||||
* @param im importer (not null)
|
* @param im importer (not null)
|
||||||
* @throws IOException from importer
|
* @throws IOException from importer
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void read(JmeImporter im) throws IOException {
|
public void read(JmeImporter im) throws IOException {
|
||||||
InputCapsule capsule = im.getCapsule(this);
|
InputCapsule capsule = im.getCapsule(this);
|
||||||
this.nodeA = ((PhysicsRigidBody) capsule.readSavable("nodeA", null));
|
this.nodeA = ((PhysicsRigidBody) capsule.readSavable("nodeA", null));
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2019 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -794,6 +794,7 @@ public class PhysicsRigidBody extends PhysicsCollisionObject {
|
|||||||
*
|
*
|
||||||
* @param collisionShape the shape to apply (not null, alias created)
|
* @param collisionShape the shape to apply (not null, alias created)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setCollisionShape(CollisionShape collisionShape) {
|
public void setCollisionShape(CollisionShape collisionShape) {
|
||||||
super.setCollisionShape(collisionShape);
|
super.setCollisionShape(collisionShape);
|
||||||
if (collisionShape instanceof MeshCollisionShape && mass != 0) {
|
if (collisionShape instanceof MeshCollisionShape && mass != 0) {
|
||||||
|
@ -216,6 +216,7 @@ public class Joint implements Savable, JmeCloneable, HasLocalTransform {
|
|||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setLocalTransform(Transform localTransform) {
|
public void setLocalTransform(Transform localTransform) {
|
||||||
this.localTransform.set(localTransform);
|
this.localTransform.set(localTransform);
|
||||||
}
|
}
|
||||||
@ -272,6 +273,7 @@ public class Joint implements Savable, JmeCloneable, HasLocalTransform {
|
|||||||
return initialTransform;
|
return initialTransform;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Transform getLocalTransform() {
|
public Transform getLocalTransform() {
|
||||||
return localTransform;
|
return localTransform;
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,7 @@ public class MatrixJointModelTransform implements JointModelTransform {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void getOffsetTransform(Matrix4f outTransform, Matrix4f inverseModelBindMatrix) {
|
public void getOffsetTransform(Matrix4f outTransform, Matrix4f inverseModelBindMatrix) {
|
||||||
modelTransformMatrix.mult(inverseModelBindMatrix, outTransform);
|
modelTransformMatrix.mult(inverseModelBindMatrix, outTransform);
|
||||||
}
|
}
|
||||||
|
@ -23,6 +23,7 @@ public class SeparateJointModelTransform implements JointModelTransform {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void getOffsetTransform(Matrix4f outTransform, Matrix4f inverseModelBindMatrix) {
|
public void getOffsetTransform(Matrix4f outTransform, Matrix4f inverseModelBindMatrix) {
|
||||||
modelTransform.toTransformMatrix(outTransform).mult(inverseModelBindMatrix, outTransform);
|
modelTransform.toTransformMatrix(outTransform).mult(inverseModelBindMatrix, outTransform);
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2019 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -208,10 +208,12 @@ public class TransformTrack implements AnimTrack<Transform> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public double getLength() {
|
public double getLength() {
|
||||||
return length;
|
return length;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void getDataAtTime(double t, Transform transform) {
|
public void getDataAtTime(double t, Transform transform) {
|
||||||
float time = (float) t;
|
float time = (float) t;
|
||||||
|
|
||||||
|
@ -49,6 +49,7 @@ public class BlendAction extends BlendableAction {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void doInterpolate(double t) {
|
public void doInterpolate(double t) {
|
||||||
blendWeight = blendSpace.getWeight();
|
blendWeight = blendSpace.getWeight();
|
||||||
BlendableAction firstActiveAction = (BlendableAction) actions[firstActiveIndex];
|
BlendableAction firstActiveAction = (BlendableAction) actions[firstActiveIndex];
|
||||||
|
@ -63,6 +63,7 @@ public class ClipAction extends BlendableAction {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return clip.toString();
|
return clip.toString();
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2019 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -73,10 +73,12 @@ public class AudioTrack implements ClonableTrack {
|
|||||||
//Animation listener to stop the sound when the animation ends or is changed
|
//Animation listener to stop the sound when the animation ends or is changed
|
||||||
private class OnEndListener implements AnimEventListener {
|
private class OnEndListener implements AnimEventListener {
|
||||||
|
|
||||||
|
@Override
|
||||||
public void onAnimCycleDone(AnimControl control, AnimChannel channel, String animName) {
|
public void onAnimCycleDone(AnimControl control, AnimChannel channel, String animName) {
|
||||||
stop();
|
stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void onAnimChange(AnimControl control, AnimChannel channel, String animName) {
|
public void onAnimChange(AnimControl control, AnimChannel channel, String animName) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -120,6 +122,7 @@ public class AudioTrack implements ClonableTrack {
|
|||||||
* @see Track#setTime(float, float, com.jme3.animation.AnimControl,
|
* @see Track#setTime(float, float, com.jme3.animation.AnimControl,
|
||||||
* com.jme3.animation.AnimChannel, com.jme3.util.TempVars)
|
* com.jme3.animation.AnimChannel, com.jme3.util.TempVars)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setTime(float time, float weight, AnimControl control, AnimChannel channel, TempVars vars) {
|
public void setTime(float time, float weight, AnimControl control, AnimChannel channel, TempVars vars) {
|
||||||
|
|
||||||
if (time >= length) {
|
if (time >= length) {
|
||||||
@ -146,6 +149,7 @@ public class AudioTrack implements ClonableTrack {
|
|||||||
*
|
*
|
||||||
* @return length of the track
|
* @return length of the track
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public float getLength() {
|
public float getLength() {
|
||||||
return length;
|
return length;
|
||||||
}
|
}
|
||||||
@ -255,6 +259,7 @@ public class AudioTrack implements ClonableTrack {
|
|||||||
data.addTrack(audioTrack);
|
data.addTrack(audioTrack);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void cleanUp() {
|
public void cleanUp() {
|
||||||
TrackInfo t = (TrackInfo) audio.getUserData("TrackInfo");
|
TrackInfo t = (TrackInfo) audio.getUserData("TrackInfo");
|
||||||
t.getTracks().remove(this);
|
t.getTracks().remove(this);
|
||||||
@ -308,6 +313,7 @@ public class AudioTrack implements ClonableTrack {
|
|||||||
* @param ex exporter
|
* @param ex exporter
|
||||||
* @throws IOException exception
|
* @throws IOException exception
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void write(JmeExporter ex) throws IOException {
|
public void write(JmeExporter ex) throws IOException {
|
||||||
OutputCapsule out = ex.getCapsule(this);
|
OutputCapsule out = ex.getCapsule(this);
|
||||||
out.write(audio, "audio", null);
|
out.write(audio, "audio", null);
|
||||||
@ -321,6 +327,7 @@ public class AudioTrack implements ClonableTrack {
|
|||||||
* @param im importer
|
* @param im importer
|
||||||
* @throws IOException Exception
|
* @throws IOException Exception
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void read(JmeImporter im) throws IOException {
|
public void read(JmeImporter im) throws IOException {
|
||||||
InputCapsule in = im.getCapsule(this);
|
InputCapsule in = im.getCapsule(this);
|
||||||
audio = (AudioNode) in.readSavable("audio", null);
|
audio = (AudioNode) in.readSavable("audio", null);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2019 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -202,6 +202,7 @@ public final class BoneTrack implements JmeCloneable, Track {
|
|||||||
* @param channel
|
* @param channel
|
||||||
* @param vars
|
* @param vars
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setTime(float time, float weight, AnimControl control, AnimChannel channel, TempVars vars) {
|
public void setTime(float time, float weight, AnimControl control, AnimChannel channel, TempVars vars) {
|
||||||
BitSet affectedBones = channel.getAffectedBones();
|
BitSet affectedBones = channel.getAffectedBones();
|
||||||
if (affectedBones != null && !affectedBones.get(targetBoneIndex)) {
|
if (affectedBones != null && !affectedBones.get(targetBoneIndex)) {
|
||||||
@ -268,6 +269,7 @@ public final class BoneTrack implements JmeCloneable, Track {
|
|||||||
/**
|
/**
|
||||||
* @return the length of the track
|
* @return the length of the track
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public float getLength() {
|
public float getLength() {
|
||||||
return times == null ? 0 : times[times.length - 1] - times[0];
|
return times == null ? 0 : times[times.length - 1] - times[0];
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2019 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -117,6 +117,7 @@ public final class Pose implements Savable, Cloneable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JmeExporter e) throws IOException {
|
public void write(JmeExporter e) throws IOException {
|
||||||
OutputCapsule out = e.getCapsule(this);
|
OutputCapsule out = e.getCapsule(this);
|
||||||
out.write(name, "name", "");
|
out.write(name, "name", "");
|
||||||
@ -125,6 +126,7 @@ public final class Pose implements Savable, Cloneable {
|
|||||||
out.write(indices, "indices", null);
|
out.write(indices, "indices", null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void read(JmeImporter i) throws IOException {
|
public void read(JmeImporter i) throws IOException {
|
||||||
InputCapsule in = i.getCapsule(this);
|
InputCapsule in = i.getCapsule(this);
|
||||||
name = in.readString("name", "");
|
name = in.readString("name", "");
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2019 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -87,12 +87,14 @@ public final class PoseTrack implements Track {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JmeExporter e) throws IOException {
|
public void write(JmeExporter e) throws IOException {
|
||||||
OutputCapsule out = e.getCapsule(this);
|
OutputCapsule out = e.getCapsule(this);
|
||||||
out.write(poses, "poses", null);
|
out.write(poses, "poses", null);
|
||||||
out.write(weights, "weights", null);
|
out.write(weights, "weights", null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void read(JmeImporter i) throws IOException {
|
public void read(JmeImporter i) throws IOException {
|
||||||
InputCapsule in = i.getCapsule(this);
|
InputCapsule in = i.getCapsule(this);
|
||||||
weights = in.readFloatArray("weights", null);
|
weights = in.readFloatArray("weights", null);
|
||||||
@ -132,6 +134,7 @@ public final class PoseTrack implements Track {
|
|||||||
pb.updateData(pb.getData());
|
pb.updateData(pb.getData());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setTime(float time, float weight, AnimControl control, AnimChannel channel, TempVars vars) {
|
public void setTime(float time, float weight, AnimControl control, AnimChannel channel, TempVars vars) {
|
||||||
// TODO: When MeshControl is created, it will gather targets
|
// TODO: When MeshControl is created, it will gather targets
|
||||||
// list automatically which is then retrieved here.
|
// list automatically which is then retrieved here.
|
||||||
@ -161,6 +164,7 @@ public final class PoseTrack implements Track {
|
|||||||
/**
|
/**
|
||||||
* @return the length of the track
|
* @return the length of the track
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public float getLength() {
|
public float getLength() {
|
||||||
return times == null ? 0 : times[times.length - 1] - times[0];
|
return times == null ? 0 : times[times.length - 1] - times[0];
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2018 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -101,6 +101,7 @@ public class SpatialTrack implements JmeCloneable, Track {
|
|||||||
* @param time
|
* @param time
|
||||||
* the current time of the animation
|
* the current time of the animation
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setTime(float time, float weight, AnimControl control, AnimChannel channel, TempVars vars) {
|
public void setTime(float time, float weight, AnimControl control, AnimChannel channel, TempVars vars) {
|
||||||
Spatial spatial = trackSpatial;
|
Spatial spatial = trackSpatial;
|
||||||
if (spatial == null) {
|
if (spatial == null) {
|
||||||
@ -242,6 +243,7 @@ public class SpatialTrack implements JmeCloneable, Track {
|
|||||||
/**
|
/**
|
||||||
* @return the length of the track
|
* @return the length of the track
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public float getLength() {
|
public float getLength() {
|
||||||
return times == null ? 0 : times[times.length - 1] - times[0];
|
return times == null ? 0 : times[times.length - 1] - times[0];
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2012 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -55,11 +55,13 @@ public class TrackInfo implements Savable, JmeCloneable {
|
|||||||
public TrackInfo() {
|
public TrackInfo() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JmeExporter ex) throws IOException {
|
public void write(JmeExporter ex) throws IOException {
|
||||||
OutputCapsule c = ex.getCapsule(this);
|
OutputCapsule c = ex.getCapsule(this);
|
||||||
c.writeSavableArrayList(tracks, "tracks", null);
|
c.writeSavableArrayList(tracks, "tracks", null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void read(JmeImporter im) throws IOException {
|
public void read(JmeImporter im) throws IOException {
|
||||||
InputCapsule c = im.getCapsule(this);
|
InputCapsule c = im.getCapsule(this);
|
||||||
tracks = c.readSavableArrayList("tracks", null);
|
tracks = c.readSavableArrayList("tracks", null);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2012 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -66,6 +66,7 @@ public class AppTask<V> implements Future<V> {
|
|||||||
this.callable = callable;
|
this.callable = callable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean cancel(boolean mayInterruptIfRunning) {
|
public boolean cancel(boolean mayInterruptIfRunning) {
|
||||||
stateLock.lock();
|
stateLock.lock();
|
||||||
try {
|
try {
|
||||||
@ -82,6 +83,7 @@ public class AppTask<V> implements Future<V> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public V get() throws InterruptedException, ExecutionException {
|
public V get() throws InterruptedException, ExecutionException {
|
||||||
stateLock.lock();
|
stateLock.lock();
|
||||||
try {
|
try {
|
||||||
@ -97,6 +99,7 @@ public class AppTask<V> implements Future<V> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public V get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException {
|
public V get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException {
|
||||||
stateLock.lock();
|
stateLock.lock();
|
||||||
try {
|
try {
|
||||||
@ -115,6 +118,7 @@ public class AppTask<V> implements Future<V> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean isCancelled() {
|
public boolean isCancelled() {
|
||||||
stateLock.lock();
|
stateLock.lock();
|
||||||
try {
|
try {
|
||||||
@ -124,6 +128,7 @@ public class AppTask<V> implements Future<V> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean isDone() {
|
public boolean isDone() {
|
||||||
stateLock.lock();
|
stateLock.lock();
|
||||||
try {
|
try {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2019 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -129,6 +129,7 @@ public class ChaseCameraAppState extends AbstractAppState implements ActionListe
|
|||||||
inputManager.setCursorVisible(dragToRotate);
|
inputManager.setCursorVisible(dragToRotate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void onAction(String name, boolean keyPressed, float tpf) {
|
public void onAction(String name, boolean keyPressed, float tpf) {
|
||||||
if (isEnabled()) {
|
if (isEnabled()) {
|
||||||
if (dragToRotate) {
|
if (dragToRotate) {
|
||||||
@ -150,6 +151,7 @@ public class ChaseCameraAppState extends AbstractAppState implements ActionListe
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void onAnalog(String name, float value, float tpf) {
|
public void onAnalog(String name, float value, float tpf) {
|
||||||
if (isEnabled()) {
|
if (isEnabled()) {
|
||||||
if (canRotate) {
|
if (canRotate) {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2012 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -94,6 +94,7 @@ public class DebugKeysAppState extends AbstractAppState {
|
|||||||
|
|
||||||
private class DebugKeyListener implements ActionListener {
|
private class DebugKeyListener implements ActionListener {
|
||||||
|
|
||||||
|
@Override
|
||||||
public void onAction(String name, boolean value, float tpf) {
|
public void onAction(String name, boolean value, float tpf) {
|
||||||
if (!value) {
|
if (!value) {
|
||||||
return;
|
return;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2019 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -126,6 +126,7 @@ public class LegacyApplication implements Application, SystemListener {
|
|||||||
*
|
*
|
||||||
* @return The lost focus behavior of the application.
|
* @return The lost focus behavior of the application.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public LostFocusBehavior getLostFocusBehavior() {
|
public LostFocusBehavior getLostFocusBehavior() {
|
||||||
return lostFocusBehavior;
|
return lostFocusBehavior;
|
||||||
}
|
}
|
||||||
@ -142,6 +143,7 @@ public class LegacyApplication implements Application, SystemListener {
|
|||||||
*
|
*
|
||||||
* @see LostFocusBehavior
|
* @see LostFocusBehavior
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setLostFocusBehavior(LostFocusBehavior lostFocusBehavior) {
|
public void setLostFocusBehavior(LostFocusBehavior lostFocusBehavior) {
|
||||||
this.lostFocusBehavior = lostFocusBehavior;
|
this.lostFocusBehavior = lostFocusBehavior;
|
||||||
}
|
}
|
||||||
@ -153,6 +155,7 @@ public class LegacyApplication implements Application, SystemListener {
|
|||||||
*
|
*
|
||||||
* @see #getLostFocusBehavior()
|
* @see #getLostFocusBehavior()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isPauseOnLostFocus() {
|
public boolean isPauseOnLostFocus() {
|
||||||
return getLostFocusBehavior() == LostFocusBehavior.PauseOnLostFocus;
|
return getLostFocusBehavior() == LostFocusBehavior.PauseOnLostFocus;
|
||||||
}
|
}
|
||||||
@ -173,6 +176,7 @@ public class LegacyApplication implements Application, SystemListener {
|
|||||||
*
|
*
|
||||||
* @see #setLostFocusBehavior(com.jme3.app.LostFocusBehavior)
|
* @see #setLostFocusBehavior(com.jme3.app.LostFocusBehavior)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setPauseOnLostFocus(boolean pauseOnLostFocus) {
|
public void setPauseOnLostFocus(boolean pauseOnLostFocus) {
|
||||||
if (pauseOnLostFocus) {
|
if (pauseOnLostFocus) {
|
||||||
setLostFocusBehavior(LostFocusBehavior.PauseOnLostFocus);
|
setLostFocusBehavior(LostFocusBehavior.PauseOnLostFocus);
|
||||||
@ -227,6 +231,7 @@ public class LegacyApplication implements Application, SystemListener {
|
|||||||
*
|
*
|
||||||
* @param settings The settings to set.
|
* @param settings The settings to set.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setSettings(AppSettings settings){
|
public void setSettings(AppSettings settings){
|
||||||
this.settings = settings;
|
this.settings = settings;
|
||||||
if (context != null && settings.useInput() != inputEnabled){
|
if (context != null && settings.useInput() != inputEnabled){
|
||||||
@ -248,6 +253,7 @@ public class LegacyApplication implements Application, SystemListener {
|
|||||||
* frame times. By default, Application will use the Timer as returned
|
* frame times. By default, Application will use the Timer as returned
|
||||||
* by the current JmeContext implementation.
|
* by the current JmeContext implementation.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setTimer(Timer timer){
|
public void setTimer(Timer timer){
|
||||||
this.timer = timer;
|
this.timer = timer;
|
||||||
|
|
||||||
@ -260,6 +266,7 @@ public class LegacyApplication implements Application, SystemListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Timer getTimer(){
|
public Timer getTimer(){
|
||||||
return timer;
|
return timer;
|
||||||
}
|
}
|
||||||
@ -355,6 +362,7 @@ public class LegacyApplication implements Application, SystemListener {
|
|||||||
/**
|
/**
|
||||||
* @return The {@link AssetManager asset manager} for this application.
|
* @return The {@link AssetManager asset manager} for this application.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public AssetManager getAssetManager(){
|
public AssetManager getAssetManager(){
|
||||||
return assetManager;
|
return assetManager;
|
||||||
}
|
}
|
||||||
@ -362,6 +370,7 @@ public class LegacyApplication implements Application, SystemListener {
|
|||||||
/**
|
/**
|
||||||
* @return the {@link InputManager input manager}.
|
* @return the {@link InputManager input manager}.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public InputManager getInputManager(){
|
public InputManager getInputManager(){
|
||||||
return inputManager;
|
return inputManager;
|
||||||
}
|
}
|
||||||
@ -369,6 +378,7 @@ public class LegacyApplication implements Application, SystemListener {
|
|||||||
/**
|
/**
|
||||||
* @return the {@link AppStateManager app state manager}
|
* @return the {@link AppStateManager app state manager}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public AppStateManager getStateManager() {
|
public AppStateManager getStateManager() {
|
||||||
return stateManager;
|
return stateManager;
|
||||||
}
|
}
|
||||||
@ -376,6 +386,7 @@ public class LegacyApplication implements Application, SystemListener {
|
|||||||
/**
|
/**
|
||||||
* @return the {@link RenderManager render manager}
|
* @return the {@link RenderManager render manager}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public RenderManager getRenderManager() {
|
public RenderManager getRenderManager() {
|
||||||
return renderManager;
|
return renderManager;
|
||||||
}
|
}
|
||||||
@ -383,6 +394,7 @@ public class LegacyApplication implements Application, SystemListener {
|
|||||||
/**
|
/**
|
||||||
* @return The {@link Renderer renderer} for the application
|
* @return The {@link Renderer renderer} for the application
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Renderer getRenderer(){
|
public Renderer getRenderer(){
|
||||||
return renderer;
|
return renderer;
|
||||||
}
|
}
|
||||||
@ -390,6 +402,7 @@ public class LegacyApplication implements Application, SystemListener {
|
|||||||
/**
|
/**
|
||||||
* @return The {@link AudioRenderer audio renderer} for the application
|
* @return The {@link AudioRenderer audio renderer} for the application
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public AudioRenderer getAudioRenderer() {
|
public AudioRenderer getAudioRenderer() {
|
||||||
return audioRenderer;
|
return audioRenderer;
|
||||||
}
|
}
|
||||||
@ -397,6 +410,7 @@ public class LegacyApplication implements Application, SystemListener {
|
|||||||
/**
|
/**
|
||||||
* @return The {@link Listener listener} object for audio
|
* @return The {@link Listener listener} object for audio
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Listener getListener() {
|
public Listener getListener() {
|
||||||
return listener;
|
return listener;
|
||||||
}
|
}
|
||||||
@ -404,6 +418,7 @@ public class LegacyApplication implements Application, SystemListener {
|
|||||||
/**
|
/**
|
||||||
* @return The {@link JmeContext display context} for the application
|
* @return The {@link JmeContext display context} for the application
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public JmeContext getContext(){
|
public JmeContext getContext(){
|
||||||
return context;
|
return context;
|
||||||
}
|
}
|
||||||
@ -411,6 +426,7 @@ public class LegacyApplication implements Application, SystemListener {
|
|||||||
/**
|
/**
|
||||||
* @return The {@link Camera camera} for the application
|
* @return The {@link Camera camera} for the application
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Camera getCamera(){
|
public Camera getCamera(){
|
||||||
return cam;
|
return cam;
|
||||||
}
|
}
|
||||||
@ -420,6 +436,7 @@ public class LegacyApplication implements Application, SystemListener {
|
|||||||
*
|
*
|
||||||
* @see #start(com.jme3.system.JmeContext.Type)
|
* @see #start(com.jme3.system.JmeContext.Type)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void start(){
|
public void start(){
|
||||||
start(JmeContext.Type.Display, false);
|
start(JmeContext.Type.Display, false);
|
||||||
}
|
}
|
||||||
@ -429,6 +446,7 @@ public class LegacyApplication implements Application, SystemListener {
|
|||||||
*
|
*
|
||||||
* @see #start(com.jme3.system.JmeContext.Type)
|
* @see #start(com.jme3.system.JmeContext.Type)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void start(boolean waitFor){
|
public void start(boolean waitFor){
|
||||||
start(JmeContext.Type.Display, waitFor);
|
start(JmeContext.Type.Display, waitFor);
|
||||||
}
|
}
|
||||||
@ -468,6 +486,7 @@ public class LegacyApplication implements Application, SystemListener {
|
|||||||
* specific steps within a single update frame. Value defaults
|
* specific steps within a single update frame. Value defaults
|
||||||
* to null.
|
* to null.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setAppProfiler(AppProfiler prof) {
|
public void setAppProfiler(AppProfiler prof) {
|
||||||
this.prof = prof;
|
this.prof = prof;
|
||||||
if (renderManager != null) {
|
if (renderManager != null) {
|
||||||
@ -478,6 +497,7 @@ public class LegacyApplication implements Application, SystemListener {
|
|||||||
/**
|
/**
|
||||||
* Returns the current AppProfiler hook, or null if none is set.
|
* Returns the current AppProfiler hook, or null if none is set.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public AppProfiler getAppProfiler() {
|
public AppProfiler getAppProfiler() {
|
||||||
return prof;
|
return prof;
|
||||||
}
|
}
|
||||||
@ -538,6 +558,7 @@ public class LegacyApplication implements Application, SystemListener {
|
|||||||
/**
|
/**
|
||||||
* Internal use only.
|
* Internal use only.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void reshape(int w, int h){
|
public void reshape(int w, int h){
|
||||||
if (renderManager != null) {
|
if (renderManager != null) {
|
||||||
renderManager.notifyReshape(w, h);
|
renderManager.notifyReshape(w, h);
|
||||||
@ -551,6 +572,7 @@ public class LegacyApplication implements Application, SystemListener {
|
|||||||
* applied immediately; calling this method forces the context
|
* applied immediately; calling this method forces the context
|
||||||
* to restart, applying the new settings.
|
* to restart, applying the new settings.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void restart(){
|
public void restart(){
|
||||||
context.setSettings(settings);
|
context.setSettings(settings);
|
||||||
context.restart();
|
context.restart();
|
||||||
@ -564,6 +586,7 @@ public class LegacyApplication implements Application, SystemListener {
|
|||||||
*
|
*
|
||||||
* @see #stop(boolean)
|
* @see #stop(boolean)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void stop(){
|
public void stop(){
|
||||||
stop(false);
|
stop(false);
|
||||||
}
|
}
|
||||||
@ -573,6 +596,7 @@ public class LegacyApplication implements Application, SystemListener {
|
|||||||
* and making necessary cleanup operations.
|
* and making necessary cleanup operations.
|
||||||
* After the application has stopped, it cannot be used anymore.
|
* After the application has stopped, it cannot be used anymore.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void stop(boolean waitFor){
|
public void stop(boolean waitFor){
|
||||||
logger.log(Level.FINE, "Closing application: {0}", getClass().getName());
|
logger.log(Level.FINE, "Closing application: {0}", getClass().getName());
|
||||||
context.destroy(waitFor);
|
context.destroy(waitFor);
|
||||||
@ -588,6 +612,7 @@ public class LegacyApplication implements Application, SystemListener {
|
|||||||
* perspective projection with 45° field of view, with near
|
* perspective projection with 45° field of view, with near
|
||||||
* and far values 1 and 1000 units respectively.
|
* and far values 1 and 1000 units respectively.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void initialize(){
|
public void initialize(){
|
||||||
if (assetManager == null){
|
if (assetManager == null){
|
||||||
initAssetManager();
|
initAssetManager();
|
||||||
@ -611,6 +636,7 @@ public class LegacyApplication implements Application, SystemListener {
|
|||||||
/**
|
/**
|
||||||
* Internal use only.
|
* Internal use only.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void handleError(String errMsg, Throwable t){
|
public void handleError(String errMsg, Throwable t){
|
||||||
// Print error to log.
|
// Print error to log.
|
||||||
logger.log(Level.SEVERE, errMsg, t);
|
logger.log(Level.SEVERE, errMsg, t);
|
||||||
@ -630,6 +656,7 @@ public class LegacyApplication implements Application, SystemListener {
|
|||||||
/**
|
/**
|
||||||
* Internal use only.
|
* Internal use only.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void gainFocus(){
|
public void gainFocus(){
|
||||||
if (lostFocusBehavior != LostFocusBehavior.Disabled) {
|
if (lostFocusBehavior != LostFocusBehavior.Disabled) {
|
||||||
if (lostFocusBehavior == LostFocusBehavior.PauseOnLostFocus) {
|
if (lostFocusBehavior == LostFocusBehavior.PauseOnLostFocus) {
|
||||||
@ -645,6 +672,7 @@ public class LegacyApplication implements Application, SystemListener {
|
|||||||
/**
|
/**
|
||||||
* Internal use only.
|
* Internal use only.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void loseFocus(){
|
public void loseFocus(){
|
||||||
if (lostFocusBehavior != LostFocusBehavior.Disabled){
|
if (lostFocusBehavior != LostFocusBehavior.Disabled){
|
||||||
if (lostFocusBehavior == LostFocusBehavior.PauseOnLostFocus) {
|
if (lostFocusBehavior == LostFocusBehavior.PauseOnLostFocus) {
|
||||||
@ -657,6 +685,7 @@ public class LegacyApplication implements Application, SystemListener {
|
|||||||
/**
|
/**
|
||||||
* Internal use only.
|
* Internal use only.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void requestClose(boolean esc){
|
public void requestClose(boolean esc){
|
||||||
context.destroy(false);
|
context.destroy(false);
|
||||||
}
|
}
|
||||||
@ -671,6 +700,7 @@ public class LegacyApplication implements Application, SystemListener {
|
|||||||
*
|
*
|
||||||
* @param callable The callable to run in the main jME3 thread
|
* @param callable The callable to run in the main jME3 thread
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public <V> Future<V> enqueue(Callable<V> callable) {
|
public <V> Future<V> enqueue(Callable<V> callable) {
|
||||||
AppTask<V> task = new AppTask<V>(callable);
|
AppTask<V> task = new AppTask<V>(callable);
|
||||||
taskQueue.add(task);
|
taskQueue.add(task);
|
||||||
@ -687,6 +717,7 @@ public class LegacyApplication implements Application, SystemListener {
|
|||||||
*
|
*
|
||||||
* @param runnable The runnable to run in the main jME3 thread
|
* @param runnable The runnable to run in the main jME3 thread
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void enqueue(Runnable runnable){
|
public void enqueue(Runnable runnable){
|
||||||
enqueue(new RunnableWrapper(runnable));
|
enqueue(new RunnableWrapper(runnable));
|
||||||
}
|
}
|
||||||
@ -707,6 +738,7 @@ public class LegacyApplication implements Application, SystemListener {
|
|||||||
* Do not call manually.
|
* Do not call manually.
|
||||||
* Callback from ContextListener.
|
* Callback from ContextListener.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void update(){
|
public void update(){
|
||||||
// Make sure the audio renderer is available to callables
|
// Make sure the audio renderer is available to callables
|
||||||
AudioContext.setAudioRenderer(audioRenderer);
|
AudioContext.setAudioRenderer(audioRenderer);
|
||||||
@ -752,6 +784,7 @@ public class LegacyApplication implements Application, SystemListener {
|
|||||||
* Do not call manually.
|
* Do not call manually.
|
||||||
* Callback from ContextListener.
|
* Callback from ContextListener.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void destroy(){
|
public void destroy(){
|
||||||
stateManager.cleanup();
|
stateManager.cleanup();
|
||||||
|
|
||||||
@ -766,10 +799,12 @@ public class LegacyApplication implements Application, SystemListener {
|
|||||||
* @return The GUI viewport. Which is used for the on screen
|
* @return The GUI viewport. Which is used for the on screen
|
||||||
* statistics and FPS.
|
* statistics and FPS.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public ViewPort getGuiViewPort() {
|
public ViewPort getGuiViewPort() {
|
||||||
return guiViewPort;
|
return guiViewPort;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public ViewPort getViewPort() {
|
public ViewPort getViewPort() {
|
||||||
return viewPort;
|
return viewPort;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2012 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -82,6 +82,7 @@ public abstract class SimpleApplication extends LegacyApplication {
|
|||||||
|
|
||||||
private class AppActionListener implements ActionListener {
|
private class AppActionListener implements ActionListener {
|
||||||
|
|
||||||
|
@Override
|
||||||
public void onAction(String name, boolean value, float tpf) {
|
public void onAction(String name, boolean value, float tpf) {
|
||||||
if (!value) {
|
if (!value) {
|
||||||
return;
|
return;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2018 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -96,6 +96,7 @@ public class StatsView extends Node implements Control, JmeCloneable {
|
|||||||
return statText.getLineHeight() * statLabels.length;
|
return statText.getLineHeight() * statLabels.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void update(float tpf) {
|
public void update(float tpf) {
|
||||||
|
|
||||||
if (!isEnabled())
|
if (!isEnabled())
|
||||||
@ -133,6 +134,7 @@ public class StatsView extends Node implements Control, JmeCloneable {
|
|||||||
throw new UnsupportedOperationException("Not yet implemented.");
|
throw new UnsupportedOperationException("Not yet implemented.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setSpatial(Spatial spatial) {
|
public void setSpatial(Spatial spatial) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -145,6 +147,7 @@ public class StatsView extends Node implements Control, JmeCloneable {
|
|||||||
return enabled;
|
return enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void render(RenderManager rm, ViewPort vp) {
|
public void render(RenderManager rm, ViewPort vp) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2018 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -187,6 +187,7 @@ public class ScreenshotAppState extends AbstractAppState implements ActionListen
|
|||||||
super.initialize(stateManager, app);
|
super.initialize(stateManager, app);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void onAction(String name, boolean value, float tpf) {
|
public void onAction(String name, boolean value, float tpf) {
|
||||||
if (value){
|
if (value){
|
||||||
capture = true;
|
capture = true;
|
||||||
@ -197,6 +198,7 @@ public class ScreenshotAppState extends AbstractAppState implements ActionListen
|
|||||||
capture = true;
|
capture = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void initialize(RenderManager rm, ViewPort vp) {
|
public void initialize(RenderManager rm, ViewPort vp) {
|
||||||
renderer = rm.getRenderer();
|
renderer = rm.getRenderer();
|
||||||
this.rm = rm;
|
this.rm = rm;
|
||||||
@ -208,18 +210,22 @@ public class ScreenshotAppState extends AbstractAppState implements ActionListen
|
|||||||
return super.isInitialized() && renderer != null;
|
return super.isInitialized() && renderer != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void reshape(ViewPort vp, int w, int h) {
|
public void reshape(ViewPort vp, int w, int h) {
|
||||||
outBuf = BufferUtils.createByteBuffer(w * h * 4);
|
outBuf = BufferUtils.createByteBuffer(w * h * 4);
|
||||||
width = w;
|
width = w;
|
||||||
height = h;
|
height = h;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void preFrame(float tpf) {
|
public void preFrame(float tpf) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void postQueue(RenderQueue rq) {
|
public void postQueue(RenderQueue rq) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void postFrame(FrameBuffer out) {
|
public void postFrame(FrameBuffer out) {
|
||||||
if (capture){
|
if (capture){
|
||||||
capture = false;
|
capture = false;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2012 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -191,11 +191,13 @@ public class AssetKey<T> implements Savable, Cloneable {
|
|||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JmeExporter ex) throws IOException {
|
public void write(JmeExporter ex) throws IOException {
|
||||||
OutputCapsule oc = ex.getCapsule(this);
|
OutputCapsule oc = ex.getCapsule(this);
|
||||||
oc.write(name, "name", null);
|
oc.write(name, "name", null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void read(JmeImporter im) throws IOException {
|
public void read(JmeImporter im) throws IOException {
|
||||||
InputCapsule ic = im.getCapsule(this);
|
InputCapsule ic = im.getCapsule(this);
|
||||||
name = reducePath(ic.readString("name", null));
|
name = reducePath(ic.readString("name", null));
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2012 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -39,10 +39,12 @@ package com.jme3.asset;
|
|||||||
*/
|
*/
|
||||||
public class CloneableAssetProcessor implements AssetProcessor {
|
public class CloneableAssetProcessor implements AssetProcessor {
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object postProcess(AssetKey key, Object obj) {
|
public Object postProcess(AssetKey key, Object obj) {
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object createClone(Object obj) {
|
public Object createClone(Object obj) {
|
||||||
CloneableSmartAsset asset = (CloneableSmartAsset) obj;
|
CloneableSmartAsset asset = (CloneableSmartAsset) obj;
|
||||||
return asset.clone();
|
return asset.clone();
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2019 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -99,26 +99,32 @@ public class DesktopAssetManager implements AssetManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void addClassLoader(ClassLoader loader) {
|
public void addClassLoader(ClassLoader loader) {
|
||||||
classLoaders.add(loader);
|
classLoaders.add(loader);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void removeClassLoader(ClassLoader loader) {
|
public void removeClassLoader(ClassLoader loader) {
|
||||||
classLoaders.remove(loader);
|
classLoaders.remove(loader);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public List<ClassLoader> getClassLoaders(){
|
public List<ClassLoader> getClassLoaders(){
|
||||||
return Collections.unmodifiableList(classLoaders);
|
return Collections.unmodifiableList(classLoaders);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void addAssetEventListener(AssetEventListener listener) {
|
public void addAssetEventListener(AssetEventListener listener) {
|
||||||
eventListeners.add(listener);
|
eventListeners.add(listener);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void removeAssetEventListener(AssetEventListener listener) {
|
public void removeAssetEventListener(AssetEventListener listener) {
|
||||||
eventListeners.remove(listener);
|
eventListeners.remove(listener);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void clearAssetEventListeners() {
|
public void clearAssetEventListeners() {
|
||||||
eventListeners.clear();
|
eventListeners.clear();
|
||||||
}
|
}
|
||||||
@ -128,6 +134,7 @@ public class DesktopAssetManager implements AssetManager {
|
|||||||
eventListeners.add(listener);
|
eventListeners.add(listener);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void registerLoader(Class<? extends AssetLoader> loader, String ... extensions){
|
public void registerLoader(Class<? extends AssetLoader> loader, String ... extensions){
|
||||||
handler.addLoader(loader, extensions);
|
handler.addLoader(loader, extensions);
|
||||||
if (logger.isLoggable(Level.FINER)){
|
if (logger.isLoggable(Level.FINER)){
|
||||||
@ -150,6 +157,7 @@ public class DesktopAssetManager implements AssetManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void unregisterLoader(Class<? extends AssetLoader> loaderClass) {
|
public void unregisterLoader(Class<? extends AssetLoader> loaderClass) {
|
||||||
handler.removeLoader(loaderClass);
|
handler.removeLoader(loaderClass);
|
||||||
if (logger.isLoggable(Level.FINER)){
|
if (logger.isLoggable(Level.FINER)){
|
||||||
@ -158,6 +166,7 @@ public class DesktopAssetManager implements AssetManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void registerLocator(String rootPath, Class<? extends AssetLocator> locatorClass){
|
public void registerLocator(String rootPath, Class<? extends AssetLocator> locatorClass){
|
||||||
handler.addLocator(locatorClass, rootPath);
|
handler.addLocator(locatorClass, rootPath);
|
||||||
if (logger.isLoggable(Level.FINER)){
|
if (logger.isLoggable(Level.FINER)){
|
||||||
@ -180,6 +189,7 @@ public class DesktopAssetManager implements AssetManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void unregisterLocator(String rootPath, Class<? extends AssetLocator> clazz){
|
public void unregisterLocator(String rootPath, Class<? extends AssetLocator> clazz){
|
||||||
handler.removeLocator(clazz, rootPath);
|
handler.removeLocator(clazz, rootPath);
|
||||||
if (logger.isLoggable(Level.FINER)){
|
if (logger.isLoggable(Level.FINER)){
|
||||||
@ -188,6 +198,7 @@ public class DesktopAssetManager implements AssetManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public AssetInfo locateAsset(AssetKey<?> key){
|
public AssetInfo locateAsset(AssetKey<?> key){
|
||||||
AssetInfo info = handler.tryLocate(key);
|
AssetInfo info = handler.tryLocate(key);
|
||||||
if (info == null){
|
if (info == null){
|
||||||
@ -383,48 +394,59 @@ public class DesktopAssetManager implements AssetManager {
|
|||||||
return clone;
|
return clone;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object loadAsset(String name){
|
public Object loadAsset(String name){
|
||||||
return loadAsset(new AssetKey(name));
|
return loadAsset(new AssetKey(name));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Texture loadTexture(TextureKey key){
|
public Texture loadTexture(TextureKey key){
|
||||||
return (Texture) loadAsset(key);
|
return (Texture) loadAsset(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Material loadMaterial(String name){
|
public Material loadMaterial(String name){
|
||||||
return (Material) loadAsset(new MaterialKey(name));
|
return (Material) loadAsset(new MaterialKey(name));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Texture loadTexture(String name){
|
public Texture loadTexture(String name){
|
||||||
TextureKey key = new TextureKey(name, true);
|
TextureKey key = new TextureKey(name, true);
|
||||||
key.setGenerateMips(true);
|
key.setGenerateMips(true);
|
||||||
return loadTexture(key);
|
return loadTexture(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public AudioData loadAudio(AudioKey key){
|
public AudioData loadAudio(AudioKey key){
|
||||||
return (AudioData) loadAsset(key);
|
return (AudioData) loadAsset(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public AudioData loadAudio(String name){
|
public AudioData loadAudio(String name){
|
||||||
return loadAudio(new AudioKey(name, false));
|
return loadAudio(new AudioKey(name, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public BitmapFont loadFont(String name){
|
public BitmapFont loadFont(String name){
|
||||||
return (BitmapFont) loadAsset(new AssetKey(name));
|
return (BitmapFont) loadAsset(new AssetKey(name));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Spatial loadModel(ModelKey key){
|
public Spatial loadModel(ModelKey key){
|
||||||
return (Spatial) loadAsset(key);
|
return (Spatial) loadAsset(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Spatial loadModel(String name){
|
public Spatial loadModel(String name){
|
||||||
return loadModel(new ModelKey(name));
|
return loadModel(new ModelKey(name));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public FilterPostProcessor loadFilter(FilterKey key){
|
public FilterPostProcessor loadFilter(FilterKey key){
|
||||||
return (FilterPostProcessor) loadAsset(key);
|
return (FilterPostProcessor) loadAsset(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public FilterPostProcessor loadFilter(String name){
|
public FilterPostProcessor loadFilter(String name){
|
||||||
return loadFilter(new FilterKey(name));
|
return loadFilter(new FilterKey(name));
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2012 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -53,6 +53,7 @@ public class ThreadingManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected class LoadingThreadFactory implements ThreadFactory {
|
protected class LoadingThreadFactory implements ThreadFactory {
|
||||||
|
@Override
|
||||||
public Thread newThread(Runnable r) {
|
public Thread newThread(Runnable r) {
|
||||||
Thread t = new Thread(r, "jME3-threadpool-" + (nextThreadId++));
|
Thread t = new Thread(r, "jME3-threadpool-" + (nextThreadId++));
|
||||||
t.setDaemon(true);
|
t.setDaemon(true);
|
||||||
@ -69,6 +70,7 @@ public class ThreadingManager {
|
|||||||
this.assetKey = assetKey;
|
this.assetKey = assetKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public T call() throws Exception {
|
public T call() throws Exception {
|
||||||
return owner.loadAsset(assetKey);
|
return owner.loadAsset(assetKey);
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2012 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -46,25 +46,31 @@ public class SimpleAssetCache implements AssetCache {
|
|||||||
|
|
||||||
private final ConcurrentHashMap<AssetKey, Object> keyToAssetMap = new ConcurrentHashMap<AssetKey, Object>();
|
private final ConcurrentHashMap<AssetKey, Object> keyToAssetMap = new ConcurrentHashMap<AssetKey, Object>();
|
||||||
|
|
||||||
|
@Override
|
||||||
public <T> void addToCache(AssetKey<T> key, T obj) {
|
public <T> void addToCache(AssetKey<T> key, T obj) {
|
||||||
keyToAssetMap.put(key, obj);
|
keyToAssetMap.put(key, obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public <T> void registerAssetClone(AssetKey<T> key, T clone) {
|
public <T> void registerAssetClone(AssetKey<T> key, T clone) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public <T> T getFromCache(AssetKey<T> key) {
|
public <T> T getFromCache(AssetKey<T> key) {
|
||||||
return (T) keyToAssetMap.get(key);
|
return (T) keyToAssetMap.get(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean deleteFromCache(AssetKey key) {
|
public boolean deleteFromCache(AssetKey key) {
|
||||||
return keyToAssetMap.remove(key) != null;
|
return keyToAssetMap.remove(key) != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void clearCache() {
|
public void clearCache() {
|
||||||
keyToAssetMap.clear();
|
keyToAssetMap.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void notifyNoAssetClone() {
|
public void notifyNoAssetClone() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2012 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -84,6 +84,7 @@ public class WeakRefAssetCache implements AssetCache {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public <T> void addToCache(AssetKey<T> key, T obj) {
|
public <T> void addToCache(AssetKey<T> key, T obj) {
|
||||||
removeCollectedAssets();
|
removeCollectedAssets();
|
||||||
|
|
||||||
@ -93,6 +94,7 @@ public class WeakRefAssetCache implements AssetCache {
|
|||||||
assetCache.put(key, ref);
|
assetCache.put(key, ref);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public <T> T getFromCache(AssetKey<T> key) {
|
public <T> T getFromCache(AssetKey<T> key) {
|
||||||
AssetRef ref = assetCache.get(key);
|
AssetRef ref = assetCache.get(key);
|
||||||
if (ref != null){
|
if (ref != null){
|
||||||
@ -102,17 +104,21 @@ public class WeakRefAssetCache implements AssetCache {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean deleteFromCache(AssetKey key) {
|
public boolean deleteFromCache(AssetKey key) {
|
||||||
return assetCache.remove(key) != null;
|
return assetCache.remove(key) != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void clearCache() {
|
public void clearCache() {
|
||||||
assetCache.clear();
|
assetCache.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public <T> void registerAssetClone(AssetKey<T> key, T clone) {
|
public <T> void registerAssetClone(AssetKey<T> key, T clone) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void notifyNoAssetClone() {
|
public void notifyNoAssetClone() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2012 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -119,6 +119,7 @@ public class WeakRefCloneAssetCache implements AssetCache {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public <T> void addToCache(AssetKey<T> originalKey, T obj) {
|
public <T> void addToCache(AssetKey<T> originalKey, T obj) {
|
||||||
// Make room for new asset
|
// Make room for new asset
|
||||||
removeCollectedAssets();
|
removeCollectedAssets();
|
||||||
@ -143,16 +144,19 @@ public class WeakRefCloneAssetCache implements AssetCache {
|
|||||||
loadStack.add(originalKey);
|
loadStack.add(originalKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public <T> void registerAssetClone(AssetKey<T> key, T clone) {
|
public <T> void registerAssetClone(AssetKey<T> key, T clone) {
|
||||||
ArrayList<AssetKey> loadStack = assetLoadStack.get();
|
ArrayList<AssetKey> loadStack = assetLoadStack.get();
|
||||||
((CloneableSmartAsset)clone).setKey(loadStack.remove(loadStack.size() - 1));
|
((CloneableSmartAsset)clone).setKey(loadStack.remove(loadStack.size() - 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void notifyNoAssetClone() {
|
public void notifyNoAssetClone() {
|
||||||
ArrayList<AssetKey> loadStack = assetLoadStack.get();
|
ArrayList<AssetKey> loadStack = assetLoadStack.get();
|
||||||
loadStack.remove(loadStack.size() - 1);
|
loadStack.remove(loadStack.size() - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public <T> T getFromCache(AssetKey<T> key) {
|
public <T> T getFromCache(AssetKey<T> key) {
|
||||||
AssetRef smartInfo = smartCache.get(key);
|
AssetRef smartInfo = smartCache.get(key);
|
||||||
if (smartInfo == null) {
|
if (smartInfo == null) {
|
||||||
@ -177,6 +181,7 @@ public class WeakRefCloneAssetCache implements AssetCache {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean deleteFromCache(AssetKey key) {
|
public boolean deleteFromCache(AssetKey key) {
|
||||||
ArrayList<AssetKey> loadStack = assetLoadStack.get();
|
ArrayList<AssetKey> loadStack = assetLoadStack.get();
|
||||||
|
|
||||||
@ -188,6 +193,7 @@ public class WeakRefCloneAssetCache implements AssetCache {
|
|||||||
return smartCache.remove(key) != null;
|
return smartCache.remove(key) != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void clearCache() {
|
public void clearCache() {
|
||||||
ArrayList<AssetKey> loadStack = assetLoadStack.get();
|
ArrayList<AssetKey> loadStack = assetLoadStack.get();
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2012 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -59,6 +59,7 @@ public class AudioBuffer extends AudioData {
|
|||||||
super(id);
|
super(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public DataType getDataType() {
|
public DataType getDataType() {
|
||||||
return DataType.Buffer;
|
return DataType.Buffer;
|
||||||
}
|
}
|
||||||
@ -67,6 +68,7 @@ public class AudioBuffer extends AudioData {
|
|||||||
* @return The duration of the audio in seconds. It is expected
|
* @return The duration of the audio in seconds. It is expected
|
||||||
* that audio is uncompressed.
|
* that audio is uncompressed.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public float getDuration(){
|
public float getDuration(){
|
||||||
int bytesPerSec = (bitsPerSample / 8) * channels * sampleRate;
|
int bytesPerSec = (bitsPerSample / 8) * channels * sampleRate;
|
||||||
if (audioData != null)
|
if (audioData != null)
|
||||||
@ -98,6 +100,7 @@ public class AudioBuffer extends AudioData {
|
|||||||
return audioData;
|
return audioData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void resetObject() {
|
public void resetObject() {
|
||||||
id = -1;
|
id = -1;
|
||||||
setUpdateNeeded();
|
setUpdateNeeded();
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2012, 2016, 2018-2019 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -252,6 +252,7 @@ public class AudioNode extends Node implements AudioSource {
|
|||||||
/**
|
/**
|
||||||
* Do not use.
|
* Do not use.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public final void setChannel(int channel) {
|
public final void setChannel(int channel) {
|
||||||
if (status != AudioSource.Status.Stopped) {
|
if (status != AudioSource.Status.Stopped) {
|
||||||
throw new IllegalStateException("Can only set source id when stopped");
|
throw new IllegalStateException("Can only set source id when stopped");
|
||||||
@ -263,6 +264,7 @@ public class AudioNode extends Node implements AudioSource {
|
|||||||
/**
|
/**
|
||||||
* Do not use.
|
* Do not use.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public int getChannel() {
|
public int getChannel() {
|
||||||
return channel;
|
return channel;
|
||||||
}
|
}
|
||||||
@ -271,6 +273,7 @@ public class AudioNode extends Node implements AudioSource {
|
|||||||
* @return The {#link Filter dry filter} that is set.
|
* @return The {#link Filter dry filter} that is set.
|
||||||
* @see AudioNode#setDryFilter(com.jme3.audio.Filter)
|
* @see AudioNode#setDryFilter(com.jme3.audio.Filter)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Filter getDryFilter() {
|
public Filter getDryFilter() {
|
||||||
return dryFilter;
|
return dryFilter;
|
||||||
}
|
}
|
||||||
@ -315,6 +318,7 @@ public class AudioNode extends Node implements AudioSource {
|
|||||||
* {@link AudioNode#setAudioData(com.jme3.audio.AudioData, com.jme3.audio.AudioKey) }
|
* {@link AudioNode#setAudioData(com.jme3.audio.AudioData, com.jme3.audio.AudioKey) }
|
||||||
* or any of the constructors that initialize the audio data.
|
* or any of the constructors that initialize the audio data.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public AudioData getAudioData() {
|
public AudioData getAudioData() {
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
@ -324,6 +328,7 @@ public class AudioNode extends Node implements AudioSource {
|
|||||||
* The status will be changed when either the {@link AudioNode#play() }
|
* The status will be changed when either the {@link AudioNode#play() }
|
||||||
* or {@link AudioNode#stop() } methods are called.
|
* or {@link AudioNode#stop() } methods are called.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public AudioSource.Status getStatus() {
|
public AudioSource.Status getStatus() {
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
@ -331,6 +336,7 @@ public class AudioNode extends Node implements AudioSource {
|
|||||||
/**
|
/**
|
||||||
* Do not use.
|
* Do not use.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public final void setStatus(AudioSource.Status status) {
|
public final void setStatus(AudioSource.Status status) {
|
||||||
this.status = status;
|
this.status = status;
|
||||||
}
|
}
|
||||||
@ -353,6 +359,7 @@ public class AudioNode extends Node implements AudioSource {
|
|||||||
* otherwise, false.
|
* otherwise, false.
|
||||||
* @see AudioNode#setLooping(boolean)
|
* @see AudioNode#setLooping(boolean)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isLooping() {
|
public boolean isLooping() {
|
||||||
return loop;
|
return loop;
|
||||||
}
|
}
|
||||||
@ -373,6 +380,7 @@ public class AudioNode extends Node implements AudioSource {
|
|||||||
*
|
*
|
||||||
* @see AudioNode#setPitch(float)
|
* @see AudioNode#setPitch(float)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public float getPitch() {
|
public float getPitch() {
|
||||||
return pitch;
|
return pitch;
|
||||||
}
|
}
|
||||||
@ -399,6 +407,7 @@ public class AudioNode extends Node implements AudioSource {
|
|||||||
*
|
*
|
||||||
* @see AudioNode#setVolume(float)
|
* @see AudioNode#setVolume(float)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public float getVolume() {
|
public float getVolume() {
|
||||||
return volume;
|
return volume;
|
||||||
}
|
}
|
||||||
@ -424,6 +433,7 @@ public class AudioNode extends Node implements AudioSource {
|
|||||||
/**
|
/**
|
||||||
* @return the time offset in the sound sample when to start playing.
|
* @return the time offset in the sound sample when to start playing.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public float getTimeOffset() {
|
public float getTimeOffset() {
|
||||||
return timeOffset;
|
return timeOffset;
|
||||||
}
|
}
|
||||||
@ -456,6 +466,7 @@ public class AudioNode extends Node implements AudioSource {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Vector3f getPosition() {
|
public Vector3f getPosition() {
|
||||||
return getWorldTranslation();
|
return getWorldTranslation();
|
||||||
}
|
}
|
||||||
@ -465,6 +476,7 @@ public class AudioNode extends Node implements AudioSource {
|
|||||||
*
|
*
|
||||||
* @see AudioNode#setVelocity(com.jme3.math.Vector3f)
|
* @see AudioNode#setVelocity(com.jme3.math.Vector3f)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Vector3f getVelocity() {
|
public Vector3f getVelocity() {
|
||||||
return velocity;
|
return velocity;
|
||||||
}
|
}
|
||||||
@ -487,6 +499,7 @@ public class AudioNode extends Node implements AudioSource {
|
|||||||
*
|
*
|
||||||
* @see AudioNode#setReverbEnabled(boolean)
|
* @see AudioNode#setReverbEnabled(boolean)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isReverbEnabled() {
|
public boolean isReverbEnabled() {
|
||||||
return reverbEnabled;
|
return reverbEnabled;
|
||||||
}
|
}
|
||||||
@ -513,6 +526,7 @@ public class AudioNode extends Node implements AudioSource {
|
|||||||
*
|
*
|
||||||
* @see AudioNode#setReverbFilter(com.jme3.audio.Filter)
|
* @see AudioNode#setReverbFilter(com.jme3.audio.Filter)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Filter getReverbFilter() {
|
public Filter getReverbFilter() {
|
||||||
return reverbFilter;
|
return reverbFilter;
|
||||||
}
|
}
|
||||||
@ -538,6 +552,7 @@ public class AudioNode extends Node implements AudioSource {
|
|||||||
*
|
*
|
||||||
* @see AudioNode#setMaxDistance(float)
|
* @see AudioNode#setMaxDistance(float)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public float getMaxDistance() {
|
public float getMaxDistance() {
|
||||||
return maxDistance;
|
return maxDistance;
|
||||||
}
|
}
|
||||||
@ -572,6 +587,7 @@ public class AudioNode extends Node implements AudioSource {
|
|||||||
*
|
*
|
||||||
* @see AudioNode#setRefDistance(float)
|
* @see AudioNode#setRefDistance(float)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public float getRefDistance() {
|
public float getRefDistance() {
|
||||||
return refDistance;
|
return refDistance;
|
||||||
}
|
}
|
||||||
@ -601,6 +617,7 @@ public class AudioNode extends Node implements AudioSource {
|
|||||||
*
|
*
|
||||||
* @see AudioNode#setDirectional(boolean)
|
* @see AudioNode#setDirectional(boolean)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isDirectional() {
|
public boolean isDirectional() {
|
||||||
return directional;
|
return directional;
|
||||||
}
|
}
|
||||||
@ -626,6 +643,7 @@ public class AudioNode extends Node implements AudioSource {
|
|||||||
*
|
*
|
||||||
* @see AudioNode#setDirection(com.jme3.math.Vector3f)
|
* @see AudioNode#setDirection(com.jme3.math.Vector3f)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Vector3f getDirection() {
|
public Vector3f getDirection() {
|
||||||
return direction;
|
return direction;
|
||||||
}
|
}
|
||||||
@ -648,6 +666,7 @@ public class AudioNode extends Node implements AudioSource {
|
|||||||
*
|
*
|
||||||
* @see AudioNode#setInnerAngle(float)
|
* @see AudioNode#setInnerAngle(float)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public float getInnerAngle() {
|
public float getInnerAngle() {
|
||||||
return innerAngle;
|
return innerAngle;
|
||||||
}
|
}
|
||||||
@ -669,6 +688,7 @@ public class AudioNode extends Node implements AudioSource {
|
|||||||
*
|
*
|
||||||
* @see AudioNode#setOuterAngle(float)
|
* @see AudioNode#setOuterAngle(float)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public float getOuterAngle() {
|
public float getOuterAngle() {
|
||||||
return outerAngle;
|
return outerAngle;
|
||||||
}
|
}
|
||||||
@ -690,6 +710,7 @@ public class AudioNode extends Node implements AudioSource {
|
|||||||
*
|
*
|
||||||
* @see AudioNode#setPositional(boolean)
|
* @see AudioNode#setPositional(boolean)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isPositional() {
|
public boolean isPositional() {
|
||||||
return positional;
|
return positional;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2012 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -115,6 +115,7 @@ public class AudioStream extends AudioData implements Closeable {
|
|||||||
return readSamples(buf, 0, buf.length);
|
return readSamples(buf, 0, buf.length);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public float getDuration() {
|
public float getDuration() {
|
||||||
return duration;
|
return duration;
|
||||||
}
|
}
|
||||||
@ -181,6 +182,7 @@ public class AudioStream extends AudioData implements Closeable {
|
|||||||
*
|
*
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void close() {
|
public void close() {
|
||||||
if (in != null && open) {
|
if (in != null && open) {
|
||||||
try {
|
try {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2012 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -47,10 +47,12 @@ public abstract class Filter extends NativeObject implements Savable {
|
|||||||
super(id);
|
super(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JmeExporter ex) throws IOException {
|
public void write(JmeExporter ex) throws IOException {
|
||||||
// nothing to save
|
// nothing to save
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void read(JmeImporter im) throws IOException {
|
public void read(JmeImporter im) throws IOException {
|
||||||
// nothing to read
|
// nothing to read
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2012 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -76,6 +76,7 @@ public class LowPassFilter extends Filter {
|
|||||||
this.updateNeeded = true;
|
this.updateNeeded = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JmeExporter ex) throws IOException{
|
public void write(JmeExporter ex) throws IOException{
|
||||||
super.write(ex);
|
super.write(ex);
|
||||||
OutputCapsule oc = ex.getCapsule(this);
|
OutputCapsule oc = ex.getCapsule(this);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2019 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -216,6 +216,7 @@ public class ALAudioRenderer implements AudioRenderer, Runnable {
|
|||||||
alc.destroyALC();
|
alc.destroyALC();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
if (decoderThread.isAlive()) {
|
if (decoderThread.isAlive()) {
|
||||||
throw new IllegalStateException("Initialize already called");
|
throw new IllegalStateException("Initialize already called");
|
||||||
@ -237,6 +238,7 @@ public class ALAudioRenderer implements AudioRenderer, Runnable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
long updateRateNanos = (long) (UPDATE_RATE * 1000000000);
|
long updateRateNanos = (long) (UPDATE_RATE * 1000000000);
|
||||||
mainloop:
|
mainloop:
|
||||||
@ -267,6 +269,7 @@ public class ALAudioRenderer implements AudioRenderer, Runnable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void cleanup() {
|
public void cleanup() {
|
||||||
// kill audio thread
|
// kill audio thread
|
||||||
if (!decoderThread.isAlive()) {
|
if (!decoderThread.isAlive()) {
|
||||||
@ -359,6 +362,7 @@ public class ALAudioRenderer implements AudioRenderer, Runnable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void updateSourceParam(AudioSource src, AudioParam param) {
|
public void updateSourceParam(AudioSource src, AudioParam param) {
|
||||||
checkDead();
|
checkDead();
|
||||||
synchronized (threadLock) {
|
synchronized (threadLock) {
|
||||||
@ -585,6 +589,7 @@ public class ALAudioRenderer implements AudioRenderer, Runnable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void updateListenerParam(Listener listener, ListenerParam param) {
|
public void updateListenerParam(Listener listener, ListenerParam param) {
|
||||||
checkDead();
|
checkDead();
|
||||||
synchronized (threadLock) {
|
synchronized (threadLock) {
|
||||||
@ -651,6 +656,7 @@ public class ALAudioRenderer implements AudioRenderer, Runnable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setEnvironment(Environment env) {
|
public void setEnvironment(Environment env) {
|
||||||
checkDead();
|
checkDead();
|
||||||
synchronized (threadLock) {
|
synchronized (threadLock) {
|
||||||
@ -845,6 +851,7 @@ public class ALAudioRenderer implements AudioRenderer, Runnable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void update(float tpf) {
|
public void update(float tpf) {
|
||||||
synchronized (threadLock) {
|
synchronized (threadLock) {
|
||||||
updateInRenderThread(tpf);
|
updateInRenderThread(tpf);
|
||||||
@ -977,6 +984,7 @@ public class ALAudioRenderer implements AudioRenderer, Runnable {
|
|||||||
objManager.deleteUnused(this);
|
objManager.deleteUnused(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setListener(Listener listener) {
|
public void setListener(Listener listener) {
|
||||||
checkDead();
|
checkDead();
|
||||||
synchronized (threadLock) {
|
synchronized (threadLock) {
|
||||||
@ -996,6 +1004,7 @@ public class ALAudioRenderer implements AudioRenderer, Runnable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void pauseAll() {
|
public void pauseAll() {
|
||||||
if (!supportPauseDevice) {
|
if (!supportPauseDevice) {
|
||||||
throw new UnsupportedOperationException("Pause device is NOT supported!");
|
throw new UnsupportedOperationException("Pause device is NOT supported!");
|
||||||
@ -1004,6 +1013,7 @@ public class ALAudioRenderer implements AudioRenderer, Runnable {
|
|||||||
alc.alcDevicePauseSOFT();
|
alc.alcDevicePauseSOFT();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void resumeAll() {
|
public void resumeAll() {
|
||||||
if (!supportPauseDevice) {
|
if (!supportPauseDevice) {
|
||||||
throw new UnsupportedOperationException("Pause device is NOT supported!");
|
throw new UnsupportedOperationException("Pause device is NOT supported!");
|
||||||
@ -1012,6 +1022,7 @@ public class ALAudioRenderer implements AudioRenderer, Runnable {
|
|||||||
alc.alcDeviceResumeSOFT();
|
alc.alcDeviceResumeSOFT();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void playSourceInstance(AudioSource src) {
|
public void playSourceInstance(AudioSource src) {
|
||||||
checkDead();
|
checkDead();
|
||||||
synchronized (threadLock) {
|
synchronized (threadLock) {
|
||||||
@ -1049,6 +1060,7 @@ public class ALAudioRenderer implements AudioRenderer, Runnable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void playSource(AudioSource src) {
|
public void playSource(AudioSource src) {
|
||||||
checkDead();
|
checkDead();
|
||||||
synchronized (threadLock) {
|
synchronized (threadLock) {
|
||||||
@ -1087,6 +1099,7 @@ public class ALAudioRenderer implements AudioRenderer, Runnable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void pauseSource(AudioSource src) {
|
public void pauseSource(AudioSource src) {
|
||||||
checkDead();
|
checkDead();
|
||||||
synchronized (threadLock) {
|
synchronized (threadLock) {
|
||||||
@ -1103,6 +1116,7 @@ public class ALAudioRenderer implements AudioRenderer, Runnable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void stopSource(AudioSource src) {
|
public void stopSource(AudioSource src) {
|
||||||
synchronized (threadLock) {
|
synchronized (threadLock) {
|
||||||
if (audioDisabled) {
|
if (audioDisabled) {
|
||||||
@ -1196,6 +1210,7 @@ public class ALAudioRenderer implements AudioRenderer, Runnable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void deleteFilter(Filter filter) {
|
public void deleteFilter(Filter filter) {
|
||||||
int id = filter.getId();
|
int id = filter.getId();
|
||||||
if (id != -1) {
|
if (id != -1) {
|
||||||
@ -1206,6 +1221,7 @@ public class ALAudioRenderer implements AudioRenderer, Runnable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void deleteAudioData(AudioData ad) {
|
public void deleteAudioData(AudioData ad) {
|
||||||
synchronized (threadLock) {
|
synchronized (threadLock) {
|
||||||
if (audioDisabled) {
|
if (audioDisabled) {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2013 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -106,6 +106,7 @@ public class BoundingBox extends BoundingVolume {
|
|||||||
setMinMax(min, max);
|
setMinMax(min, max);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Type getType() {
|
public Type getType() {
|
||||||
return Type.AABB;
|
return Type.AABB;
|
||||||
}
|
}
|
||||||
@ -117,6 +118,7 @@ public class BoundingBox extends BoundingVolume {
|
|||||||
* @param points
|
* @param points
|
||||||
* the points to contain.
|
* the points to contain.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void computeFromPoints(FloatBuffer points) {
|
public void computeFromPoints(FloatBuffer points) {
|
||||||
containAABB(points);
|
containAABB(points);
|
||||||
}
|
}
|
||||||
@ -293,6 +295,7 @@ public class BoundingBox extends BoundingVolume {
|
|||||||
* @param store
|
* @param store
|
||||||
* box to store result in
|
* box to store result in
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public BoundingVolume transform(Transform trans, BoundingVolume store) {
|
public BoundingVolume transform(Transform trans, BoundingVolume store) {
|
||||||
|
|
||||||
BoundingBox box;
|
BoundingBox box;
|
||||||
@ -326,6 +329,7 @@ public class BoundingBox extends BoundingVolume {
|
|||||||
return box;
|
return box;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public BoundingVolume transform(Matrix4f trans, BoundingVolume store) {
|
public BoundingVolume transform(Matrix4f trans, BoundingVolume store) {
|
||||||
BoundingBox box;
|
BoundingBox box;
|
||||||
if (store == null || store.getType() != Type.AABB) {
|
if (store == null || store.getType() != Type.AABB) {
|
||||||
@ -365,6 +369,7 @@ public class BoundingBox extends BoundingVolume {
|
|||||||
* @param plane
|
* @param plane
|
||||||
* the plane to check against.
|
* the plane to check against.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Plane.Side whichSide(Plane plane) {
|
public Plane.Side whichSide(Plane plane) {
|
||||||
float radius = FastMath.abs(xExtent * plane.getNormal().getX())
|
float radius = FastMath.abs(xExtent * plane.getNormal().getX())
|
||||||
+ FastMath.abs(yExtent * plane.getNormal().getY())
|
+ FastMath.abs(yExtent * plane.getNormal().getY())
|
||||||
@ -392,6 +397,7 @@ public class BoundingBox extends BoundingVolume {
|
|||||||
* @return this box (with its components modified) or null if the second
|
* @return this box (with its components modified) or null if the second
|
||||||
* volume is of some type other than AABB or Sphere
|
* volume is of some type other than AABB or Sphere
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public BoundingVolume merge(BoundingVolume volume) {
|
public BoundingVolume merge(BoundingVolume volume) {
|
||||||
return mergeLocal(volume);
|
return mergeLocal(volume);
|
||||||
}
|
}
|
||||||
@ -406,6 +412,7 @@ public class BoundingBox extends BoundingVolume {
|
|||||||
* @return this box (with its components modified) or null if the second
|
* @return this box (with its components modified) or null if the second
|
||||||
* volume is of some type other than AABB or Sphere
|
* volume is of some type other than AABB or Sphere
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public BoundingVolume mergeLocal(BoundingVolume volume) {
|
public BoundingVolume mergeLocal(BoundingVolume volume) {
|
||||||
if (volume == null) {
|
if (volume == null) {
|
||||||
return this;
|
return this;
|
||||||
@ -548,6 +555,7 @@ public class BoundingBox extends BoundingVolume {
|
|||||||
* a new store is created.
|
* a new store is created.
|
||||||
* @return the new BoundingBox
|
* @return the new BoundingBox
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public BoundingVolume clone(BoundingVolume store) {
|
public BoundingVolume clone(BoundingVolume store) {
|
||||||
if (store != null && store.getType() == Type.AABB) {
|
if (store != null && store.getType() == Type.AABB) {
|
||||||
BoundingBox rVal = (BoundingBox) store;
|
BoundingBox rVal = (BoundingBox) store;
|
||||||
@ -584,6 +592,7 @@ public class BoundingBox extends BoundingVolume {
|
|||||||
*
|
*
|
||||||
* @see BoundingVolume#intersects(com.jme3.bounding.BoundingVolume)
|
* @see BoundingVolume#intersects(com.jme3.bounding.BoundingVolume)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean intersects(BoundingVolume bv) {
|
public boolean intersects(BoundingVolume bv) {
|
||||||
return bv.intersectsBoundingBox(this);
|
return bv.intersectsBoundingBox(this);
|
||||||
}
|
}
|
||||||
@ -593,6 +602,7 @@ public class BoundingBox extends BoundingVolume {
|
|||||||
*
|
*
|
||||||
* @see BoundingVolume#intersectsSphere(com.jme3.bounding.BoundingSphere)
|
* @see BoundingVolume#intersectsSphere(com.jme3.bounding.BoundingSphere)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean intersectsSphere(BoundingSphere bs) {
|
public boolean intersectsSphere(BoundingSphere bs) {
|
||||||
return bs.intersectsBoundingBox(this);
|
return bs.intersectsBoundingBox(this);
|
||||||
}
|
}
|
||||||
@ -604,6 +614,7 @@ public class BoundingBox extends BoundingVolume {
|
|||||||
*
|
*
|
||||||
* @see BoundingVolume#intersectsBoundingBox(com.jme3.bounding.BoundingBox)
|
* @see BoundingVolume#intersectsBoundingBox(com.jme3.bounding.BoundingBox)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean intersectsBoundingBox(BoundingBox bb) {
|
public boolean intersectsBoundingBox(BoundingBox bb) {
|
||||||
assert Vector3f.isValidVector(center) && Vector3f.isValidVector(bb.center);
|
assert Vector3f.isValidVector(center) && Vector3f.isValidVector(bb.center);
|
||||||
|
|
||||||
@ -636,6 +647,7 @@ public class BoundingBox extends BoundingVolume {
|
|||||||
*
|
*
|
||||||
* @see BoundingVolume#intersects(com.jme3.math.Ray)
|
* @see BoundingVolume#intersects(com.jme3.math.Ray)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean intersects(Ray ray) {
|
public boolean intersects(Ray ray) {
|
||||||
assert Vector3f.isValidVector(center);
|
assert Vector3f.isValidVector(center);
|
||||||
|
|
||||||
@ -853,6 +865,7 @@ public class BoundingBox extends BoundingVolume {
|
|||||||
&& FastMath.abs(center.z - point.z) <= zExtent;
|
&& FastMath.abs(center.z - point.z) <= zExtent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public float distanceToEdge(Vector3f point) {
|
public float distanceToEdge(Vector3f point) {
|
||||||
// compute coordinates of point in box coordinate system
|
// compute coordinates of point in box coordinate system
|
||||||
TempVars vars= TempVars.get();
|
TempVars vars= TempVars.get();
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2012 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -85,6 +85,7 @@ public class BoundingSphere extends BoundingVolume {
|
|||||||
this.radius = r;
|
this.radius = r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Type getType() {
|
public Type getType() {
|
||||||
return Type.Sphere;
|
return Type.Sphere;
|
||||||
}
|
}
|
||||||
@ -116,6 +117,7 @@ public class BoundingSphere extends BoundingVolume {
|
|||||||
* @param points
|
* @param points
|
||||||
* the points to contain.
|
* the points to contain.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void computeFromPoints(FloatBuffer points) {
|
public void computeFromPoints(FloatBuffer points) {
|
||||||
calcWelzl(points);
|
calcWelzl(points);
|
||||||
}
|
}
|
||||||
@ -383,6 +385,7 @@ public class BoundingSphere extends BoundingVolume {
|
|||||||
* @return BoundingVolume
|
* @return BoundingVolume
|
||||||
* @return ref
|
* @return ref
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public BoundingVolume transform(Transform trans, BoundingVolume store) {
|
public BoundingVolume transform(Transform trans, BoundingVolume store) {
|
||||||
BoundingSphere sphere;
|
BoundingSphere sphere;
|
||||||
if (store == null || store.getType() != BoundingVolume.Type.Sphere) {
|
if (store == null || store.getType() != BoundingVolume.Type.Sphere) {
|
||||||
@ -398,6 +401,7 @@ public class BoundingSphere extends BoundingVolume {
|
|||||||
return sphere;
|
return sphere;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public BoundingVolume transform(Matrix4f trans, BoundingVolume store) {
|
public BoundingVolume transform(Matrix4f trans, BoundingVolume store) {
|
||||||
BoundingSphere sphere;
|
BoundingSphere sphere;
|
||||||
if (store == null || store.getType() != BoundingVolume.Type.Sphere) {
|
if (store == null || store.getType() != BoundingVolume.Type.Sphere) {
|
||||||
@ -441,6 +445,7 @@ public class BoundingSphere extends BoundingVolume {
|
|||||||
* the plane to check against.
|
* the plane to check against.
|
||||||
* @return side
|
* @return side
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Plane.Side whichSide(Plane plane) {
|
public Plane.Side whichSide(Plane plane) {
|
||||||
float distance = plane.pseudoDistance(center);
|
float distance = plane.pseudoDistance(center);
|
||||||
|
|
||||||
@ -461,6 +466,7 @@ public class BoundingSphere extends BoundingVolume {
|
|||||||
* the sphere to combine with this sphere.
|
* the sphere to combine with this sphere.
|
||||||
* @return a new sphere
|
* @return a new sphere
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public BoundingVolume merge(BoundingVolume volume) {
|
public BoundingVolume merge(BoundingVolume volume) {
|
||||||
if (volume == null) {
|
if (volume == null) {
|
||||||
return this;
|
return this;
|
||||||
@ -506,6 +512,7 @@ public class BoundingSphere extends BoundingVolume {
|
|||||||
* the sphere to combine with this sphere.
|
* the sphere to combine with this sphere.
|
||||||
* @return this
|
* @return this
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public BoundingVolume mergeLocal(BoundingVolume volume) {
|
public BoundingVolume mergeLocal(BoundingVolume volume) {
|
||||||
if (volume == null) {
|
if (volume == null) {
|
||||||
return this;
|
return this;
|
||||||
@ -629,6 +636,7 @@ public class BoundingSphere extends BoundingVolume {
|
|||||||
* a new store is created.
|
* a new store is created.
|
||||||
* @return the new BoundingSphere
|
* @return the new BoundingSphere
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public BoundingVolume clone(BoundingVolume store) {
|
public BoundingVolume clone(BoundingVolume store) {
|
||||||
if (store != null && store.getType() == Type.Sphere) {
|
if (store != null && store.getType() == Type.Sphere) {
|
||||||
BoundingSphere rVal = (BoundingSphere) store;
|
BoundingSphere rVal = (BoundingSphere) store;
|
||||||
@ -661,6 +669,7 @@ public class BoundingSphere extends BoundingVolume {
|
|||||||
*
|
*
|
||||||
* @see com.jme.bounding.BoundingVolume#intersects(com.jme.bounding.BoundingVolume)
|
* @see com.jme.bounding.BoundingVolume#intersects(com.jme.bounding.BoundingVolume)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean intersects(BoundingVolume bv) {
|
public boolean intersects(BoundingVolume bv) {
|
||||||
return bv.intersectsSphere(this);
|
return bv.intersectsSphere(this);
|
||||||
}
|
}
|
||||||
@ -670,6 +679,7 @@ public class BoundingSphere extends BoundingVolume {
|
|||||||
*
|
*
|
||||||
* @see com.jme.bounding.BoundingVolume#intersectsSphere(com.jme.bounding.BoundingSphere)
|
* @see com.jme.bounding.BoundingVolume#intersectsSphere(com.jme.bounding.BoundingSphere)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean intersectsSphere(BoundingSphere bs) {
|
public boolean intersectsSphere(BoundingSphere bs) {
|
||||||
return Intersection.intersect(bs, center, radius);
|
return Intersection.intersect(bs, center, radius);
|
||||||
}
|
}
|
||||||
@ -679,6 +689,7 @@ public class BoundingSphere extends BoundingVolume {
|
|||||||
*
|
*
|
||||||
* @see com.jme.bounding.BoundingVolume#intersectsBoundingBox(com.jme.bounding.BoundingBox)
|
* @see com.jme.bounding.BoundingVolume#intersectsBoundingBox(com.jme.bounding.BoundingBox)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean intersectsBoundingBox(BoundingBox bb) {
|
public boolean intersectsBoundingBox(BoundingBox bb) {
|
||||||
return Intersection.intersect(bb, center, radius);
|
return Intersection.intersect(bb, center, radius);
|
||||||
}
|
}
|
||||||
@ -697,6 +708,7 @@ public class BoundingSphere extends BoundingVolume {
|
|||||||
*
|
*
|
||||||
* @see com.jme.bounding.BoundingVolume#intersects(com.jme.math.Ray)
|
* @see com.jme.bounding.BoundingVolume#intersects(com.jme.math.Ray)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean intersects(Ray ray) {
|
public boolean intersects(Ray ray) {
|
||||||
assert Vector3f.isValidVector(center);
|
assert Vector3f.isValidVector(center);
|
||||||
|
|
||||||
@ -988,6 +1000,7 @@ public class BoundingSphere extends BoundingVolume {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int collideWith(Collidable other, CollisionResults results) {
|
public int collideWith(Collidable other, CollisionResults results) {
|
||||||
if (other instanceof Ray) {
|
if (other instanceof Ray) {
|
||||||
Ray ray = (Ray) other;
|
Ray ray = (Ray) other;
|
||||||
@ -1034,6 +1047,7 @@ public class BoundingSphere extends BoundingVolume {
|
|||||||
return center.distanceSquared(point) <= (getRadius() * getRadius());
|
return center.distanceSquared(point) <= (getRadius() * getRadius());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public float distanceToEdge(Vector3f point) {
|
public float distanceToEdge(Vector3f point) {
|
||||||
return center.distance(point) - radius;
|
return center.distance(point) - radius;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2012 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -317,10 +317,12 @@ public abstract class BoundingVolume implements Savable, Cloneable, Collidable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JmeExporter e) throws IOException {
|
public void write(JmeExporter e) throws IOException {
|
||||||
e.getCapsule(this).write(center, "center", Vector3f.ZERO);
|
e.getCapsule(this).write(center, "center", Vector3f.ZERO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void read(JmeImporter e) throws IOException {
|
public void read(JmeImporter e) throws IOException {
|
||||||
center = (Vector3f) e.getCapsule(this).readSavable("center", Vector3f.ZERO.clone());
|
center = (Vector3f) e.getCapsule(this).readSavable("center", Vector3f.ZERO.clone());
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2019 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -270,6 +270,7 @@ public class Cinematic extends AbstractCinematicEvent implements AppState {
|
|||||||
* @param stateManager the state manager
|
* @param stateManager the state manager
|
||||||
* @param app the application
|
* @param app the application
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void initialize(AppStateManager stateManager, Application app) {
|
public void initialize(AppStateManager stateManager, Application app) {
|
||||||
initEvent(app, this);
|
initEvent(app, this);
|
||||||
for (CinematicEvent cinematicEvent : cinematicEvents) {
|
for (CinematicEvent cinematicEvent : cinematicEvents) {
|
||||||
@ -288,6 +289,7 @@ public class Cinematic extends AbstractCinematicEvent implements AppState {
|
|||||||
*
|
*
|
||||||
* @return true if initialized, otherwise false
|
* @return true if initialized, otherwise false
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isInitialized() {
|
public boolean isInitialized() {
|
||||||
return initialized;
|
return initialized;
|
||||||
}
|
}
|
||||||
@ -312,6 +314,7 @@ public class Cinematic extends AbstractCinematicEvent implements AppState {
|
|||||||
*
|
*
|
||||||
* @param enabled true or false
|
* @param enabled true or false
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setEnabled(boolean enabled) {
|
public void setEnabled(boolean enabled) {
|
||||||
if (enabled) {
|
if (enabled) {
|
||||||
play();
|
play();
|
||||||
@ -324,6 +327,7 @@ public class Cinematic extends AbstractCinematicEvent implements AppState {
|
|||||||
*
|
*
|
||||||
* @return true if enabled
|
* @return true if enabled
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isEnabled() {
|
public boolean isEnabled() {
|
||||||
return playState == PlayState.Playing;
|
return playState == PlayState.Playing;
|
||||||
}
|
}
|
||||||
@ -333,6 +337,7 @@ public class Cinematic extends AbstractCinematicEvent implements AppState {
|
|||||||
*
|
*
|
||||||
* @param stateManager the state manager
|
* @param stateManager the state manager
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void stateAttached(AppStateManager stateManager) {
|
public void stateAttached(AppStateManager stateManager) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -341,6 +346,7 @@ public class Cinematic extends AbstractCinematicEvent implements AppState {
|
|||||||
*
|
*
|
||||||
* @param stateManager the state manager
|
* @param stateManager the state manager
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void stateDetached(AppStateManager stateManager) {
|
public void stateDetached(AppStateManager stateManager) {
|
||||||
stop();
|
stop();
|
||||||
}
|
}
|
||||||
@ -508,6 +514,7 @@ public class Cinematic extends AbstractCinematicEvent implements AppState {
|
|||||||
*
|
*
|
||||||
* @see AppState#render(com.jme3.renderer.RenderManager)
|
* @see AppState#render(com.jme3.renderer.RenderManager)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void render(RenderManager rm) {
|
public void render(RenderManager rm) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -516,6 +523,7 @@ public class Cinematic extends AbstractCinematicEvent implements AppState {
|
|||||||
*
|
*
|
||||||
* @see AppState#postRender()
|
* @see AppState#postRender()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void postRender() {
|
public void postRender() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -524,6 +532,7 @@ public class Cinematic extends AbstractCinematicEvent implements AppState {
|
|||||||
*
|
*
|
||||||
* @see AppState#cleanup()
|
* @see AppState#cleanup()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void cleanup() {
|
public void cleanup() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2012 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -69,12 +69,14 @@ public class KeyFrame implements Savable {
|
|||||||
return cinematicEvents.isEmpty();
|
return cinematicEvents.isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JmeExporter ex) throws IOException {
|
public void write(JmeExporter ex) throws IOException {
|
||||||
OutputCapsule oc = ex.getCapsule(this);
|
OutputCapsule oc = ex.getCapsule(this);
|
||||||
oc.writeSavableArrayList((ArrayList) cinematicEvents, "cinematicEvents", null);
|
oc.writeSavableArrayList((ArrayList) cinematicEvents, "cinematicEvents", null);
|
||||||
oc.write(index, "index", 0);
|
oc.write(index, "index", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void read(JmeImporter im) throws IOException {
|
public void read(JmeImporter im) throws IOException {
|
||||||
InputCapsule ic = im.getCapsule(this);
|
InputCapsule ic = im.getCapsule(this);
|
||||||
cinematicEvents = ic.readSavableArrayList("cinematicEvents", null);
|
cinematicEvents = ic.readSavableArrayList("cinematicEvents", null);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2012 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -104,6 +104,7 @@ public class TimeLine extends HashMap<Integer, KeyFrame> implements Savable {
|
|||||||
return lastKeyFrameIndex;
|
return lastKeyFrameIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JmeExporter ex) throws IOException {
|
public void write(JmeExporter ex) throws IOException {
|
||||||
OutputCapsule oc = ex.getCapsule(this);
|
OutputCapsule oc = ex.getCapsule(this);
|
||||||
ArrayList list = new ArrayList();
|
ArrayList list = new ArrayList();
|
||||||
@ -111,6 +112,7 @@ public class TimeLine extends HashMap<Integer, KeyFrame> implements Savable {
|
|||||||
oc.writeSavableArrayList(list, "keyFrames", null);
|
oc.writeSavableArrayList(list, "keyFrames", null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void read(JmeImporter im) throws IOException {
|
public void read(JmeImporter im) throws IOException {
|
||||||
InputCapsule ic = im.getCapsule(this);
|
InputCapsule ic = im.getCapsule(this);
|
||||||
ArrayList list = ic.readSavableArrayList("keyFrames", null);
|
ArrayList list = ic.readSavableArrayList("keyFrames", null);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2019 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -104,6 +104,7 @@ public abstract class AbstractCinematicEvent implements CinematicEvent {
|
|||||||
* or when it was force-stopped during playback.
|
* or when it was force-stopped during playback.
|
||||||
* By default, this method just calls regular stop().
|
* By default, this method just calls regular stop().
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void forceStop(){
|
public void forceStop(){
|
||||||
stop();
|
stop();
|
||||||
}
|
}
|
||||||
@ -111,6 +112,7 @@ public abstract class AbstractCinematicEvent implements CinematicEvent {
|
|||||||
/**
|
/**
|
||||||
* Play this event.
|
* Play this event.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void play() {
|
public void play() {
|
||||||
onPlay();
|
onPlay();
|
||||||
playState = PlayState.Playing;
|
playState = PlayState.Playing;
|
||||||
@ -131,6 +133,7 @@ public abstract class AbstractCinematicEvent implements CinematicEvent {
|
|||||||
* Used internally only.
|
* Used internally only.
|
||||||
* @param tpf time per frame.
|
* @param tpf time per frame.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void internalUpdate(float tpf) {
|
public void internalUpdate(float tpf) {
|
||||||
if (playState == PlayState.Playing) {
|
if (playState == PlayState.Playing) {
|
||||||
time = time + (tpf * speed);
|
time = time + (tpf * speed);
|
||||||
@ -161,6 +164,7 @@ public abstract class AbstractCinematicEvent implements CinematicEvent {
|
|||||||
* Stops the animation.
|
* Stops the animation.
|
||||||
* Next time when play() is called, the animation starts from the beginning.
|
* Next time when play() is called, the animation starts from the beginning.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void stop() {
|
public void stop() {
|
||||||
onStop();
|
onStop();
|
||||||
time = 0;
|
time = 0;
|
||||||
@ -182,6 +186,7 @@ public abstract class AbstractCinematicEvent implements CinematicEvent {
|
|||||||
* Pause this event.
|
* Pause this event.
|
||||||
* Next time when play() is called, the animation restarts from here.
|
* Next time when play() is called, the animation restarts from here.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void pause() {
|
public void pause() {
|
||||||
onPause();
|
onPause();
|
||||||
playState = PlayState.Paused;
|
playState = PlayState.Paused;
|
||||||
@ -202,6 +207,7 @@ public abstract class AbstractCinematicEvent implements CinematicEvent {
|
|||||||
* Returns the actual duration of the animation (initialDuration/speed)
|
* Returns the actual duration of the animation (initialDuration/speed)
|
||||||
* @return the duration (in seconds)
|
* @return the duration (in seconds)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public float getDuration() {
|
public float getDuration() {
|
||||||
return initialDuration / speed;
|
return initialDuration / speed;
|
||||||
}
|
}
|
||||||
@ -212,6 +218,7 @@ public abstract class AbstractCinematicEvent implements CinematicEvent {
|
|||||||
* At speed = 2, the animation will last initialDuration/2...
|
* At speed = 2, the animation will last initialDuration/2...
|
||||||
* @param speed
|
* @param speed
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setSpeed(float speed) {
|
public void setSpeed(float speed) {
|
||||||
this.speed = speed;
|
this.speed = speed;
|
||||||
}
|
}
|
||||||
@ -220,6 +227,7 @@ public abstract class AbstractCinematicEvent implements CinematicEvent {
|
|||||||
* Returns the speed of the animation.
|
* Returns the speed of the animation.
|
||||||
* @return the speed
|
* @return the speed
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public float getSpeed() {
|
public float getSpeed() {
|
||||||
return speed;
|
return speed;
|
||||||
}
|
}
|
||||||
@ -228,6 +236,7 @@ public abstract class AbstractCinematicEvent implements CinematicEvent {
|
|||||||
* Returns the current playstate of the animation (playing or paused or stopped).
|
* Returns the current playstate of the animation (playing or paused or stopped).
|
||||||
* @return the enum value
|
* @return the enum value
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public PlayState getPlayState() {
|
public PlayState getPlayState() {
|
||||||
return playState;
|
return playState;
|
||||||
}
|
}
|
||||||
@ -236,6 +245,7 @@ public abstract class AbstractCinematicEvent implements CinematicEvent {
|
|||||||
* Returns the initial duration of the animation at speed = 1 in seconds.
|
* Returns the initial duration of the animation at speed = 1 in seconds.
|
||||||
* @return the duration in seconds
|
* @return the duration in seconds
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public float getInitialDuration() {
|
public float getInitialDuration() {
|
||||||
return initialDuration;
|
return initialDuration;
|
||||||
}
|
}
|
||||||
@ -244,6 +254,7 @@ public abstract class AbstractCinematicEvent implements CinematicEvent {
|
|||||||
* Sets the duration of the animation at speed = 1 in seconds.
|
* Sets the duration of the animation at speed = 1 in seconds.
|
||||||
* @param initialDuration
|
* @param initialDuration
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setInitialDuration(float initialDuration) {
|
public void setInitialDuration(float initialDuration) {
|
||||||
this.initialDuration = initialDuration;
|
this.initialDuration = initialDuration;
|
||||||
}
|
}
|
||||||
@ -253,6 +264,7 @@ public abstract class AbstractCinematicEvent implements CinematicEvent {
|
|||||||
* @see LoopMode
|
* @see LoopMode
|
||||||
* @return the enum value
|
* @return the enum value
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public LoopMode getLoopMode() {
|
public LoopMode getLoopMode() {
|
||||||
return loopMode;
|
return loopMode;
|
||||||
}
|
}
|
||||||
@ -262,6 +274,7 @@ public abstract class AbstractCinematicEvent implements CinematicEvent {
|
|||||||
* @see LoopMode
|
* @see LoopMode
|
||||||
* @param loopMode
|
* @param loopMode
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setLoopMode(LoopMode loopMode) {
|
public void setLoopMode(LoopMode loopMode) {
|
||||||
this.loopMode = loopMode;
|
this.loopMode = loopMode;
|
||||||
}
|
}
|
||||||
@ -271,6 +284,7 @@ public abstract class AbstractCinematicEvent implements CinematicEvent {
|
|||||||
* @param ex exporter
|
* @param ex exporter
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void write(JmeExporter ex) throws IOException {
|
public void write(JmeExporter ex) throws IOException {
|
||||||
OutputCapsule oc = ex.getCapsule(this);
|
OutputCapsule oc = ex.getCapsule(this);
|
||||||
oc.write(playState, "playState", PlayState.Stopped);
|
oc.write(playState, "playState", PlayState.Stopped);
|
||||||
@ -284,6 +298,7 @@ public abstract class AbstractCinematicEvent implements CinematicEvent {
|
|||||||
* @param im importer
|
* @param im importer
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void read(JmeImporter im) throws IOException {
|
public void read(JmeImporter im) throws IOException {
|
||||||
InputCapsule ic = im.getCapsule(this);
|
InputCapsule ic = im.getCapsule(this);
|
||||||
playState = ic.readEnum("playState", PlayState.class, PlayState.Stopped);
|
playState = ic.readEnum("playState", PlayState.class, PlayState.Stopped);
|
||||||
@ -297,6 +312,7 @@ public abstract class AbstractCinematicEvent implements CinematicEvent {
|
|||||||
* @param app
|
* @param app
|
||||||
* @param cinematic
|
* @param cinematic
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void initEvent(Application app, Cinematic cinematic) {
|
public void initEvent(Application app, Cinematic cinematic) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -331,6 +347,7 @@ public abstract class AbstractCinematicEvent implements CinematicEvent {
|
|||||||
* Fast-forward the event to the given timestamp. Time=0 is the start of the event.
|
* Fast-forward the event to the given timestamp. Time=0 is the start of the event.
|
||||||
* @param time the time to fast forward to.
|
* @param time the time to fast forward to.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setTime(float time) {
|
public void setTime(float time) {
|
||||||
this.time = time ;
|
this.time = time ;
|
||||||
}
|
}
|
||||||
@ -338,10 +355,12 @@ public abstract class AbstractCinematicEvent implements CinematicEvent {
|
|||||||
/**
|
/**
|
||||||
* Return the current timestamp of the event. Time=0 is the start of the event.
|
* Return the current timestamp of the event. Time=0 is the start of the event.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public float getTime() {
|
public float getTime() {
|
||||||
return time;
|
return time;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void dispose() {
|
public void dispose() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2019 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -159,6 +159,7 @@ public class MotionEvent extends AbstractCinematicEvent implements Control, JmeC
|
|||||||
this.loopMode = loopMode;
|
this.loopMode = loopMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void update(float tpf) {
|
public void update(float tpf) {
|
||||||
if (isControl) {
|
if (isControl) {
|
||||||
internalUpdate(tpf);
|
internalUpdate(tpf);
|
||||||
@ -200,6 +201,7 @@ public class MotionEvent extends AbstractCinematicEvent implements Control, JmeC
|
|||||||
onUpdate(0);
|
onUpdate(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void onUpdate(float tpf) {
|
public void onUpdate(float tpf) {
|
||||||
traveledDistance = path.interpolatePath(time, this, tpf);
|
traveledDistance = path.interpolatePath(time, this, tpf);
|
||||||
computeTargetDirection();
|
computeTargetDirection();
|
||||||
@ -457,9 +459,11 @@ public class MotionEvent extends AbstractCinematicEvent implements Control, JmeC
|
|||||||
return playState != PlayState.Stopped;
|
return playState != PlayState.Stopped;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void render(RenderManager rm, ViewPort vp) {
|
public void render(RenderManager rm, ViewPort vp) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setSpatial(Spatial spatial) {
|
public void setSpatial(Spatial spatial) {
|
||||||
this.spatial = spatial;
|
this.spatial = spatial;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2019 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -97,6 +97,7 @@ public class CollisionResult implements Comparable<CollisionResult> {
|
|||||||
return store;
|
return store;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int compareTo(CollisionResult other) {
|
public int compareTo(CollisionResult other) {
|
||||||
return Float.compare(distance, other.distance);
|
return Float.compare(distance, other.distance);
|
||||||
}
|
}
|
||||||
@ -134,6 +135,7 @@ public class CollisionResult implements Comparable<CollisionResult> {
|
|||||||
return triangleIndex;
|
return triangleIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "CollisionResult[geometry=" + geometry
|
return "CollisionResult[geometry=" + geometry
|
||||||
+ ", contactPoint=" + contactPoint
|
+ ", contactPoint=" + contactPoint
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2019 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -61,6 +61,7 @@ public class CollisionResults implements Iterable<CollisionResult> {
|
|||||||
*
|
*
|
||||||
* @return the iterator
|
* @return the iterator
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Iterator<CollisionResult> iterator() {
|
public Iterator<CollisionResult> iterator() {
|
||||||
if (results == null) {
|
if (results == null) {
|
||||||
List<CollisionResult> dumbCompiler = Collections.emptyList();
|
List<CollisionResult> dumbCompiler = Collections.emptyList();
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2018 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -412,6 +412,7 @@ class SweepSphere implements Collidable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int collideWith(Collidable other, CollisionResults results)
|
public int collideWith(Collidable other, CollisionResults results)
|
||||||
throws UnsupportedCollisionException {
|
throws UnsupportedCollisionException {
|
||||||
if (other instanceof AbstractTriangle){
|
if (other instanceof AbstractTriangle){
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2012 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -111,6 +111,7 @@ public final class BIHNode implements Savable {
|
|||||||
this.rightPlane = rightPlane;
|
this.rightPlane = rightPlane;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JmeExporter ex) throws IOException {
|
public void write(JmeExporter ex) throws IOException {
|
||||||
OutputCapsule oc = ex.getCapsule(this);
|
OutputCapsule oc = ex.getCapsule(this);
|
||||||
oc.write(leftIndex, "left_index", 0);
|
oc.write(leftIndex, "left_index", 0);
|
||||||
@ -122,6 +123,7 @@ public final class BIHNode implements Savable {
|
|||||||
oc.write(right, "right_node", null);
|
oc.write(right, "right_node", null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void read(JmeImporter im) throws IOException {
|
public void read(JmeImporter im) throws IOException {
|
||||||
InputCapsule ic = im.getCapsule(this);
|
InputCapsule ic = im.getCapsule(this);
|
||||||
leftIndex = ic.readInt("left_index", 0);
|
leftIndex = ic.readInt("left_index", 0);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2012 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -461,6 +461,7 @@ public class BIHTree implements CollisionData {
|
|||||||
return root.intersectWhere(bv, bbox, worldMatrix, this, results);
|
return root.intersectWhere(bv, bbox, worldMatrix, this, results);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int collideWith(Collidable other,
|
public int collideWith(Collidable other,
|
||||||
Matrix4f worldMatrix,
|
Matrix4f worldMatrix,
|
||||||
BoundingVolume worldBound,
|
BoundingVolume worldBound,
|
||||||
@ -477,6 +478,7 @@ public class BIHTree implements CollisionData {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JmeExporter ex) throws IOException {
|
public void write(JmeExporter ex) throws IOException {
|
||||||
OutputCapsule oc = ex.getCapsule(this);
|
OutputCapsule oc = ex.getCapsule(this);
|
||||||
oc.write(mesh, "mesh", null);
|
oc.write(mesh, "mesh", null);
|
||||||
@ -486,6 +488,7 @@ public class BIHTree implements CollisionData {
|
|||||||
oc.write(triIndices, "indices", null);
|
oc.write(triIndices, "indices", null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void read(JmeImporter im) throws IOException {
|
public void read(JmeImporter im) throws IOException {
|
||||||
InputCapsule ic = im.getCapsule(this);
|
InputCapsule ic = im.getCapsule(this);
|
||||||
mesh = (Mesh) ic.readSavable("mesh", null);
|
mesh = (Mesh) ic.readSavable("mesh", null);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2012 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -42,6 +42,7 @@ public class TriangleAxisComparator implements Comparator<BIHTriangle> {
|
|||||||
this.axis = axis;
|
this.axis = axis;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int compare(BIHTriangle o1, BIHTriangle o2) {
|
public int compare(BIHTriangle o1, BIHTriangle o2) {
|
||||||
float v1, v2;
|
float v1, v2;
|
||||||
Vector3f c1 = o1.getCenter();
|
Vector3f c1 = o1.getCenter();
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2019 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -141,6 +141,7 @@ public class ParticleEmitter extends Geometry {
|
|||||||
this.parentEmitter = cloner.clone(parentEmitter);
|
this.parentEmitter = cloner.clone(parentEmitter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setSpatial(Spatial spatial) {
|
public void setSpatial(Spatial spatial) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -152,17 +153,21 @@ public class ParticleEmitter extends Geometry {
|
|||||||
return parentEmitter.isEnabled();
|
return parentEmitter.isEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void update(float tpf) {
|
public void update(float tpf) {
|
||||||
parentEmitter.updateFromControl(tpf);
|
parentEmitter.updateFromControl(tpf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void render(RenderManager rm, ViewPort vp) {
|
public void render(RenderManager rm, ViewPort vp) {
|
||||||
parentEmitter.renderFromControl(rm, vp);
|
parentEmitter.renderFromControl(rm, vp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JmeExporter ex) throws IOException {
|
public void write(JmeExporter ex) throws IOException {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void read(JmeImporter im) throws IOException {
|
public void read(JmeImporter im) throws IOException {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -180,6 +185,7 @@ public class ParticleEmitter extends Geometry {
|
|||||||
/**
|
/**
|
||||||
* The old clone() method that did not use the new Cloner utility.
|
* The old clone() method that did not use the new Cloner utility.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public ParticleEmitter oldClone(boolean cloneMaterial) {
|
public ParticleEmitter oldClone(boolean cloneMaterial) {
|
||||||
ParticleEmitter clone = (ParticleEmitter) super.clone(cloneMaterial);
|
ParticleEmitter clone = (ParticleEmitter) super.clone(cloneMaterial);
|
||||||
clone.shape = shape.deepClone();
|
clone.shape = shape.deepClone();
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2012 jMonkeyEngine
|
* Copyright (c) 2009-2020 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -41,8 +41,10 @@ import java.io.IOException;
|
|||||||
* @author Kirill Vainer
|
* @author Kirill Vainer
|
||||||
*/
|
*/
|
||||||
public class NullSavable implements Savable {
|
public class NullSavable implements Savable {
|
||||||
|
@Override
|
||||||
public void write(JmeExporter ex) throws IOException {
|
public void write(JmeExporter ex) throws IOException {
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public void read(JmeImporter im) throws IOException {
|
public void read(JmeImporter im) throws IOException {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user