/** Rules for attaching components */
struct ENGINE_API FAttachmentTransformRules
{
/** Various preset attachment rules. Note that these default rules do NOT by default weld simulated bodies */
static FAttachmentTransformRules KeepRelativeTransform;
static FAttachmentTransformRules KeepWorldTransform;
static FAttachmentTransformRules SnapToTargetNotIncludingScale;
static FAttachmentTransformRules SnapToTargetIncludingScale;
FAttachmentTransformRules(EAttachmentRule InRule, bool bInWeldSimulatedBodies)
: LocationRule(InRule)
, RotationRule(InRule)
, ScaleRule(InRule)
, bWeldSimulatedBodies(bInWeldSimulatedBodies)
{}
FAttachmentTransformRules(EAttachmentRule InLocationRule, EAttachmentRule InRotationRule, EAttachmentRule InScaleRule, bool bInWeldSimulatedBodies)
: LocationRule(InLocationRule)
, RotationRule(InRotationRule)
, ScaleRule(InScaleRule)
, bWeldSimulatedBodies(bInWeldSimulatedBodies)
{}
/** The rule to apply to location when attaching */
EAttachmentRule LocationRule;
/** The rule to apply to rotation when attaching */
EAttachmentRule RotationRule;
/** The rule to apply to scale when attaching */
EAttachmentRule ScaleRule;
/** Whether to weld simulated bodies together when attaching */
bool bWeldSimulatedBodies;
};
- KeepRelativeTransform 保持两个物体的相对位置不变
- KeepWorldTransform 保持两个物体的世界位置不变
- SnapToTargetNotIncludingScale 忽略缩放对齐到目标
- SnapToTargetIncludingScale 保持比例对齐到目标