Skip to content

Huge Performance Boost #8

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

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions Assets/Project/Scripts/Fractures/ChunkNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ private bool Contains(ChunkNode chunkNode)
return Neighbours.Contains(chunkNode);
}

private void FixedUpdate()
{
// Kinda hacky, but otherwise the chunks slowly drift apart.
if (frozen)
{
transform.position = frozenPos;
transform.rotation = forzenRot;
}
}
// private void FixedUpdate()
// {
// // Kinda hacky, but otherwise the chunks slowly drift apart.
// if (frozen)
// {
// transform.position = frozenPos;
// transform.rotation = forzenRot;
// }
// }

public void Setup()
{
Expand Down Expand Up @@ -135,4 +135,4 @@ private void OnDrawGizmosSelected()
}
}
}
}
}
4 changes: 3 additions & 1 deletion Assets/Project/Scripts/Fractures/Fracture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ private void Setup(int i, GameObject chunk, NvFractureTool fractureTool)
var rigibody = chunk.AddComponent<Rigidbody>();
rigibody.mass = totalMass / totalChunks;

rigibody.sleepThreshold = 5;

var mc = chunk.AddComponent<MeshCollider>();
mc.inflateMesh = true;
mc.convex = true;
Expand All @@ -90,4 +92,4 @@ private void Voronoi(NvFractureTool fractureTool, NvMesh mesh)
fractureTool.voronoiFracturing(0, sites);
}
}
}
}