refactor(animation):优化动画系统字段不可变性与getter方法格式- 将AnimationClip中的creationTime字段设为final

- 将AnimationLayer中的parameterOverrides字段设为final
- 将AnimationParameter中的id、defaultValue、minValue、maxValue字段设为final
- 将LightSource中的position、color、intensity字段设为final
- 统一所有getter方法的代码格式,增加换行与大括号
- 优化Mesh2D中部分条件判断逻辑与字段final声明- 调整部分JavaDoc注释格式与空行位置提升可读性
This commit is contained in:
tzdwindows 7
2025-10-25 17:11:51 +08:00
parent 1f5752257e
commit a9c2d202d3
50 changed files with 1342 additions and 703 deletions

View File

@@ -5,7 +5,6 @@ import com.chuangzhou.vivid2D.render.model.Model2D;
import com.chuangzhou.vivid2D.render.model.ModelPart;
import com.chuangzhou.vivid2D.render.model.util.Mesh2D;
import com.chuangzhou.vivid2D.render.model.util.Texture;
import org.lwjgl.glfw.GLFW;
import org.lwjgl.glfw.GLFWVidMode;
import org.lwjgl.opengl.GL;
import org.lwjgl.system.MemoryUtil;
@@ -15,6 +14,7 @@ import static org.lwjgl.opengl.GL11.*;
/**
* Texture Render Test Class - Debug Version
*
* @author tzdwindows 7
*/
public class ModelRenderTextureTest {
@@ -143,10 +143,10 @@ public class ModelRenderTextureTest {
// 回退到手动创建顶点
System.out.println("Using manual vertex creation");
float[] vertices = {
-width/2, -height/2, // bottom left
width/2, -height/2, // bottom right
width/2, height/2, // top right
-width/2, height/2 // top left
-width / 2, -height / 2, // bottom left
width / 2, -height / 2, // bottom right
width / 2, height / 2, // top right
-width / 2, height / 2 // top left
};
float[] uvs = {
@@ -203,10 +203,10 @@ public class ModelRenderTextureTest {
} catch (Exception e) {
// 手动创建
float[] vertices = {
-width/2, -height/2,
width/2, -height/2,
width/2, height/2,
-width/2, height/2
-width / 2, -height / 2,
width / 2, -height / 2,
width / 2, height / 2,
-width / 2, height / 2
};
float[] uvs = {
@@ -320,11 +320,16 @@ public class ModelRenderTextureTest {
private String getGLErrorString(int error) {
switch (error) {
case GL_INVALID_ENUM: return "GL_INVALID_ENUM";
case GL_INVALID_VALUE: return "GL_INVALID_VALUE";
case GL_INVALID_OPERATION: return "GL_INVALID_OPERATION";
case GL_OUT_OF_MEMORY: return "GL_OUT_OF_MEMORY";
default: return "Unknown Error (0x" + Integer.toHexString(error) + ")";
case GL_INVALID_ENUM:
return "GL_INVALID_ENUM";
case GL_INVALID_VALUE:
return "GL_INVALID_VALUE";
case GL_INVALID_OPERATION:
return "GL_INVALID_OPERATION";
case GL_OUT_OF_MEMORY:
return "GL_OUT_OF_MEMORY";
default:
return "Unknown Error (0x" + Integer.toHexString(error) + ")";
}
}