Class PlaneRenderer


  • public class PlaneRenderer
    extends java.lang.Object
    Control rendering of ARCore planes.

    Used to visualize detected planes and to control whether Renderables cast shadows on them.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String MATERIAL_COLOR
      Float3 material parameter to control the RGB tint of the plane.
      static java.lang.String MATERIAL_SPOTLIGHT_RADIUS
      Float material parameter to control the radius of the spotlight.
      static java.lang.String MATERIAL_TEXTURE
      Material parameter that controls what texture is being used when rendering the planes.
      static java.lang.String MATERIAL_UV_SCALE
      Float2 material parameter to control the X/Y scaling of the texture's UV coordinates.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.concurrent.CompletableFuture<Material> getMaterial()
      Returns default material instance used to render the planes.
      boolean isEnabled()
      Check if the plane renderer is enabled.
      boolean isShadowReceiver()
      Return true if Renderables in the scene cast shadows onto the planes.
      boolean isVisible()
      Return true if plane visualization is visible.
      void setEnabled​(boolean enabled)
      Enable/disable the plane renderer.
      void setShadowReceiver​(boolean shadowReceiver)
      Control whether Renderables in the scene should cast shadows onto the planes.
      void setVisible​(boolean visible)
      Control visibility of plane visualization.
      void update​(com.google.ar.core.Frame frame, int viewWidth, int viewHeight)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • MATERIAL_TEXTURE

        public static final java.lang.String MATERIAL_TEXTURE
        Material parameter that controls what texture is being used when rendering the planes.
        See Also:
        Constant Field Values
      • MATERIAL_UV_SCALE

        public static final java.lang.String MATERIAL_UV_SCALE
        Float2 material parameter to control the X/Y scaling of the texture's UV coordinates. Can be used to adjust for the texture's aspect ratio and control the frequency of tiling.
        See Also:
        Constant Field Values
      • MATERIAL_COLOR

        public static final java.lang.String MATERIAL_COLOR
        Float3 material parameter to control the RGB tint of the plane.
        See Also:
        Constant Field Values
      • MATERIAL_SPOTLIGHT_RADIUS

        public static final java.lang.String MATERIAL_SPOTLIGHT_RADIUS
        Float material parameter to control the radius of the spotlight.
        See Also:
        Constant Field Values
    • Constructor Detail

      • PlaneRenderer

        public PlaneRenderer​(Renderer renderer)
    • Method Detail

      • setEnabled

        public void setEnabled​(boolean enabled)
        Enable/disable the plane renderer.
      • isEnabled

        public boolean isEnabled()
        Check if the plane renderer is enabled.
      • setShadowReceiver

        public void setShadowReceiver​(boolean shadowReceiver)
        Control whether Renderables in the scene should cast shadows onto the planes.

        If false - no planes receive shadows, regardless of the per-plane setting.

      • isShadowReceiver

        public boolean isShadowReceiver()
        Return true if Renderables in the scene cast shadows onto the planes.
      • setVisible

        public void setVisible​(boolean visible)
        Control visibility of plane visualization.

        If false - no planes are drawn. Note that shadow visibility is independent of plane visibility.

      • isVisible

        public boolean isVisible()
        Return true if plane visualization is visible.
      • getMaterial

        public java.util.concurrent.CompletableFuture<Material> getMaterial()
        Returns default material instance used to render the planes.
      • update

        public void update​(com.google.ar.core.Frame frame,
                           int viewWidth,
                           int viewHeight)