Navigation
API > API/Runtime > API/Runtime/GeometryCore
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).
| Name | FCapsuleGenerator |
| Type | class |
| Header File | /Engine/Source/Runtime/GeometryCore/Public/Generators/CapsuleGenerator.h |
| Include Path | #include "Generators/CapsuleGenerator.h" |
Syntax
class FCapsuleGenerator : public UE::Geometry::FMeshShapeGenerator
Inheritance Hierarchy
- FMeshShapeGenerator → FCapsuleGenerator
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| CornerIndices | FVector3i | Generators/CapsuleGenerator.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bPolygroupPerQuad | bool | If true, each quad gets a separate polygroup, otherwise the entire mesh is a single polygroup | Generators/CapsuleGenerator.h | |
| NumCircleSteps | int | Number of vertices along each circle | Generators/CapsuleGenerator.h | |
| NumHemisphereArcSteps | int | Number of vertices along the 90-degree arc from the pole to edge of spherical cap. | Generators/CapsuleGenerator.h | |
| NumSegmentSteps | int | Number of subdivisions lengthwise along the cylindrical section | Generators/CapsuleGenerator.h | |
| Radius | double | Radius of capsule | Generators/CapsuleGenerator.h | |
| SegmentLength | double | Length of capsule line segment, so total height is SegmentLength + 2*Radius | Generators/CapsuleGenerator.h |
Functions
Public
Overridden from FMeshShapeGenerator
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual FMeshShapeGenerator & Generate() |
Generate the mesh | Generators/CapsuleGenerator.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static FVector3d SphericalToCartesian
(
double r, |
Generators/CapsuleGenerator.h |