hmi.graphics.opengl.geometry
Class CapsuleGeometry

java.lang.Object
  extended by hmi.graphics.opengl.geometry.CapsuleGeometry
All Implemented Interfaces:
GLRenderObject

public class CapsuleGeometry
extends Object
implements GLRenderObject

A simple capsule object, centered at (0,0,0) rendered using direct mode OpenGL Primary for debugging purposes, optimized for flexibility, not rendering speed. [DR]: I did not really understand what I was doing, but I adapted some of the code of Job's SphereGeometry. Textures on this capsule are surely going to be wrong.

Author:
Herwin van Welbergen, Job Zwiers, Dennis Reidsma

Field Summary
private  float cylinderHeight
           
private  float drho
           
private  float ds
           
private  float dt
           
private  float dtheta
           
private  float height
           
static int NUM_SLICES
           
static int NUM_STACKS
           
private  int numSlices
           
private  int numStacks
           
private  float radius
           
private  int sphereList
           
 
Constructor Summary
CapsuleGeometry(float r, float h, int slices, int stacks)
          Constructor
 
Method Summary
 void glInit(GLRenderContext gl)
          Called during OpenGL initialization.
 void glRender(GLRenderContext gl)
          Called during openGL rendering.
private  void render(GLRenderContext gl)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NUM_SLICES

public static final int NUM_SLICES
See Also:
Constant Field Values

NUM_STACKS

public static final int NUM_STACKS
See Also:
Constant Field Values

cylinderHeight

private float cylinderHeight

height

private float height

radius

private float radius

numSlices

private int numSlices

numStacks

private int numStacks

drho

private float drho

dtheta

private float dtheta

ds

private float ds

dt

private float dt

sphereList

private int sphereList
Constructor Detail

CapsuleGeometry

public CapsuleGeometry(float r,
                       float h,
                       int slices,
                       int stacks)
Constructor

Parameters:
h - height of the cylindrical part
r - radius
Method Detail

glInit

public void glInit(GLRenderContext gl)
Description copied from interface: GLRenderObject
Called during OpenGL initialization.

Specified by:
glInit in interface GLRenderObject

glRender

public void glRender(GLRenderContext gl)
Description copied from interface: GLRenderObject
Called during openGL rendering.

Specified by:
glRender in interface GLRenderObject

render

private void render(GLRenderContext gl)