Skip to content

PlaneGeometry

Generates a flat 2D plane geometry assignable to any mesh.

[PlaneGeometry](/reference/geometries/plane_geometry) creates a rectangular surface in the X-Y plane, suitable for ground planes, walls, billboards, or UI backgrounds. It supports width and height segmentation for effects like displacement or tesselation.

cpp
auto geometry = vglx::PlaneGeometry::Create({
    .width = 5.0f,
    .height = 3.0f,
    .width_segments = 2,
    .height_segments = 2
});

auto mesh = vglx::Mesh::Create(geometry, UnlitMaterial::Create(0x049EF4));
my_scene->Add(mesh);

INFO

Derives from Geometry and inherits all public properties and methods.

Construction

Constructors


PlaneGeometry()

cpp
vglx::PlaneGeometry::PlaneGeometry(const Parameters &params)
ParameterDescription
paramsPlaneGeometry::Parameters

Constructs a PlaneGeometry object.

Factories preferred


PlaneGeometry::Create() auto

cpp
static auto vglx::PlaneGeometry::Create()

Creates a shared pointer to a PlaneGeometry object with default parameters.

PlaneGeometry::Create() auto

cpp
static auto vglx::PlaneGeometry::Create(const Parameters &params)
ParameterDescription
paramsPlaneGeometry::Parameters

Creates a shared pointer to a PlaneGeometry object.

Types

PlaneGeometry::Parameters struct

Parameters for constructing a PlaneGeometry object.

NameTypeDescription
heightfloatHeight of the plane.
height_segmentsunsignedSubdivisions along the height.
widthfloatWidth of the plane.
width_segmentsunsignedSubdivisions along the width.

Released under the MIT License.