Navigation
API > API/Runtime > API/Runtime/Chaos
Note: While Convex technically supports a margin, the margin is typically a property of the instance wrapper (ImplicitScaled, ImplicitTransformed, or ImplicitInstanced). Usually the margin on the convex itself is zero.
| Name | FConvex |
| Type | class |
| Header File | /Engine/Source/Runtime/Experimental/Chaos/Public/Chaos/Convex.h |
| Include Path | #include "Chaos/Convex.h" |
Syntax
class FConvex : public Chaos::FImplicitObject
Inheritance Hierarchy
- FChaosRefCountedObject → FImplicitObject → FConvex
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| IMPORTANT to keep this copy constructor private to avoid unintented expensive copies. | Chaos/Convex.h | ||
| NOTE: This constructor will result in approximate COM and volume calculations, since it does not have face indices for surface particles. | Chaos/Convex.h | ||
| Chaos/Convex.h | |||
FConvex
(
const TArray< FVec3Type >& InVertices, |
Chaos/Convex.h | ||
| Chaos/Convex.h | |||
| Chaos/Convex.h | |||
FConvex () |
Chaos/Convex.h |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| FAABB3Type | TAABB< FRealType, 3 > | Chaos/Convex.h | |
| FPlaneType | TPlaneConcrete< FRealType, 3 > | Chaos/Convex.h | |
| FRealType | TType | Chaos/Convex.h | |
| FVec3Type | TVec3< FRealType > | Chaos/Convex.h | |
| TType | FRealSingle | Chaos/Convex.h |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| D | unsigned | Chaos/Convex.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| CenterOfMass | FVec3Type | Chaos/Convex.h | ||
| LocalBoundingBox | FAABB3Type | Chaos/Convex.h | ||
| Planes | TArray< FPlaneType > | Chaos/Convex.h | ||
| RotationOfMass | FRotation3 | Chaos/Convex.h | ||
| StructureData | FConvexStructureData | Chaos/Convex.h | ||
| UnitMassInertiaTensor | FVec3 | Chaos/Convex.h | ||
| Vertices | TArray< FVec3Type > | Chaos/Convex.h | ||
| Volume | FRealType | Chaos/Convex.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
TUniquePtr< FConvex > CopyAsConvex() |
Chaos/Convex.h | ||
int32 FindVertexPlanes
(
int32 VertexIndex, |
Get an array of all the plane indices that belong to a vertex (up to MaxVertexPlanes). | Chaos/Convex.h | |
FVec3 GetCenter() |
Chaos/Convex.h | ||
const FVec3 GetCenterOfMass() |
Chaos/Convex.h | ||
FVec3 GetClosestEdge
(
int32 PlaneIndexHint, |
Get the nearest point on an edge and the edge vertices Used for manifold generation | Chaos/Convex.h | |
FVec3 GetClosestEdgePosition
(
int32 PlaneIndex, |
Get the nearest point on an edge of the specified face. | Chaos/Convex.h | |
bool GetClosestEdgeVertices
(
int32 PlaneIndex, |
Chaos/Convex.h | ||
int32 GetEdgePlane
(
int32 EdgeIndex, |
Get the plane index of one of the two planes using an edge. | Chaos/Convex.h | |
int32 GetEdgeVertex
(
int32 EdgeIndex, |
Get the vertex index of one of the two vertices in an edge. | Chaos/Convex.h | |
const TArray< FPlaneType > & GetFaces() |
Chaos/Convex.h | ||
void GetHalfEdges
(
int32 EdgeIndex, |
Get the half edges associated with an edge. | Chaos/Convex.h | |
const FMatrix33 GetInertiaTensor
(
const FReal Mass |
Chaos/Convex.h | ||
FConvex::FAABB3Type GetLocalBoundingBox() |
Chaos/Convex.h | ||
FVec3 GetMarginAdjustedVertex
(
const int32 VertexIndex, |
Chaos/Convex.h | ||
FVec3 GetMarginAdjustedVertexScaled
(
int32 VertexIndex, |
Chaos/Convex.h | ||
int32 GetMostOpposingPlane
(
const FVec3& Normal |
Get the index of the plane that most opposes the normal. | Chaos/Convex.h | |
int32 GetMostOpposingPlaneScaled
(
const FVec3& Normal, |
Get the index of the plane that most opposes the normal. | Chaos/Convex.h | |
const TPlaneConcrete< FReal, 3 > GetPlane
(
int32 FaceIndex |
Get the plane at the specified index (e.g., indices from FindVertexPlanes) | Chaos/Convex.h | |
int32 GetPlaneHalfEdge
(
int32 PlaneIndex, |
Get the half edge index for a given plane. | Chaos/Convex.h | |
void GetPlaneNX
(
const int32 FaceIndex, |
Chaos/Convex.h | ||
const FPlaneType & GetPlaneRaw
(
int32 FaceIndex |
Chaos/Convex.h | ||
int32 GetPlaneVertex
(
int32 PlaneIndex, |
Get the vertex index of one of the vertices making up the corners of the specified face. | Chaos/Convex.h | |
FRotation3 GetRotationOfMass() |
Chaos/Convex.h | ||
const FConvexStructureData & GetStructureData() |
The convex structure data (mainly exposed for testing) | Chaos/Convex.h | |
const FVec3Type & GetVertex
(
int32 VertexIndex |
Get the vertex at the specified index (e.g., indices from GetPlaneVertexs) | Chaos/Convex.h | |
int32 GetVertexPlanes3
(
int32 VertexIndex, |
Chaos/Convex.h | ||
const TArray< FVec3Type > & GetVertices() |
Chaos/Convex.h | ||
const FReal GetVolume() |
Chaos/Convex.h | ||
FReal GetWindingOrder() |
Returns a winding order multiplier used in the manifold clipping and required when we have negative scales (See ImplicitObjectScaled) | Chaos/Convex.h | |
bool HasStructureData() |
Whether the structure data has been created for this convex (will eventually always be true) | Chaos/Convex.h | |
bool IntersectPlanes3
(
const FVec3& X1, |
Chaos/Convex.h | ||
void MovePlanesAndRebuild
(
FRealType InDelta |
Chaos/Convex.h | ||
int32 NumEdges() |
Chaos/Convex.h | ||
int32 NumPlanes() |
Chaos/Convex.h | ||
int32 NumPlaneVertices
(
int32 PlaneIndex |
The number of vertices that make up the corners of the specified face. | Chaos/Convex.h | |
int32 NumVertices() |
Chaos/Convex.h | ||
Chaos::FConvex * RawCopyAsConvex() |
Chaos/Convex.h | ||
bool RaycastFast
(
const FVec3& StartPoint, |
Chaos/Convex.h | ||
void SerializeImp
(
FArchive& Ar |
Chaos/Convex.h | ||
void SimplifyGeometry() |
Chaos/Convex.h | ||
FVec3 Support
(
const FVec3& Direction, |
Return support point on the shape | Chaos/Convex.h | |
FVec3 SupportCore
(
const FVec3& Direction, |
Return support point on the core shape (the convex shape with all planes moved inwards by margin). | Chaos/Convex.h | |
FVec3 SupportCoreScaled
(
const FVec3& Direction, |
SupportCore with non-uniform scale support. | Chaos/Convex.h | |
VectorRegister4Float SupportCoreSimd
(
const VectorRegister4Float& Direction, |
Return support point on the core shape (the convex shape with all planes moved inwards by margin). | Chaos/Convex.h | |
FVec3 SupportScaled
(
const FVec3& Direction, |
Chaos/Convex.h | ||
FString ToStringFull() |
Print all the datas. | Chaos/Convex.h | |
FString ToStringSummary() |
A one-line summary of the convex. | Chaos/Convex.h |
Overridden from FImplicitObject
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual const FAABB3 BoundingBox() |
Chaos/Convex.h | ||
virtual Chaos::FImplicitObjectPtr CopyGeometry() |
Chaos/Convex.h | ||
virtual Chaos::FImplicitObjectPtr CopyGeometryWithScale
(
const FVec3& Scale |
Chaos/Convex.h | ||
virtual Chaos::FImplicitObjectPtr DeepCopyGeometry() |
Chaos/Convex.h | ||
virtual Chaos::FImplicitObjectPtr DeepCopyGeometryWithScale
(
const FVec3& Scale |
Chaos/Convex.h | ||
virtual int32 FindClosestFaceAndVertices
(
const FVec3& Position, |
Finds the first intersecting face at given position | Chaos/Convex.h | |
virtual Pair< FVec3, bool > FindClosestIntersectionImp
(
const FVec3& StartPoint, |
Chaos/Convex.h | ||
virtual FVec3 FindGeometryOpposingNormal
(
const FVec3& DenormDir, |
Given a normal and a face index, compute the most opposing normal associated with the underlying geometry features. | Chaos/Convex.h | |
virtual int32 FindMostOpposingFace
(
const FVec3& Position, |
Returns the most opposing face. | Chaos/Convex.h | |
virtual int32 FindMostOpposingFaceScaled
(
const FVec3& Position, |
Chaos/Convex.h | ||
virtual FReal GetMargin() |
Chaos/Convex.h | ||
virtual FReal GetRadius() |
Chaos/Convex.h | ||
virtual uint32 GetTypeHash() |
Chaos/Convex.h | ||
virtual FName GetTypeName () |
Chaos/Convex.h | ||
virtual bool IsPerformanceWarning() |
Chaos/Convex.h | ||
virtual bool IsValidGeometry() |
Chaos/Convex.h | ||
virtual FString PerformanceWarningAndSimplifaction() |
Chaos/Convex.h | ||
virtual FReal PhiWithNormal
(
const FVec3& X, |
Return the distance to the surface. | Chaos/Convex.h | |
virtual FReal PhiWithNormalScaled
(
const FVec3& Pos, |
Find the closest point on the surface, and return the separating distance and axis. | Chaos/Convex.h | |
virtual bool Raycast
(
const FVec3& StartPoint, |
Calls [GJKRaycast()](API\Runtime\Chaos\Chaos__GJKRaycast)_, which may return true_ but 0 for OutTime_, which means the bodies are touching, but not by enough to determine OutPosition_ and `OutNormal_ should be. |
Chaos/Convex.h | |
virtual void Serialize
(
FChaosArchive& Ar |
Chaos/Convex.h | ||
| Chaos/Convex.h | |||
virtual FString ToString() |
Chaos/Convex.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static const FName GetTypeName
(
const EImplicitObjectType InType |
Chaos/Convex.h | ||
static EImplicitObjectType StaticType() |
Chaos/Convex.h |