Commit 3ee12ab8 authored by lildholdt's avatar lildholdt
Browse files

Working partical swarm

parent 3ffad4cb
......@@ -25,7 +25,7 @@ public class Particle
private static Random rand = new Random();
private Pose pose;
private float weight = 1;
private int blackWhiteThreshold = 42;
private int blackWhiteThreshold = 500;
/**
* Create a particle with a specific pose
......@@ -76,7 +76,7 @@ public class Particle
{
if ( m.getColor(pose) == Color.BLACK )
{
if ( lightValue < blackWhiteThreshold)
if ( lightValue > blackWhiteThreshold)
weight = 0.9f;
else
weight = 0.1f;
......@@ -85,7 +85,7 @@ public class Particle
{
if ( m.getColor(pose) == Color.WHITE )
{
if ( lightValue < blackWhiteThreshold)
if ( lightValue > blackWhiteThreshold)
weight = 0.1f;
else
weight = 0.9f;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment