Static utility class for generating primitive mesh shapes.
More...
#include <PrimitiveGenerator.h>
|
static std::shared_ptr< Mesh > | CreateCube (float size=1.0f) |
| Creates a cube mesh.
|
|
static std::shared_ptr< Mesh > | CreatePlane (float width=1.0f, float height=1.0f, int widthSegments=1, int heightSegments=1) |
| Creates a plane mesh.
|
|
static std::shared_ptr< Mesh > | CreateSphere (float radius=0.5f, int widthSegments=32, int heightSegments=16) |
| Creates a sphere mesh.
|
|
static std::shared_ptr< Mesh > | CreateCylinder (float radiusTop=0.5f, float radiusBottom=0.5f, float height=1.0f, int radialSegments=32, int heightSegments=1) |
| Creates a cylinder mesh.
|
|
static std::shared_ptr< Mesh > | CreateTriangle (float size=1.0f) |
| Creates a triangle mesh.
|
|
Static utility class for generating primitive mesh shapes.
PrimitiveGenerator provides methods to create common 3D primitive shapes such as cubes, spheres, planes, cylinders, etc. Each method returns a shared pointer to a Mesh object that can be used with scene objects.
◆ CreateCube()
std::shared_ptr< Mesh > PrimitiveGenerator::CreateCube |
( |
float |
size = 1.0f | ) |
|
|
static |
Creates a cube mesh.
- Parameters
-
size | The size of the cube (default: 1.0). |
- Returns
- Shared pointer to the cube mesh.
◆ CreateCylinder()
std::shared_ptr< Mesh > PrimitiveGenerator::CreateCylinder |
( |
float |
radiusTop = 0.5f , |
|
|
float |
radiusBottom = 0.5f , |
|
|
float |
height = 1.0f , |
|
|
int |
radialSegments = 32 , |
|
|
int |
heightSegments = 1 |
|
) |
| |
|
static |
Creates a cylinder mesh.
- Parameters
-
radiusTop | The radius at the top (default: 0.5). |
radiusBottom | The radius at the bottom (default: 0.5). |
height | The height of the cylinder (default: 1.0). |
radialSegments | Number of radial segments (default: 32). |
heightSegments | Number of height segments (default: 1). |
- Returns
- Shared pointer to the cylinder mesh.
◆ CreatePlane()
std::shared_ptr< Mesh > PrimitiveGenerator::CreatePlane |
( |
float |
width = 1.0f , |
|
|
float |
height = 1.0f , |
|
|
int |
widthSegments = 1 , |
|
|
int |
heightSegments = 1 |
|
) |
| |
|
static |
Creates a plane mesh.
- Parameters
-
width | The width of the plane (default: 1.0). |
height | The height of the plane (default: 1.0). |
widthSegments | Number of width segments (default: 1). |
heightSegments | Number of height segments (default: 1). |
- Returns
- Shared pointer to the plane mesh.
◆ CreateSphere()
std::shared_ptr< Mesh > PrimitiveGenerator::CreateSphere |
( |
float |
radius = 0.5f , |
|
|
int |
widthSegments = 32 , |
|
|
int |
heightSegments = 16 |
|
) |
| |
|
static |
Creates a sphere mesh.
- Parameters
-
radius | The radius of the sphere (default: 0.5). |
widthSegments | Number of horizontal segments (default: 32). |
heightSegments | Number of vertical segments (default: 16). |
- Returns
- Shared pointer to the sphere mesh.
◆ CreateTriangle()
std::shared_ptr< Mesh > PrimitiveGenerator::CreateTriangle |
( |
float |
size = 1.0f | ) |
|
|
static |
Creates a triangle mesh.
- Parameters
-
size | The size of the triangle (default: 1.0). |
- Returns
- Shared pointer to the triangle mesh.
The documentation for this class was generated from the following files: