Skip to content

PlaneGeometry

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

PlaneGeometry 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()

Constructs a PlaneGeometry object.

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

Factories preferred


PlaneGeometry::Create() auto

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

cpp
static auto PlaneGeometry::Create();

PlaneGeometry::Create() auto

Creates a shared pointer to a PlaneGeometry object.

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

Types

PlaneGeometry::Parameters struct

Parameters for constructing a PlaneGeometry object.

ParameterDescription
width floatWidth of the plane.
height floatHeight of the plane.
width_segments unsignedSubdivisions along the width.
height_segments unsignedSubdivisions along the height.

Released under the MIT License.