diff options
Diffstat (limited to 'core/src/sk/neuromancer/sphaera/rewrite/MovingSphere.java')
| -rwxr-xr-x | core/src/sk/neuromancer/sphaera/rewrite/MovingSphere.java | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/core/src/sk/neuromancer/sphaera/rewrite/MovingSphere.java b/core/src/sk/neuromancer/sphaera/rewrite/MovingSphere.java new file mode 100755 index 0000000..a79bbc8 --- /dev/null +++ b/core/src/sk/neuromancer/sphaera/rewrite/MovingSphere.java @@ -0,0 +1,72 @@ +package sk.neuromancer.sphaera.rewrite; + +import com.badlogic.gdx.graphics.g3d.Material; + +import sk.neuromancer.sphaera.interf.Moving; + +public class MovingSphere extends Sphere implements Moving { + + private float azimuth = 0f; + + public MovingSphere() { + super(); + } + + public MovingSphere(float radius) { + super(radius); + } + + public MovingSphere(float radius, Material... mat) { + super(radius, mat); + } + + public MovingSphere(float x, float y, float z, float radius, + Material... mat) { + super(x, y, z, radius, mat); + } + + public MovingSphere(Sphere parent, float a, float b, float radius, + Material... mat) { + super(parent, a, b, radius, mat); + } + + public MovingSphere(Sphere parent, float a, float b, float radius, float azimuth, + Material... mat) { + super(parent, a, b, radius, mat); + this.azimuth = azimuth; + } + + @Override + public void forward(float angle){ + this.setVelocity(SphereUtils.rotateDegVelocity(getSphericalPosition(), angle, azimuth)); + } + + @Override + public void back(float angle){ + this.forward(-angle); + } + + @Override + public void rotateAzimuth(float angle){ + this.azimuth+=angle; + } + + @Override + public void rotateLeft(float angle){ + rotateAzimuth(-angle); + } + + @Override + public void rotateRight(float angle){ + rotateAzimuth(angle); + } + + public float getAzimuth() { + return azimuth; + } + + public void setAzimuth(float azimuth) { + this.azimuth = azimuth; + } + +} |
