Class SceneHints

java.lang.Object
com.ardor3d.scenegraph.hint.SceneHints
All Implemented Interfaces:
Savable

public class SceneHints extends Object implements Savable
SceneHints encapsulates various rendering and interaction preferences for a scene object.
  • Field Details

    • _dataMode

      protected DataMode _dataMode
      How we want the data for a subset of the scenegraph to be sent to the card.
    • _normalsMode

      protected NormalsMode _normalsMode
      A flag indicating how normals should be treated by the renderer.
    • _cullHint

      protected CullHint _cullHint
      A flag indicating if scene culling should be done on this object by inheritance, dynamically, never, or always.
    • _lightCombineMode

      protected LightCombineMode _lightCombineMode
      Flag signaling how lights are combined for this node. By default set to INHERIT.
    • _textureCombineMode

      protected TextureCombineMode _textureCombineMode
      Flag signaling how textures are combined for this node. By default set to INHERIT.
    • _renderBucketType

      protected RenderBucketType _renderBucketType
      RenderBucketType for this spatial
    • _orthoOrder

      protected int _orthoOrder
      Draw order to use when drawing in ortho mode.
    • _pickingHints

      protected final EnumSet<PickingHint> _pickingHints
      Field for setting whether the Spatial is enabled for Picking or Collision. Both are enabled by default.
    • _castsShadows

      protected boolean _castsShadows
      Hint for shadow implementations
  • Constructor Details

    • SceneHints

      public SceneHints(Hintable source)
  • Method Details

    • set

      public void set(SceneHints sceneHints)
    • getDataMode

      public DataMode 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

      public DataMode getLocalDataMode()
      Returns:
      the exact data mode set.
    • setDataMode

      public void setDataMode(DataMode type)
      Parameters:
      type - the new data mode to set on this SceneHints
    • getNormalsMode

      public NormalsMode 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

      public NormalsMode getLocalNormalsMode()
      Returns:
      the exact normals mode set.
    • setNormalsMode

      public void setNormalsMode(NormalsMode mode)
      Parameters:
      mode - the new normals mode to set on this SceneHints
    • getCullHint

      public CullHint getCullHint()
      Returns:
      the cull mode of this spatial, or if set to INHERIT, the cullmode of its parent.
      See Also:
    • getLocalCullHint

      public CullHint getLocalCullHint()
      Returns:
      the cullmode set on this Spatial
    • setCullHint

      public void setCullHint(CullHint hint)
      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

      public TextureCombineMode 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

      public TextureCombineMode getLocalTextureCombineMode()
      Returns:
      the textureCombineMode set on this Spatial
    • setTextureCombineMode

      public void setTextureCombineMode(TextureCombineMode mode)
      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

      public LightCombineMode 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

      public LightCombineMode getLocalLightCombineMode()
      Returns:
      the lightCombineMode set on this Spatial
    • setLightCombineMode

      public void setLightCombineMode(LightCombineMode mode)
      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

      public RenderBucketType 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, then Opaque is used.

      Returns:
      the render queue mode used for this spatial.
      See Also:
    • getLocalRenderBucketType

      public RenderBucketType 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, then Opaque is used.

      Returns:
      the render queue mode set on this spatial.
      See Also:
    • setRenderBucketType

      public void setRenderBucketType(RenderBucketType renderBucketType)
      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

      public boolean isPickingHintEnabled(PickingHint pickingHint)
      Returns whether a certain pick hint is set on this spatial.
      Parameters:
      pickingHint - Pick hint to test for
      Returns:
      Enabled or disabled
    • setPickingHint

      public void setPickingHint(PickingHint pickingHint, boolean enabled)
      Enable or disable a picking hint for this Spatial
      Parameters:
      pickingHint - PickingHint to set. Pickable or Collidable
      enabled - 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

      public TransparencyType 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

      public TransparencyType getLocalTransparencyType()
      Returns:
      the exact transparency rendering type set.
    • setTransparencyType

      public void setTransparencyType(TransparencyType type)
      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

      public Class<? extends SceneHints> getClassTag()
      Specified by:
      getClassTag in interface Savable
    • read

      public void read(InputCapsule capsule) throws IOException
      Specified by:
      read in interface Savable
      Throws:
      IOException
    • write

      public void write(OutputCapsule capsule) throws IOException
      Specified by:
      write in interface Savable
      Throws:
      IOException