Skip to content

Commit 03aca19

Browse files
authored
WireFrustum: code review
1 parent 3a35d44 commit 03aca19

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

jme3-core/src/main/java/com/jme3/scene/debug/WireFrustum.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public WireFrustum(Vector3f[] points) {
7575
if (points == null || points.length != 8) {
7676
throw new IllegalArgumentException("Frustum points array must not be null and must contain 8 points.");
7777
}
78-
setGeometryData(this, points);
78+
setGeometryData(points);
7979
}
8080

8181
/**
@@ -84,13 +84,13 @@ public WireFrustum(Vector3f[] points) {
8484
*
8585
* @param points The 8 `Vector3f` points defining the frustum's corners.
8686
*/
87-
private void setGeometryData(Mesh m, Vector3f[] points) {
87+
private void setGeometryData(Vector3f[] points) {
8888
// Set vertex positions
89-
m.setBuffer(Type.Position, 3, BufferUtils.createFloatBuffer(points));
89+
setBuffer(Type.Position, 3, BufferUtils.createFloatBuffer(points));
9090

9191
// Set indices to draw lines connecting the frustum corners
9292
// The indices define 12 lines: 4 for near plane, 4 for far plane, and 4 connecting near to far.
93-
m.setBuffer(Type.Index, 2,
93+
setBuffer(Type.Index, 2,
9494
new short[]{
9595
// Near plane
9696
0, 1,
@@ -111,8 +111,8 @@ private void setGeometryData(Mesh m, Vector3f[] points) {
111111
3, 7,
112112
}
113113
);
114-
m.getBuffer(Type.Index).setUsage(Usage.Static);
115-
m.setMode(Mode.Lines);
114+
getBuffer(Type.Index).setUsage(Usage.Static);
115+
setMode(Mode.Lines);
116116
}
117117

118118
/**
@@ -160,7 +160,7 @@ public void update(Vector3f[] points) {
160160
* @param points An array of 8 `Vector3f` objects representing the frustum's corners.
161161
* @return A new `WireFrustum` instance.
162162
*/
163-
public static Mesh makeFrustum(Vector3f[] points) {
163+
public static WireFrustum makeFrustum(Vector3f[] points) {
164164
return new WireFrustum(points);
165165
}
166166

0 commit comments

Comments
 (0)