FImplicitObject

Base class for implicit collision geometry such as spheres, capsules, boxes, etc.

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

Chaos

Header

/Engine/Source/Runtime/Experimental/Chaos/Public/Chaos/ImplicitObject.h

Include

#include "Chaos/ImplicitObject.h"

Syntax

class FImplicitObject

Remarks

Base class for implicit collision geometry such as spheres, capsules, boxes, etc.

Some shapes are represented by a core shape with a margin. E.g. Spheres are a point with a margin equal to the radius; boxes are a core AABB with a margin. The margin is considered to be physically part of the shape for the pupose of collision detection, separating distance, etc.

The margin exists to make GJK and EPA collision more robust, and is not required by all derived types. E.g., We never use GJK to perform triangle-triangle collision so we do not need a margin on triangles. We would need a margin on every type that can be tested against a triangle though.

Variables

Name Description

Protected variable

bool

 

bDoCollide

Protected variable

bool

 

bHasBoundingBox

Protected variable

bool

 

bIsConvex

Protected variable

bool

 

bIsTracked

Protected variable

EImplicitObject...

 

CollisionType

Protected variable

FReal

 

Margin

Protected variable

EImplicitObject...

 

Type

Constructors

Name Description

Public function

FImplicitObject

(
    const FImplicitObject&
)

Public function

FImplicitObject

(
    FImplicitObject&&
)

Public function

FImplicitObject

(
    int32 Flags,
    EImplicitObjectType InType
)

Destructors

Name Description

Public function Virtual

~FImplicitObject()

Functions

Name Description

Public function Virtual Const

void

 

AccumulateAllImplicitObjects

(
    TArray< Pair< const FImplicitObject...,
    const FRigidTransform3& ParentTM
)

Public function Virtual Const

void

 

AccumulateAllSerializableImplicitObjects

(
    TArray< Pair< TSerializablePtr< FIm...,
    const FRigidTransform3& ParentTM,
    TSerializablePtr< FImplicitObject >...
)

Public function Virtual Const

const FAABB3

 

BoundingBox()

Public function Virtual Const

TUniquePtr< ...

 

Copy()

Public function Virtual Const

TUniquePtr< ...

 

DeepCopy()

Public function Virtual Const

void

 

FindAllIntersectingObjects

(
    TArray< Pair< const FImplicitObject...,
    const FAABB3& LocalBounds
)

Public function Virtual Const

int32

 

FindClosestFaceAndVertices

(
    const FVec3& Position,
    TArray< FVec3 >& FaceVertices,
    FReal SearchDist
)

Finds the first intersecting face at given position

Public function Const

Pair< FVec3,...

 

FindClosestIntersection

(
    const FVec3& StartPoint,
    const FVec3& EndPoint,
    const FReal Thickness
)

Public function Const

Pair< FVec3,...

 

FindDeepestIntersection

(
    const FImplicitObject* Other,
    const FBVHParticles* Particles,
    const FMatrix33& OtherToLocalTrans...,
    const FReal Thickness
)

Public function Const

Pair< FVec3,...

 

FindDeepestIntersection

(
    const FImplicitObject* Other,
    const FParticles* Particles,
    const FMatrix33& OtherToLocalTrans...,
    const FReal Thickness
)

Public function Virtual Const

FVec3

 

FindGeometryOpposingNormal

(
    const FVec3& DenormDir,
    int32 FaceIndex,
    const FVec3& OriginalNormal
)

Given a normal and a face index, compute the most opposing normal associated with the underlying geometry features.

Public function Virtual Const

int32

 

FindMostOpposingFace

(
    const FVec3& Position,
    const FVec3& UnitDir,
    int32 HintFaceIndex,
    FReal SearchDist
)

Returns the most opposing face.

Public function Virtual Const

int32

 

FindMostOpposingFaceScaled

(
    const FVec3& Position,
    const FVec3& UnitDir,
    int32 HintFaceIndex,
    FReal SearchDist,
    const FVec3& Scale
)

Public function Const

EImplicitObj...

 

GetCollisionType()

Public function Const

bool

 

GetDoCollide()

Protected function Const

FVec3

 

GetInnerUnscaledNormal

(
    const FVec3& OuterNormal,
    const FVec3& Scale
)

Convert a normal in the outer scaled object space into a normal in the inner unscaled object space.

Public function Const

FReal

 

GetMargin()

Public function Virtual Const

uint16

 

GetMaterialIndex

(
    uint32 HintIndex
)

Public function Const

const T_DERI...

 

GetObject()

Public function

T_DERIVED &#...

 

GetObject()

Public function

T_DERIVED &

 

GetObjectChecked()

Public function Const

const T_DERI...

 

GetObjectChecked()

Public function Static

int32

 

GetOffsetOfMargin()

Public function Static

int32

 

GetOffsetOfType()

Protected function Const

FVec3

 

GetOuterScaledNormal

(
    const FVec3& InnerNormal,
    const FVec3& Scale
)

Convert a normal in the inner unscaled object space into a normal in the outer scaled object space.

Public function Const

EImplicitObj...

 

GetType()

Public function Const

uint32

 

GetTypeHash()

Public function Virtual Const

FName

 

GetTypeName()

Public function Static

const FName

 

GetTypeName

(
    const EImplicitObjectType InType
)

Public function Const

bool

 

HasBoundingBox()

Public function Const

bool

 

IsConvex()

Public function Virtual Const

bool

 

IsPerformanceWarning()

Public function Const

bool

 

IsUnderlyingUnion()

This is strictly used for optimization purposes.

Public function Virtual Const

bool

 

IsValidGeometry()

Public function Const

FVec3

 

Normal

(
    const FVec3& x
)

Explicitly non-virtual. Must cast to derived types to target their implementation.

Public function Virtual Const

bool

 

Overlap

(
    const FVec3& Point,
    const FReal Thickness
)

This gives derived types a way to do an overlap check without calling PhiWithNormal todo: this api is confusing.

Public function Virtual

FString

 

PerformanceWarningAndSimplifaction()

Public function Const

FReal

 

PhiWithNormal

(
    const FVec3& x,
    FVec3& Normal
)

Find the closest point on the surface, and return the separating distance and axis.

Public function Virtual Const

FReal

 

PhiWithNormalScaled

(
    const FVec3& Pos,
    const FVec3& Scale,
    FVec3& Normal
)

Find the closest point on the surface, and return the separating distance and axis.

Public function Virtual Const

bool

 

Raycast

(
    const FVec3& StartPoint,
    const FVec3& Dir,
    const FReal Length,
    const FReal Thickness,
    FReal& OutTime,
    FVec3& OutPosition,
    FVec3& OutNormal,
    int32& OutFaceIndex
)

This gives derived types a way to avoid calling PhiWithNormal todo: this api is confusing.

Protected function Const

FVec3

 

ScaledNormalHelper

(
    const FVec3& Normal,
    const FVec3& Scale
)

Safely scale a normal - used with both scale and inverse scale.

Public function Static

FImplicitObj...

 

SerializationFactory

(
    FChaosArchive& Ar,
    FImplicitObject* Obj
)

Public function Virtual

void

 

Serialize

(
    FChaosArchive& Ar
)

Public function Virtual

void

 

Serialize

(
    FArchive& Ar
)

Public function

void

 

SerializeImp

(
    FArchive& Ar
)

Public function Static

FArchive &

 

SerializeLegacyHelper

(
    FArchive& Ar,
    TUniquePtr< FImplicitObject >& Val...
)

Public function

void

 

SetCollisionType

(
    EImplicitObjectType InCollisionType
)

Public function

void

 

SetConvex

(
    const bool Convex
)

Public function

void

 

SetDoCollide

(
    const bool Collide
)

Protected function

void

 

SetMargin

(
    FReal InMargin
)

Not all derived types support a margin, and for some it represents some other property (the radius of a sphere for example), so the setter should only be exposed in a derived class if at all (and it may want to change the size of the core shape as well)

Public function Const

FReal

 

SignedDistance

(
    const FVec3& x
)

Explicitly non-virtual. Must cast to derived types to target their implementation.

Public function Static

constexpr EI...

 

StaticType()

Public function Virtual Const

FString

 

ToString()

Public function

void

 

Track

(
    TSerializablePtr< FImplicitObject >...,
    const FString& DebugInfo
)

Turn on memory tracking. Must pass object itself as a serializable ptr so we can save it out.

Typedefs

Name

Description

TType

Constants

Name

Description

D

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss