Skip to content

Commit

Permalink
fixed depth of field filter import-export
Browse files Browse the repository at this point in the history
  • Loading branch information
codex128 committed Jun 23, 2024
1 parent 09d4eba commit 42f5ab6
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 8 deletions.
3 changes: 1 addition & 2 deletions jme3-core/src/main/java/com/jme3/math/FastMath.java
Original file line number Diff line number Diff line change
Expand Up @@ -848,8 +848,7 @@ public static float determinant(double m00, double m01, double m02,
*
* @param min the desired minimum value
* @param max the desired maximum value
* @return A random float between <tt>min</tt> (inclusive) to
* <tt>max</tt> (inclusive).
* @return A random float between min (inclusive) to max (inclusive).
*/
public static float nextRandomFloat(float min, float max) {
float f = (nextRandomFloat() * (max - min + 1.0f)) + min;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -941,7 +941,6 @@ public static String groupTicketName(String group, int i) {
/**
*
* @param group
* @param i
* @return
*/
public static String listTicketName(String group) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ protected ObjectSerializer<?> getSerializer(Object obj) {
/**
* Register a serializer
*
* @param type
* @param serializer
*/
protected void registerSerializer(ObjectSerializer<?> serializer) {
serializers.add(serializer);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ public class StructStd140BufferObject extends BufferObject {
private final Std140Layout std140 = new Std140Layout();

/**
* Create an empty Struct buffer
*
* @param str
* Create an empty Struct buffer.
*/
public StructStd140BufferObject() {
}

/**
* Internal only
* Internal only.
*
* @param id
*/
public StructStd140BufferObject(int id) {
super(id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,29 @@ protected void initFilter(AssetManager assets, RenderManager renderManager,
material.setFloat("XScale", blurScale * xScale);
material.setFloat("YScale", blurScale * yScale);
}

@Override
public void write(JmeExporter ex) throws IOException {
super.write(ex);
OutputCapsule out = ex.getCapsule(this);
out.write(focusDistance, "focusDistance", 50f);
out.write(focusRange, "focusRange", 10f);
out.write(blurScale, "blurScale", 1f);
out.write(blurThreshold, "blurThreshold", 0.2f);
out.write(debugUnfocus, "debugUnfocus", false);
}

@Override
public void read(JmeImporter im) throws IOException {
super.read(im);
InputCapsule in = im.getCapsule(this);
focusDistance = in.readFloat("focusDistance", 50f);
focusRange = in.readFloat("focusRange", 10f);
blurScale = in.readFloat("blurScale", 1f);
blurThreshold = in.readFloat("blurThreshold", 0.2f);
debugUnfocus = in.readBoolean("debugUnfocus", false);
}

/**
* Sets the distance at which objects are purely in focus.
*
Expand Down

0 comments on commit 42f5ab6

Please sign in to comment.