jme.geometry.primitive
Class Pyramid

java.lang.Object
  extended byjme.geometry.primitive.Primitive
      extended byjme.geometry.primitive.Pyramid
All Implemented Interfaces:
Geometry

public class Pyramid
extends Primitive

Pyramid defines a primitive object of a pyramid shape. The pyramid is a four sided pyramid. The pyramid is defined by the size of the base and the height.

Version:
$Id: Pyramid.java,v 1.4 2003/09/08 20:29:27 mojomonkey Exp $
Author:
Mark Powell

Field Summary
 
Fields inherited from class jme.geometry.primitive.Primitive
alpha, blue, green, red
 
Constructor Summary
Pyramid(float base, float height)
          Constructor instantiates a new Pyramid object with the given attributes.
 
Method Summary
 Vector[] getPoints()
          getPoints returns an array of Vectors that represents each point that makes up the piece of geometry.
 void initialize()
          initialize sets up the bounding volumes of the pyramid.
 void preRender()
          preRender does not do anything within Pyramid.
 void render()
          render displays the pyramid with the current parameters.
 void setBase(float base)
          setBase sets the base size for the pyramid.
 void setHeight(float height)
          setHeight sets the new peak height of the pyramid.
 void useDisplayList(boolean value)
          useDisplayList sets the pyramid as a display list for possibly faster rendering.
 
Methods inherited from class jme.geometry.primitive.Primitive
clean, getTextureId, setColor, setTexture, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Pyramid

public Pyramid(float base,
               float height)
Constructor instantiates a new Pyramid object with the given attributes.

Parameters:
base - The size of the base of the pyramid, where the size is one side of the base.
height - the height of the pyramid at it's peak.
Throws:
MonkeyRuntimeException - if base and/or height is negative.
MonkeyGLException - if OpenGL has not been set up yet.
Method Detail

setBase

public void setBase(float base)
setBase sets the base size for the pyramid. The base is the size of a single size of the base.

Parameters:
base - the new size of the pyramid base.
Throws:
MonkeyRuntimeException - if the base is negative.

setHeight

public void setHeight(float height)
setHeight sets the new peak height of the pyramid.

Parameters:
height - the new peak height of the pyramid.
Throws:
MonkeyRuntimeException - if the height is negative.

useDisplayList

public void useDisplayList(boolean value)
useDisplayList sets the pyramid as a display list for possibly faster rendering.

Parameters:
value - true will use the display list, false will not.

render

public void render()
render displays the pyramid with the current parameters.

Specified by:
render in interface Geometry
Specified by:
render in class Primitive

initialize

public void initialize()
initialize sets up the bounding volumes of the pyramid.


preRender

public void preRender()
preRender does not do anything within Pyramid.


getPoints

public Vector[] getPoints()
Description copied from interface: Geometry
getPoints returns an array of Vectors that represents each point that makes up the piece of geometry.

Returns:
the array of vectors for the points.