Class Renderable
- java.lang.Object
 - 
- com.google.ar.sceneform.rendering.Renderable
 
 
- 
- Direct Known Subclasses:
 ModelRenderable,ViewRenderable
public abstract class Renderable extends java.lang.ObjectBase class for rendering in 3D space by attaching to aNodewithNode.setRenderable(Renderable). 
- 
- 
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_ANIMATION_FRAME_RATEstatic intRENDER_PRIORITY_DEFAULTstatic intRENDER_PRIORITY_FIRSTstatic intRENDER_PRIORITY_LAST 
- 
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description RenderableInstancecreateInstance(TransformProvider transformProvider)intgetAnimationFrameRate()Gets the number of frames per seconds defined in the asset animation.CollisionShapegetCollisionShape()Get theCollisionShapeused for collision detection with thisRenderable.MatrixgetFinalModelMatrix(Matrix originalMatrix)Gets the final model matrix to use for rendering thisRenderablebased on the matrix passed in.ChangeIdgetId()MaterialgetMaterial()Returns the material bound to the first submesh.MaterialgetMaterial(int submeshIndex)Returns the material bound to the specified submesh.intgetRenderPriority()Get the render priority that controls the order of rendering.intgetSubmeshCount()Returns the number of submeshes that this renderable has.java.lang.StringgetSubmeshName(int submeshIndex)Returns the name associated with the specified submesh.booleanisShadowCaster()Returns true if configured to cast shadows on other renderables.booleanisShadowReceiver()Returns true if configured to receive shadows cast by other renderables.abstract RenderablemakeCopy()Creates a new instance of this Renderable.voidsetCollisionShape(CollisionShape collisionShape)Set theCollisionShapeused for collision detection with thisRenderable.voidsetMaterial(int submeshIndex, Material material)Sets the material bound to the specified submesh.voidsetMaterial(Material material)Sets the material bound to the first submesh.voidsetRenderPriority(int renderPriority)Set the render priority to control the order of rendering.voidsetShadowCaster(boolean isShadowCaster)Sets whether the renderable casts shadow on other renderables in the scene.voidsetShadowReceiver(boolean isShadowReceiver)Sets whether the renderable receives shadows cast by other renderables in the scene.voidupdateFromDefinition(RenderableDefinition definition) 
 - 
 
- 
- 
Field Detail
- 
RENDER_PRIORITY_DEFAULT
public static final int RENDER_PRIORITY_DEFAULT
- See Also:
 - Constant Field Values
 
 
- 
RENDER_PRIORITY_FIRST
public static final int RENDER_PRIORITY_FIRST
- See Also:
 - Constant Field Values
 
 
- 
RENDER_PRIORITY_LAST
public static final int RENDER_PRIORITY_LAST
- See Also:
 - Constant Field Values
 
 
- 
DEFAULT_ANIMATION_FRAME_RATE
public static final int DEFAULT_ANIMATION_FRAME_RATE
- See Also:
 - Constant Field Values
 
 
 - 
 
- 
Method Detail
- 
getCollisionShape
@Nullable public CollisionShape getCollisionShape()
Get theCollisionShapeused for collision detection with thisRenderable. 
- 
setCollisionShape
public void setCollisionShape(@Nullable CollisionShape collisionShape)Set theCollisionShapeused for collision detection with thisRenderable. 
- 
getMaterial
public Material getMaterial()
Returns the material bound to the first submesh. 
- 
getMaterial
public Material getMaterial(int submeshIndex)
Returns the material bound to the specified submesh. 
- 
setMaterial
public void setMaterial(Material material)
Sets the material bound to the first submesh. 
- 
setMaterial
public void setMaterial(int submeshIndex, Material material)Sets the material bound to the specified submesh. 
- 
getSubmeshName
public java.lang.String getSubmeshName(int submeshIndex)
Returns the name associated with the specified submesh.- Throws:
 java.lang.IllegalArgumentException- if the index is out of range
 
- 
getRenderPriority
public int getRenderPriority()
Get the render priority that controls the order of rendering. The priority is between a range of 0 (rendered first) and 7 (rendered last). The default value is 4. 
- 
setRenderPriority
public void setRenderPriority(@IntRange(from=0L,to=7L) int renderPriority)Set the render priority to control the order of rendering. The priority is between a range of 0 (rendered first) and 7 (rendered last). The default value is 4. 
- 
isShadowCaster
public boolean isShadowCaster()
Returns true if configured to cast shadows on other renderables. 
- 
setShadowCaster
public void setShadowCaster(boolean isShadowCaster)
Sets whether the renderable casts shadow on other renderables in the scene. 
- 
isShadowReceiver
public boolean isShadowReceiver()
Returns true if configured to receive shadows cast by other renderables. 
- 
setShadowReceiver
public void setShadowReceiver(boolean isShadowReceiver)
Sets whether the renderable receives shadows cast by other renderables in the scene. 
- 
getAnimationFrameRate
public int getAnimationFrameRate()
Gets the number of frames per seconds defined in the asset animation. 
- 
getSubmeshCount
public int getSubmeshCount()
Returns the number of submeshes that this renderable has. All Renderables have at least one. 
- 
getId
public ChangeId getId()
 
- 
createInstance
public RenderableInstance createInstance(TransformProvider transformProvider)
 
- 
updateFromDefinition
public void updateFromDefinition(RenderableDefinition definition)
 
- 
makeCopy
public abstract Renderable makeCopy()
Creates a new instance of this Renderable.The new renderable will have unique copy of all mutable state. All materials referenced by the Renderable will also be instanced. Immutable data will be shared between the instances.
 
- 
getFinalModelMatrix
public Matrix getFinalModelMatrix(Matrix originalMatrix)
Gets the final model matrix to use for rendering thisRenderablebased on the matrix passed in. Default implementation simply passes through the original matrix. WARNING: Do not modify the originalMatrix! If the final matrix isn't the same as the original matrix, then a new instance must be returned. 
 - 
 
 -