de.rico.engine.geometry
Class MeshFactory

java.lang.Object
  extended by de.rico.engine.geometry.MeshFactory

public class MeshFactory
extends java.lang.Object

This class is used as a factory class for mesh objects

Author:
Frank Bruns

Constructor Summary
MeshFactory()
           
 
Method Summary
static MeshDL createBox(float height, float width, float length, float texRepeat, boolean smooth)
          Creates a box with the specified meassures
static MeshDL createDisc(float radius, int numLines, boolean smooth)
          Creates a mesh with the shape of a disc.
static MeshDL createHorizontalRectangle(float length, float width, float texRepeat, boolean smooth)
          Creates a simple horizontal square with the specified meassures
static MeshDL createVerticalRectangle(float height, float width, float texRepeat, boolean smooth)
          Creates a simple vertical square with the specified meassures
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MeshFactory

public MeshFactory()
Method Detail

createBox

public static MeshDL createBox(float height,
                               float width,
                               float length,
                               float texRepeat,
                               boolean smooth)
Creates a box with the specified meassures

Parameters:
height - height of the box
width - width of the box
length - length of the box
texRepeat - applies the potential texture of the plane the number of times in both directions (1f means no repeat)
smooth - shade mesh smoothly? --> true=yes, false=no
Returns:
box

createVerticalRectangle

public static MeshDL createVerticalRectangle(float height,
                                             float width,
                                             float texRepeat,
                                             boolean smooth)
Creates a simple vertical square with the specified meassures

Parameters:
height - height of the square
width - width of the square
texRepeat - applies the potential texture of the plane the number of times in both directions (1f means no repeat)
smooth - shade mesh smoothly? --> true=yes, false=no
Returns:
square

createHorizontalRectangle

public static MeshDL createHorizontalRectangle(float length,
                                               float width,
                                               float texRepeat,
                                               boolean smooth)
Creates a simple horizontal square with the specified meassures

Parameters:
length - height of the square
width - width of the square
texRepeat - applies the potential texture of the plane the number of times in both directions (1f means no repeat)
smooth - shade mesh smoothly? --> true=yes, false=no
Returns:
square

createDisc

public static MeshDL createDisc(float radius,
                                int numLines,
                                boolean smooth)
Creates a mesh with the shape of a disc.

Parameters:
radius - radius of the disc
numLines - number of lines (more lines --> higher precision)
smooth - shade mesh smoothly? --> true=yes, false=no
Returns:
the disc mesh