ShapesAPI
Defined in: packages/threeplay/src/plugins/shapes/types.ts:85
API of the shapes plugin.
Methods
Section titled “Methods”box(
width?,height?,depth?,opts?):PrimitiveComp
Defined in: packages/threeplay/src/plugins/shapes/types.ts:86
Parameters
Section titled “Parameters”width?
Section titled “width?”number
height?
Section titled “height?”number
depth?
Section titled “depth?”number
Returns
Section titled “Returns”capsule()
Section titled “capsule()”capsule(
radius?,height?,opts?):PrimitiveComp
Defined in: packages/threeplay/src/plugins/shapes/types.ts:89
height is the total height, including the round caps.
Parameters
Section titled “Parameters”radius?
Section titled “radius?”number
height?
Section titled “height?”number
Returns
Section titled “Returns”color()
Section titled “color()”color(
c?,g?,b?):ColorComp
Defined in: packages/threeplay/src/plugins/shapes/types.ts:97
Component: color of the shape (or HUD element).
Parameters
Section titled “Parameters”number
number
Returns
Section titled “Returns”cone()
Section titled “cone()”cone(
radius?,height?,opts?):PrimitiveComp
Defined in: packages/threeplay/src/plugins/shapes/types.ts:91
Parameters
Section titled “Parameters”radius?
Section titled “radius?”number
height?
Section titled “height?”number
Returns
Section titled “Returns”cylinder()
Section titled “cylinder()”cylinder(
radius?,height?,opts?):PrimitiveComp
Defined in: packages/threeplay/src/plugins/shapes/types.ts:90
Parameters
Section titled “Parameters”radius?
Section titled “radius?”number
height?
Section titled “height?”number
Returns
Section titled “Returns”material()
Section titled “material()”material(
opts):Comp&object
Defined in: packages/threeplay/src/plugins/shapes/types.ts:101
Component: replaces the material of the shape.
Parameters
Section titled “Parameters”Material<MaterialEventMap> | MaterialOpts
Returns
Section titled “Returns”Comp & object
mesh()
Section titled “mesh()”mesh(
geometry,material?,opts?):PrimitiveComp
Defined in: packages/threeplay/src/plugins/shapes/types.ts:95
Any three.js geometry and (optional) material.
Parameters
Section titled “Parameters”geometry
Section titled “geometry”BufferGeometry
material?
Section titled “material?”Material<MaterialEventMap>
Returns
Section titled “Returns”opacity()
Section titled “opacity()”opacity(
value?):OpacityComp
Defined in: packages/threeplay/src/plugins/shapes/types.ts:99
Component: opacity 0–1.
Parameters
Section titled “Parameters”value?
Section titled “value?”number
Returns
Section titled “Returns”plane()
Section titled “plane()”plane(
width?,depth?,opts?):PrimitiveComp
Defined in: packages/threeplay/src/plugins/shapes/types.ts:93
A flat rectangle on the XZ plane (a floor), facing up.
Parameters
Section titled “Parameters”width?
Section titled “width?”number
depth?
Section titled “depth?”number
Returns
Section titled “Returns”sphere()
Section titled “sphere()”sphere(
radius?,opts?):PrimitiveComp
Defined in: packages/threeplay/src/plugins/shapes/types.ts:87
Parameters
Section titled “Parameters”radius?
Section titled “radius?”number