Skip to content

Fixed Capsule

Struct · FFixedCapsule

#include "Types/Capsule.h"

deterministic: safe in simulation code

Capsule using fixed-point arithmetic. Represents a capsule defined by a line segment and radius. The capsule is essentially a sphere swept along a line segment.

FFixedVector Start

Editable in defaults and on instances · Blueprint read and write

Start point of the capsule’s central axis.

FFixedVector End

Editable in defaults and on instances · Blueprint read and write

End point of the capsule’s central axis.

FFixedPoint Radius

Editable in defaults and on instances · Blueprint read and write

Radius of the capsule.

C++ members (19)
  • static FFixedCapsule FromCenterAndHalfHeight(const FFixedVector& Center, FFixedPoint HalfHeight, FFixedPoint InRadius, const FFixedVector& UpDirection = FFixedVector::UpVector); Creates a capsule from center, half-height, and radius (typical Unreal convention).
  • FFixedVector GetCenter() const; Returns the center of the capsule.
  • FFixedPoint GetHalfHeight() const; Returns the half-height of the capsule (distance from center to either end).
  • FFixedPoint GetHeight() const; Returns the full height of the capsule (distance between start and end).
  • FFixedVector GetDirection() const; Returns the direction vector from Start to End (normalized).
  • FFixedPoint GetVolume() const; Returns the volume of the capsule (cylinder + 2 hemispheres).
  • FFixedVector GetClosestPointOnAxis(const FFixedVector& Point) const; Returns the closest point on the capsule’s central axis to the given point.
  • FFixedVector GetClosestPoint(const FFixedVector& Point) const; Returns the closest point on the capsule surface to the given point.
  • bool Contains(const FFixedVector& Point) const; Returns true if the capsule contains the given point.
  • FFixedPoint GetDistanceToPoint(const FFixedVector& Point) const; Returns the distance from the capsule surface to a point (negative if inside).
  • FFixedCapsule& Expand(FFixedPoint Amount); Expands the capsule radius by a given amount.
  • FFixedCapsule GetExpanded(FFixedPoint Amount) const; Returns an expanded copy of the capsule.
  • FFixedCapsule& Translate(const FFixedVector& Offset); Translates the capsule by a vector.
  • FFixedCapsule GetTranslated(const FFixedVector& Offset) const; Returns a translated copy of the capsule.
  • bool operator==(const FFixedCapsule& Other) const;
  • bool operator!=(const FFixedCapsule& Other) const;
  • FFixedCapsule operator+(const FFixedVector& Offset) const;
  • FFixedCapsule& operator+=(const FFixedVector& Offset);
  • FString ToString() const;