|
Engine²
Open-source game engine written in C++.
|
Functions | |
| Component::Mesh | GenerateBoxMesh (float width, float height, float depth) |
| Generate a box mesh with specified dimensions. | |
| Component::Mesh | GenerateCapsuleMesh (float radius=0.5f, float height=1.0f, uint32_t segments=32u, uint32_t heightSegments=4u) |
| Generate a capsule mesh with given radius and cylinder height. | |
| Component::Mesh | GenerateClothMesh (uint32_t width, uint32_t height, float spacing) |
| Component::Mesh | GenerateCubeMesh (float size=1.0f) |
| Generate a cube mesh with specified size. | |
| Component::Mesh | GenerateCylinderMesh (float radiusTop=0.5f, float radiusBottom=0.5f, float height=1.0f, uint32_t segments=32u, uint32_t heightSegments=1u) |
| Generate a cylinder mesh with specified dimensions. | |
| Component::Mesh | GenerateJellyCubeMesh (uint32_t gridSize, float spacing) |
| static void | NormalizeVector (glm::vec3 &normal, float epsilon) |
| void | RecalculateNormals (Component::Mesh &mesh) |
| Recalculate normals for a mesh based on face geometry. | |
| bool | ValidateMeshArraySizes (const Component::Mesh &mesh) |
| Validate mesh data integrity. | |
| Component::Mesh | GeneratePlaneMesh (float width=1.0f, float depth=1.0f, uint32_t subdivisionsX=1u, uint32_t subdivisionsZ=1u) |
| Generate a plane mesh with specified width and depth. | |
| Component::Mesh | GenerateRopeMesh (uint32_t segmentCount, float segmentLength) |
| Component::Mesh | GenerateSphereMesh (float radius=0.5f, uint32_t segments=32u, uint32_t rings=16u) |
| Generate a sphere mesh with specified radius and subdivisions. | |
| Component::Mesh | GenerateWheelMesh (float radius=0.3f, float width=0.2f, uint32_t segments=24u) |
| Generate a wheel mesh (cylinder oriented along the X axis). | |
| Component::Mesh Object::Utils::GenerateBoxMesh | ( | float | width, |
| float | height, | ||
| float | depth ) |
Generate a box mesh with specified dimensions.
| width | Width of the box |
| height | Height of the box |
| depth | Depth of the box |
| Component::Mesh Object::Utils::GenerateCapsuleMesh | ( | float | radius = 0.5f, |
| float | height = 1.0f, | ||
| uint32_t | segments = 32u, | ||
| uint32_t | heightSegments = 4u ) |
Generate a capsule mesh with given radius and cylinder height.
| radius | Radius of the capsule |
| height | Height of the cylindrical middle section |
| segments | Radial segments |
| heightSegments | Number of subdivisions along the cylinder height |
| Component::Mesh Object::Utils::GenerateClothMesh | ( | uint32_t | width, |
| uint32_t | height, | ||
| float | spacing ) |
| Component::Mesh Object::Utils::GenerateCubeMesh | ( | float | size = 1.0f | ) |
Generate a cube mesh with specified size.
| size | Side length of the cube (default: 1.0) |
| Component::Mesh Object::Utils::GenerateCylinderMesh | ( | float | radiusTop = 0.5f, |
| float | radiusBottom = 0.5f, | ||
| float | height = 1.0f, | ||
| uint32_t | segments = 32u, | ||
| uint32_t | heightSegments = 1u ) |
Generate a cylinder mesh with specified dimensions.
| radiusTop | Radius at the top (default: 0.5) |
| radiusBottom | Radius at the bottom (default: 0.5) |
| height | Height of the cylinder (default: 1.0) |
| segments | Number of radial segments (default: 32) |
| heightSegments | Number of height segments (default: 1) |
| Component::Mesh Object::Utils::GenerateJellyCubeMesh | ( | uint32_t | gridSize, |
| float | spacing ) |
| Component::Mesh Object::Utils::GeneratePlaneMesh | ( | float | width = 1.0f, |
| float | depth = 1.0f, | ||
| uint32_t | subdivisionsX = 1u, | ||
| uint32_t | subdivisionsZ = 1u ) |
Generate a plane mesh with specified width and depth.
| width | Width of the plane (X axis, default: 1.0) |
| depth | Depth of the plane (Z axis, default: 1.0) |
| subdivisionsX | Number of subdivisions along X (default: 1) |
| subdivisionsZ | Number of subdivisions along Z (default: 1) |
| Component::Mesh Object::Utils::GenerateRopeMesh | ( | uint32_t | segmentCount, |
| float | segmentLength ) |
| Component::Mesh Object::Utils::GenerateSphereMesh | ( | float | radius = 0.5f, |
| uint32_t | segments = 32u, | ||
| uint32_t | rings = 16u ) |
Generate a sphere mesh with specified radius and subdivisions.
Uses UV sphere generation (latitude/longitude grid)
| radius | Radius of the sphere (default: 0.5) |
| segments | Number of horizontal segments (default: 32) |
| rings | Number of vertical rings (default: 16) |
| Component::Mesh Object::Utils::GenerateWheelMesh | ( | float | radius = 0.3f, |
| float | width = 0.2f, | ||
| uint32_t | segments = 24u ) |
Generate a wheel mesh (cylinder oriented along the X axis).
Creates a cylinder mesh rotated 90 degrees so the wheel's axis of rotation is along the X axis (left-right), suitable for vehicle wheels.
| radius | Radius of the wheel (default: 0.3) |
| width | Width of the wheel (default: 0.2) |
| segments | Number of radial segments (default: 24) |
|
static |
| void Object::Utils::RecalculateNormals | ( | Component::Mesh & | mesh | ) |
Recalculate normals for a mesh based on face geometry.
This function computes smooth normals by averaging the face normals of all triangles that share each vertex. This is essential for correct lighting on deformable meshes like soft bodies.
Algorithm:
| mesh | The mesh to recalculate normals for. Must have:
|
|
nodiscard |
Validate mesh data integrity.
Checks that vertices, normals, and texCoords arrays have matching sizes. This is a debug utility to catch malformed meshes early.
| mesh | The mesh to validate. |