-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Export window, tweaks and bug fixes
- Loading branch information
1 parent
0b0c8f6
commit 9754bdb
Showing
17 changed files
with
880 additions
and
205 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
|
@@ -8,4 +8,5 @@ imgs/ | |
*.prim | ||
*.jar | ||
*.bat | ||
*.zip | ||
*.zip | ||
log.txt |
This file contains 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
This file contains 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
55 changes: 55 additions & 0 deletions
55
...Play/src/main/java/com/tiggerbiggo/prima/primaplay/node/implemented/io/ColorEditNode.java
This file contains 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 |
---|---|---|
@@ -0,0 +1,55 @@ | ||
//Unfinished class, do not use. | ||
|
||
package com.tiggerbiggo.prima.primaplay.node.implemented.io; | ||
|
||
import com.tiggerbiggo.prima.primaplay.graphics.ColorTools; | ||
import com.tiggerbiggo.prima.primaplay.node.core.NodeInOut; | ||
import java.awt.Color; | ||
import java.util.function.BiFunction; | ||
import java.util.function.Function; | ||
|
||
public class ColorEditNode{//} extends NodeInOut { | ||
|
||
|
||
//@Override | ||
public String getName() { | ||
return null; | ||
} | ||
|
||
//@Override | ||
public String getDescription() { | ||
return null; | ||
} | ||
} | ||
|
||
/*enum ColorAction{ | ||
ADD("Add", new BiFunction<Color, Color, Color>() { | ||
@Override | ||
public Color apply(Color color, Color color2) { | ||
return ColorTools.; | ||
} | ||
}), | ||
SUB, | ||
MUL, | ||
DIV; | ||
String name; | ||
BiFunction<Color, Color, Color> func; | ||
ColorAction(String _name, BiFunction<Color, Color, Color> _func){ | ||
func = _func; | ||
name = _name; | ||
} | ||
public Color transform(Color A, Color B){ | ||
return func.apply(A, B); | ||
} | ||
@Override | ||
public String toString() { | ||
return name; | ||
} | ||
} | ||
*/ |
This file contains 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
This file contains 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
59 changes: 59 additions & 0 deletions
59
PrimaPlay/src/main/java/com/tiggerbiggo/prima/primaplay/node/implemented/io/NoiseNode.java
This file contains 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 |
---|---|---|
@@ -0,0 +1,59 @@ | ||
package com.tiggerbiggo.prima.primaplay.node.implemented.io; | ||
|
||
import ch.hephaistos.utilities.loki.util.annotations.TransferGrid; | ||
import com.tiggerbiggo.prima.primaplay.core.RenderParams; | ||
import com.tiggerbiggo.prima.primaplay.node.core.NodeInOut; | ||
import com.tiggerbiggo.prima.primaplay.node.link.type.VectorInputLink; | ||
import com.tiggerbiggo.prima.primaplay.node.link.type.VectorOutputLink; | ||
import com.tiggerbiggo.prima.primaplay.node.link.type.defaults.MapGenDefaultLink; | ||
import com.tiggerbiggo.utils.calculation.SimplexNoise; | ||
import com.tiggerbiggo.utils.calculation.Vector2; | ||
|
||
public class NoiseNode extends NodeInOut{ | ||
|
||
@TransferGrid | ||
double z; | ||
|
||
@TransferGrid | ||
NoiseType type; | ||
|
||
VectorInputLink mapIn; | ||
VectorOutputLink out; | ||
|
||
public NoiseNode() { | ||
z = 0; | ||
type = NoiseType.SIMPLEX; | ||
|
||
mapIn = new MapGenDefaultLink(); | ||
addInput(mapIn); | ||
|
||
out = new VectorOutputLink() { | ||
@Override | ||
public Vector2 get(RenderParams p) { | ||
switch(type){ | ||
case WHITE: | ||
return new Vector2(Math.random(), Math.random()); | ||
case SIMPLEX: | ||
double n = SimplexNoise.noise(mapIn.get(p), z); | ||
return new Vector2(n); | ||
} | ||
return Vector2.ZERO; | ||
} | ||
}; | ||
addOutput(out); | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return "Noise Node"; | ||
} | ||
|
||
@Override | ||
public String getDescription() { | ||
return "Generates different kinds of random noise"; | ||
} | ||
} | ||
enum NoiseType{ | ||
WHITE, | ||
SIMPLEX | ||
} |
This file contains 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
15 changes: 15 additions & 0 deletions
15
.../main/java/com/tiggerbiggo/prima/primaplay/node/link/type/defaults/MapGenDefaultLink.java
This file contains 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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.tiggerbiggo.prima.primaplay.node.link.type.defaults; | ||
|
||
import com.tiggerbiggo.prima.primaplay.core.RenderParams; | ||
import com.tiggerbiggo.prima.primaplay.node.link.type.VectorInputLink; | ||
import com.tiggerbiggo.utils.calculation.Vector2; | ||
|
||
public class MapGenDefaultLink extends VectorInputLink { | ||
@Override | ||
public Vector2 defaultValue(RenderParams p) { | ||
return new Vector2( | ||
p.x() * (1d / p.width()), | ||
p.y() * (1d / p.height()) | ||
); | ||
} | ||
} |
Oops, something went wrong.