Skip to content
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);
}
}
}
}