@Test public void testEquals() throws Exception { Vec3 n = new Vec3(3, 4, 5).normalize(); double distance = 6; Plane plane1 = new Plane(n.x, n.y, n.z, distance); Plane plane2 = new Plane(n.x, n.y, n.z, distance); assertEquals("normal", plane1.normal, plane2.normal); assertEquals("distance", plane1.distance, plane2.distance, 0); assertTrue("equals", plane1.equals(plane2)); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || this.getClass() != o.getClass()) { return false; } Plane that = (Plane) o; return this.normal.equals(that.normal) && this.distance == that.distance; }
Plane { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || this.getClass() != o.getClass()) { return false; } Plane that = (Plane) o; return this.normal.equals(that.normal) && this.distance == that.distance; } }
Plane { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || this.getClass() != o.getClass()) { return false; } Plane that = (Plane) o; return this.normal.equals(that.normal) && this.distance == that.distance; } Plane();  Plane(double x, double y, double z, double distance);  Plane(Plane plane); }
Plane { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || this.getClass() != o.getClass()) { return false; } Plane that = (Plane) o; return this.normal.equals(that.normal) && this.distance == that.distance; } Plane();  Plane(double x, double y, double z, double distance);  Plane(Plane plane); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); double distanceToPoint(Vec3 point); Plane set(double x, double y, double z, double distance); Plane set(Plane plane); Plane transformByMatrix(Matrix4 matrix); double dot(Vec3 vector); boolean intersectsSegment(Vec3 endPoint1, Vec3 endPoint2); int onSameSide(Vec3 pointA, Vec3 pointB); Vec3[] clip(Vec3 pointA, Vec3 pointB); }
Plane { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || this.getClass() != o.getClass()) { return false; } Plane that = (Plane) o; return this.normal.equals(that.normal) && this.distance == that.distance; } Plane();  Plane(double x, double y, double z, double distance);  Plane(Plane plane); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); double distanceToPoint(Vec3 point); Plane set(double x, double y, double z, double distance); Plane set(Plane plane); Plane transformByMatrix(Matrix4 matrix); double dot(Vec3 vector); boolean intersectsSegment(Vec3 endPoint1, Vec3 endPoint2); int onSameSide(Vec3 pointA, Vec3 pointB); Vec3[] clip(Vec3 pointA, Vec3 pointB);  }