Skip to content

Commit

Permalink
Fix Joint connection
Browse files Browse the repository at this point in the history
- modified in SetArticulationBodyAnchor()
  • Loading branch information
hyunseok-yang committed Feb 1, 2024
1 parent 194b34f commit f55b233
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Assets/Scripts/Tools/SDF/Implement/Implement.Joint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ public static UE.Pose SetArticulationBodyRelationship(in SDF.Joint joint, UE.Tra
linkChild.SetParent(linkParent);

// Set anchor pose
anchorPose.position = linkChild.localPosition;
// anchorPose.position = linkChild.localPosition;
// UE.Debug.LogWarningFormat("Linking1 ({0}) => ({1})", linkChild.name, linkParent.name);
}
else
{
modelTransformChild.SetParent(linkParent);

// Set anchor pose
anchorPose.position = modelTransformChild.localPosition;
// anchorPose.position = modelTransformChild.localPosition;
// UE.Debug.LogWarningFormat("Linking2 ({0}) => ({1})", modelTransformChild.name, linkParent.name);
}

Expand All @@ -67,7 +67,8 @@ public static UE.Pose SetArticulationBodyRelationship(in SDF.Joint joint, UE.Tra

public static void SetArticulationBodyAnchor(in UE.ArticulationBody body, in UE.Pose parentAnchor)
{
body.anchorPosition = UE.Vector3.zero;
// UE.Debug.Log(parentAnchor.position);
body.anchorPosition = parentAnchor.position; //UE.Vector3.zero;
body.anchorRotation = parentAnchor.rotation;

// TODO: Consider parentAnchor
Expand Down

0 comments on commit f55b233

Please sign in to comment.