Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reset bone location and rotation may cause trouble when switching between skeleton LODs #44

Closed
ZP-Z opened this issue Dec 22, 2021 · 1 comment

Comments

@ZP-Z
Copy link

ZP-Z commented Dec 22, 2021

//@struct FKawaiiPhysicsModifyBone
void UpdatePoseTranform(const FBoneContainer& BoneContainer, FCSPose<FCompactPose>& Pose)
{
	auto CompactPoseIndex = BoneRef.GetCompactPoseIndex(BoneContainer);
	if (CompactPoseIndex < 0)
	{
		PoseLocation = FVector::ZeroVector;
		PoseRotation = FQuat::Identity;
		PoseScale = FVector::OneVector;
		return;
	}

	auto ComponentSpaceTransform = Pose.GetComponentSpaceTransform(CompactPoseIndex);
	PoseLocation = ComponentSpaceTransform.GetLocation();
	PoseRotation = ComponentSpaceTransform.GetRotation();
	PoseScale = ComponentSpaceTransform.GetScale3D();
}

Bone motion is too large when switching LOD.
When CompactPoseIndex < 0, maybe just keeping the information saved before works well.

@ZP-Z ZP-Z changed the title Reset bone location and rotation may cause trouble when switch between skeleton LODs Reset bone location and rotation may cause trouble when switching between skeleton LODs Dec 22, 2021
pafuhana1213 added a commit that referenced this issue Apr 11, 2022
@pafuhana1213
Copy link
Owner

Hi,
I can't see the issue in sample, but your point sounds good.
So I have added new flag to avoid reset transform.
20c1ec0

I'm happy if this change help you.
thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants