123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- package me.hammerle.supersnuvi.rendering;
- public class Light
- {
- private float red = 0.0f;
- private float green = 0.0f;
- private float blue = 0.0f;
- private float lastX = 0.0f;
- private float lastY = 0.0f;
- private float x = 0.0f;
- private float y = 0.0f;
- private float strength = 0.0f;
- private boolean dirty = false;
-
- public void setColor(float r, float g, float b)
- {
- markDirty();
- red = r;
- green = g;
- blue = b;
- }
-
- public void setPosition(float x, float y)
- {
- markDirty();
- this.x = x;
- this.y = y;
- lastX = x;
- lastY = y;
- }
-
- public void setPositionSmooth(float x, float y)
- {
- markDirty();
- lastX = this.x;
- lastY = this.y;
- this.x = x;
- this.y = y;
- }
-
- public void setStrength(float f)
- {
- markDirty();
- strength = f;
- }
- public float getRed()
- {
- return red;
- }
-
- public float getGreen()
- {
- return green;
- }
-
- public float getBlue()
- {
- return blue;
- }
-
- public float getX()
- {
- return x;
- }
-
- public float getY()
- {
- return y;
- }
-
- public float getLastX()
- {
- return lastX;
- }
-
- public float getLastY()
- {
- return lastY;
- }
-
- public float getStrength()
- {
- return strength;
- }
-
- public boolean isDirty()
- {
- return dirty;
- }
-
- public void markDirty()
- {
- dirty = true;
- }
-
- public void clearDirtyFlag()
- {
- dirty = false;
- }
-
- public void reset()
- {
- markDirty();
- setColor(0.0f, 0.0f, 0.0f);
- setPosition(0.0f, 0.0f);
- setStrength(0.0f);
- }
- }
|