Skip to content

Commit

Permalink
Added config for ray max distance
Browse files Browse the repository at this point in the history
Signed-off-by: djpadbit <[email protected]>
  • Loading branch information
djpadbit committed May 15, 2019
1 parent 8bc501c commit bbe011d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/main/java/com/sonicether/soundphysics/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public class Config {
public static float snowAirAbsorptionFactor;
public static float underwaterFilter;
public static boolean noteBlockEnable;
public static float maxDistance;

// performance
public static boolean skipRainOcclusionTracing;
Expand Down Expand Up @@ -123,6 +124,8 @@ private void syncConfig() {
"How much sound is filtered when the player is underwater. 0.0 means no filter. 1.0 means fully filtered.");
noteBlockEnable = this.forgeConfig.getBoolean("Affect Note Blocks", categoryGeneral, true,
"If true, note blocks will be processed.");
maxDistance = this.forgeConfig.getFloat("Max ray distance", categoryGeneral, 256.0f, 1.0f, 8192.0f,
"How far the rays should be traced.");

// performance
skipRainOcclusionTracing = this.forgeConfig.getBoolean("Skip Rain Occlusion Tracing", categoryPerformance, true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ public void run() {
// Shoot rays around sound
final float phi = 1.618033988f;
final float gAngle = phi * (float) Math.PI * 2.0f;
final float maxDistance = 256.0f;
final float maxDistance = Config.maxDistance;

final int numRays = Config.environmentEvaluationRays;
final int rayBounces = Config.environmentEvaluationRaysBounces;
Expand Down

0 comments on commit bbe011d

Please sign in to comment.