Refactored GLEventListener.java and JoglEventListener2D.java + deleted useless 2d classes
This commit is contained in:
@@ -2,18 +2,12 @@ package lsystem.screen.gl3d;
|
||||
|
||||
import com.jogamp.opengl.GL2;
|
||||
import com.jogamp.opengl.util.gl2.GLUT;
|
||||
import lsystem.screen.AbstractCanvas;
|
||||
import lsystem.screen.gl2d.Point2;
|
||||
import lsystem.screen.gl2d.SwingGLCanvas2D;
|
||||
|
||||
public class DrawHelper {
|
||||
|
||||
public static void placeCamera(GL2 gl, GLCanvas canvas) {
|
||||
gl.glRotatef(canvas.camera[4], 1f, 0f, 0f);
|
||||
gl.glRotatef(canvas.camera[3], 0f, 1f, 0f);
|
||||
gl.glRotatef(canvas.camera[5], 0f, 0f, 1f);
|
||||
}
|
||||
|
||||
public static void placeCamera(GL2 gl, SwingGLCanvas2D canvas) {
|
||||
public static void placeCamera(GL2 gl, AbstractCanvas canvas) {
|
||||
gl.glRotatef(canvas.camera[4], 1f, 0f, 0f);
|
||||
gl.glRotatef(canvas.camera[3], 0f, 1f, 0f);
|
||||
gl.glRotatef(canvas.camera[5], 0f, 0f, 1f);
|
||||
@@ -86,15 +80,7 @@ public class DrawHelper {
|
||||
gl.glPopMatrix();
|
||||
}
|
||||
|
||||
public static void drawDebugInformation(GL2 gl, GLUT glut, GLCanvas canvas) {
|
||||
gl.glRasterPos3f(canvas.camera[0], canvas.camera[1], canvas.camera[2] - 1);
|
||||
gl.glColor3f(1f, 1f, 1f);
|
||||
glut.glutBitmapString(GLUT.BITMAP_HELVETICA_18,
|
||||
"x=" + canvas.camera[0] + ", y=" + canvas.camera[1] + ", z=" + canvas.camera[2] + "\n yaw = "
|
||||
+ canvas.camera[3] + " pitch = " + canvas.camera[4] + " roll = " + canvas.camera[5]);
|
||||
}
|
||||
|
||||
public static void drawDebugInformation(GL2 gl, GLUT glut, SwingGLCanvas2D canvas) {
|
||||
public static void drawDebugInformation(GL2 gl, GLUT glut, AbstractCanvas canvas) {
|
||||
gl.glRasterPos3f(canvas.camera[0], canvas.camera[1], canvas.camera[2] - 1);
|
||||
gl.glColor3f(1f, 1f, 1f);
|
||||
glut.glutBitmapString(GLUT.BITMAP_HELVETICA_18,
|
||||
@@ -103,13 +89,13 @@ public class DrawHelper {
|
||||
}
|
||||
|
||||
public static void drawStick(GL2 gl, Point2 origin, Point2 newOrigin) {
|
||||
|
||||
|
||||
gl.glBegin(GL2.GL_LINES);
|
||||
gl.glVertex2f(origin.getX(), origin.getY());
|
||||
gl.glVertex2f(newOrigin.getX(), newOrigin.getY());
|
||||
gl.glEnd();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user