Package com.jme3.scene.shape
Class Surface
java.lang.Object
com.jme3.scene.Mesh
com.jme3.scene.shape.Surface
- All Implemented Interfaces:
Savable
,JmeCloneable
,Cloneable
This class represents a surface described by knots, weights and control points.
Currently the following types are supported:
a) NURBS
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic final Surface
createNurbsSurface
(List<List<Vector4f>> controlPoints, List<Float>[] nurbKnots, int uSegments, int vSegments, int basisUFunctionDegree, int basisVFunctionDegree) This method creates a NURBS surface.static final Surface
createNurbsSurface
(List<List<Vector4f>> controlPoints, List<Float>[] nurbKnots, int uSegments, int vSegments, int basisUFunctionDegree, int basisVFunctionDegree, boolean smooth) This method creates a NURBS surface.int
This method returns the degree of basis U function.int
This method returns the degree of basis V function.getKnots
(int dim) This method returns the knots for specified dimension (U knots - value: '0', V knots - value: '1').getType()
This method returns the type of the surface.int
This method returns the amount of U control points.int
This method returns the amount of V control points.void
read
(JmeImporter importer) De-serializes from the specified importer, for example when loading from a J3O file.void
write
(JmeExporter exporter) Serializes to the specified exporter, for example when saving to a J3O file.Methods inherited from class com.jme3.scene.Mesh
addMorphTarget, clearBuffer, clearCollisionData, clone, cloneFields, cloneForAnim, collideWith, createCollisionData, deepClone, extractVertexData, generateBindPose, generateBindPose, getBound, getBuffer, getBufferList, getBuffers, getElementLengths, getFloatBuffer, getId, getIndexBuffer, getIndicesAsList, getInstanceCount, getLineWidth, getLodLevel, getMaxNumWeights, getMode, getModeStart, getMorphIndex, getMorphTarget, getMorphTargetNames, getMorphTargets, getNumLodLevels, getPatchVertexCount, getPointSize, getShortBuffer, getTriangle, getTriangle, getTriangle, getTriangleCount, getTriangleCount, getVertexCount, hasMorphTargets, isAnimated, isAnimatedByBone, isAnimatedByJoint, jmeClone, prepareForAnim, removeMorphTarget, removeMorphTarget, scaleTextureCoordinates, setBound, setBuffer, setBuffer, setBuffer, setBuffer, setBuffer, setBuffer, setBuffer, setBuffer, setBuffer, setBuffer, setDynamic, setElementLengths, setId, setInterleaved, setLineWidth, setLodLevels, setMaxNumWeights, setMode, setModeStart, setPatchVertexCount, setStatic, setStreamed, updateBound, updateCounts
-
Constructor Details
-
Surface
protected Surface()For serialization only. Do not use.
-
-
Method Details
-
createNurbsSurface
public static final Surface createNurbsSurface(List<List<Vector4f>> controlPoints, List<Float>[] nurbKnots, int uSegments, int vSegments, int basisUFunctionDegree, int basisVFunctionDegree) This method creates a NURBS surface. The created mesh is smooth by default.- Parameters:
controlPoints
- space control pointsnurbKnots
- knots of the surfaceuSegments
- the amount of U segmentsvSegments
- the amount of V segmentsbasisUFunctionDegree
- the degree of basis U functionbasisVFunctionDegree
- the degree of basis V function- Returns:
- an instance of NURBS surface
-
createNurbsSurface
public static final Surface createNurbsSurface(List<List<Vector4f>> controlPoints, List<Float>[] nurbKnots, int uSegments, int vSegments, int basisUFunctionDegree, int basisVFunctionDegree, boolean smooth) This method creates a NURBS surface.- Parameters:
controlPoints
- space control pointsnurbKnots
- knots of the surfaceuSegments
- the amount of U segmentsvSegments
- the amount of V segmentsbasisUFunctionDegree
- the degree of basis U functionbasisVFunctionDegree
- the degree of basis V functionsmooth
- true for a smooth mesh- Returns:
- an instance of NURBS surface
-
getControlPoints
-
getUControlPointsAmount
public int getUControlPointsAmount()This method returns the amount of U control points.- Returns:
- the amount of U control points
-
getVControlPointsAmount
public int getVControlPointsAmount()This method returns the amount of V control points.- Returns:
- the amount of V control points
-
getBasisUFunctionDegree
public int getBasisUFunctionDegree()This method returns the degree of basis U function.- Returns:
- the degree of basis U function
-
getBasisVFunctionDegree
public int getBasisVFunctionDegree()This method returns the degree of basis V function.- Returns:
- the degree of basis V function
-
getKnots
This method returns the knots for specified dimension (U knots - value: '0', V knots - value: '1').- Parameters:
dim
- an integer specifying if the U or V knots are required- Returns:
- an array of knots
-
getType
This method returns the type of the surface.- Returns:
- the type of the surface
-
read
De-serializes from the specified importer, for example when loading from a J3O file.- Specified by:
read
in interfaceSavable
- Overrides:
read
in classMesh
- Parameters:
importer
- the importer to use (not null)- Throws:
IOException
- from the importer
-
write
Serializes to the specified exporter, for example when saving to a J3O file. The current instance is unaffected.- Specified by:
write
in interfaceSavable
- Overrides:
write
in classMesh
- Parameters:
exporter
- the exporter to use (not null)- Throws:
IOException
- from the exporter
-