com.jme.scene
Class BezierPatch

java.lang.Object
  extended by com.jme.scene.BezierPatch
All Implemented Interfaces:
Savable

public class BezierPatch
extends java.lang.Object
implements Savable

BezierPatch defines a 4x4 mesh of control points. The patch will be enough to generate a single section of a BezierMesh. The detail level of the patch determines the smoothness of the resultant BezierMesh.

Version:
$Id: BezierPatch.java 4131 2009-03-19 20:15:28Z blaine.dev $
Author:
Mark Powell

Constructor Summary
BezierPatch()
          Constructor instantiates a new BezierPatch with a default empty control point mesh and a detail level of zero.
BezierPatch(Vector3f[][] anchors)
          Constructor instantiates a new BezierPatch with a given control point grid and a default detail level of zero.
BezierPatch(Vector3f[][] anchors, int detailLevel)
          Constructor instantiates a new BezierPatch with a given control point grid and a given detail level.
 
Method Summary
 Vector3f getAnchor(int i, int j)
          getAnchor returns a single control anchor of a given (i, j) of the patch.
 Vector3f[][] getAnchors()
          getAnchors returns the control anchors that make up this patch.
 java.lang.Class getClassTag()
           
 int getDetailLevel()
          getDetailLevel retrieves the detail level of this patch.
 void read(JMEImporter e)
           
 void setAnchor(int i, int j, Vector3f anchor)
          setAnchor sets a single anchor of the patch.
 void setAnchors(Vector3f[][] anchors)
          setAnchors sets the control anchors of this patch.
 void setDetailLevel(int detailLevel)
          setDetailLevel sets the detail level of this patch.
 void write(JMEExporter e)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BezierPatch

public BezierPatch()
Constructor instantiates a new BezierPatch with a default empty control point mesh and a detail level of zero.


BezierPatch

public BezierPatch(Vector3f[][] anchors)
Constructor instantiates a new BezierPatch with a given control point grid and a default detail level of zero.

Parameters:
anchors - the control points that make up the patch.

BezierPatch

public BezierPatch(Vector3f[][] anchors,
                   int detailLevel)
Constructor instantiates a new BezierPatch with a given control point grid and a given detail level.

Parameters:
anchors - the control points that make up the patch.
detailLevel - the detail level of the patch.
Method Detail

setAnchors

public void setAnchors(Vector3f[][] anchors)
setAnchors sets the control anchors of this patch.

Parameters:
anchors - the control anchors of this patch.

getAnchors

public Vector3f[][] getAnchors()
getAnchors returns the control anchors that make up this patch.

Returns:
the control anchors of this patch.

setAnchor

public void setAnchor(int i,
                      int j,
                      Vector3f anchor)
setAnchor sets a single anchor of the patch.

Parameters:
i - the i index (row).
j - the j index (column).
anchor - the control anchor for this point.

getAnchor

public Vector3f getAnchor(int i,
                          int j)
getAnchor returns a single control anchor of a given (i, j) of the patch.

Parameters:
i - the i index (row).
j - the j index (column).
Returns:
the control anchor of the given i,j.

setDetailLevel

public void setDetailLevel(int detailLevel)
setDetailLevel sets the detail level of this patch.

Parameters:
detailLevel - the detail level of this patch.

getDetailLevel

public int getDetailLevel()
getDetailLevel retrieves the detail level of this patch.

Returns:
the detail level of this patch.

write

public void write(JMEExporter e)
           throws java.io.IOException
Specified by:
write in interface Savable
Throws:
java.io.IOException

read

public void read(JMEImporter e)
          throws java.io.IOException
Specified by:
read in interface Savable
Throws:
java.io.IOException

getClassTag

public java.lang.Class getClassTag()
Specified by:
getClassTag in interface Savable