Navigation
API > API/Runtime > API/Runtime/Engine
One convex hull, used for simplified collision.
| Name | FKConvexElem |
| Type | struct |
| Header File | /Engine/Source/Runtime/Engine/Classes/PhysicsEngine/ConvexElem.h |
| Include Path | #include "PhysicsEngine/ConvexElem.h" |
Syntax
USTRUCT ()
struct FKConvexElem : public FKShapeElem
Inheritance Hierarchy
- FKShapeElem → FKConvexElem
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FKConvexElem () |
PhysicsEngine/ConvexElem.h | ||
FKConvexElem
(
const FKConvexElem& Other |
PhysicsEngine/ConvexElem.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
~FKConvexElem() |
PhysicsEngine/ConvexElem.h |
Enums
Public
| Name | Remarks |
|---|---|
| EConvexDataUpdateMethod |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| StaticShapeType | EAggCollisionShape::Type | PhysicsEngine/ConvexElem.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| ElemBox | FBox | Bounding box of this convex hull. | PhysicsEngine/ConvexElem.h | |
| IndexData | TArray< int32 > | PhysicsEngine/ConvexElem.h | ||
| VertexData | TArray< FVector > | Array of indices that make up the convex hull. | PhysicsEngine/ConvexElem.h |
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| ChaosConvex | Chaos::FConvexPtr | PhysicsEngine/ConvexElem.h | ||
| Transform | FTransform | Transform of this element | PhysicsEngine/ConvexElem.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void AddCachedSolidConvexGeom
(
TArray< FDynamicMeshVertex >& VertexBuffer, |
PhysicsEngine/ConvexElem.h | ||
void BakeTransformToVerts() |
Apply current element transform to verts, and reset transform to identity | PhysicsEngine/ConvexElem.h | |
FBox CalcAABB
(
const FTransform& BoneTM, |
Calculate a bounding box for this convex element with the specified transform and scale | PhysicsEngine/ConvexElem.h | |
void ComputeChaosConvexIndices
(
bool bForceCompute |
PhysicsEngine/ConvexElem.h | ||
void ConvexFromBoxElem
(
const FKBoxElem& InBox |
Utility for setting this convex element to match a supplied box element. Also copies transform. | PhysicsEngine/ConvexElem.h | |
void DrawElemSolid
(
FPrimitiveDrawInterface* PDI, |
PhysicsEngine/ConvexElem.h | ||
TArray< int32 > GetChaosConvexIndices() |
PhysicsEngine/ConvexElem.h | ||
const auto & GetChaosConvexMesh() |
PhysicsEngine/ConvexElem.h | ||
float GetClosestPointAndNormal
(
const FVector& WorldPosition, |
Finds the closest point on the shape given a world position. | PhysicsEngine/ConvexElem.h | |
void GetPlanes
(
TArray< FPlane >& Planes |
Get set of planes that define this convex hull | PhysicsEngine/ConvexElem.h | |
FVector::FReal GetScaledVolume
(
const FVector& Scale3D |
Returns the volume of this element | PhysicsEngine/ConvexElem.h | |
float GetShortestDistanceToPoint
(
const FVector& WorldPosition, |
Finds the shortest distance between the element and a world position. | PhysicsEngine/ConvexElem.h | |
FVector::FReal GetVolume
(
const FVector& Scale |
Returns the volume of this element | PhysicsEngine/ConvexElem.h | |
| Utility for creating a convex hull from a set of planes. Will reset current state of this elem. | PhysicsEngine/ConvexElem.h | ||
void Reset() |
Reset the hull to empty all arrays | PhysicsEngine/ConvexElem.h | |
void ResetChaosConvexMesh() |
PhysicsEngine/ConvexElem.h | ||
void ScaleElem
(
FVector DeltaSize, |
PhysicsEngine/ConvexElem.h | ||
void SetChaosConvexMesh
(
TSharedPtr< Chaos::FConvex, ESPMode::ThreadSafe >&& InChaosConvex, |
Set the chaos convex mesh Note : This will by default invalidate the convex data and recompute them by calling ComputeChaosConvexIndices Only set ConvexDataUpdateMethod to UpdateConvexDataOnlyIfMissing if you know the data is up to date with the chaos convex object or if you plan to call ComputeChaosConvexIndices later | PhysicsEngine/ConvexElem.h | |
void SetConvexMeshObject
(
Chaos::FConvexPtr&& InChaosConvex, |
PhysicsEngine/ConvexElem.h | ||
void SetTransform
(
const FTransform& InTransform |
Modify the transform to apply to convex mesh vertices NOTE: When doing this, BodySetup convex meshes need to be recooked - usually by calling InvalidatePhysicsData() and CreatePhysicsMeshes() | PhysicsEngine/ConvexElem.h | |
void UpdateElemBox() |
Updates internal ElemBox based on current value of VertexData | PhysicsEngine/ConvexElem.h |
Overridden from FKShapeElem
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void DrawElemWire
(
FPrimitiveDrawInterface* PDI, |
PhysicsEngine/ConvexElem.h | ||
virtual FTransform GetTransform() |
Get current transform applied to convex mesh vertices | PhysicsEngine/ConvexElem.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
const FKConvexElem & operator=
(
const FKConvexElem& Other |
PhysicsEngine/ConvexElem.h |