Package com.jme3.scene
Class Spatial
java.lang.Object
com.jme3.scene.Spatial
- All Implemented Interfaces:
- HasLocalTransform,- CloneableSmartAsset,- Collidable,- Savable,- JmeCloneable,- Cloneable
public abstract class Spatial
extends Object
implements Savable, Cloneable, Collidable, CloneableSmartAsset, JmeCloneable, HasLocalTransform
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic enumSpecifies if this spatial should be batchedstatic enumSpecifies how frustum culling should be handled by this spatial.static enumSpecifies the mode of the depth first search.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected Spatial.BatchHintprotected SafeArrayList<Control> protected Spatial.CullHintprotected Camera.FrustumIntersectprotected AssetKeyUsed for smart asset cachingprotected LightListLightListprotected SafeArrayList<MatParamOverride> protected Transformprotected StringThis spatial's name.protected NodeSpatial's parent, or null if it has none.protected RenderQueue.Bucketfloatprotected intRefresh flags.protected static final intRefresh flag typesprotected static final intRefresh flag typesprotected static final intRefresh flag typesprotected static final intRefresh flag typesprotected static final intRefresh flag typesprotected RenderQueue.ShadowModeprotected BoundingVolumeSpatial's bounding volume relative to the world.protected LightListprotected SafeArrayList<MatParamOverride> protected Transform
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddControl(Control control) Add a control to the list of controls.voidaddControlAt(int index, Control control) Adds the specified control to the list, at the specified index.voidaddLightadds the given light to the Spatial; causing all child Spatials to be affected by it.voidaddMatParamOverride(MatParamOverride override) Adds a local material parameter override.voidbreadthFirstTraversal(SceneGraphVisitor visitor) Visit each scene graph element ordered by BFSprotected abstract voidbreadthFirstTraversal(SceneGraphVisitor visitor, Queue<Spatial> queue) center()Centers the spatial in the origin of the world bound.booleancheckCulling(Camera cam) checkCullingchecks the spatial with the camera to see if it should be culled.voidRemove all local material parameter overrides.clone()Creates a clone of the asset.clone(boolean cloneMaterial) voidcloneFields(Cloner cloner, Object original) Called internally by com.jme3.util.clone.Cloner.voiddepthFirstTraversal(SceneGraphVisitor visitor) Visit each scene graph element ordered by DFS with the default post order mode.abstract voiddepthFirstTraversal(SceneGraphVisitor visitor, Spatial.DFSMode mode) Visit each scene graph element ordered by DFS.voidforceRefresh(boolean transforms, boolean bounds, boolean lights) (Internal use only) Forces a refresh of the given types of data.getControl(int index) Returns the control at the given index in the list.<T extends Control>
 TgetControl(Class<T> controlType) Returns the first control that is an instance of the given class, or null if no such control exists.getKey()Returns the asset key that is used to track this asset for garbage collection.Returns this spatial's last frustum intersection result.Returns the localLightList, which are the lights that were directly attached to thisSpatialthrough theaddLight(com.jme3.light.Light)andremoveLight(com.jme3.light.Light)methods.Get the local material parameter overrides.getLocalRotationretrieves the local rotation of this node.getLocalScaleretrieves the local scale of this node.getLocalToWorldMatrix(Matrix4f store) Creates a transform matrix that will convert from this spatials' local coordinate space to the world coordinate space based on the world transform.getLocalTransformretrieves the local transform of this spatial.getLocalTranslationretrieves the local translation of this node.getName()Returns the name of this spatial.intgetParentretrieves this node's parent.Returns this spatial's render-queue bucket.abstract int<T> TgetUserData(String key) abstract intgetWorldBoundretrieves the world bound at this node level.Returns the worldLightList, containing the lights combined from all thisSpatial'sparents up to and including thisSpatial's lights.Get the world material parameter overrides.getWorldRotationretrieves the absolute rotation of the Spatial.getWorldScaleretrieves the absolute scale factor of the spatial.getWorldTransformretrieves the world transformation of the spatial.getWorldTranslationretrieves the absolute translation of the spatial.booleanhasAncestor(Node ancestor) determines if the provided Node is the parent, or parent's parent, etc.jmeClone()Called internally by com.jme3.util.clone.Cloner.localToWorld(Vector3f in, Vector3f store) Convert a vector (in) from this spatial's local coordinate space to world coordinate space.voidlookAtis a convenience method for auto-setting the local rotation based on a position in world space and an up vector.booleanNote that we are matching the pattern, therefore the pattern must match the entire pattern (i.e.move(float x, float y, float z) Translates the spatial by the given translation vector.Translates the spatial by the given translation vector.oldClone(boolean cloneMaterial) Deprecated.voidread(JmeImporter im) booleanremoveControl(Control control) Removes the given control from this spatial's controls.voidremoveControl(Class<? extends Control> controlType) Removes the first control that is an instance of the given class.booleanremoveFromParentremoves this Spatial from its parent.voidremoveLight(Light light) removeLightremoves the given light from the Spatial.voidremoveMatParamOverride(MatParamOverride override) Remove a local material parameter override if it exists.rotate(float xAngle, float yAngle, float zAngle) Rotates the spatial by the xAngle, yAngle and zAngle angles (in radians), (aka pitch, yaw, roll) in the local coordinate space.rotate(Quaternion rot) Rotates the spatial by the given rotation.voidrotateUpTo(Vector3f newUp) rotateUpTois a utility function that alters the local rotation to point the Y axis in the direction given by newUp.voidrunControlRender(RenderManager rm, ViewPort vp) Called when the Spatial is about to be rendered, to notify controls attached to this Spatial using the Control.render() method.scale(float s) Scales the spatial by the given valuescale(float x, float y, float z) Scales the spatial by the given scale vector.voidsetBatchHintalters how batching will treat this spatial.protected voidIndicate that the bounding of this spatial has changed and that a refresh is required.voidsetCullHint(Spatial.CullHint hint) setCullHintalters how view frustum culling will treat this spatial.voidAssigns the specified AssetKey to the asset.voidsetLastFrustumIntersection(Camera.FrustumIntersect intersects) Overrides the last intersection result.protected voidvoidsetLocalRotation(Matrix3f rotation) setLocalRotationsets the local rotation of this node by using aMatrix3f.voidsetLocalRotation(Quaternion quaternion) setLocalRotationsets the local rotation of this node.voidsetLocalScale(float localScale) setLocalScalesets the local scale of this node.voidsetLocalScale(float x, float y, float z) setLocalScalesets the local scale of this node.voidsetLocalScale(Vector3f localScale) setLocalScalesets the local scale of this node.voidsetLocalTransformsets the local transform of this spatial.voidsetLocalTranslation(float x, float y, float z) setLocalTranslationsets the local translation of this spatial.voidsetLocalTranslation(Vector3f localTranslation) setLocalTranslationsets the local translation of this spatial.voidsetLodLevel(int lod) Sets the level of detail to use when rendering this Spatial, this call propagates to all geometries under this Spatial.voidsetMaterial(Material material) Applies the given material to the Spatial, this will propagate the material down to the geometries in the scene graph.protected voidabstract voidsetModelBound(BoundingVolume modelBound) setModelBoundsets the bounding object for this Spatial.voidSets the name of this spatial.protected voidCalled byNode.attachChild(Spatial)andNode.detachChild(Spatial)- don't call directly.voidsetQueueBucket(RenderQueue.Bucket queueBucket) setQueueBucketdetermines at what phase of the rendering process this Spatial will rendered.protected voidsetRequiresUpdates(boolean f) Subclasses can call this with true to denote that they require updateLogicalState() to be called even if they contain no controls.voidsetShadowMode(RenderQueue.ShadowMode shadowMode) Sets the shadow mode of the spatial The shadow mode determines how the spatial should be shadowed, when a shadowing technique is used.protected voidIndicate that the transform of this spatial has changed and that a refresh is required.voidsetUserData(String key, Object data) toString()Returns the Spatial's name followed by the class of the spatial
 Example: "MyNode (com.jme3.scene.Spatial)"voidupdateGeometricStateupdates the light list, computes the world transforms, and computes the world bounds for this Spatial.voidupdateLogicalState(float tpf) updateLogicalStatecalls theupdate()method for all controls attached to this Spatial.protected voidabstract voidupdateModelBoundrecalculates the bounding object for this Spatial.protected voidShould be overridden by Node and Geometry.protected voidprotected voidShould only be called from updateGeometricState().worldToLocal(Vector3f in, Vector3f store) Convert a vector (in) from world coordinate space to this spatial's local coordinate space.voidwrite(JmeExporter ex) Methods inherited from class java.lang.Objectequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.jme3.collision.CollidablecollideWith
- 
Field Details- 
RF_TRANSFORMprotected static final int RF_TRANSFORMRefresh flag types- See Also:
 
- 
RF_BOUNDprotected static final int RF_BOUNDRefresh flag types- See Also:
 
- 
RF_LIGHTLISTprotected static final int RF_LIGHTLISTRefresh flag types- See Also:
 
- 
RF_CHILD_LIGHTLISTprotected static final int RF_CHILD_LIGHTLISTRefresh flag types- See Also:
 
- 
RF_MATPARAM_OVERRIDEprotected static final int RF_MATPARAM_OVERRIDERefresh flag types- See Also:
 
- 
cullHint
- 
batchHint
- 
worldBoundSpatial's bounding volume relative to the world.
- 
localLightsLightList
- 
worldLights
- 
localOverrides
- 
worldOverrides
- 
nameThis spatial's name.
- 
frustrumIntersects
- 
queueBucket
- 
shadowMode
- 
queueDistancepublic transient float queueDistance
- 
localTransform
- 
worldTransform
- 
controls
- 
userData
- 
keyUsed for smart asset caching- See Also:
 
- 
parentSpatial's parent, or null if it has none.
- 
refreshFlagsprotected transient int refreshFlagsRefresh flags. Indicate what data of the spatial need to be updated to reflect the correct state.
 
- 
- 
Constructor Details- 
Spatialprotected Spatial()Serialization only. Do not use. Not really. This class is never instantiated directly but the subclasses like to use the no-arg constructor for their own no-arg constructor... which is technically weaker than forward supplying defaults.
- 
SpatialConstructor instantiates a newSpatialobject, setting the rotation, translation, and scale values to their defaults.- Parameters:
- name- the name of the scene element. This is required for identification and comparison purposes.
 
 
- 
- 
Method Details- 
setKeyDescription copied from interface:CloneableSmartAssetAssigns the specified AssetKey to the asset. This is invoked by theAssetManager. Only clones of the asset have non-null keys. The original copy that was loaded has no key assigned. Only the clones are tracked for garbage collection.- Specified by:
- setKeyin interface- CloneableSmartAsset
- Parameters:
- key- The AssetKey to assign
 
- 
getKeyDescription copied from interface:CloneableSmartAssetReturns the asset key that is used to track this asset for garbage collection.- Specified by:
- getKeyin interface- CloneableSmartAsset
- Returns:
- the asset key that is used to track this asset for garbage collection.
 
- 
setRequiresUpdatesprotected void setRequiresUpdates(boolean f) Subclasses can call this with true to denote that they require updateLogicalState() to be called even if they contain no controls. Setting this to false reverts to the default behavior of only updating if the spatial has controls. This is not meant to indicate dynamic state in any way and must be called while unattached or an IllegalStateException is thrown. It is designed to be called during object construction and then never changed, ie: it's meant to be subclass specific state and not runtime state. Subclasses of Node or Geometry that do not set this will get the old default behavior as if this was set to true. Subclasses should call setRequiresUpdate(false) in their constructors to receive optimal behavior if they don't require updateLogicalState() to be called even if there are no controls.- Parameters:
- f- true→require updates, false→don't require updates
 
- 
setTransformRefreshprotected void setTransformRefresh()Indicate that the transform of this spatial has changed and that a refresh is required.
- 
setLightListRefreshprotected void setLightListRefresh()
- 
setMatParamOverrideRefreshprotected void setMatParamOverrideRefresh()
- 
setBoundRefreshprotected void setBoundRefresh()Indicate that the bounding of this spatial has changed and that a refresh is required.
- 
forceRefreshpublic void forceRefresh(boolean transforms, boolean bounds, boolean lights) (Internal use only) Forces a refresh of the given types of data.- Parameters:
- transforms- Refresh world transform based on parents'
- bounds- Refresh bounding volume data based on child nodes
- lights- Refresh light list based on parents'
 
- 
checkCullingcheckCullingchecks the spatial with the camera to see if it should be culled.This method is called by the renderer. Usually it should not be called directly. - Parameters:
- cam- The camera to check against.
- Returns:
- true if inside or intersecting camera frustum (should be rendered), false if outside.
 
- 
setNameSets the name of this spatial.- Parameters:
- name- The spatial's new name.
 
- 
getNameReturns the name of this spatial.- Returns:
- This spatial's name.
 
- 
getLocalLightListReturns the localLightList, which are the lights that were directly attached to thisSpatialthrough theaddLight(com.jme3.light.Light)andremoveLight(com.jme3.light.Light)methods.- Returns:
- The local light list
 
- 
getWorldLightListReturns the worldLightList, containing the lights combined from all thisSpatial'sparents up to and including thisSpatial's lights.- Returns:
- The combined world light list
 
- 
getLocalMatParamOverridesGet the local material parameter overrides.- Returns:
- The list of local material parameter overrides.
 
- 
getWorldMatParamOverridesGet the world material parameter overrides. Note that this list is only updated on a call toupdateGeometricState(). After update, the world overrides list will contain theparent'sworld overrides combined with this spatial'slocal overrides.- Returns:
- The list of world material parameter overrides.
 
- 
getWorldRotationgetWorldRotationretrieves the absolute rotation of the Spatial.- Returns:
- the Spatial's world rotation quaternion.
 
- 
getWorldTranslationgetWorldTranslationretrieves the absolute translation of the spatial.- Returns:
- the Spatial's world translation vector.
 
- 
getWorldScalegetWorldScaleretrieves the absolute scale factor of the spatial.- Returns:
- the Spatial's world scale factor.
 
- 
getWorldTransformgetWorldTransformretrieves the world transformation of the spatial.- Returns:
- the world transform.
 
- 
rotateUpTorotateUpTois a utility function that alters the local rotation to point the Y axis in the direction given by newUp.- Parameters:
- newUp- the up vector to use - assumed to be a unit vector.
 
- 
lookAtlookAtis a convenience method for auto-setting the local rotation based on a position in world space and an up vector. It computes the rotation to transform the z-axis to point onto 'position' and the y-axis to 'up'. UnlikeQuaternion.lookAt(com.jme3.math.Vector3f, com.jme3.math.Vector3f)this method takes a world position to look at and not a relative direction. Note : 28/01/2013 this method has been fixed as it was not taking into account the parent rotation. This was resulting in improper rotation when the spatial had rotated parent nodes. This method is intended to work in world space, so no matter what parent graph the spatial has, it will look at the given position in world space.- Parameters:
- position- where to look at in terms of world coordinates
- upVector- a vector indicating the (local) up direction. (typically {0, 1, 0} in jME.)
 
- 
updateWorldBoundprotected void updateWorldBound()Should be overridden by Node and Geometry.
- 
updateWorldLightListprotected void updateWorldLightList()
- 
updateMatParamOverridesprotected void updateMatParamOverrides()
- 
addMatParamOverrideAdds a local material parameter override.- Parameters:
- override- The override to add.
- See Also:
 
- 
removeMatParamOverrideRemove a local material parameter override if it exists.- Parameters:
- override- The override to remove.
- See Also:
 
- 
clearMatParamOverridespublic void clearMatParamOverrides()Remove all local material parameter overrides.- See Also:
 
- 
updateWorldTransformsprotected void updateWorldTransforms()Should only be called from updateGeometricState(). In most cases should not be subclassed.
- 
runControlRenderCalled when the Spatial is about to be rendered, to notify controls attached to this Spatial using the Control.render() method.- Parameters:
- rm- The RenderManager rendering the Spatial.
- vp- The ViewPort to which the Spatial is being rendered to.
- See Also:
 
- 
addControlAdd a control to the list of controls.- Parameters:
- control- The control to add.
- See Also:
 
- 
addControlAtAdds the specified control to the list, at the specified index. Any controls with indices greater than or equal to the specified index will have their indices increased by one.- Parameters:
- index- the index at which to add the control (0→first, ≥0)
- control- the control to add (not null)
- Throws:
- IllegalStateException- if the control is already added here
 
- 
removeControlRemoves the first control that is an instance of the given class.- Parameters:
- controlType- the type of Control to remove
- See Also:
 
- 
removeControlRemoves the given control from this spatial's controls.- Parameters:
- control- The control to remove
- Returns:
- True if the control was successfully removed. False if the control is not assigned to this spatial.
- See Also:
 
- 
getControlReturns the first control that is an instance of the given class, or null if no such control exists.- Type Parameters:
- T- the type of control to look for
- Parameters:
- controlType- The superclass of the control to look for.
- Returns:
- The first instance in the list of the controlType class, or null.
- See Also:
 
- 
getControlReturns the control at the given index in the list.- Parameters:
- index- The index of the control in the list to find.
- Returns:
- The control at the given index.
- Throws:
- IndexOutOfBoundsException- If the index is outside the range [0, getNumControls()-1]
- See Also:
 
- 
getNumControlspublic int getNumControls()- Returns:
- The number of controls attached to this Spatial.
- See Also:
 
- 
updateLogicalStatepublic void updateLogicalState(float tpf) updateLogicalStatecalls theupdate()method for all controls attached to this Spatial.- Parameters:
- tpf- Time per frame.
- See Also:
 
- 
updateGeometricStatepublic void updateGeometricState()updateGeometricStateupdates the light list, computes the world transforms, and computes the world bounds for this Spatial. Calling this when the Spatial is attached to a node will cause undefined results. User code should only call this method on Spatials having no parent.- See Also:
 
- 
localToWorldConvert a vector (in) from this spatial's local coordinate space to world coordinate space.- Parameters:
- in- vector to read from
- store- where to write the result (null to create a new vector, may be same as in)
- Returns:
- the result (store)
 
- 
worldToLocalConvert a vector (in) from world coordinate space to this spatial's local coordinate space.- Parameters:
- in- vector to read from
- store- where to write the result
- Returns:
- the result (store)
 
- 
getParentgetParentretrieves this node's parent. If the parent is null this is the root node.- Returns:
- the parent of this node.
 
- 
setParentCalled byNode.attachChild(Spatial)andNode.detachChild(Spatial)- don't call directly.setParentsets the parent of this node.- Parameters:
- parent- the parent of this node.
 
- 
removeFromParentpublic boolean removeFromParent()removeFromParentremoves this Spatial from its parent.- Returns:
- true if it has a parent and performed the remove.
 
- 
hasAncestordetermines if the provided Node is the parent, or parent's parent, etc. of this Spatial.- Parameters:
- ancestor- the ancestor object to look for.
- Returns:
- true if the ancestor is found, false otherwise.
 
- 
getLocalRotationgetLocalRotationretrieves the local rotation of this node.- Returns:
- the local rotation of this node.
 
- 
setLocalRotationsetLocalRotationsets the local rotation of this node by using aMatrix3f.- Parameters:
- rotation- the new local rotation.
 
- 
setLocalRotationsetLocalRotationsets the local rotation of this node.- Parameters:
- quaternion- the new local rotation (not null,- quaternion.norm()approximately equal to 1, unaffected)
 
- 
getLocalScalegetLocalScaleretrieves the local scale of this node.- Returns:
- the local scale of this node.
 
- 
setLocalScalepublic void setLocalScale(float localScale) setLocalScalesets the local scale of this node.- Parameters:
- localScale- the new local scale, applied to x, y and z
 
- 
setLocalScalepublic void setLocalScale(float x, float y, float z) setLocalScalesets the local scale of this node.- Parameters:
- x- the desired scale factor for the X axis
- y- the desired scale factor for the Y axis
- z- the desired scale factor for the Z axis
 
- 
setLocalScalesetLocalScalesets the local scale of this node.- Parameters:
- localScale- the new local scale.
 
- 
getLocalTranslationgetLocalTranslationretrieves the local translation of this node.- Returns:
- the local translation of this node.
 
- 
setLocalTranslationsetLocalTranslationsets the local translation of this spatial.- Parameters:
- localTranslation- the local translation of this spatial.
 
- 
setLocalTranslationpublic void setLocalTranslation(float x, float y, float z) setLocalTranslationsets the local translation of this spatial.- Parameters:
- x- the desired offset in the +X direction
- y- the desired offset in the +Y direction
- z- the desired offset in the +Z direction
 
- 
setLocalTransformsetLocalTransformsets the local transform of this spatial.- Specified by:
- setLocalTransformin interface- HasLocalTransform
- Parameters:
- t- the desired local transform (not null,- t.rot.norm()approximately equal to 1, unaffected)
 
- 
getLocalTransformgetLocalTransformretrieves the local transform of this spatial.- Specified by:
- getLocalTransformin interface- HasLocalTransform
- Returns:
- the local transform of this spatial.
 
- 
setMaterialApplies the given material to the Spatial, this will propagate the material down to the geometries in the scene graph.- Parameters:
- material- The material to set.
 
- 
addLightaddLightadds the given light to the Spatial; causing all child Spatials to be affected by it.- Parameters:
- light- The light to add.
 
- 
removeLightremoveLightremoves the given light from the Spatial.- Parameters:
- light- The light to remove.
- See Also:
 
- 
moveTranslates the spatial by the given translation vector.- Parameters:
- x- the offset to apply in the +X direction
- y- the offset to apply in the +Y direction
- z- the offset to apply in the +Z direction
- Returns:
- The spatial on which this method is called, e.g this.
 
- 
moveTranslates the spatial by the given translation vector.- Parameters:
- offset- the desired offset (not null, unaffected)
- Returns:
- The spatial on which this method is called, e.g this.
 
- 
scaleScales the spatial by the given value- Parameters:
- s- the scaling factor to apply to all axes
- Returns:
- The spatial on which this method is called, e.g this.
 
- 
scaleScales the spatial by the given scale vector.- Parameters:
- x- the scaling factor to apply to the X axis
- y- the scaling factor to apply to the Y axis
- z- the scaling factor to apply to the Z axis
- Returns:
- The spatial on which this method is called, e.g this.
 
- 
rotateRotates the spatial by the given rotation.- Parameters:
- rot- the intrinsic rotation to apply (not null, unaffected)
- Returns:
- The spatial on which this method is called, e.g this.
 
- 
rotateRotates the spatial by the xAngle, yAngle and zAngle angles (in radians), (aka pitch, yaw, roll) in the local coordinate space.- Parameters:
- xAngle- the angle of rotation around the +X axis (in radians)
- yAngle- the angle of rotation around the +Y axis (in radians)
- zAngle- the angle of rotation around the +Z axis (in radians)
- Returns:
- The spatial on which this method is called, e.g this.
 
- 
centerCenters the spatial in the origin of the world bound.- Returns:
- The spatial on which this method is called, e.g this.
 
- 
getCullHint- Returns:
- the cull mode of this spatial, or if set to CullHint.Inherit, the cull mode of its parent.
- See Also:
 
- 
getBatchHint
- 
getQueueBucketReturns this spatial's render-queue bucket. If the mode is set to inherit, then the spatial gets its render-queue bucket from its parent.- Returns:
- The spatial's current render-queue bucket.
 
- 
getShadowMode- Returns:
- The shadow mode of this spatial, if the local shadow mode is set to inherit, then the parent's shadow mode is returned.
- See Also:
 
- 
setLodLevelpublic void setLodLevel(int lod) Sets the level of detail to use when rendering this Spatial, this call propagates to all geometries under this Spatial.- Parameters:
- lod- The lod level to set.
 
- 
updateModelBoundpublic abstract void updateModelBound()updateModelBoundrecalculates the bounding object for this Spatial.
- 
setModelBoundsetModelBoundsets the bounding object for this Spatial.- Parameters:
- modelBound- the bounding object for this spatial.
 
- 
getVertexCountpublic abstract int getVertexCount()- Returns:
- The sum of all vertices under this Spatial.
 
- 
getTriangleCountpublic abstract int getTriangleCount()- Returns:
- The sum of all triangles under this Spatial.
 
- 
clone- Parameters:
- cloneMaterial- true to clone materials, false to share them
- Returns:
- A clone of this Spatial, the scene graph in its entirety is cloned and can be altered independently of the original scene graph. Note that meshes of geometries are not cloned explicitly, they are shared if static, or specially cloned if animated.
- See Also:
 
- 
oldCloneDeprecated.The old clone() method that did not use the new Cloner utility.- Parameters:
- cloneMaterial- ignored
- Returns:
- never
 
- 
cloneDescription copied from interface:CloneableSmartAssetCreates a clone of the asset. Please seeObject.clone()for more info on how this method should be implemented.- Specified by:
- clonein interface- CloneableSmartAsset
- Overrides:
- clonein class- Object
- Returns:
- A clone of this Spatial, the scene graph in its entirety is cloned and can be altered independently of the original scene graph. Note that meshes of geometries are not cloned explicitly, they are shared if static, or specially cloned if animated.
- See Also:
 
- 
deepClone- Returns:
- Similar to Spatial.clone() except will create a deep clone of all geometries' meshes. Normally this method shouldn't be used. Instead, use Spatial.clone()
- See Also:
 
- 
jmeCloneCalled internally by com.jme3.util.clone.Cloner. Do not call directly.- Specified by:
- jmeClonein interface- JmeCloneable
- Returns:
- a new instance
 
- 
cloneFieldsCalled internally by com.jme3.util.clone.Cloner. Do not call directly.- Specified by:
- cloneFieldsin interface- JmeCloneable
- Parameters:
- 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 only clone what it wants.
 
- 
setUserData
- 
getUserData
- 
getUserDataKeys
- 
matchesNote that we are matching the pattern, therefore the pattern must match the entire pattern (i.e. it behaves as if it is sandwiched between "^" and "$"). You can set regex modes, like case insensitivity, by using the (?X) or (?X:Y) constructs.- Parameters:
- spatialSubclass- Subclass which this must implement. Null causes all Spatials to qualify.
- nameRegex- Regular expression to match this name against. Null causes all Names to qualify.
- Returns:
- true if this implements the specified class and this's name matches the specified pattern.
- See Also:
 
- 
write- Specified by:
- writein interface- Savable
- Throws:
- IOException
 
- 
read- Specified by:
- readin interface- Savable
- Throws:
- IOException
 
- 
getWorldBoundgetWorldBoundretrieves the world bound at this node level.- Returns:
- the world bound at this level.
 
- 
setCullHintsetCullHintalters how view frustum culling will treat this spatial.- Parameters:
- hint- one of:- CullHint.Dynamic,- CullHint.Always,- CullHint.Inherit, or- CullHint.Never- The effect of the default value (CullHint.Inherit) may change if the spatial gets re-parented. 
 
- 
setBatchHintsetBatchHintalters how batching will treat this spatial.- Parameters:
- hint- one of:- BatchHint.Never,- BatchHint.Always, or- BatchHint.Inherit- The effect of the default value (BatchHint.Inherit) may change if the spatial gets re-parented. 
 
- 
getLocalCullHint- Returns:
- the cull mode of this Spatial
 
- 
getLocalBatchHint- Returns:
- the batch hint for this Spatial
 
- 
setQueueBucketsetQueueBucketdetermines at what phase of the rendering process this Spatial will rendered. See theRenderQueue.Bucketenum for an explanation of the various render queue buckets.- Parameters:
- queueBucket- The bucket to use for this Spatial.
 
- 
setShadowModeSets the shadow mode of the spatial The shadow mode determines how the spatial should be shadowed, when a shadowing technique is used. See the documentation for the classRenderQueue.ShadowModefor more information.- Parameters:
- shadowMode- The local shadow mode to set.
- See Also:
 
- 
getLocalQueueBucket- Returns:
- The locally set queue bucket mode
- See Also:
 
- 
getLocalShadowMode- Returns:
- The locally set shadow mode
- See Also:
 
- 
getLastFrustumIntersectionReturns this spatial's last frustum intersection result. This int is set when a check is made to determine if the bounds of the object fall inside a camera's frustum. If a parent is found to fall outside the frustum, the value for this spatial will not be updated.- Returns:
- The spatial's last frustum intersection result.
 
- 
setLastFrustumIntersectionOverrides the last intersection result. This is useful for operations that want to start rendering at the middle of a scene tree and don't want the parent of that node to influence culling.- Parameters:
- intersects- the new value
 
- 
toStringReturns the Spatial's name followed by the class of the spatial
 Example: "MyNode (com.jme3.scene.Spatial)"
- 
getLocalToWorldMatrixCreates a transform matrix that will convert from this spatials' local coordinate space to the world coordinate space based on the world transform.- Parameters:
- store- Matrix where to store the result, if null, a new one will be created and returned.
- Returns:
- store if not null, otherwise, a new matrix containing the result.
- See Also:
 
- 
depthFirstTraversalVisit each scene graph element ordered by DFS with the default post order mode.- Parameters:
- visitor- the action to take for each visited Spatial
- See Also:
 
- 
depthFirstTraversalVisit each scene graph element ordered by DFS. There are two modes: pre order and post order.- Parameters:
- visitor- the action to take for each visited Spatial
- mode- the traversal mode: pre order or post order
 
- 
breadthFirstTraversalVisit each scene graph element ordered by BFS- Parameters:
- visitor- the action to take for each visited Spatial
 
- 
breadthFirstTraversal
 
-