Skip to content

Commit 6c60f46

Browse files
committed
refactoring (part 1)
1 parent 43970a2 commit 6c60f46

File tree

168 files changed

+7030
-8219
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

168 files changed

+7030
-8219
lines changed

.gitignore

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
/.nb-gradle/private/
21
/build/
32
/.gradle/
4-
/bin/
5-
/.classpath
6-
/.project
3+
/.idea/
4+
/.nb-gradle/

build.gradle

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ mainClassName = mainClass
2626
repositories {
2727
mavenCentral()
2828
jcenter()
29+
maven {
30+
url 'https://dl.bintray.com/miho/VVecMath'
31+
}
2932
}
3033

3134
// javadoc is way too strict for my taste.
@@ -62,7 +65,8 @@ dependencies {
6265

6366
compile group: 'eu.mihosoft.ext.org.fxyz', name: 'extfxyz', version: '0.4'
6467
compile group: 'eu.mihosoft.ext.org.fxyz', name: 'extfxyz', version: '0.4', classifier: 'sources'
65-
compile group: 'java3d', name: 'vecmath', version: '1.3.1'
68+
compile group: 'eu.mihosoft.vvecmath', name: 'vvecmath', version: '0.3'
69+
compile group: 'eu.mihosoft.vvecmath', name: 'vvecmath', version: '0.3', classifier: 'sources'
6670
compile 'org.slf4j:slf4j-simple:1.6.1'
6771
}
6872

gradle/wrapper/gradle-wrapper.jar

-708 Bytes
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#Tue Nov 08 17:36:28 CET 2016
1+
#Fri Feb 03 02:51:41 CET 2017
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME

gradlew

Lines changed: 30 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gradlew.bat

Lines changed: 84 additions & 90 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/java/eu/mihosoft/vrl/v3d/Bounds.java renamed to src/main/java/eu/mihosoft/jcsg/Bounds.java

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
* To change this template file, choose Tools | Templates
44
* and open the template in the editor.
55
*/
6-
package eu.mihosoft.vrl.v3d;
6+
package eu.mihosoft.jcsg;
7+
8+
import eu.mihosoft.vvecmath.Vector3d;
79

810
/**
911
* Bounding box for CSGs.
@@ -26,15 +28,15 @@ public class Bounds {
2628
* @param max max x,y,z values
2729
*/
2830
public Bounds(Vector3d min, Vector3d max) {
29-
this.center = new Vector3d(
30-
(max.x + min.x) / 2,
31-
(max.y + min.y) / 2,
32-
(max.z + min.z) / 2);
31+
this.center = Vector3d.xyz(
32+
(max.x() + min.x()) / 2,
33+
(max.y() + min.y()) / 2,
34+
(max.z() + min.z()) / 2);
3335

34-
this.bounds = new Vector3d(
35-
Math.abs(max.x - min.x),
36-
Math.abs(max.y - min.y),
37-
Math.abs(max.z - min.z));
36+
this.bounds = Vector3d.xyz(
37+
Math.abs(max.x() - min.x()),
38+
Math.abs(max.y() - min.y()),
39+
Math.abs(max.z() - min.z()));
3840

3941
this.min = min.clone();
4042
this.max = max.clone();
@@ -105,9 +107,9 @@ public boolean contains(Vertex v) {
105107
* {@code false} otherwise
106108
*/
107109
public boolean contains(Vector3d v) {
108-
boolean inX = min.x <= v.x && v.x <= max.x;
109-
boolean inY = min.y <= v.y && v.y <= max.y;
110-
boolean inZ = min.z <= v.z && v.z <= max.z;
110+
boolean inX = min.x() <= v.x() && v.x() <= max.x();
111+
boolean inY = min.y() <= v.y() && v.y() <= max.y();
112+
boolean inZ = min.z() <= v.z() && v.z() <= max.z();
111113

112114
return inX && inY && inZ;
113115
}
@@ -148,13 +150,13 @@ public boolean intersects(Polygon p) {
148150
*/
149151
public boolean intersects(Bounds b) {
150152

151-
if (b.getMin().x > this.getMax().x || b.getMax().x < this.getMin().x) {
153+
if (b.getMin().x() > this.getMax().x() || b.getMax().x() < this.getMin().x()) {
152154
return false;
153155
}
154-
if (b.getMin().y > this.getMax().y || b.getMax().y < this.getMin().y) {
156+
if (b.getMin().y() > this.getMax().y() || b.getMax().y() < this.getMin().y()) {
155157
return false;
156158
}
157-
if (b.getMin().z > this.getMax().z || b.getMax().z < this.getMin().z) {
159+
if (b.getMin().z() > this.getMax().z() || b.getMax().z() < this.getMin().z()) {
158160
return false;
159161
}
160162

0 commit comments

Comments
 (0)