UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
Chaos::FTaperedCapsuleSpecializeSamplingHelper Struct Reference

#include <TaperedCapsule.h>

Static Public Member Functions

static FORCEINLINE void ComputeSamplePoints (TArray< FVec3 > &Points, const FTaperedCapsule &Capsule, const int32 NumPoints)
 
static FORCEINLINE void ComputeGoldenSpiralPoints (TArray< FVec3 > &Points, const FTaperedCapsule &Capsule, const int32 NumPoints)
 
static void ComputeGoldenSpiralPoints (TArray< FVec3 > &Points, const FVec3 &Origin, const FVec3 &Axis, const FReal Radius1, const FReal Radius2, const FReal Height, const int32 NumPoints, const int32 SpiralSeed=0)
 
static void ComputeGoldenSpiralPointsUnoriented (TArray< FVec3 > &Points, const FReal Radius1, const FReal Radius2, const FReal Height, const int32 NumPoints, int32 SpiralSeed=0)
 

Member Function Documentation

◆ ComputeGoldenSpiralPoints() [1/2]

static FORCEINLINE void Chaos::FTaperedCapsuleSpecializeSamplingHelper::ComputeGoldenSpiralPoints ( TArray< FVec3 > &  Points,
const FTaperedCapsule Capsule,
const int32  NumPoints 
)
inlinestatic

◆ ComputeGoldenSpiralPoints() [2/2]

static void Chaos::FTaperedCapsuleSpecializeSamplingHelper::ComputeGoldenSpiralPoints ( TArray< FVec3 > &  Points,
const FVec3 Origin,
const FVec3 Axis,
const FReal  Radius1,
const FReal  Radius2,
const FReal  Height,
const int32  NumPoints,
const int32  SpiralSeed = 0 
)
inlinestatic

Use the golden spiral method to generate evenly spaced points on a tapered capsule (truncated cone with two hemispherical ends).

The "golden" part is derived from the golden ratio; stand at the center, turn a golden ratio of whole turns, then emit a point in that direction.

Points are generated starting from the bottom of the tapered capsule part, ending at the top. Contiguous entries in Points generally will not be spatially adjacent.

Points to append to. Origin is the bottom-most point of the tapered capsule. Axis is the orientation of the tapered capsule. Radius1 is the first radius of the tapered capsule. Radius2 is the second radius of the tapered capsule. Height is the height of the tapered capsule. NumPoints is the number of points to generate. SpiralSeed is the starting index for golden spiral generation. When using this method to continue a spiral started elsewhere, SpiralSeed should equal the number of particles already created.

◆ ComputeGoldenSpiralPointsUnoriented()

static void Chaos::FTaperedCapsuleSpecializeSamplingHelper::ComputeGoldenSpiralPointsUnoriented ( TArray< FVec3 > &  Points,
const FReal  Radius1,
const FReal  Radius2,
const FReal  Height,
const int32  NumPoints,
int32  SpiralSeed = 0 
)
inlinestatic

Generates points on a tapered capsule (truncated cone), oriented about the Z axis, varying from [-Height/2, Height/2].

TODO: Note that this method does not produce evenly spaced points! It'll bunch points together on the side of the capsule with the smaller radius, and spread them apart on the larger. We need a routine that operates in conical space, rather than cylindrical. That said, points are distributed evenly between the two end caps, proportional to their respective areas.

The "golden" part is derived from the golden ratio; stand at the center, turn a golden ratio of whole turns, then emit a point in that direction.

Points are generated starting from the bottom of the capsule, ending at the top. Contiguous entries in Points generally will not be spatially adjacent.

Points to append to. Radius1 is the first radius of the tapered capsule. Radius2 is the second radius of the tapered capsule. Height is the height of the capsule. NumPoints is the number of points to generate. SpiralSeed is the starting index for golden spiral generation. When using this method to continue a spiral started elsewhere, SpiralSeed should equal the number of particles already created.

◆ ComputeSamplePoints()

static FORCEINLINE void Chaos::FTaperedCapsuleSpecializeSamplingHelper::ComputeSamplePoints ( TArray< FVec3 > &  Points,
const FTaperedCapsule Capsule,
const int32  NumPoints 
)
inlinestatic

The documentation for this struct was generated from the following file: