Plane

fun FilamentSceneScope.Plane(material: MaterialInstance?, position: Position = Position(0f), rotation: Rotation = Rotation.Identity, scale: Scale = Scale(1f), pivot: Position = Position(0f), width: Float = 1.0f, depth: Float = 1.0f, doubleSided: Boolean = true, visible: Boolean = true, castShadows: Boolean = true, receiveShadows: Boolean = true, onCreate: EntityScope.() -> 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, or null while it is still loading.

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.

visible

Whether this renderable is in the scene. False removes it from the scene (cheaply, keeping the entity alive) — a show/hide toggle without losing state.

castShadows

Whether the plane casts shadows onto other renderables. On by default; set false for a pure ground/receiver plane to avoid it shadowing itself.

receiveShadows

Whether the plane receives shadows cast by others. On by default.

onCreate

Runs once when the plane enters the scene, with the renderable entity and engine in scope (EntityScope).