@@ -195,14 +195,18 @@ struct KAWAIIPHYSICS_API FKawaiiPhysicsModifyBone
195
195
196
196
public:
197
197
198
- void UpdatePoseTranform (const FBoneContainer& BoneContainer, FCSPose<FCompactPose>& Pose)
198
+ void UpdatePoseTranform (const FBoneContainer& BoneContainer, FCSPose<FCompactPose>& Pose, bool ResetBoneTransformWhenBoneNotFound )
199
199
{
200
200
auto CompactPoseIndex = BoneRef.GetCompactPoseIndex (BoneContainer);
201
201
if (CompactPoseIndex < 0 )
202
202
{
203
- PoseLocation = FVector::ZeroVector;
204
- PoseRotation = FQuat::Identity;
205
- PoseScale = FVector::OneVector;
203
+ // Reset bone location and rotation may cause trouble when switching between skeleton LODs #44
204
+ if (ResetBoneTransformWhenBoneNotFound)
205
+ {
206
+ PoseLocation = FVector::ZeroVector;
207
+ PoseRotation = FQuat::Identity;
208
+ PoseScale = FVector::OneVector;
209
+ }
206
210
return ;
207
211
}
208
212
@@ -300,6 +304,9 @@ struct KAWAIIPHYSICS_API FAnimNode_KawaiiPhysics : public FAnimNode_SkeletalCont
300
304
UPROPERTY (EditAnywhere, BlueprintReadWrite, Category = " Advanced Physics Settings" , meta = (PinHiddenByDefault))
301
305
EPlanarConstraint PlanarConstraint = EPlanarConstraint::None;
302
306
307
+ UPROPERTY (EditAnywhere, BlueprintReadWrite, Category = " Advanced Physics Settings" , meta = (PinHiddenByDefault))
308
+ bool ResetBoneTransformWhenBoneNotFound = false ;
309
+
303
310
304
311
UPROPERTY (EditAnywhere, Category = " Spherical Limits" )
305
312
TArray< FSphericalLimit> SphericalLimits;
@@ -330,24 +337,24 @@ struct KAWAIIPHYSICS_API FAnimNode_KawaiiPhysics : public FAnimNode_SkeletalCont
330
337
FVector Gravity = FVector::ZeroVector;
331
338
332
339
/* * Whether or not wind is enabled for the bodies in this simulation */
333
- UPROPERTY (EditAnywhere, BlueprintReadWrite, Category = Wind, meta = (PinHiddenByDefault))
340
+ UPROPERTY (EditAnywhere, BlueprintReadWrite, Category = " Wind" , meta = (PinHiddenByDefault))
334
341
bool bEnableWind = false ;
335
342
336
343
/* * Scale to apply to calculated wind velocities in the solver */
337
- UPROPERTY (EditAnywhere, BlueprintReadWrite, Category = Wind, meta = (DisplayAfter = " bEnableWind" ), meta = (PinHiddenByDefault))
344
+ UPROPERTY (EditAnywhere, BlueprintReadWrite, Category = " Wind" , meta = (DisplayAfter = " bEnableWind" ), meta = (PinHiddenByDefault))
338
345
float WindScale = 1 .0f ;
339
346
340
347
/* *
341
348
* EXPERIMENTAL. Perform sweeps for each simulating bodies to avoid collisions with the world.
342
349
* This greatly increases the cost of the physics simulation.
343
350
*/
344
- UPROPERTY (EditAnywhere, BlueprintReadWrite, Category = Collision, meta = (PinHiddenByDefault))
351
+ UPROPERTY (EditAnywhere, BlueprintReadWrite, Category = " Collision" , meta = (PinHiddenByDefault))
345
352
bool bAllowWorldCollision = false ;
346
353
// use component collision channel settings by default
347
- UPROPERTY (EditAnywhere, BlueprintReadWrite, Category = Collision, meta = (PinHiddenByDefault, EditCondition = " bAllowWorldCollision" ))
354
+ UPROPERTY (EditAnywhere, BlueprintReadWrite, Category = " Collision" , meta = (PinHiddenByDefault, EditCondition = " bAllowWorldCollision" ))
348
355
bool bOverrideCollisionParams = false ;
349
356
/* * Types of objects that this physics objects will collide with. */
350
- UPROPERTY (EditAnywhere, Category = Collision, meta = (FullyExpand = " true" , EditCondition = " bAllowWorldCollision&&bOverrideCollisionParams" ))
357
+ UPROPERTY (EditAnywhere, Category = " Collision" , meta = (FullyExpand = " true" , EditCondition = " bAllowWorldCollision&&bOverrideCollisionParams" ))
351
358
FBodyInstance CollisionChannelSettings;
352
359
353
360
0 commit comments