public class InstancedGeometry extends Geometry
Spatial.BatchHint, Spatial.CullHint, Spatial.DFSMode
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
Constructor and Description |
---|
InstancedGeometry() |
InstancedGeometry(java.lang.String name)
Creates instanced geometry with the specified mode and name.
|
Modifier and Type | Method and Description |
---|---|
void |
addInstance(Geometry geometry) |
void |
cloneFields(Cloner cloner,
java.lang.Object original)
Called internally by com.jme3.util.clone.Cloner.
|
void |
deleteInstance(Geometry geom) |
int |
getActualNumInstances() |
VertexBuffer[] |
getAllInstanceData() |
Geometry[] |
getGeometries() |
VertexBuffer[] |
getGlobalUserInstanceData()
Global user specified per-instance data.
|
int |
getMaxNumInstances() |
VertexBuffer |
getTransformUserInstanceData()
Return user per-instance transform data.
|
void |
read(JmeImporter importer) |
void |
setGlobalUserInstanceData(VertexBuffer[] globalInstanceData)
Specify global user per-instance data.
|
void |
setMaxNumInstances(int maxNumInstances)
Set the maximum amount of instances that can be rendered by this
instanced geometry when mode is set to auto.
|
void |
setTransformUserInstanceData(VertexBuffer transformInstanceData)
Specify camera specific user per-instance data.
|
void |
updateInstances() |
protected void |
updateWorldBound()
updateWorldBound updates the bounding volume that contains
this geometry. |
void |
write(JmeExporter exporter) |
associateWithGroupNode, breadthFirstTraversal, checkCulling, clone, clone, collideWith, computeWorldMatrix, deepClone, depthFirstTraversal, getFallbackMorphTarget, getLodLevel, getMaterial, getMesh, getModelBound, getMorphState, getMorphState, getNbSimultaneousGPUMorph, getTriangleCount, getVertexCount, getWorldMatrix, isBatched, isDirtyMorph, isGrouped, isIgnoreTransform, oldDeepClone, removeFromParent, setDirtyMorph, setFallbackMorphTarget, setIgnoreTransform, setLodLevel, setMaterial, setMesh, setModelBound, setMorphState, setMorphState, setNbSimultaneousGPUMorph, setParent, unassociateFromGroupNode, updateModelBound, updateWorldLightList, updateWorldTransforms
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, getWorldBound, 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, toString, updateGeometricState, updateLogicalState, updateMatParamOverrides, worldToLocal
public InstancedGeometry()
public InstancedGeometry(java.lang.String name)
name
- The name of the spatial.Spatial.Spatial(java.lang.String)
public VertexBuffer[] getGlobalUserInstanceData()
null
, specify an array of VertexBuffers
via setGlobalUserInstanceData(com.jme3.scene.VertexBuffer[])
.setGlobalUserInstanceData(com.jme3.scene.VertexBuffer[])
public void setGlobalUserInstanceData(VertexBuffer[] globalInstanceData)
null
, specify an array of VertexBuffers
that contain per-instance vertex attributes.globalInstanceData
- global user per-instance data.java.lang.IllegalArgumentException
- If one of the VertexBuffers is not
instanced
.public void setTransformUserInstanceData(VertexBuffer transformInstanceData)
transformInstanceData
- The transforms for each instance.public VertexBuffer getTransformUserInstanceData()
setTransformUserInstanceData(com.jme3.scene.VertexBuffer)
public final void setMaxNumInstances(int maxNumInstances)
maxNumInstances
- The maximum number of instances that can be
rendered.java.lang.IllegalStateException
- If mode is set to manual.java.lang.IllegalArgumentException
- If maxNumInstances is zero or negativepublic int getMaxNumInstances()
public int getActualNumInstances()
public void updateInstances()
public void deleteInstance(Geometry geom)
public void addInstance(Geometry geometry)
protected void updateWorldBound()
Geometry
updateWorldBound
updates the bounding volume that contains
this geometry. The location of the geometry is based on the location of
all this node's parents.updateWorldBound
in class Geometry
Spatial.updateWorldBound()
public Geometry[] getGeometries()
public VertexBuffer[] getAllInstanceData()
public void cloneFields(Cloner cloner, java.lang.Object original)
cloneFields
in interface JmeCloneable
cloneFields
in class Geometry
cloner
- The cloner that is performing the cloning operation. The
cloneFields method can call back into the cloner to make
clones of its subordinate fields.original
- The original object from which this object was cloned.
This is provided for the very rare case that this object needs
to refer to its original for some reason. In general, all of
the relevant values should have been transferred during the
shallow clone and this object need merely clone what it wants.public void write(JmeExporter exporter) throws java.io.IOException
public void read(JmeImporter importer) throws java.io.IOException