public abstract class Spatial extends java.lang.Object implements Savable, java.lang.Cloneable, Collidable, CloneableSmartAsset, JmeCloneable, HasLocalTransform
Modifier and Type | Class and Description |
---|---|
static class |
Spatial.BatchHint
Specifies if this spatial should be batched
|
static class |
Spatial.CullHint
Specifies how frustum culling should be handled by
this spatial.
|
static class |
Spatial.DFSMode
Specifies the mode of the depth first search.
|
Modifier and Type | Field and Description |
---|---|
protected Spatial.BatchHint |
batchHint |
protected SafeArrayList<Control> |
controls |
protected Spatial.CullHint |
cullHint |
protected Camera.FrustumIntersect |
frustrumIntersects |
protected AssetKey |
key
Used for smart asset caching
|
protected LightList |
localLights
LightList
|
protected SafeArrayList<MatParamOverride> |
localOverrides |
protected Transform |
localTransform |
protected java.lang.String |
name
This spatial's name.
|
protected Node |
parent
Spatial's parent, or null if it has none.
|
protected RenderQueue.Bucket |
queueBucket |
float |
queueDistance |
protected int |
refreshFlags
Refresh flags.
|
protected static int |
RF_BOUND
Refresh flag types
|
protected static int |
RF_CHILD_LIGHTLIST
Refresh flag types
|
protected static int |
RF_LIGHTLIST
Refresh flag types
|
protected static int |
RF_MATPARAM_OVERRIDE
Refresh flag types
|
protected static int |
RF_TRANSFORM
Refresh flag types
|
protected RenderQueue.ShadowMode |
shadowMode |
protected java.util.HashMap<java.lang.String,Savable> |
userData |
protected BoundingVolume |
worldBound
Spatial's bounding volume relative to the world.
|
protected LightList |
worldLights |
protected SafeArrayList<MatParamOverride> |
worldOverrides |
protected Transform |
worldTransform |
Modifier | Constructor and Description |
---|---|
protected |
Spatial()
Serialization only.
|
protected |
Spatial(java.lang.String name)
Constructor instantiates a new
Spatial object, setting the
rotation, translation, and scale values to their defaults. |
Modifier and Type | Method and Description |
---|---|
void |
addControl(Control control)
Add a control to the list of controls.
|
void |
addLight(Light light)
addLight adds the given light to the Spatial; causing all
child Spatials to be affected by it. |
void |
addMatParamOverride(MatParamOverride override)
Adds a local material parameter override.
|
void |
breadthFirstTraversal(SceneGraphVisitor visitor)
Visit each scene graph element ordered by BFS
|
protected abstract void |
breadthFirstTraversal(SceneGraphVisitor visitor,
java.util.Queue<Spatial> queue) |
Spatial |
center()
Centers the spatial in the origin of the world bound.
|
boolean |
checkCulling(Camera cam)
checkCulling checks the spatial with the camera to see if it
should be culled. |
void |
clearMatParamOverrides()
Remove all local material parameter overrides.
|
Spatial |
clone()
Creates a clone of the asset.
|
Spatial |
clone(boolean cloneMaterial) |
void |
cloneFields(Cloner cloner,
java.lang.Object original)
Called internally by com.jme3.util.clone.Cloner.
|
Spatial |
deepClone() |
void |
depthFirstTraversal(SceneGraphVisitor visitor)
Visit each scene graph element ordered by DFS with the default post order mode.
|
abstract void |
depthFirstTraversal(SceneGraphVisitor visitor,
Spatial.DFSMode mode)
Visit each scene graph element ordered by DFS.
|
void |
forceRefresh(boolean transforms,
boolean bounds,
boolean lights)
(Internal use only) Forces a refresh of the given types of data.
|
Spatial.BatchHint |
getBatchHint() |
<T extends Control> |
getControl(java.lang.Class<T> controlType)
Returns the first control that is an instance of the given class,
or null if no such control exists.
|
Control |
getControl(int index)
Returns the control at the given index in the list.
|
Spatial.CullHint |
getCullHint() |
AssetKey |
getKey()
Returns the asset key that is used to track this asset for garbage
collection.
|
Camera.FrustumIntersect |
getLastFrustumIntersection()
Returns this spatial's last frustum intersection result.
|
Spatial.BatchHint |
getLocalBatchHint() |
Spatial.CullHint |
getLocalCullHint() |
LightList |
getLocalLightList()
Returns the local
LightList , which are the lights
that were directly attached to this Spatial through the
addLight(com.jme3.light.Light) and
removeLight(com.jme3.light.Light) methods. |
SafeArrayList<MatParamOverride> |
getLocalMatParamOverrides()
Get the local material parameter overrides.
|
RenderQueue.Bucket |
getLocalQueueBucket() |
Quaternion |
getLocalRotation()
getLocalRotation retrieves the local rotation of this
node. |
Vector3f |
getLocalScale()
getLocalScale retrieves the local scale of this node. |
RenderQueue.ShadowMode |
getLocalShadowMode() |
Matrix4f |
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.
|
Transform |
getLocalTransform()
getLocalTransform retrieves the local transform of
this spatial. |
Vector3f |
getLocalTranslation()
getLocalTranslation retrieves the local translation of
this node. |
java.lang.String |
getName()
Returns the name of this spatial.
|
int |
getNumControls() |
Node |
getParent()
getParent retrieves this node's parent. |
RenderQueue.Bucket |
getQueueBucket()
Returns this spatial's render-queue bucket.
|
RenderQueue.ShadowMode |
getShadowMode() |
abstract int |
getTriangleCount() |
<T> T |
getUserData(java.lang.String key) |
java.util.Collection<java.lang.String> |
getUserDataKeys() |
abstract int |
getVertexCount() |
BoundingVolume |
getWorldBound()
getWorldBound retrieves the world bound at this node
level. |
LightList |
getWorldLightList()
Returns the world
LightList , containing the lights
combined from all this Spatial's parents up to and including
this Spatial 's lights. |
SafeArrayList<MatParamOverride> |
getWorldMatParamOverrides()
Get the world material parameter overrides.
|
Quaternion |
getWorldRotation()
getWorldRotation retrieves the absolute rotation of the
Spatial. |
Vector3f |
getWorldScale()
getWorldScale retrieves the absolute scale factor of the
spatial. |
Transform |
getWorldTransform()
getWorldTransform retrieves the world transformation
of the spatial. |
Vector3f |
getWorldTranslation()
getWorldTranslation retrieves the absolute translation of
the spatial. |
boolean |
hasAncestor(Node ancestor)
determines if the provided Node is the parent, or parent's parent, etc.
|
Spatial |
jmeClone()
Called internally by com.jme3.util.clone.Cloner.
|
Vector3f |
localToWorld(Vector3f in,
Vector3f store)
Convert a vector (in) from this spatial's local coordinate space to world
coordinate space.
|
void |
lookAt(Vector3f position,
Vector3f upVector)
lookAt is a convenience method for auto-setting the local
rotation based on a position in world space and an up vector. |
boolean |
matches(java.lang.Class<? extends Spatial> spatialSubclass,
java.lang.String nameRegex)
Note that we are matching the pattern, therefore the pattern
must match the entire pattern (i.e.
|
Spatial |
move(float x,
float y,
float z)
Translates the spatial by the given translation vector.
|
Spatial |
move(Vector3f offset)
Translates the spatial by the given translation vector.
|
Spatial |
oldClone(boolean cloneMaterial)
Deprecated.
|
void |
read(JmeImporter im) |
void |
removeControl(java.lang.Class<? extends Control> controlType)
Removes the first control that is an instance of the given class.
|
boolean |
removeControl(Control control)
Removes the given control from this spatial's controls.
|
boolean |
removeFromParent()
removeFromParent removes this Spatial from its parent. |
void |
removeLight(Light light)
removeLight removes the given light from the Spatial. |
void |
removeMatParamOverride(MatParamOverride override)
Remove a local material parameter override if it exists.
|
Spatial |
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.
|
Spatial |
rotate(Quaternion rot)
Rotates the spatial by the given rotation.
|
void |
rotateUpTo(Vector3f newUp)
rotateUpTo is a utility function that alters the
local rotation to point the Y axis in the direction given by newUp. |
void |
runControlRender(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.
|
Spatial |
scale(float s)
Scales the spatial by the given value
|
Spatial |
scale(float x,
float y,
float z)
Scales the spatial by the given scale vector.
|
void |
setBatchHint(Spatial.BatchHint hint)
setBatchHint alters how batching will treat this spatial. |
protected void |
setBoundRefresh()
Indicate that the bounding of this spatial has changed and that
a refresh is required.
|
void |
setCullHint(Spatial.CullHint hint)
setCullHint alters how view frustum culling will treat this
spatial. |
void |
setKey(AssetKey key)
Set by the
AssetManager to track this asset. |
void |
setLastFrustumIntersection(Camera.FrustumIntersect intersects)
Overrides the last intersection result.
|
protected void |
setLightListRefresh() |
void |
setLocalRotation(Matrix3f rotation)
setLocalRotation sets the local rotation of this node
by using a Matrix3f . |
void |
setLocalRotation(Quaternion quaternion)
setLocalRotation sets the local rotation of this node. |
void |
setLocalScale(float localScale)
setLocalScale sets the local scale of this node. |
void |
setLocalScale(float x,
float y,
float z)
setLocalScale sets the local scale of this node. |
void |
setLocalScale(Vector3f localScale)
setLocalScale sets the local scale of this node. |
void |
setLocalTransform(Transform t)
setLocalTransform sets the local transform of this
spatial. |
void |
setLocalTranslation(float x,
float y,
float z)
setLocalTranslation sets the local translation of this
spatial. |
void |
setLocalTranslation(Vector3f localTranslation)
setLocalTranslation sets the local translation of this
spatial. |
void |
setLodLevel(int lod)
Sets the level of detail to use when rendering this Spatial,
this call propagates to all geometries under this Spatial.
|
void |
setMaterial(Material material)
Applies the given material to the Spatial, this will propagate the
material down to the geometries in the scene graph.
|
protected void |
setMatParamOverrideRefresh() |
abstract void |
setModelBound(BoundingVolume modelBound)
setModelBound sets the bounding object for this Spatial. |
void |
setName(java.lang.String name)
Sets the name of this spatial.
|
protected void |
setParent(Node parent)
Called by
Node.attachChild(Spatial) and
Node.detachChild(Spatial) - don't call directly. |
void |
setQueueBucket(RenderQueue.Bucket queueBucket)
setQueueBucket determines at what phase of the
rendering process this Spatial will rendered. |
protected 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.
|
void |
setShadowMode(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 void |
setTransformRefresh()
Indicate that the transform of this spatial has changed and that
a refresh is required.
|
void |
setUserData(java.lang.String key,
java.lang.Object data) |
java.lang.String |
toString()
Returns the Spatial's name followed by the class of the spatial
Example: "MyNode (com.jme3.scene.Spatial)" |
void |
updateGeometricState()
updateGeometricState updates the light list,
computes the world transforms, and computes the world bounds
for this Spatial. |
void |
updateLogicalState(float tpf)
updateLogicalState calls the update() method
for all controls attached to this Spatial. |
protected void |
updateMatParamOverrides() |
abstract void |
updateModelBound()
updateModelBound recalculates the bounding object for this
Spatial. |
protected void |
updateWorldBound()
Should be overridden by Node and Geometry.
|
protected void |
updateWorldLightList() |
protected void |
updateWorldTransforms()
Should only be called from updateGeometricState().
|
Vector3f |
worldToLocal(Vector3f in,
Vector3f store)
Convert a vector (in) from world coordinate space to this spatial's local
coordinate space.
|
void |
write(JmeExporter ex) |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
collideWith
protected static final int RF_TRANSFORM
protected static final int RF_BOUND
protected static final int RF_LIGHTLIST
protected static final int RF_CHILD_LIGHTLIST
protected static final int RF_MATPARAM_OVERRIDE
protected Spatial.CullHint cullHint
protected Spatial.BatchHint batchHint
protected BoundingVolume worldBound
protected LightList localLights
protected transient LightList worldLights
protected SafeArrayList<MatParamOverride> localOverrides
protected SafeArrayList<MatParamOverride> worldOverrides
protected java.lang.String name
protected transient Camera.FrustumIntersect frustrumIntersects
protected RenderQueue.Bucket queueBucket
protected RenderQueue.ShadowMode shadowMode
public transient float queueDistance
protected Transform localTransform
protected Transform worldTransform
protected SafeArrayList<Control> controls
protected java.util.HashMap<java.lang.String,Savable> userData
protected AssetKey key
AssetKey.getCacheType()
protected transient Node parent
protected transient int refreshFlags
protected Spatial()
protected Spatial(java.lang.String name)
Spatial
object, setting the
rotation, translation, and scale values to their defaults.name
- the name of the scene element. This is required for
identification and comparison purposes.public void setKey(AssetKey key)
CloneableSmartAsset
AssetManager
to track this asset.
Only clones of the asset has this set, the original copy that
was loaded has this key set to null so that only the clones are tracked
for garbage collection.setKey
in interface CloneableSmartAsset
key
- The AssetKey to setpublic AssetKey getKey()
CloneableSmartAsset
getKey
in interface CloneableSmartAsset
protected void setRequiresUpdates(boolean f)
f
- true→require updates, false→don't require updatesprotected void setTransformRefresh()
protected void setLightListRefresh()
protected void setMatParamOverrideRefresh()
protected void setBoundRefresh()
public void forceRefresh(boolean transforms, boolean bounds, boolean lights)
transforms
- Refresh world transform based on parents'bounds
- Refresh bounding volume data based on child nodeslights
- Refresh light list based on parents'public boolean checkCulling(Camera cam)
checkCulling
checks 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.
cam
- The camera to check against.public void setName(java.lang.String name)
name
- The spatial's new name.public java.lang.String getName()
public LightList getLocalLightList()
LightList
, which are the lights
that were directly attached to this Spatial
through the
addLight(com.jme3.light.Light)
and
removeLight(com.jme3.light.Light)
methods.public LightList getWorldLightList()
LightList
, containing the lights
combined from all this Spatial's
parents up to and including
this Spatial
's lights.public SafeArrayList<MatParamOverride> getLocalMatParamOverrides()
public SafeArrayList<MatParamOverride> getWorldMatParamOverrides()
updateGeometricState()
. After update, the world overrides list
will contain the parent's
world overrides combined
with this spatial's local overrides
.public Quaternion getWorldRotation()
getWorldRotation
retrieves the absolute rotation of the
Spatial.public Vector3f getWorldTranslation()
getWorldTranslation
retrieves the absolute translation of
the spatial.public Vector3f getWorldScale()
getWorldScale
retrieves the absolute scale factor of the
spatial.public Transform getWorldTransform()
getWorldTransform
retrieves the world transformation
of the spatial.public void rotateUpTo(Vector3f newUp)
rotateUpTo
is a utility function that alters the
local rotation to point the Y axis in the direction given by newUp.newUp
- the up vector to use - assumed to be a unit vector.public void lookAt(Vector3f position, Vector3f upVector)
lookAt
is 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'.
Unlike Quaternion.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.position
- where to look at in terms of world coordinatesupVector
- a vector indicating the (local) up direction. (typically {0,
1, 0} in jME.)protected void updateWorldBound()
protected void updateWorldLightList()
protected void updateMatParamOverrides()
public void addMatParamOverride(MatParamOverride override)
override
- The override to add.MatParamOverride
public void removeMatParamOverride(MatParamOverride override)
override
- The override to remove.MatParamOverride
public void clearMatParamOverrides()
protected void updateWorldTransforms()
public void runControlRender(RenderManager rm, ViewPort vp)
rm
- The RenderManager rendering the Spatial.vp
- The ViewPort to which the Spatial is being rendered to.addControl(com.jme3.scene.control.Control)
,
getControl(java.lang.Class)
public void addControl(Control control)
control
- The control to add.removeControl(java.lang.Class)
public void removeControl(java.lang.Class<? extends Control> controlType)
controlType
- the type of Control to removeaddControl(com.jme3.scene.control.Control)
public boolean removeControl(Control control)
control
- The control to removeaddControl(com.jme3.scene.control.Control)
public <T extends Control> T getControl(java.lang.Class<T> controlType)
T
- the type of control to look forcontrolType
- The superclass of the control to look for.addControl(com.jme3.scene.control.Control)
public Control getControl(int index)
index
- The index of the control in the list to find.java.lang.IndexOutOfBoundsException
- If the index is outside the range [0, getNumControls()-1]addControl(com.jme3.scene.control.Control)
public int getNumControls()
addControl(com.jme3.scene.control.Control)
,
removeControl(java.lang.Class)
public void updateLogicalState(float tpf)
updateLogicalState
calls the update()
method
for all controls attached to this Spatial.tpf
- Time per frame.addControl(com.jme3.scene.control.Control)
public void updateGeometricState()
updateGeometricState
updates 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.getWorldLightList()
,
getWorldTransform()
,
getWorldBound()
public Vector3f localToWorld(Vector3f in, Vector3f store)
in
- vector to read fromstore
- where to write the result (null to create a new vector, may be
same as in)public Vector3f worldToLocal(Vector3f in, Vector3f store)
in
- vector to read fromstore
- where to write the resultpublic Node getParent()
getParent
retrieves this node's parent. If the parent is
null this is the root node.protected void setParent(Node parent)
Node.attachChild(Spatial)
and
Node.detachChild(Spatial)
- don't call directly.
setParent
sets the parent of this node.parent
- the parent of this node.public boolean removeFromParent()
removeFromParent
removes this Spatial from its parent.public boolean hasAncestor(Node ancestor)
ancestor
- the ancestor object to look for.public Quaternion getLocalRotation()
getLocalRotation
retrieves the local rotation of this
node.public void setLocalRotation(Matrix3f rotation)
setLocalRotation
sets the local rotation of this node
by using a Matrix3f
.rotation
- the new local rotation.public void setLocalRotation(Quaternion quaternion)
setLocalRotation
sets the local rotation of this node.quaternion
- the new local rotation.public Vector3f getLocalScale()
getLocalScale
retrieves the local scale of this node.public void setLocalScale(float localScale)
setLocalScale
sets the local scale of this node.localScale
- the new local scale, applied to x, y and zpublic void setLocalScale(float x, float y, float z)
setLocalScale
sets the local scale of this node.x
- the desired scale factor for the X axisy
- the desired scale factor for the Y axisz
- the desired scale factor for the Z axispublic void setLocalScale(Vector3f localScale)
setLocalScale
sets the local scale of this node.localScale
- the new local scale.public Vector3f getLocalTranslation()
getLocalTranslation
retrieves the local translation of
this node.public void setLocalTranslation(Vector3f localTranslation)
setLocalTranslation
sets the local translation of this
spatial.localTranslation
- the local translation of this spatial.public void setLocalTranslation(float x, float y, float z)
setLocalTranslation
sets the local translation of this
spatial.x
- the desired offset in the +X directiony
- the desired offset in the +Y directionz
- the desired offset in the +Z directionpublic void setLocalTransform(Transform t)
setLocalTransform
sets the local transform of this
spatial.setLocalTransform
in interface HasLocalTransform
public Transform getLocalTransform()
getLocalTransform
retrieves the local transform of
this spatial.getLocalTransform
in interface HasLocalTransform
public void setMaterial(Material material)
material
- The material to set.public void addLight(Light light)
addLight
adds the given light to the Spatial; causing all
child Spatials to be affected by it.light
- The light to add.public void removeLight(Light light)
removeLight
removes the given light from the Spatial.light
- The light to remove.addLight(com.jme3.light.Light)
public Spatial move(float x, float y, float z)
x
- the offset to apply in the +X directiony
- the offset to apply in the +Y directionz
- the offset to apply in the +Z directionthis
.public Spatial move(Vector3f offset)
offset
- the desired offset (not null, unaffected)this
.public Spatial scale(float s)
s
- the scaling factor to apply to all axesthis
.public Spatial scale(float x, float y, float z)
x
- the scaling factor to apply to the X axisy
- the scaling factor to apply to the Y axisz
- the scaling factor to apply to the Z axisthis
.public Spatial rotate(Quaternion rot)
rot
- the intrinsic rotation to apply (not null, unaffected)this
.public Spatial rotate(float xAngle, float yAngle, float zAngle)
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)this
.public Spatial center()
this
.public Spatial.CullHint getCullHint()
setCullHint(CullHint)
public Spatial.BatchHint getBatchHint()
public RenderQueue.Bucket getQueueBucket()
public RenderQueue.ShadowMode getShadowMode()
setShadowMode(com.jme3.renderer.queue.RenderQueue.ShadowMode)
,
RenderQueue.ShadowMode
public void setLodLevel(int lod)
lod
- The lod level to set.public abstract void updateModelBound()
updateModelBound
recalculates the bounding object for this
Spatial.public abstract void setModelBound(BoundingVolume modelBound)
setModelBound
sets the bounding object for this Spatial.modelBound
- the bounding object for this spatial.public abstract int getVertexCount()
public abstract int getTriangleCount()
public Spatial clone(boolean cloneMaterial)
cloneMaterial
- true to clone materials, false to share themMesh.cloneForAnim()
@Deprecated public Spatial oldClone(boolean cloneMaterial)
cloneMaterial
- ignoredpublic Spatial clone()
CloneableSmartAsset
Object.clone()
for more info on how this method
should be implemented.clone
in interface CloneableSmartAsset
clone
in class java.lang.Object
Mesh.cloneForAnim()
public Spatial deepClone()
clone()
public Spatial jmeClone()
jmeClone
in interface JmeCloneable
public void cloneFields(Cloner cloner, java.lang.Object original)
cloneFields
in interface JmeCloneable
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.public void setUserData(java.lang.String key, java.lang.Object data)
public <T> T getUserData(java.lang.String key)
public java.util.Collection<java.lang.String> getUserDataKeys()
public boolean matches(java.lang.Class<? extends Spatial> spatialSubclass, java.lang.String nameRegex)
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.Pattern
public void write(JmeExporter ex) throws java.io.IOException
public void read(JmeImporter im) throws java.io.IOException
public BoundingVolume getWorldBound()
getWorldBound
retrieves the world bound at this node
level.public void setCullHint(Spatial.CullHint hint)
setCullHint
alters how view frustum culling will treat this
spatial.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.
public void setBatchHint(Spatial.BatchHint hint)
setBatchHint
alters how batching will treat this spatial.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.
public Spatial.CullHint getLocalCullHint()
public Spatial.BatchHint getLocalBatchHint()
public void setQueueBucket(RenderQueue.Bucket queueBucket)
setQueueBucket
determines at what phase of the
rendering process this Spatial will rendered. See the
RenderQueue.Bucket
enum for an explanation of the various
render queue buckets.queueBucket
- The bucket to use for this Spatial.public void setShadowMode(RenderQueue.ShadowMode shadowMode)
RenderQueue.ShadowMode
for more information.shadowMode
- The local shadow mode to set.RenderQueue.ShadowMode
public RenderQueue.Bucket getLocalQueueBucket()
setQueueBucket(com.jme3.renderer.queue.RenderQueue.Bucket)
public RenderQueue.ShadowMode getLocalShadowMode()
setShadowMode(com.jme3.renderer.queue.RenderQueue.ShadowMode)
public Camera.FrustumIntersect getLastFrustumIntersection()
public void setLastFrustumIntersection(Camera.FrustumIntersect intersects)
intersects
- the new valuepublic java.lang.String toString()
toString
in class java.lang.Object
public Matrix4f getLocalToWorldMatrix(Matrix4f store)
store
- Matrix where to store the result, if null, a new one
will be created and returned.getWorldTransform()
public void depthFirstTraversal(SceneGraphVisitor visitor)
visitor
- the action to take for each visited SpatialdepthFirstTraversal(com.jme3.scene.SceneGraphVisitor, com.jme3.scene.Spatial.DFSMode)
public abstract void depthFirstTraversal(SceneGraphVisitor visitor, Spatial.DFSMode mode)
visitor
- the action to take for each visited Spatialmode
- the traversal mode: pre order or post orderpublic void breadthFirstTraversal(SceneGraphVisitor visitor)
visitor
- the action to take for each visited Spatialprotected abstract void breadthFirstTraversal(SceneGraphVisitor visitor, java.util.Queue<Spatial> queue)