Skip to content

Commit 31ec2d3

Browse files
committed
Fix typo and use maven enforcer
1 parent 15d8c26 commit 31ec2d3

File tree

2 files changed

+25
-4
lines changed

2 files changed

+25
-4
lines changed

chapter-11/src/main/java/org/lwjglb/game/LightControls.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public class LightControls implements IGuiInstance {
2525
private float[] pointLightY;
2626
private float[] pointLightZ;
2727
private float[] spotLightColor;
28-
private float[] spotLightCuttoff;
28+
private float[] spotLightCutoff;
2929
private float[] spotLightIntensity;
3030
private float[] spotLightX;
3131
private float[] spotLightY;
@@ -57,7 +57,7 @@ public LightControls(Scene scene) {
5757
spotLightY = new float[]{pos.y};
5858
spotLightZ = new float[]{pos.z};
5959
spotLightIntensity = new float[]{pointLight.getIntensity()};
60-
spotLightCuttoff = new float[]{spotLight.getCutOffAngle()};
60+
spotLightCutoff = new float[]{spotLight.getCutOffAngle()};
6161
Vector3f coneDir = spotLight.getConeDirection();
6262
dirConeX = new float[]{coneDir.x};
6363
dirConeY = new float[]{coneDir.y};
@@ -100,7 +100,7 @@ public void drawGui() {
100100
ImGui.colorEdit3("Spot Light color", spotLightColor);
101101
ImGui.sliderFloat("Spot Light Intensity", spotLightIntensity, 0.0f, 1.0f, "%.2f");
102102
ImGui.separator();
103-
ImGui.sliderFloat("Spot Light cutoff", spotLightCuttoff, 0.0f, 360.0f, "%2.f");
103+
ImGui.sliderFloat("Spot Light cutoff", spotLightCutoff, 0.0f, 360.0f, "%2.f");
104104
ImGui.sliderFloat("Dir cone - x", dirConeX, -1.0f, 1.0f, "%.2f");
105105
ImGui.sliderFloat("Dir cone - y", dirConeY, -1.0f, 1.0f, "%.2f");
106106
ImGui.sliderFloat("Dir cone - z", dirConeZ, -1.0f, 1.0f, "%.2f");
@@ -145,7 +145,7 @@ public boolean handleGuiInput(Scene scene, Window window) {
145145
pointLight.setPosition(spotLightX[0], spotLightY[0], spotLightZ[0]);
146146
pointLight.setColor(spotLightColor[0], spotLightColor[1], spotLightColor[2]);
147147
pointLight.setIntensity(spotLightIntensity[0]);
148-
spotLight.setCutOffAngle(spotLightColor[0]);
148+
spotLight.setCutOffAngle(spotLightCutoff[0]);
149149
spotLight.setConeDirection(dirConeX[0], dirConeY[0], dirConeZ[0]);
150150

151151
DirLight dirLight = sceneLights.getDirLight();

pom.xml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,26 @@
1010

1111
<build>
1212
<plugins>
13+
<plugin>
14+
<groupId>org.apache.maven.plugins</groupId>
15+
<artifactId>maven-enforcer-plugin</artifactId>
16+
<version>${maven-enforcer-plugin.version}</version>
17+
<executions>
18+
<execution>
19+
<id>enforce-maven</id>
20+
<goals>
21+
<goal>enforce</goal>
22+
</goals>
23+
<configuration>
24+
<rules>
25+
<requireMavenVersion>
26+
<version>${maven.version}</version>
27+
</requireMavenVersion>
28+
</rules>
29+
</configuration>
30+
</execution>
31+
</executions>
32+
</plugin>
1333
<plugin>
1434
<groupId>org.apache.maven.plugins</groupId>
1535
<artifactId>maven-compiler-plugin</artifactId>
@@ -129,6 +149,7 @@
129149
<lwjgl.version>3.3.6</lwjgl.version>
130150
<maven-compiler-plugin.version>3.13.0</maven-compiler-plugin.version>
131151
<maven-dependency-plugin.version>3.8.0</maven-dependency-plugin.version>
152+
<maven-enforcer-plugin.version>3.5.0</maven-enforcer-plugin.version>
132153
<maven-jar-plugin.version>3.4.2</maven-jar-plugin.version>
133154
<maven-resources-plugin.version>3.3.1</maven-resources-plugin.version>
134155
<tinylog.version>2.7.0</tinylog.version>

0 commit comments

Comments
 (0)