Skip to content
Open
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 1.0.3
### Features
- Improved CPU performance

## 1.0.2
### Features
- Added `onFracture` to editor
Expand Down
3 changes: 1 addition & 2 deletions Runtime/Scripts/Fracture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,7 @@ private void ComputeFracture()
this.fragmentRoot.transform.SetParent(this.transform.parent);

// Each fragment will handle its own scale
this.fragmentRoot.transform.position = this.transform.position;
this.fragmentRoot.transform.rotation = this.transform.rotation;
this.fragmentRoot.transform.SetPositionAndRotation(this.transform.position, this.transform.rotation);
this.fragmentRoot.transform.localScale = Vector3.one;
}

Expand Down
1 change: 0 additions & 1 deletion Runtime/Scripts/Fragment/UnfreezeFragment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ void OnTriggerEnter(Collider collider)
return;
}

bool tagAllowed = triggerOptions.IsTagAllowed(collider.gameObject.tag);
if (!triggerOptions.filterCollisionsByTag || triggerOptions.IsTagAllowed(collider.gameObject.tag))
{
this.Unfreeze();
Expand Down
3 changes: 1 addition & 2 deletions Runtime/Scripts/Prefracture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ public void ComputeFracture()
this.fragmentRoot.transform.SetParent(this.transform.parent);

// Each fragment will handle its own scale
this.fragmentRoot.transform.position = this.transform.position;
this.fragmentRoot.transform.rotation = this.transform.rotation;
this.fragmentRoot.transform.SetPositionAndRotation(this.transform.position, this.transform.rotation);
this.fragmentRoot.transform.localScale = Vector3.one;
}

Expand Down
3 changes: 1 addition & 2 deletions Runtime/Scripts/Slice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ public void ComputeSlice(Vector3 sliceNormalWorld, Vector3 sliceOriginWorld)
this.fragmentRoot.transform.SetParent(this.transform.parent);

// Each fragment will handle its own scale
this.fragmentRoot.transform.position = this.transform.position;
this.fragmentRoot.transform.rotation = this.transform.rotation;
this.fragmentRoot.transform.SetPositionAndRotation(this.transform.position, this.transform.rotation);
this.fragmentRoot.transform.localScale = Vector3.one;
}

Expand Down
5 changes: 2 additions & 3 deletions Runtime/Scripts/Slicers/PlaneSlicer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,8 @@ void Update()
foreach(RaycastHit hit in hits)
{
var obj = hit.collider.gameObject;
var sliceObj = obj.GetComponent<Slice>();

if (sliceObj != null)

if (obj.TryGetComponent<Slice>(out var sliceObj))
{
sliceObj.GetComponent<MeshRenderer>()?.material.SetVector("CutPlaneOrigin", Vector3.positiveInfinity);
sliceObj.ComputeSlice(this.transform.up, this.transform.position);
Expand Down
2 changes: 1 addition & 1 deletion Runtime/Scripts/Utilities/BinSort.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public interface IBinSortable
/// |_____|_____|_____|
///
/// </summary>
public class BinSort
public static class BinSort
{
/// <summary>
/// Computes the bin number for the set of grid coordinates
Expand Down