Class ShapeFactory
- java.lang.Object
-
- com.google.ar.sceneform.rendering.ShapeFactory
-
@RequiresApi(api=24) public final class ShapeFactory extends java.lang.ObjectUtility class used to dynamically constructModelRenderables for various shapes.
-
-
Constructor Summary
Constructors Constructor Description ShapeFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ModelRenderablemakeCube(Vector3 size, Vector3 center, Material material)Creates aModelRenderablein the shape of a cube with the give specifications.static ModelRenderablemakeCylinder(float radius, float height, Vector3 center, Material material)Creates aModelRenderablein the shape of a cylinder with the give specifications.static ModelRenderablemakeSphere(float radius, Vector3 center, Material material)Creates aModelRenderablein the shape of a sphere with the give specifications.
-
-
-
Method Detail
-
makeCube
public static ModelRenderable makeCube(Vector3 size, Vector3 center, Material material)
Creates aModelRenderablein the shape of a cube with the give specifications.- Parameters:
size- the size of the constructed cubecenter- the center of the constructed cubematerial- the material to use for rendering the cube- Returns:
- renderable representing a cube with the given parameters
-
makeSphere
public static ModelRenderable makeSphere(float radius, Vector3 center, Material material)
Creates aModelRenderablein the shape of a sphere with the give specifications.- Parameters:
radius- the radius of the constructed spherecenter- the center of the constructed spherematerial- the material to use for rendering the sphere- Returns:
- renderable representing a sphere with the given parameters
-
makeCylinder
public static ModelRenderable makeCylinder(float radius, float height, Vector3 center, Material material)
Creates aModelRenderablein the shape of a cylinder with the give specifications.- Parameters:
radius- the radius of the constructed cylinderheight- the height of the constructed cylindercenter- the center of the constructed cylindermaterial- the material to use for rendering the cylinder- Returns:
- renderable representing a cylinder with the given parameters
-
-