Commit in batoru/src/games/batoru/shapes on MAIN | |||
TreeShape.java | 1.1 removed | ||
PlayerShape.java | 1.2 removed | ||
BulletShape.java | 1.1 removed | ||
TurretShape.java | 1.1 removed |
Shapes were needlessly complicating things.
diff -N TreeShape.java --- TreeShape.java 14 Nov 2003 00:08:48 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,73 +0,0 @@
-/* - * Created on 18-mrt-2003 - */ -package games.batoru.shapes; - -import net.java.games.jogl.GL; -import net.java.games.jogl.GLU; -import net.java.games.jogl.GLUquadric; -import net.java.games.jogl.util.GLUT; - -import org.codejive.world3d.*; -import org.codejive.utils4gl.*; - -/** - * @author Tako - */ -public class TreeShape extends Shape implements Renderable { - static final GLColor m_trunkColor = new GLColor(.5f, .25f, 0); - static final GLColor m_coneColor = new GLColor(0, .5f, .25f); - int m_nTreeShapeList; - - public void initRendering(RenderContext _context) { - GL gl = _context.getGl(); - GLU glu = _context.getGlu(); - GLUT glut = _context.getGlut(); - - m_nTreeShapeList = gl.glGenLists(1); - gl.glNewList(m_nTreeShapeList, GL.GL_COMPILE); - - gl.glPushMatrix(); - gl.glColor3f(m_trunkColor.getRed(), m_trunkColor.getGreen(), m_trunkColor.getBlue()); - gl.glRotatef(-90.0f, 1.0f, 0.0f, 0.0f); - GLUquadric quad = glu.gluNewQuadric(); - glu.gluCylinder(quad, 0.2d, 0.2d, 1.6d, 6, 1); - glu.gluDeleteQuadric(quad); - gl.glPopMatrix(); - - gl.glPushMatrix(); - gl.glColor3f(m_coneColor.getRed(), m_coneColor.getGreen(), m_coneColor.getBlue()); - gl.glTranslatef(0.0f, 1.6f, 0.0f); - gl.glRotatef(-90.0f, 1.0f, 0.0f, 0.0f); - glut.glutSolidCone(glu, 0.7f, 4.0f, 6, 1); - gl.glPopMatrix(); - - gl.glEndList(); - - super.initRendering(_context); - } - - public void render(RenderContext _context) { - _context.getGl().glCallList(m_nTreeShapeList); -/* - GL gl = _context.getGl(); - GLU glu = _context.getGlu(); - GLUT glut = _context.getGlut(); - - gl.glPushMatrix(); - gl.glColor3f(m_trunkColor.getRed(), m_trunkColor.getGreen(), m_trunkColor.getBlue()); - gl.glRotatef(-90.0f, 1.0f, 0.0f, 0.0f); - GLUquadric quad = glu.gluNewQuadric(); - glu.gluCylinder(quad, 0.2d, 0.2d, 1.6d, 6, 1); - glu.gluDeleteQuadric(quad); - gl.glPopMatrix(); - - gl.glPushMatrix(); - gl.glColor3f(m_coneColor.getRed(), m_coneColor.getGreen(), m_coneColor.getBlue()); - gl.glTranslatef(0.0f, 1.6f, 0.0f); - gl.glRotatef(-90.0f, 1.0f, 0.0f, 0.0f); - glut.glutSolidCone(glu, 0.7f, 4.0f, 6, 1); - gl.glPopMatrix(); -*/ - } -}batoru/src/games/batoru/shapes
PlayerShape.java removed after 1.2diff -N PlayerShape.java --- PlayerShape.java 15 Nov 2003 21:50:46 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,94 +0,0 @@-/* - * Created on 24-mrt-2003 - */ -package games.batoru.shapes; - -import net.java.games.jogl.GL; - -import org.codejive.world3d.*; -import org.codejive.world3d.loaders.md3.MD3Loader; -import org.codejive.world3d.net.MessageReader; -import org.codejive.world3d.net.NetworkDecoder; -import org.codejive.utils4gl.*; - -import games.batoru.entities.Player; - -/** - * @author tako - */ -public class PlayerShape extends Shape implements Renderable, Player, NetworkDecoder { - private float m_fEyeHeight; - - private MD3Loader m_lara; - private int m_nLocomotionState; - private int m_nActionState; - - public float getEyeHeight() { - return m_fEyeHeight; - } - - public void setLocomotionState(int _nState) { - if (m_nLocomotionState != _nState) { - switch (_nState) { - case LOC_IDLE: - m_lara.SetLegsAnimation("LEGS_IDLE"); - break; - case LOC_WALKING: - m_lara.SetLegsAnimation("LEGS_WALK"); - break; - case LOC_RUNNING: - m_lara.SetLegsAnimation("LEGS_RUN"); - break; - } - m_nLocomotionState = _nState; - } - } - - public void setActionState(int _nState) { - if (m_nActionState != _nState) { - switch (_nState) { - case ACT_IDLE: - m_lara.SetTorsoAnimation("TORSO_STAND"); - break; - case ACT_SHOOTING: - m_lara.SetTorsoAnimation("TORSO_ATTACK"); - break; - } - m_nActionState = _nState; - } - } - - public boolean isOnSurface() { - return true; - } - - public void initRendering(RenderContext _context) { - m_lara = new MD3Loader(_context.getGl(), _context.getGlu()); - m_lara.LoadModel("models/lara", "lara"); - m_lara.LoadWeapon("models/lara", "railgun"); - m_nLocomotionState = -1; - m_nActionState = -1; - setLocomotionState(LOC_IDLE); - setActionState(ACT_IDLE); - super.initRendering(_context); - } - - public void render(RenderContext _context) { - GL gl = _context.getGl(); - gl.glTranslatef(0.0f, -1.4f, 0.0f); - gl.glRotatef(90.0f, 0.0f, 1.0f, 0.0f); - gl.glScalef(0.03f, 0.03f, 0.03f); - gl.glColor3f(1, 1, 1); - gl.glCullFace(GL.GL_FRONT); // Quake3 uses front face culling apparently - m_lara.DrawModel(); - gl.glCullFace(GL.GL_BACK); - } - - /* (non-Javadoc) - * @see org.codejive.world3d.net.NetworkDecoder#netInit(org.codejive.world3d.net.ConnectedMessagePort) - */ - public void netInit(MessageReader _reader) { - super.netInit(_reader); - m_fEyeHeight = _reader.readFloat(); - } -}batoru/src/games/batoru/shapes
BulletShape.java removed after 1.1diff -N BulletShape.java --- BulletShape.java 14 Nov 2003 00:08:48 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,37 +0,0 @@-/* - * Created on 19-mrt-2003 - */ -package games.batoru.shapes; - -import java.awt.Color; - -import net.java.games.jogl.GL; -import net.java.games.jogl.GLU; -import net.java.games.jogl.GLUquadric; - -import org.codejive.world3d.*; -import org.codejive.utils4gl.*; - -/** - * @author Tako - */ -public class BulletShape extends Shape implements Renderable { - public static final int PART_TOP = 0; - - private static final GLColor m_bullet1Color = new GLColor(Color.ORANGE); - private static final GLColor m_bullet2Color = new GLColor(Color.YELLOW); - private static final GLColor m_bullet3Color = Colors.WHITE; - - public void render(RenderContext _context) { - GL gl = _context.getGl(); - GLU glu = _context.getGlu(); - - gl.glPushMatrix(); - gl.glColor3f(m_bullet1Color.getRed(), m_bullet1Color.getGreen(), m_bullet1Color.getBlue()); - gl.glRotatef(-90.0f, 1.0f, 0.0f, 0.0f); - GLUquadric quad = glu.gluNewQuadric(); - glu.gluSphere(quad, 0.4d, 6, 6); - glu.gluDeleteQuadric(quad); - gl.glPopMatrix(); - } -}\ No newline at end of filebatoru/src/games/batoru/shapes
TurretShape.java removed after 1.1diff -N TurretShape.java --- TurretShape.java 14 Nov 2003 00:08:48 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,76 +0,0 @@-/* - * Created on 19-mrt-2003 - */ -package games.batoru.shapes; - -import javax.vecmath.*; - -import net.java.games.jogl.GL; -import net.java.games.jogl.GLU; -import net.java.games.jogl.GLUquadric; -import net.java.games.jogl.util.GLUT; - -import org.codejive.world3d.*; -import org.codejive.utils4gl.*; - -import games.batoru.entities.Turret; - -/** - * @author Tako - */ -public class TurretShape extends Shape implements Renderable, Turret { - private Vector3f m_barrelOrientation = new Vector3f(); - - public static final int NO_PARTS = 2; - public static final int PART_TOP = 0; - public static final int PART_SOUND = 1; - - private static final GLColor m_baseColor = new GLColor(.5f, .5f, .5f); - private static final GLColor m_boxColor = new GLColor(0, 0, .9f); - private static final GLColor m_barrelColor = new GLColor(.5f, 0, 0); - - private static final Point3f m_basePos = new Point3f(0.0f, 0.0f, 0.0f); - private static final Vector3f m_topPos = new Vector3f(0.0f, 1.6f, 0.0f); - private static final Point3f m_boxPos = new Point3f(0.0f, 0.0f, 0.0f); - private static final Vector3f m_barrelPos = new Vector3f(1.0f, 0.0f, 0.0f); - - public Vector3f getBarrelOrientation() { - return m_barrelOrientation; - } - - public void render(RenderContext _context) { - GL gl = _context.getGl(); - GLU glu = _context.getGlu(); - GLUT glut = _context.getGlut(); - - gl.glPushMatrix(); - gl.glColor3fv(m_baseColor.toArray3f()); - gl.glTranslatef(m_basePos.x, m_basePos.y, m_basePos.z); - gl.glRotatef(-90.0f, 1.0f, 0.0f, 0.0f); - glut.glutSolidCone(glu, 0.5f, 1.6f, 12, 1); - gl.glPopMatrix(); - - gl.glPushMatrix(); - gl.glTranslatef(m_topPos.x, m_topPos.y, m_topPos.z); - Vector3f orientation = getBarrelOrientation(); - gl.glRotatef(orientation.x, 1.0f, 0.0f, 0.0f); - gl.glRotatef(orientation.y, 0.0f, 1.0f, 0.0f); - gl.glRotatef(orientation.z, 0.0f, 0.0f, 1.0f); - gl.glPushMatrix(); - gl.glColor3fv(m_boxColor.toArray3f()); - gl.glTranslatef(m_boxPos.x, m_boxPos.y, m_boxPos.z); - gl.glScalef(1.0f, 0.4f, 0.4f); - glut.glutSolidCube(gl, 1.0f); - gl.glPopMatrix(); - - gl.glPushMatrix(); - gl.glColor3fv(m_barrelColor.toArray3f()); - gl.glTranslatef(m_barrelPos.x, m_barrelPos.y, m_barrelPos.z); - gl.glRotatef(-90.0f, 0.0f, 1.0f, 0.0f); - GLUquadric quad = glu.gluNewQuadric(); - glu.gluCylinder(quad, 0.1d, 0.1d, 0.8d, 6, 1); - glu.gluDeleteQuadric(quad); - gl.glPopMatrix(); - gl.glPopMatrix(); - } -}\ No newline at end of fileCVSspam 0.2.8 Other related posts:
- » [gui4gl-commits] [CVS batoru] Shapes were needlessly complicating things.
- » [gui4gl-commits] [CVS batoru] Shapes were needlessly complicating things.
- » [gui4gl-commits] [CVS batoru] Shapes were needlessly complicating things.
- » [gui4gl-commits] [CVS batoru] Shapes were needlessly complicating things.