Skip to content

Commit 5a3bf48

Browse files
Merge branch 'master' of github.com:ClearVolume/ClearGL
2 parents 6c8dc0c + 49a282d commit 5a3bf48

File tree

2 files changed

+29
-30
lines changed

2 files changed

+29
-30
lines changed

build.gradle

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ buildscript {
77
plugins {
88
id "com.jfrog.bintray" version "1.2"
99
id "us.kirchmeier.capsule" version "1.0.2"
10-
// id "com.diffplug.gradle.spotless" version "3.1.0"
10+
id "com.diffplug.gradle.spotless" version "3.1.0"
1111
}
1212

1313
apply plugin: 'java'
1414
apply plugin: 'eclipse'
1515
apply plugin: 'idea'
1616
apply plugin: 'maven'
1717
apply plugin: 'maven-publish'
18-
//apply plugin: 'com.diffplug.gradle.spotless'
18+
apply plugin: 'com.diffplug.gradle.spotless'
1919

2020

2121
//***********************************************************************************
@@ -165,19 +165,18 @@ apply from: 'gradle/install-git-hooks.gradle'
165165

166166
//***********************************************************************************
167167
// SPOTLESS:
168-
// TODO: Fix code style so it doesn't want to rewrite all of ClearGL
169-
// spotless {
170-
// java {
171-
// //licenseHeader '/* Licensed under Apache-2.0 */' // License header
172-
//
173-
// importOrder(['java', 'javax', 'com', 'org'])
174-
//
175-
// removeUnusedImports() // removes any unused imports
176-
//
177-
// eclipseFormatFile 'cleargl-eclipse-formatter.xml'
178-
// }
179-
//}
180168

169+
spotless {
170+
java {
171+
//licenseHeader '/* Licensed under Apache-2.0 */' // License header
172+
173+
importOrder(['java', 'javax', 'com', 'org'])
174+
175+
removeUnusedImports() // removes any unused imports
176+
177+
eclipseFormatFile 'cleargl-eclipse-formatter.xml'
178+
}
179+
}
181180

182181
//***********************************************************************************
183182
// UPLOAD TO FIJI REPO:

src/main/java/cleargl/GLMatrix.java

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
package cleargl;
22

3+
import static java.lang.Math.*;
4+
import java.io.Serializable;
5+
import java.nio.ByteBuffer;
36
import com.jogamp.opengl.math.FloatUtil;
47
import com.jogamp.opengl.math.Quaternion;
58
import com.jogamp.opengl.math.VectorUtil;
69

7-
import java.io.Serializable;
8-
import java.nio.ByteBuffer;
9-
10-
import static java.lang.Math.*;
11-
1210
public class GLMatrix implements Serializable {
1311

1412
private final float[] mMatrix;
@@ -96,7 +94,8 @@ public void multinv(final GLMatrix pGLMatrix) {
9694
mult(pGLMatrix);
9795
}
9896

99-
public GLMatrix setFrustumMatrix(final float left, final float right, final float bottom, final float top, final float near, final float far) {
97+
public GLMatrix setFrustumMatrix(final float left, final float right, final float bottom, final float top,
98+
final float near, final float far) {
10099
FloatUtil.makeFrustum(mMatrix, 0, true, left, right, bottom, top, near, far);
101100

102101
return this;
@@ -178,18 +177,19 @@ public GLMatrix setGeneralizedPerspectiveProjectionMatrix(final GLVector lowerLe
178177
float top = Math.abs(lowerLeft.minus(upperLeft).y()) - res.y();
179178
float n = -res.z();
180179

181-
float s = 0.1f/n;
180+
float s = 0.1f / n;
182181

183-
System.err.println(eye + ", " + (right + res.x()) + "/" + (top + res.y()) + " => " + distance + "/" + n + " -> " + left + "/" + right + "/"+bottom+"/"+top + ", s=" + s);
184-
FloatUtil.makeFrustum(mMatrix, 0, true, left*s, right*s, bottom*s, top*s, n*s, far);
182+
System.err.println(eye + ", " + (right + res.x()) + "/" + (top + res.y()) + " => " + distance + "/" + n + " -> "
183+
+ left + "/" + right + "/" + bottom + "/" + top + ", s=" + s);
184+
FloatUtil.makeFrustum(mMatrix, 0, true, left * s, right * s, bottom * s, top * s, n * s, far);
185185

186-
final GLMatrix flip = new GLMatrix(new float[] {
186+
final GLMatrix flip = new GLMatrix(new float[]{
187187
1.0f, 0.0f, 0.0f, 0.0f,
188188
0.0f, 1.0f, 0.0f, 0.0f,
189189
0.0f, 0.0f, -1.0f, 0.0f,
190190
0.0f, 0.0f, 1.0f, 1.0f});
191191

192-
// this.mult(flip);
192+
// this.mult(flip);
193193
return this;
194194
}
195195

@@ -604,12 +604,12 @@ public ByteBuffer put(ByteBuffer buffer) {
604604
}
605605

606606
public ByteBuffer toBuffer() {
607-
ByteBuffer b = ByteBuffer.allocateDirect(16*4);
608-
b.asFloatBuffer().put(mMatrix);
609-
b.position(0);
610-
b.limit(16*4);
607+
ByteBuffer b = ByteBuffer.allocateDirect(16 * 4);
608+
b.asFloatBuffer().put(mMatrix);
609+
b.position(0);
610+
b.limit(16 * 4);
611611

612-
return b;
612+
return b;
613613
}
614614

615615
}

0 commit comments

Comments
 (0)