Skip to content

Commit 9ea5091

Browse files
committed
Release for Summer-school 2018
1 parent a30f379 commit 9ea5091

18 files changed

+110
-40
lines changed

build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ apply from: 'gradle/publishing.gradle'
1111

1212

1313
task wrapper(type: Wrapper) {
14-
gradleVersion = '4.0'
14+
gradleVersion = '4.6'
1515
distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip"
1616
}
1717

@@ -43,7 +43,7 @@ license {
4343
groovy = 'SLASHSTAR_STYLE'
4444
fxml = 'XML_STYLE'
4545
}
46-
ext.year = '2017'
46+
ext.year = '2018'
4747
ext.author = 'Michael Hoffer <[email protected]>'
4848
exclude '**/*.svg'
4949
}

config/HEADER

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright ${year} ${author}. All rights reserved.
1+
Copyright 2017-${year} ${author}. All rights reserved.
22

33
Redistribution and use in source and binary forms, with or without modification, are
44
permitted provided that the following conditions are met:

gradle/project-info.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// -----------------------------------------------------------------------------
44
ext.publishing.artifactId = project.name.toLowerCase()
55
ext.publishing.groupId = 'eu.mihosoft.vvecmath'
6-
ext.publishing.versionId = '0.3.8-SNAPSHOT'
6+
ext.publishing.versionId = '0.3.9'
77

88
ext.publishing.developerName = 'Michael Hoffer'
99
ext.publishing.developerAlias = 'miho'

src/main/java/eu/mihosoft/vvecmath/Matrix4d.java

+57-14
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017 Michael Hoffer <[email protected]>. All rights reserved.
2+
* Copyright 2017-2018 Michael Hoffer <[email protected]>. All rights reserved.
33
*
44
* Redistribution and use in source and binary forms, with or without modification, are
55
* permitted provided that the following conditions are met:
@@ -32,7 +32,6 @@
3232
* authors and should not be interpreted as representing official policies, either expressed
3333
* or implied, of Michael Hoffer <[email protected]>.
3434
*/
35-
3635
package eu.mihosoft.vvecmath;
3736

3837
/**
@@ -64,39 +63,83 @@ public Matrix4d() {
6463
public Matrix4d(double[] v) {
6564

6665
this.m00 = v[0];
67-
6866
this.m01 = v[1];
69-
7067
this.m02 = v[2];
71-
7268
this.m03 = v[3];
7369

7470
this.m10 = v[4];
75-
7671
this.m11 = v[5];
77-
7872
this.m12 = v[6];
79-
8073
this.m13 = v[7];
8174

8275
this.m20 = v[8];
83-
8476
this.m21 = v[9];
85-
8677
this.m22 = v[10];
87-
8878
this.m23 = v[11];
8979

9080
this.m30 = v[12];
91-
9281
this.m31 = v[13];
93-
9482
this.m32 = v[14];
95-
9683
this.m33 = v[15];
9784

9885
}
9986

87+
public void set(double[] values) {
88+
89+
if(values == null || values.length == 0) {
90+
values = new double[16];
91+
}
92+
93+
this.m00 = values[0];
94+
this.m01 = values[1];
95+
this.m02 = values[2];
96+
this.m03 = values[3];
97+
98+
this.m10 = values[4];
99+
this.m11 = values[5];
100+
this.m12 = values[6];
101+
this.m13 = values[7];
102+
103+
this.m20 = values[8];
104+
this.m21 = values[9];
105+
this.m22 = values[10];
106+
this.m23 = values[11];
107+
108+
this.m30 = values[12];
109+
this.m31 = values[13];
110+
this.m32 = values[14];
111+
this.m33 = values[15];
112+
}
113+
114+
public double[] get(double... values) {
115+
116+
if(values == null || values.length == 0) {
117+
values = new double[16];
118+
}
119+
120+
values[0] = this.m00;
121+
values[1] = this.m01;
122+
values[2] = this.m02;
123+
values[3] = this.m03;
124+
125+
values[4] = this.m10;
126+
values[5] = this.m11;
127+
values[6] = this.m12;
128+
values[7] = this.m13;
129+
130+
values[8] = this.m20;
131+
values[9] = this.m21;
132+
values[10] = this.m22;
133+
values[11] = this.m23;
134+
135+
values[12] = this.m30;
136+
values[13] = this.m31;
137+
values[14] = this.m32;
138+
values[15] = this.m33;
139+
140+
return values;
141+
}
142+
100143
/**
101144
* Multiplies this matrix with the specified matrix.
102145
*

src/main/java/eu/mihosoft/vvecmath/ModifiableStoredVector3d.java

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017 Michael Hoffer <[email protected]>. All rights reserved.
2+
* Copyright 2017-2018 Michael Hoffer <[email protected]>. All rights reserved.
33
*
44
* Redistribution and use in source and binary forms, with or without modification, are
55
* permitted provided that the following conditions are met:
@@ -32,11 +32,7 @@
3232
* authors and should not be interpreted as representing official policies, either expressed
3333
* or implied, of Michael Hoffer <[email protected]>.
3434
*/
35-
/*
36-
* To change this license header, choose License Headers in Project Properties.
37-
* To change this template file, choose Tools | Templates
38-
* and open the template in the editor.
39-
*/
35+
4036
package eu.mihosoft.vvecmath;
4137

4238
import static eu.mihosoft.vvecmath.StoredVector3d.getStructSize;

src/main/java/eu/mihosoft/vvecmath/ModifiableVector3d.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017 Michael Hoffer <[email protected]>. All rights reserved.
2+
* Copyright 2017-2018 Michael Hoffer <[email protected]>. All rights reserved.
33
*
44
* Redistribution and use in source and binary forms, with or without modification, are
55
* permitted provided that the following conditions are met:

src/main/java/eu/mihosoft/vvecmath/ModifiableVector3dImpl.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017 Michael Hoffer <[email protected]>. All rights reserved.
2+
* Copyright 2017-2018 Michael Hoffer <[email protected]>. All rights reserved.
33
*
44
* Redistribution and use in source and binary forms, with or without modification, are
55
* permitted provided that the following conditions are met:
@@ -32,7 +32,6 @@
3232
* authors and should not be interpreted as representing official policies, either expressed
3333
* or implied, of Michael Hoffer <[email protected]>.
3434
*/
35-
3635
package eu.mihosoft.vvecmath;
3736

3837
/**

src/main/java/eu/mihosoft/vvecmath/Plane.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017 Michael Hoffer <[email protected]>. All rights reserved.
2+
* Copyright 2017-2018 Michael Hoffer <[email protected]>. All rights reserved.
33
*
44
* Redistribution and use in source and binary forms, with or without modification, are
55
* permitted provided that the following conditions are met:

src/main/java/eu/mihosoft/vvecmath/Spline.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017 Michael Hoffer <[email protected]>. All rights reserved.
2+
* Copyright 2017-2018 Michael Hoffer <[email protected]>. All rights reserved.
33
*
44
* Redistribution and use in source and binary forms, with or without modification, are
55
* permitted provided that the following conditions are met:

src/main/java/eu/mihosoft/vvecmath/Spline3D.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017 Michael Hoffer <[email protected]>. All rights reserved.
2+
* Copyright 2017-2018 Michael Hoffer <[email protected]>. All rights reserved.
33
*
44
* Redistribution and use in source and binary forms, with or without modification, are
55
* permitted provided that the following conditions are met:
@@ -32,7 +32,6 @@
3232
* authors and should not be interpreted as representing official policies, either expressed
3333
* or implied, of Michael Hoffer <[email protected]>.
3434
*/
35-
3635
package eu.mihosoft.vvecmath;
3736

3837
import java.util.ArrayList;

src/main/java/eu/mihosoft/vvecmath/StoredVector3d.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017 Michael Hoffer <[email protected]>. All rights reserved.
2+
* Copyright 2017-2018 Michael Hoffer <[email protected]>. All rights reserved.
33
*
44
* Redistribution and use in source and binary forms, with or without modification, are
55
* permitted provided that the following conditions are met:

src/main/java/eu/mihosoft/vvecmath/StoredVector3dImpl.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017 Michael Hoffer <[email protected]>. All rights reserved.
2+
* Copyright 2017-2018 Michael Hoffer <[email protected]>. All rights reserved.
33
*
44
* Redistribution and use in source and binary forms, with or without modification, are
55
* permitted provided that the following conditions are met:

src/main/java/eu/mihosoft/vvecmath/Transform.java

+35-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017 Michael Hoffer <[email protected]>. All rights reserved.
2+
* Copyright 2017-2018 Michael Hoffer <[email protected]>. All rights reserved.
33
*
44
* Redistribution and use in source and binary forms, with or without modification, are
55
* permitted provided that the following conditions are met:
@@ -74,6 +74,36 @@ public Transform() {
7474
m.m33 = 1;
7575
}
7676

77+
/**
78+
* Returns a new transform based on the specified matrix values (4x4).
79+
*
80+
* @param values 16 double values that represent the transformation matrix
81+
* @return a new transform
82+
*/
83+
public static Transform from(double... values) {
84+
Matrix4d m = new Matrix4d(values);
85+
return new Transform(m);
86+
}
87+
88+
/**
89+
* Returns this transform as matrix (4x4).
90+
*
91+
* @param values target array (16 values)
92+
* @return a new transform
93+
*/
94+
public double[] to(double[] values) {
95+
return m.get(values);
96+
}
97+
98+
/**
99+
* Returns this transform as matrix (4x4).
100+
*
101+
* @return a new transform
102+
*/
103+
public double[] to() {
104+
return m.get(null);
105+
}
106+
77107
/**
78108
* Returns a new unity transform.
79109
*
@@ -103,7 +133,10 @@ public Transform rotX(double degrees) {
103133
double cos = Math.cos(radians);
104134
double sin = Math.sin(radians);
105135
double elemenents[] = {
106-
1, 0, 0, 0, 0, cos, sin, 0, 0, -sin, cos, 0, 0, 0, 0, 1
136+
1, 0, 0, 0,
137+
0, cos, sin, 0,
138+
0, -sin, cos, 0,
139+
0, 0, 0, 1
107140
};
108141
m.mul(new Matrix4d(elemenents));
109142
return this;

src/main/java/eu/mihosoft/vvecmath/Vector3d-iface.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017 Michael Hoffer <[email protected]>. All rights reserved.
2+
* Copyright 2017-2018 Michael Hoffer <[email protected]>. All rights reserved.
33
*
44
* Redistribution and use in source and binary forms, with or without modification, are
55
* permitted provided that the following conditions are met:

src/main/java/eu/mihosoft/vvecmath/Vector3d.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017 Michael Hoffer <[email protected]>. All rights reserved.
2+
* Copyright 2017-2018 Michael Hoffer <[email protected]>. All rights reserved.
33
*
44
* Redistribution and use in source and binary forms, with or without modification, are
55
* permitted provided that the following conditions are met:

src/main/java/eu/mihosoft/vvecmath/Vector3dImpl.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017 Michael Hoffer <[email protected]>. All rights reserved.
2+
* Copyright 2017-2018 Michael Hoffer <[email protected]>. All rights reserved.
33
*
44
* Redistribution and use in source and binary forms, with or without modification, are
55
* permitted provided that the following conditions are met:

src/main/java/eu/mihosoft/vvecmath/VectorUtilInternal.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017 Michael Hoffer <[email protected]>. All rights reserved.
2+
* Copyright 2017-2018 Michael Hoffer <[email protected]>. All rights reserved.
33
*
44
* Redistribution and use in source and binary forms, with or without modification, are
55
* permitted provided that the following conditions are met:

src/main/java/eu/mihosoft/vvecmath/Vectors3d.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017 Michael Hoffer <[email protected]>. All rights reserved.
2+
* Copyright 2017-2018 Michael Hoffer <[email protected]>. All rights reserved.
33
*
44
* Redistribution and use in source and binary forms, with or without modification, are
55
* permitted provided that the following conditions are met:

0 commit comments

Comments
 (0)