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 want to use TearingScenarioEngineto complete continuous tearing, I tested that by the following code:
int previousVertexCount= Tissue.GetMesh().vertices.Length;
while (true)
{
if (Input.GetKeyDown(KeyCode.Space))
{
Vector3[] vertices = Tissue.GetMesh().vertices;
int currentVertexCount = vertices.Length;
if (currentVertexCount==previousVertexCount)
{
continue;
}
int farthestIndex = FindFarthestPointAlongDirection(vertices, startVertexId.Value, startDirection.Value, previousVertexCount);
nbFractureMax.Value++;
Debug.DrawLine(vertices[farthestIndex], vertices[farthestIndex] + Vector3.up * 2, Color.green, 50f);
startVertexId.Value = farthestIndex;
startDirection.Value = Quaternion.Euler(0, 10, 0) * startDirection.Value;
previousVertexCount = currentVertexCount;
}
yield return new WaitForSeconds(0.02f);
}
However, when I pull the tissue or cut it too quickly, Unity crashes: https://github.com/user-attachments/assets/c07e93b8-301d-4b34-bebd-5c1f9a93fc43
The crash log is as follows: Editor.log
May I ask how to avoid this problem?
In addition, the parameter startVertexId of TearingScenarioEngine is the index of the midpoint of the tearing path. I want to use it as the starting point. Should I change line 447 of TearingEngine. inl to Pc=Pa?
Thanks in advance!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I want to use
TearingScenarioEngineto complete continuous tearing, I tested that by the following code:However, when I pull the tissue or cut it too quickly, Unity crashes:

https://github.com/user-attachments/assets/c07e93b8-301d-4b34-bebd-5c1f9a93fc43
The crash log is as follows:
Editor.log
May I ask how to avoid this problem?
In addition, the parameter
startVertexIdofTearingScenarioEngineis the index of the midpoint of the tearing path. I want to use it as the starting point. Should I change line 447 of TearingEngine. inl toPc=Pa?Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions