Skip to content

PlaneGeometry

Generated geometry representing a flat 2D plane.

PlaneGeometry creates a rectangular, axis-aligned plane centered at the origin in local space. Its width and height define the plane’s extents along the X and Y axes, and optional subdivision counts allow the plane to be tessellated for deformation, smooth shading, or procedural effects.

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

auto material = vglx::PhongMaterial::Create(0x049EF4);

my_scene->Add(vglx::Mesh::Create(geometry, material));

INFO

Derives from Geometry and inherits all public properties and methods.

Construction

Constructors


PlaneGeometry()

Constructs a plane geometry.

cpp
PlaneGeometry::PlaneGeometry(const Parameters& params);
ParameterDescription
paramsInitialization parameters used to generate the plane.

Factories preferred


PlaneGeometry::Create() std::shared_ptr<PlaneGeometry>

Creates a shared instance of PlaneGeometry with default parameters.

cpp
static std::shared_ptr<PlaneGeometry> PlaneGeometry::Create();

PlaneGeometry::Create() std::shared_ptr<PlaneGeometry>

Creates a shared instance of PlaneGeometry with custom parameters.

cpp
static std::shared_ptr<PlaneGeometry> PlaneGeometry::Create(const Parameters& params);
ParameterDescription
paramsInitialization parameters used to generate the plane.

Types

PlaneGeometry::Parameters struct

Parameters for constructing a PlaneGeometry object.

ParameterDescription
width floatSize along the X-axis.
height floatSize along the Y-axis.
width_segments unsignedSubdivisions along the plane's width.
height_segments unsignedSubdivisions along the plane's height.

Released under the MIT License.