-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Test post water 1699 #1707
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Test post water 1699 #1707
Changes from 23 commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
91a49ec
This is a very simple addition. It allows a person to set 3 variables…
bob0bob 7bcba98
Merge branch 'master' of https://github.com/bob0bob/jmonkeyengine
bob0bob ce24716
formatting and comments changes.
bob0bob aef358f
jme3test.app.TestApplication hangs with LWJGL3 #1193
bob0bob 1b0507e
Merge branch 'jMonkeyEngine:master' into master
bob0bob f0489b8
removing unwanted changes, since you can't do multiple pull requests …
bob0bob e5f608d
Merge branch 'master' of https://github.com/bob0bob/jmonkeyengine int…
bob0bob a5b0e37
formatting issues.
bob0bob 26937ca
changed parameter naming to be more consistency with other items.
bob0bob 3832d37
jme3test.app.TestApplication hangs with LWJGL3 #1193
bob0bob 811493c
jme3test.app.TestApplication hangs with LWJGL3 #1193 (#3)
bob0bob db0d9ff
removing unwanted changes.
bob0bob 5eb2690
AppSettings: enhance the new javadoc
stephengold 72d008d
AppSettings: capitalize Window{X/Y}Position consistent w/other settings
stephengold f7c5ec7
LwjglWindow: convert tabs to spaces
stephengold 4544d64
AppSettings: re-arrange @see tags in javadoc
stephengold 0d28d62
Merge branch 'jMonkeyEngine:master' into master
bob0bob f600f23
Merge branch 'jMonkeyEngine:master' into master
bob0bob 05a45a2
Merge branch 'jMonkeyEngine:master' into master
bob0bob 6488773
Merge branch 'jMonkeyEngine:master' into master
bob0bob ef5d014
Merge branch 'jMonkeyEngine:master' into master
bob0bob aedf2e7
TestPostWater issue #1699
bob0bob aad89ca
Added a feature to leave dry filter on/off. Also put on the screen o…
bob0bob 1f7de77
type preventing input to work correctly.
bob0bob cc0547b
more formattings changes.
bob0bob f5ab050
TestPostWater: standardize key names
stephengold 5e1ea29
TestPostWater: correct key assignements that were swapped
stephengold 3eee94f
TestPostWater: organize imports per the style guide
stephengold cae3fec
TestPostWater: whitespace
stephengold 2d17803
TestPostWater: change useDryFilter logic so the 4 key has prompt effect
stephengold File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,6 +33,8 @@ | |
|
|
||
| import com.jme3.app.SimpleApplication; | ||
| import com.jme3.audio.AudioData.DataType; | ||
| import com.jme3.font.BitmapFont; | ||
| import com.jme3.font.BitmapText; | ||
| import com.jme3.audio.AudioNode; | ||
| import com.jme3.audio.LowPassFilter; | ||
| import com.jme3.input.KeyInput; | ||
|
|
@@ -74,7 +76,9 @@ public class TestPostWater extends SimpleApplication { | |
| private WaterFilter water; | ||
| private AudioNode waves; | ||
| final private LowPassFilter aboveWaterAudioFilter = new LowPassFilter(1, 1); | ||
|
|
||
| private boolean useDryFilter = true; | ||
|
|
||
|
|
||
| public static void main(String[] args) { | ||
| TestPostWater app = new TestPostWater(); | ||
| app.start(); | ||
|
|
@@ -183,6 +187,15 @@ public void simpleInitApp() { | |
| // | ||
| viewPort.addProcessor(fpp); | ||
|
|
||
| guiFont = assetManager.loadFont("Interface/Fonts/Default.fnt"); | ||
|
|
||
| setText(0, 50, "1 - Set Foam Texture to Foam.jpg"); | ||
| setText(0, 80, "2 - Set Foam Texture to Foam2.jpg"); | ||
| setText(0, 110, "3 - Set Foam Texture to Foam3.jpg"); | ||
| setText(0, 140, "4 - Turn Dry Filter under water On/Off"); | ||
| setText(0, 240, "Page Dwn - Larger Reflection Map"); | ||
| setText(0, 270, "Page UP - Smaller Reflection Map"); | ||
|
|
||
| inputManager.addListener(new ActionListener() { | ||
| @Override | ||
| public void onAction(String name, boolean isPressed, float tpf) { | ||
|
|
@@ -205,12 +218,18 @@ public void onAction(String name, boolean isPressed, float tpf) { | |
| water.setReflectionMapSize(Math.max(water.getReflectionMapSize() / 2, 32)); | ||
| System.out.println("Reflection map size : " + water.getReflectionMapSize()); | ||
| } | ||
| if (name.equals("drayFilter")) | ||
| { | ||
| useDryFilter = !useDryFilter; | ||
| } | ||
|
|
||
| } | ||
| } | ||
| }, "foam1", "foam2", "foam3", "upRM", "downRM"); | ||
| }, "foam1", "foam2", "foam3", "upRM", "downRM", "dryFilter"); | ||
| inputManager.addMapping("foam1", new KeyTrigger(KeyInput.KEY_1)); | ||
| inputManager.addMapping("foam2", new KeyTrigger(KeyInput.KEY_2)); | ||
| inputManager.addMapping("foam3", new KeyTrigger(KeyInput.KEY_3)); | ||
| inputManager.addMapping("dryFilter", new KeyTrigger(KeyInput.KEY_4)); | ||
| inputManager.addMapping("upRM", new KeyTrigger(KeyInput.KEY_PGUP)); | ||
| inputManager.addMapping("downRM", new KeyTrigger(KeyInput.KEY_PGDN)); | ||
| } | ||
|
|
@@ -277,15 +296,27 @@ public void simpleUpdate(float tpf) { | |
| water.setWaterHeight(initialWaterHeight + waterHeight); | ||
| if (water.isUnderWater() && !uw) { | ||
|
|
||
| waves.setDryFilter(new LowPassFilter(0.5f, 0.1f)); | ||
| if (useDryFilter) | ||
| waves.setDryFilter(new LowPassFilter(0.5f, 0.1f)); | ||
|
|
||
| waves.setReverbEnabled(false); | ||
| uw = true; | ||
| } | ||
| if (!water.isUnderWater() && uw) { | ||
| uw = false; | ||
| //waves.setReverbEnabled(false); | ||
| waves.setDryFilter(new LowPassFilter(1, 1f)); | ||
| //waves.setDryFilter(new LowPassFilter(1,1f)); | ||
| waves.setReverbEnabled(true); | ||
|
||
| if (useDryFilter) | ||
| waves.setDryFilter(new LowPassFilter(1f, 1f)); | ||
|
|
||
| } | ||
| } | ||
|
|
||
| protected void setText(int x, int y, String text) { | ||
| BitmapText txt2 = new BitmapText(guiFont, false); | ||
| txt2.setText(text); | ||
| txt2.setLocalTranslation(x, cam.getHeight()-y, 0); | ||
| txt2.setColor(ColorRGBA.Red); | ||
| guiNode.attachChild(txt2); | ||
|
|
||
| } | ||
| } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.