(09-12-2022, 08:36 PM)idmah Wrote: So exploring the idea that TransformPoint is giving me troubles.
So wrote found this and modified it.
Code:public Vector3 TransFormToWorld(Vector3 localSpacePosition)
{
// assumes localScale is correct thing to look at?? //
Matrix4x4 m = Matrix4x4.TRS (ropeComp.solver.transform.position, ropeComp.solver.transform.rotation, ropeComp.solver.transform.localScale);
Vector3 worldPos = m.MultiplyPoint3x4(localSpacePosition);
Debug.Log("Convert: " + localSpacePosition + " World" + worldPos+ " Vs TransformPoint:"+ pathSmoother.transform.TransformPoint(localSpacePosition));
return worldPos;
}
Which outputs:
Where localSpacePosition = ropeComp.solver.positions[ropeComp.solverIndices[i]]Code:Convert: (0.19, -1.33, 29.97) World(0.45, 4.25, -9.63) Vs TransformPoint:(10.00, 5.31, 0.08)
UnityEngine.Debug:Log (object)
FindClimbObiRope:TransFormToWorld (UnityEngine.Vector3) (at Assets/Scripts/FindClimbObiRope.cs:219)
FindClimbObiRope:FindClosestRopeParticle () (at Assets/Scripts/FindClimbObiRope.cs:152)
FindClimbObiRope:LateUpdate () (at Assets/Scripts/FindClimbObiRope.cs:59)
And seem?! to give me the correct closest point I think. Right??
Attaching to Rope, Jitter.
|
|
« Next Oldest | Next Newest »
|
Messages In This Thread |
Attaching to Rope, Jitter. - by idmah - 07-12-2022, 06:39 PM
RE: Attaching to Rope, Jitter. - by josemendez - 07-12-2022, 08:07 PM
RE: Attaching to Rope, Jitter. - by idmah - 08-12-2022, 04:34 AM
RE: Attaching to Rope, Jitter. - by josemendez - 08-12-2022, 10:02 AM
RE: Attaching to Rope, Jitter. - by idmah - 09-12-2022, 08:36 PM
RE: Attaching to Rope, Jitter. - by idmah - 09-12-2022, 11:08 PM
RE: Attaching to Rope, Jitter. - by josemendez - 10-12-2022, 11:27 AM
|