public class TemporalMesh extends Geometry
Spatial.BatchHint, Spatial.CullHint, Spatial.DFSMode
Modifier and Type | Field and Description |
---|---|
protected BlenderContext |
blenderContext
The blender context.
|
protected java.util.Map<java.lang.String,java.lang.Integer> |
boneIndexes
The bone indexes.
|
protected BoundingBox |
boundingBox
The bounding box of the temporal mesh.
|
protected java.util.List<Edge> |
edges
The edges of the mesh.
|
protected java.util.List<Face> |
faces
The faces of the mesh.
|
protected java.util.Map<java.lang.Integer,java.util.Set<Edge>> |
indexToEdgeMapping
A map between index and edges that contain it (for faster index - edge queries).
|
protected java.util.Map<java.lang.Integer,java.util.Set<Face>> |
indexToFaceMapping
A map between index and faces that contain it (for faster index - face queries).
|
protected MaterialContext[] |
materials
Materials used by the mesh.
|
protected Structure |
meshStructure
The mesh's structure.
|
protected java.util.List<Vector3f> |
normals
Loaded normals.
|
protected java.util.List<Point> |
points
The points of the mesh.
|
protected java.util.List<Modifier> |
postMeshCreationModifiers
The modifiers that should be applied after the mesh has been created.
|
protected Properties |
properties
The properties of the mesh.
|
protected java.util.List<java.util.Map<java.lang.String,java.lang.Float>> |
vertexGroups
Loaded vertex groups.
|
protected java.util.List<Vector3f> |
vertices
Loaded vertices.
|
protected java.util.List<byte[]> |
verticesColors
Loaded vertex colors.
|
cachedWorldMat, groupNode, ignoreTransform, lodLevel, material, mesh, SAVABLE_VERSION, startIndex
batchHint, controls, cullHint, frustrumIntersects, key, localLights, localOverrides, localTransform, name, parent, queueBucket, queueDistance, refreshFlags, RF_BOUND, RF_CHILD_LIGHTLIST, RF_LIGHTLIST, RF_MATPARAM_OVERRIDE, RF_TRANSFORM, shadowMode, userData, worldBound, worldLights, worldOverrides, worldTransform
Modifier | Constructor and Description |
---|---|
|
TemporalMesh(Structure meshStructure,
BlenderContext blenderContext)
Creates a temporal mesh based on the given mesh structure.
|
protected |
TemporalMesh(Structure meshStructure,
BlenderContext blenderContext,
boolean loadData)
Creates a temporal mesh based on the given mesh structure.
|
Modifier and Type | Method and Description |
---|---|
void |
addBoneIndex(java.lang.String boneName,
java.lang.Integer boneIndex)
Adds bone index to the mesh.
|
void |
append(TemporalMesh mesh)
The method appends the given mesh to the current one.
|
void |
applyAfterMeshCreate(Modifier modifier)
The modifier to be applied after the geometries are created.
|
void |
clear()
Removes all vertices from the mesh.
|
TemporalMesh |
clone()
This version of clone is a shallow clone, in other words, the
same mesh is referenced as the original geometry.
|
boolean |
equals(java.lang.Object obj) |
java.util.Collection<Edge> |
getAdjacentEdges(java.lang.Integer index) |
java.util.Collection<Face> |
getAdjacentFaces(Edge edge) |
java.util.Collection<Face> |
getAdjacentFaces(java.lang.Integer index) |
BlenderContext |
getBlenderContext() |
java.util.List<Edge> |
getEdges() |
java.util.List<Face> |
getFaces() |
BoundingVolume |
getModelBound() |
java.util.List<Vector3f> |
getNormals() |
java.util.List<Point> |
getPoints() |
int |
getVertexCount()
Returns this geometry's mesh vertex count.
|
java.util.List<java.util.Map<java.lang.String,java.lang.Float>> |
getVertexGroups() |
java.util.List<Vector3f> |
getVertices() |
java.util.List<byte[]> |
getVerticesColors() |
BoundingVolume |
getWorldBound()
getWorldBound retrieves the world bound at this node
level. |
int |
hashCode() |
boolean |
isBoundary(Edge edge)
Tells if the given edge is a boundary edge.
|
boolean |
isBoundary(java.lang.Integer index)
The method tells if the given index is a boundary index.
|
protected void |
prepareFacesGeometry(java.util.List<Geometry> result,
MeshHelper meshHelper)
The method creates geometries from faces.
|
protected void |
prepareLinesGeometry(java.util.List<Geometry> result,
MeshHelper meshHelper)
The method creates geometries from lines.
|
protected void |
preparePointsGeometry(java.util.List<Geometry> result,
MeshHelper meshHelper)
The method creates geometries from points.
|
void |
rebuildIndexesMappings()
The method rebuilds the mappings between faces and edges.
|
void |
setMaterials(MaterialContext[] materials)
Sets the materials of the mesh.
|
void |
setProperties(Properties properties)
Sets the properties of the mesh.
|
void |
toGeometries()
The mesh builds geometries from the mesh.
|
java.lang.String |
toString()
Returns the Spatial's name followed by the class of the spatial
Example: "MyNode (com.jme3.scene.Spatial) |
void |
triangulate()
Triangulates the mesh.
|
void |
updateModelBound()
Updates the bounding volume of the mesh.
|
associateWithGroupNode, breadthFirstTraversal, checkCulling, clone, cloneFields, collideWith, computeWorldMatrix, deepClone, depthFirstTraversal, getFallbackMorphTarget, getLodLevel, getMaterial, getMesh, getMorphState, getMorphState, getNbSimultaneousGPUMorph, getTriangleCount, getWorldMatrix, isBatched, isDirtyMorph, isGrouped, isIgnoreTransform, oldDeepClone, read, removeFromParent, setDirtyMorph, setFallbackMorphTarget, setIgnoreTransform, setLodLevel, setMaterial, setMesh, setModelBound, setMorphState, setMorphState, setNbSimultaneousGPUMorph, setParent, unassociateFromGroupNode, updateWorldBound, updateWorldLightList, updateWorldTransforms, write
addControl, addLight, addMatParamOverride, breadthFirstTraversal, center, clearMatParamOverrides, depthFirstTraversal, forceRefresh, getBatchHint, getControl, getControl, getCullHint, getKey, getLastFrustumIntersection, getLocalBatchHint, getLocalCullHint, getLocalLightList, getLocalMatParamOverrides, getLocalQueueBucket, getLocalRotation, getLocalScale, getLocalShadowMode, getLocalToWorldMatrix, getLocalTransform, getLocalTranslation, getName, getNumControls, getParent, getQueueBucket, getShadowMode, getUserData, getUserDataKeys, getWorldLightList, getWorldMatParamOverrides, getWorldRotation, getWorldScale, getWorldTransform, getWorldTranslation, hasAncestor, jmeClone, localToWorld, lookAt, matches, move, move, oldClone, removeControl, removeControl, removeLight, removeMatParamOverride, rotate, rotate, rotateUpTo, runControlRender, scale, scale, setBatchHint, setBoundRefresh, setCullHint, setKey, setLastFrustumIntersection, setLightListRefresh, setLocalRotation, setLocalRotation, setLocalScale, setLocalScale, setLocalScale, setLocalTransform, setLocalTranslation, setLocalTranslation, setMatParamOverrideRefresh, setName, setQueueBucket, setRequiresUpdates, setShadowMode, setTransformRefresh, setUserData, updateGeometricState, updateLogicalState, updateMatParamOverrides, worldToLocal
protected final BlenderContext blenderContext
protected final Structure meshStructure
protected java.util.List<Vector3f> vertices
protected java.util.List<Vector3f> normals
protected java.util.List<java.util.Map<java.lang.String,java.lang.Float>> vertexGroups
protected java.util.List<byte[]> verticesColors
protected MaterialContext[] materials
protected Properties properties
protected java.util.Map<java.lang.String,java.lang.Integer> boneIndexes
protected java.util.List<Modifier> postMeshCreationModifiers
protected java.util.List<Face> faces
protected java.util.List<Edge> edges
protected java.util.List<Point> points
protected java.util.Map<java.lang.Integer,java.util.Set<Face>> indexToFaceMapping
protected java.util.Map<java.lang.Integer,java.util.Set<Edge>> indexToEdgeMapping
protected BoundingBox boundingBox
public TemporalMesh(Structure meshStructure, BlenderContext blenderContext) throws BlenderFileException
meshStructure
- the mesh structureblenderContext
- the blender contextBlenderFileException
- an exception is thrown when problems with file reading occurprotected TemporalMesh(Structure meshStructure, BlenderContext blenderContext, boolean loadData) throws BlenderFileException
meshStructure
- the mesh structureblenderContext
- the blender contextloadData
- tells if the data should be loaded from the mesh structureBlenderFileException
- an exception is thrown when problems with file reading occurpublic BlenderContext getBlenderContext()
public java.util.List<Vector3f> getVertices()
public java.util.List<Vector3f> getNormals()
public java.util.List<Face> getFaces()
public java.util.List<Edge> getEdges()
public java.util.List<Point> getPoints()
public java.util.List<byte[]> getVerticesColors()
public java.util.List<java.util.Map<java.lang.String,java.lang.Float>> getVertexGroups()
public java.util.Collection<Face> getAdjacentFaces(java.lang.Integer index)
public java.util.Collection<Face> getAdjacentFaces(Edge edge)
edge
- the edge of the meshpublic java.util.Collection<Edge> getAdjacentEdges(java.lang.Integer index)
index
- the index of the meshpublic boolean isBoundary(Edge edge)
edge
- the edge of the meshpublic boolean isBoundary(java.lang.Integer index)
index
- the index of the meshpublic TemporalMesh clone()
Geometry
clone
in interface CloneableSmartAsset
clone
in class Geometry
Mesh.cloneForAnim()
public void rebuildIndexesMappings()
Note: I will remove this method soon and cause the mappings to be done automatically when the mesh is modified.
public void updateModelBound()
Geometry
updateModelBound
in class Geometry
public BoundingVolume getModelBound()
getModelBound
in class Geometry
public BoundingVolume getWorldBound()
Spatial
getWorldBound
retrieves the world bound at this node
level.getWorldBound
in class Spatial
public void triangulate()
public void append(TemporalMesh mesh)
mesh
- the mesh to be appendedpublic void setProperties(Properties properties)
properties
- the properties of the meshpublic void setMaterials(MaterialContext[] materials)
materials
- the materials of the meshpublic void addBoneIndex(java.lang.String boneName, java.lang.Integer boneIndex)
boneName
- the name of the boneboneIndex
- the index of the bonepublic void applyAfterMeshCreate(Modifier modifier)
modifier
- the modifier to be appliedpublic int getVertexCount()
Geometry
getVertexCount
in class Geometry
Mesh.getVertexCount()
public void clear()
public void toGeometries()
protected void prepareFacesGeometry(java.util.List<Geometry> result, MeshHelper meshHelper)
result
- the list where new geometries will be appendedmeshHelper
- the mesh helperprotected void prepareLinesGeometry(java.util.List<Geometry> result, MeshHelper meshHelper)
result
- the list where new geometries will be appendedmeshHelper
- the mesh helperprotected void preparePointsGeometry(java.util.List<Geometry> result, MeshHelper meshHelper)
result
- the list where new geometries will be appendedmeshHelper
- the mesh helperpublic java.lang.String toString()
Spatial
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object