Plane

fun FilamentSceneScope.Plane(material: MaterialInstance, position: Position = Position(0f), rotation: Quaternion = Quaternion(), scale: Scale = Scale(1f), pivot: Position = Position(0f), width: Float = 1.0f, depth: Float = 1.0f, doubleSided: Boolean = true, onCreate: (Entity) -> Unit = {})

A flat quad lying in the XZ plane centered on the origin. The mesh is two-sided by default: we emit a full set of vertices/triangles for both the +Y face and the -Y face with correctly oriented normals, so lighting works from above and below without disabling face culling or requiring a doubleSided material.

Parameters

material

Material applied to both faces.

position

World-space position of the pivot point.

rotation

World-space rotation. Use this to make a wall or a ceiling.

scale

Per-axis scale.

pivot

Point in mesh space that rotation/scale revolve around. Defaults to the plane centre.

width

Size along the X axis in mesh space.

depth

Size along the Z axis in mesh space.

doubleSided

When true (default) the mesh has both faces. Set false to omit the back side when you know nothing will ever look at it from below.

onCreate

Receives the renderable entity ID once the plane is added to the scene.