You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#rb tyson.brochu #preflight 62211dad4e07145cce561fd4 #jira none #rnx #ROBOMERGE-AUTHOR: ryan.schmidt #ROBOMERGE-SOURCE: CL 19252433 in //UE5/Release-5.0/... via CL 19252680 #ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v924-19243027) [CL 19263458 by ryan schmidt in ue5-main branch]
91 lines
2.7 KiB
C++
91 lines
2.7 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "Components/PrimitiveComponent.h"
|
|
#include "TransformTypes.h"
|
|
|
|
class UBodySetup;
|
|
class UStaticMesh;
|
|
struct FKAggregateGeom;
|
|
|
|
namespace UE
|
|
{
|
|
namespace Geometry
|
|
{
|
|
|
|
struct FSimpleShapeSet3d;
|
|
|
|
/**
|
|
* Component/BodySetup collision settings (eg StaticMeshComponent) we might need to pass through the functions below
|
|
*/
|
|
struct MODELINGCOMPONENTS_API FComponentCollisionSettings
|
|
{
|
|
int32 CollisionTypeFlag = 0; // this is ECollisionTraceFlag
|
|
bool bIsGeneratedCollision = true;
|
|
};
|
|
|
|
/**
|
|
* @return true if the component type supports collision settings
|
|
*/
|
|
MODELINGCOMPONENTS_API bool ComponentTypeSupportsCollision(
|
|
const UPrimitiveComponent* Component);
|
|
|
|
|
|
/**
|
|
* @return current Component collision settings
|
|
*/
|
|
MODELINGCOMPONENTS_API FComponentCollisionSettings GetCollisionSettings(
|
|
const UPrimitiveComponent* Component);
|
|
|
|
|
|
/**
|
|
* Apply Transform to any Simple Collision geometry owned by Component.
|
|
* Note that Nonuniform scaling support is very limited and will generally enlarge collision volumes.
|
|
*/
|
|
MODELINGCOMPONENTS_API bool TransformSimpleCollision(
|
|
UPrimitiveComponent* Component,
|
|
const FTransform3d& Transform);
|
|
|
|
/**
|
|
* Replace existing Simple Collision geometry in Component with that defined by ShapeSet,
|
|
* and update the Component/BodySetup collision settings
|
|
*/
|
|
MODELINGCOMPONENTS_API bool SetSimpleCollision(
|
|
UPrimitiveComponent* Component,
|
|
const FSimpleShapeSet3d* ShapeSet,
|
|
FComponentCollisionSettings CollisionSettings = FComponentCollisionSettings() );
|
|
|
|
|
|
/**
|
|
* Apply Transform to the existing Simple Collision geometry in Component and then append to to ShapeSetOut
|
|
*/
|
|
MODELINGCOMPONENTS_API bool AppendSimpleCollision(
|
|
const UPrimitiveComponent* SourceComponent,
|
|
FSimpleShapeSet3d* ShapeSetOut,
|
|
const FTransform3d& Transform);
|
|
|
|
/**
|
|
* Apply TransformSequence (in-order) to the existing Simple Collision geometry in Component and then append to to ShapeSetOut
|
|
*/
|
|
MODELINGCOMPONENTS_API bool AppendSimpleCollision(
|
|
const UPrimitiveComponent* SourceComponent,
|
|
FSimpleShapeSet3d* ShapeSetOut,
|
|
const TArray<FTransform3d>& TransformSeqeuence);
|
|
|
|
/**
|
|
* Replace existing Simple Collision geometry in BodySetup with that defined by NewGeometry,
|
|
* and update the Component/BodySetup collision settings. Optional StaticMesh argument allows
|
|
* for necessary updates to it and any active UStaticMeshComponent that reference it
|
|
*/
|
|
MODELINGCOMPONENTS_API void UpdateSimpleCollision(
|
|
UBodySetup* BodySetup,
|
|
const FKAggregateGeom* NewGeometry,
|
|
UStaticMesh* StaticMesh = nullptr,
|
|
FComponentCollisionSettings CollisionSettings = FComponentCollisionSettings());
|
|
|
|
|
|
|
|
} // end namespace Geometry
|
|
} // end namespace UE
|