![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <CapsuleGenerator.h>
Inheritance diagram for UE::Geometry::FCapsuleGenerator:Public Attributes | |
| double | Radius = 1.0 |
| double | SegmentLength = 1.0 |
| int | NumHemisphereArcSteps = 5 |
| int | NumCircleSteps = 3 |
| int | NumSegmentSteps = 0 |
| bool | bPolygroupPerQuad = false |
Public Attributes inherited from UE::Geometry::FMeshShapeGenerator | |
| TArray< FVector3d > | Vertices |
| TArray< FVector2f > | UVs |
| TArray< int > | UVParentVertex |
| TArray< FVector3f > | Normals |
| TArray< int > | NormalParentVertex |
| TArray< FIndex3i > | Triangles |
| TArray< FIndex3i > | TriangleUVs |
| TArray< FIndex3i > | TriangleNormals |
| TArray< int > | TrianglePolygonIDs |
| bool | bReverseOrientation = false |
Additional Inherited Members | |
Static Public Member Functions inherited from UE::Geometry::FMeshShapeGenerator | |
| static FVector3d | BilinearInterp (const FVector3d &v00, const FVector3d &v10, const FVector3d &v11, const FVector3d &v01, double tx, double ty) |
| static FVector2d | BilinearInterp (const FVector2d &v00, const FVector2d &v10, const FVector2d &v11, const FVector2d &v01, double tx, double ty) |
| static FVector2f | BilinearInterp (const FVector2f &v00, const FVector2f &v10, const FVector2f &v11, const FVector2f &v01, float tx, float ty) |
| static FVector3i | LinearInterp (const FVector3i &a, const FVector3i &b, double t) |
Generate a Capsule mesh, with UVs wrapped cylindrically. This is basically a "stretched" standard sphere triangulation, where we have a set of quad strips "around" the sphere with a disc-shaped cap at each pole. For the Capsule we duplicate the equatorial ring, creating two separate hemispherical caps which are joined with a single quad strip.
The Capsule line segment is oriented along +Z, with the start point at (0,0,0) and the end point at (0,0,SegmentLength). So the lower hemispherical cap is below the origin, ie the bottom pole is at (0,0,-Radius) and the top pole is at (0,0,SegmentLength+Radius).
|
inlineoverridevirtual |
Generate the mesh
Implements UE::Geometry::FMeshShapeGenerator.
If true, each quad gets a separate polygroup, otherwise the entire mesh is a single polygroup
| int UE::Geometry::FCapsuleGenerator::NumCircleSteps = 3 |
Number of vertices along each circle
| int UE::Geometry::FCapsuleGenerator::NumHemisphereArcSteps = 5 |
Number of vertices along the 90-degree arc from the pole to edge of spherical cap.
| int UE::Geometry::FCapsuleGenerator::NumSegmentSteps = 0 |
Number of subdivisions lengthwise along the cylindrical section
| double UE::Geometry::FCapsuleGenerator::Radius = 1.0 |
Radius of capsule
| double UE::Geometry::FCapsuleGenerator::SegmentLength = 1.0 |
Length of capsule line segment, so total height is SegmentLength + 2*Radius