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 ¶ms)
Parameter | Description |
---|---|
params | PlaneGeometry::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 ¶ms)
Parameter | Description |
---|---|
params | PlaneGeometry::Parameters |
Creates a shared pointer to a PlaneGeometry object.
Types
PlaneGeometry::Parameters struct
Parameters for constructing a PlaneGeometry object.
Name | Type | Description |
---|---|---|
height | float | Height of the plane. |
height_segments | unsigned | Subdivisions along the height. |
width | float | Width of the plane. |
width_segments | unsigned | Subdivisions along the width. |