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);| Parameter | Description |
|---|---|
| params | PlaneGeometry::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);| Parameter | Description |
|---|---|
| params | PlaneGeometry::Parameters |
Types
PlaneGeometry::Parameters struct
Parameters for constructing a PlaneGeometry object.
| Parameter | Description |
|---|---|
| width float | Width of the plane. |
| height float | Height of the plane. |
| width_segments unsigned | Subdivisions along the width. |
| height_segments unsigned | Subdivisions along the height. |