kopia lustrzana https://github.com/jameshball/osci-render
Added default weight attribute
rodzic
6c6616999a
commit
a6c1335ef2
|
@ -12,7 +12,7 @@ public class AudioClient {
|
|||
public static void main(String[] args) throws InterruptedException {
|
||||
AudioPlayer player = new AudioPlayer(SAMPLE_RATE, 440);
|
||||
|
||||
Camera camera = new Camera(0.6, new Vector3(0, 0, -3));
|
||||
Camera camera = new Camera(0.6, new Vector3(0, 0, -2));
|
||||
WorldObject cube = new WorldObject(args[0], new Vector3(0, 0, 0), new Vector3());
|
||||
Vector3 rotation = new Vector3(0,Math.PI / 100,Math.PI / 100);
|
||||
|
||||
|
|
|
@ -17,11 +17,11 @@ public class Ellipse extends Shape {
|
|||
}
|
||||
|
||||
public Ellipse(double a, double b, Vector2 position) {
|
||||
this(a, b, 100, 0, position);
|
||||
this(a, b, Shape.DEFAULT_WEIGHT, 0, position);
|
||||
}
|
||||
|
||||
public Ellipse(double a, double b) {
|
||||
this(a, b, 100, 0, new Vector2());
|
||||
this(a, b, Shape.DEFAULT_WEIGHT, 0, new Vector2());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -4,8 +4,6 @@ public class Line extends Shape {
|
|||
private final Vector2 a;
|
||||
private final Vector2 b;
|
||||
|
||||
public static final double DEFAULT_WEIGHT = 100;
|
||||
|
||||
public Line(Vector2 a, Vector2 b, double weight) {
|
||||
this.a = a;
|
||||
this.b = b;
|
||||
|
@ -14,7 +12,7 @@ public class Line extends Shape {
|
|||
}
|
||||
|
||||
public Line(Vector2 a, Vector2 b) {
|
||||
this(a, b, DEFAULT_WEIGHT);
|
||||
this(a, b, Shape.DEFAULT_WEIGHT);
|
||||
}
|
||||
|
||||
public Line(double x1, double y1, double x2, double y2, double weight) {
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package shapes;
|
||||
|
||||
public abstract class Shape {
|
||||
public static final int DEFAULT_WEIGHT = 100;
|
||||
|
||||
protected double weight;
|
||||
protected double length;
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@ public class Vector2 extends Shape{
|
|||
public Vector2(double x, double y) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.weight = Shape.DEFAULT_WEIGHT;
|
||||
}
|
||||
|
||||
public Vector2() {
|
||||
|
|
Ładowanie…
Reference in New Issue