diff options
| author | J08nY | 2017-11-07 18:11:44 +0100 |
|---|---|---|
| committer | J08nY | 2017-11-07 18:11:44 +0100 |
| commit | f07dcb0044e65ebff9143556adc3abe985394a14 (patch) | |
| tree | c7be0a3e202c880748ca72bb1a1e1d7dd4077912 /core/src/sk/neuromancer/sphaera/rewrite/MovingSphere.java | |
| download | ld34-master.tar.gz ld34-master.tar.zst ld34-master.zip | |
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; + } + +} |
