FConeData
Overview
FConeData is a struct that encapsulates the properties of a cone. It provides methods to calculate various geometric properties such as the base center point, hypotenuse length, volume, and radius at a given height. The class uses lazy evaluation for these properties to ensure they are only computed when necessary.
Properties
Type | Name | Access | Description |
|---|---|---|---|
FVector | Apex | Public | The apex point of the cone. |
FQuat | Orientation | Public | The orientation of the cone. |
float | Angle | Public | The full angle of the cone in degrees. |
float | Height | Public | The height of the cone. |
FVector | BaseCenterPoint | Private | Lazy-evaluated base center point of the cone. |
float | HypotenuseLength | Private | Lazy-evaluated length of the cone's hypotenuse. |
float | Volume | Private | Lazy-evaluated volume of the cone. |
float | BaseRadius | Private | Lazy-evaluated radius of the cone at its base. |
Functions
Return Type | Signature | Description |
|---|---|---|
FConeData | FromAngle(const FVector& InApex, const FQuat& InOrientation, const float InAngle, const float InHeight) | Creates a new |
bool | IsPossible() const | Checks if the cone data is valid (non-zero apex or non-zero angle/height). |
FVector | GetApex() const | Returns the apex point of the cone. |
FQuat | GetOrientation() const | Returns the orientation of the cone. |
float | GetAngle() const | Returns the full angle of the cone in degrees. |
float | GetHeight() const | Returns the height of the cone. |
FVector | GetBaseCenterPoint() const | Returns the base center point of the cone, lazily evaluated. |
FVector | GetSafeBaseCenterPoint() const | Returns a safe base center point of the cone. |
float | GetHypotenuseLength() const | Returns the length of the cone's hypotenuse, lazily evaluated. |
float | GetVolume() const | Returns the volume of the cone, lazily evaluated. |
float | GetBaseRadius() const | Returns the radius of the cone at its base, lazily evaluated. |
float | GetRadiusAtHeight(const float TestHeight) const | Returns the radius of the cone at a given height. |
Usage & Implementation Notes
The
FConeDatastruct uses lazy evaluation for properties likeBaseCenterPoint,HypotenuseLength,Volume, andBaseRadiusto optimize performance by avoiding unnecessary calculations.The
GetBaseCenterPointfunction includes a safety check to ensure the base center point is only computed once.