PlaneRenderer

public class PlaneRenderer

Control rendering of ARCore planes.

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

Constants

String MATERIAL_COLOR Float3 material parameter to control the RGB tint of the plane.
String MATERIAL_SPOTLIGHT_RADIUS Float material parameter to control the radius of the spotlight.
String MATERIAL_TEXTURE Material parameter that controls what texture is being used when rendering the planes.
String MATERIAL_UV_SCALE Float2 material parameter to control the X/Y scaling of the texture's UV coordinates.

Public Methods

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.

Inherited Methods

Constants

public static final String MATERIAL_COLOR

Float3 material parameter to control the RGB tint of the plane.

Constant Value: "color"

public static final String MATERIAL_SPOTLIGHT_RADIUS

Float material parameter to control the radius of the spotlight.

Constant Value: "radius"

public static final String MATERIAL_TEXTURE

Material parameter that controls what texture is being used when rendering the planes.

Constant Value: "texture"

public static final 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.

Constant Value: "uvScale"

Public Methods

public CompletableFuture<Material> getMaterial ()

Returns default material instance used to render the planes.

public boolean isEnabled ()

Check if the plane renderer is enabled.

public boolean isShadowReceiver ()

Return true if Renderables in the scene cast shadows onto the planes.

public boolean isVisible ()

Return true if plane visualization is visible.

public void setEnabled (boolean enabled)

Enable/disable the plane renderer.

Parameters
enabled

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.

Parameters
shadowReceiver

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.

Parameters
visible

Send feedback about...