You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't know if this is appropriate, but we tried to deal with it this way and it stopped being NaN,
The Drag section has a behavior that seems to diverge infinitely when warping or moving at high speed.
You might want to brush up the code more.
We are not looking for strictness, so this was a good enough behavior for us.
It would be great if the person who created SPCR could improve it if possible!,
AnimNode_SPCRJointDynamics.cpp
if (bUseDrag)
{
float MoveSpeed = Displacement.SizeSquared();
FVector VelNormalize = Displacement.GetSafeNormal();
//instead of -1 can I make the -1/2??
FVector DragForce = -1 * ((Point.Drag * MoveSpeed * VelNormalize) / 2);
Displacement += DragForce;
}
↓
if (bUseDrag)
{
float MoveSpeed = Displacement.SizeSquared();
FVector VelNormalize = Displacement.GetSafeNormal();
//instead of -1 can I make the -1/2??
FVector DragForce = -1 * ((Point.Drag * MoveSpeed * VelNormalize) * 0.5);
//Start CUSTOM Not to diverge endlessly.
if (Displacement.Length() > DragForce.Length())
{
Displacement += DragForce;
}
else
{
if (Displacement.Length() > 0.001f)
{
float gainScale = Displacement.Length() / DragForce.Length();
Displacement += DragForce * gainScale * 0.9999f;
}
}
//Custom End
}
MoveSpeed value will be very very large
The text was updated successfully, but these errors were encountered: