Package com.ardor3d.scenegraph.hint
Class SceneHints
java.lang.Object
com.ardor3d.scenegraph.hint.SceneHints
- All Implemented Interfaces:
Savable
SceneHints encapsulates various rendering and interaction preferences for a scene object.
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
Hint for shadow implementationsprotected CullHint
A flag indicating if scene culling should be done on this object by inheritance, dynamically, never, or always.protected DataMode
How we want the data for a subset of the scenegraph to be sent to the card.protected LightCombineMode
Flag signaling how lights are combined for this node.protected NormalsMode
A flag indicating how normals should be treated by the renderer.protected int
Draw order to use when drawing in ortho mode.protected final EnumSet
<PickingHint> Field for setting whether the Spatial is enabled for Picking or Collision.protected RenderBucketType
RenderBucketType for this spatialprotected TextureCombineMode
Flag signaling how textures are combined for this node. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionClass
<? extends SceneHints> Returns the normals mode.Returns this spatial's light combine mode.Get the render bucket type used to determine which "phase" of the rendering process this Spatial will rendered in.Returns the normals mode.int
Get the render bucket type used to determine which "phase" of the rendering process this Spatial will rendered in.Returns this spatial's texture combine mode.Returns the transparency rendering type.boolean
boolean
isPickingHintEnabled
(PickingHint pickingHint) Returns whether a certain pick hint is set on this spatial.void
read
(InputCapsule capsule) void
set
(SceneHints sceneHints) void
setAllPickingHints
(boolean enabled) Enable or disable all picking hints for this Spatialvoid
setCastsShadows
(boolean castsShadows) void
setCullHint
(CullHint hint) setCullHint
sets how scene culling should work on this spatial during drawing.void
setDataMode
(DataMode type) void
Sets how lights from parents should be combined for this spatial.void
setNormalsMode
(NormalsMode mode) void
setOrthoOrder
(int orthoOrder) void
setPickingHint
(PickingHint pickingHint, boolean enabled) Enable or disable a picking hint for this Spatialvoid
setRenderBucketType
(RenderBucketType renderBucketType) Set the render bucket type used to determine which "phase" of the rendering process this Spatial will rendered in.void
Sets how textures from parents should be combined for this Spatial.void
void
write
(OutputCapsule capsule)
-
Field Details
-
_dataMode
How we want the data for a subset of the scenegraph to be sent to the card. -
_normalsMode
A flag indicating how normals should be treated by the renderer. -
_cullHint
A flag indicating if scene culling should be done on this object by inheritance, dynamically, never, or always. -
_lightCombineMode
Flag signaling how lights are combined for this node. By default set to INHERIT. -
_textureCombineMode
Flag signaling how textures are combined for this node. By default set to INHERIT. -
_renderBucketType
RenderBucketType for this spatial -
_orthoOrder
protected int _orthoOrderDraw order to use when drawing in ortho mode. -
_pickingHints
Field for setting whether the Spatial is enabled for Picking or Collision. Both are enabled by default. -
_castsShadows
protected boolean _castsShadowsHint for shadow implementations
-
-
Constructor Details
-
SceneHints
-
-
Method Details
-
set
-
getDataMode
Returns the normals mode. If the mode is set to inherit, then we get its normals mode from the given source's hintable parent. If no parent, we'll default to NormalizeIfScaled.- Returns:
- The normals mode to use.
-
getLocalDataMode
- Returns:
- the exact data mode set.
-
setDataMode
- Parameters:
type
- the new data mode to set on this SceneHints
-
getNormalsMode
Returns the normals mode. If the mode is set to inherit, then we get its normals mode from the given source's hintable parent. If no parent, we'll default to NormalizeIfScaled.- Returns:
- The normals mode to use.
-
getLocalNormalsMode
- Returns:
- the exact normals mode set.
-
setNormalsMode
- Parameters:
mode
- the new normals mode to set on this SceneHints
-
getCullHint
- Returns:
- the cull mode of this spatial, or if set to INHERIT, the cullmode of its parent.
- See Also:
-
getLocalCullHint
- Returns:
- the cullmode set on this Spatial
-
setCullHint
setCullHint
sets how scene culling should work on this spatial during drawing. CullHint.Dynamic: Determine via the defined Camera planes whether or not this Spatial should be culled. CullHint.Always: Always throw away this object and any children during draw commands. CullHint.Never: Never throw away this object (always draw it) CullHint.Inherit: Look for a non-inherit parent and use its cull mode. NOTE: You must set this AFTER attaching to a parent or it will be reset with the parent's cullMode value.- Parameters:
hint
- one of CullHint.Dynamic, CullHint.Always, CullHint.Inherit or CullHint.Never
-
getTextureCombineMode
Returns this spatial's texture combine mode. If the mode is set to inherit, then the spatial gets its combine mode from its parent.- Returns:
- The spatial's texture current combine mode.
-
getLocalTextureCombineMode
- Returns:
- the textureCombineMode set on this Spatial
-
setTextureCombineMode
Sets how textures from parents should be combined for this Spatial.- Parameters:
mode
- The new texture combine mode for this spatial.- Throws:
IllegalArgumentException
- if mode is null
-
getLightCombineMode
Returns this spatial's light combine mode. If the mode is set to inherit, then the spatial gets its combine mode from its parent.- Returns:
- The spatial's light current combine mode.
-
getLocalLightCombineMode
- Returns:
- the lightCombineMode set on this Spatial
-
setLightCombineMode
Sets how lights from parents should be combined for this spatial.- Parameters:
mode
- The light combine mode for this spatial- Throws:
IllegalArgumentException
- if mode is null
-
getRenderBucketType
Get the render bucket type used to determine which "phase" of the rendering process this Spatial will rendered in.This method returns the effective bucket type that is used for rendering. If the type is set to
Inherit
then the bucket type from the spatial's parent will be used during rendering. If no parent, thenOpaque
is used.- Returns:
- the render queue mode used for this spatial.
- See Also:
-
getLocalRenderBucketType
Get the render bucket type used to determine which "phase" of the rendering process this Spatial will rendered in.This method returns the actual bucket type that is set on this spatial, if the type is set to
Inherit
then the bucket type from the spatial's parent will be used during rendering. If no parent, thenOpaque
is used.- Returns:
- the render queue mode set on this spatial.
- See Also:
-
setRenderBucketType
Set the render bucket type used to determine which "phase" of the rendering process this Spatial will rendered in.- Parameters:
renderBucketType
- the render bucket type to use for this spatial.- See Also:
-
isPickingHintEnabled
Returns whether a certain pick hint is set on this spatial.- Parameters:
pickingHint
- Pick hint to test for- Returns:
- Enabled or disabled
-
setPickingHint
Enable or disable a picking hint for this Spatial- Parameters:
pickingHint
- PickingHint to set. Pickable or Collidableenabled
- Enable or disable
-
setAllPickingHints
public void setAllPickingHints(boolean enabled) Enable or disable all picking hints for this Spatial- Parameters:
enabled
- Enable or disable
-
getOrthoOrder
public int getOrthoOrder()- Returns:
- a number representing z ordering when used in the Ortho bucket. Higher values are "further into the screen" and lower values are "closer". Or in other words, if you draw two quads, one with a zorder of 1 and the other with a zorder of 2, the quad with zorder of 2 will be "under" the other quad.
-
setOrthoOrder
public void setOrthoOrder(int orthoOrder) - Parameters:
orthoOrder
- the ortho order
-
getTransparencyType
Returns the transparency rendering type. If the mode is set to inherit, then we get its type from the given source's hintable parent. If no parent, we'll default to OnePass.- Returns:
- The transparency rendering type to use.
-
getLocalTransparencyType
- Returns:
- the exact transparency rendering type set.
-
setTransparencyType
- Parameters:
type
- the new transparency rendering type to set on this SceneHints
-
isCastsShadows
public boolean isCastsShadows()- Returns:
- true if this object should cast shadows
-
setCastsShadows
public void setCastsShadows(boolean castsShadows) - Parameters:
castsShadows
- set if this object should cast shadows
-
getClassTag
- Specified by:
getClassTag
in interfaceSavable
-
read
- Specified by:
read
in interfaceSavable
- Throws:
IOException
-
write
- Specified by:
write
in interfaceSavable
- Throws:
IOException
-