Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelsakharov committed Jan 26, 2025
2 parents 355df51 + fd50afe commit 76a6169
Show file tree
Hide file tree
Showing 16 changed files with 520 additions and 61 deletions.
5 changes: 4 additions & 1 deletion Prowl.Editor/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,9 @@ private static int Run(CliOpenOptions options)

Application.Quitting += () =>
{
if (PlayMode.Current == PlayMode.Mode.Playing)
PlayMode.Stop();

if (Project.HasProject)
Project.Active.SaveTempScene();
};
Expand All @@ -178,7 +181,7 @@ private static int Run(CliOpenOptions options)

public static void CheckReloadingAssemblies()
{
if (IsReloadingExternalAssemblies && Screen.IsFocused)
if (IsReloadingExternalAssemblies && Screen.IsFocused && PlayMode.Current == PlayMode.Mode.Editing)
{
IsReloadingExternalAssemblies = false;

Expand Down
2 changes: 1 addition & 1 deletion Prowl.Runtime/Components/Physics/Colliders/BoxCollider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ public Vector3 Size
}
}

public override RigidBodyShape[] CreateShapes() => [new BoxShape(size.x, size.y, size.z)];
public override RigidBodyShape[] CreateShapes() => [new BoxShape(MathD.Max(size.x, 0.01), MathD.Max(size.y, 0.01), MathD.Max(size.z, 0.01))];
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ public float Height
}
}

public override RigidBodyShape[] CreateShapes() => [new CapsuleShape(radius, height)];
public override RigidBodyShape[] CreateShapes() => [new CapsuleShape(MathD.Max(radius, 0.01), MathD.Max(height, 0.01))];
}
2 changes: 2 additions & 0 deletions Prowl.Runtime/Components/Physics/Colliders/Collider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ public RigidBodyShape[] CreateTransformedShapes()
current = current.parent;
}

cumulativeScale = Vector3.Max(cumulativeScale, Vector3.one * 0.05);

// Get the local rotation and position in world space
Quaternion localRotation = Quaternion.Euler(rotation);
Vector3 scaledCenter = Vector3.Scale(this.center, cumulativeScale);
Expand Down
2 changes: 1 addition & 1 deletion Prowl.Runtime/Components/Physics/Colliders/ConeCollider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ public float Height
}
}

public override RigidBodyShape[] CreateShapes() => [new ConeShape(radius, height)];
public override RigidBodyShape[] CreateShapes() => [new ConeShape(MathD.Max(radius, 0.01), MathD.Max(height, 0.01))];
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ public float Height
}
}

public override RigidBodyShape[] CreateShapes() => [new CylinderShape(radius, height)];
public override RigidBodyShape[] CreateShapes() => [new CylinderShape(MathD.Max(radius, 0.01), MathD.Max(height, 0.01))];
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ public float Radius
}
}

public override RigidBodyShape[] CreateShapes() => [new SphereShape(radius)];
public override RigidBodyShape[] CreateShapes() => [new SphereShape(MathD.Max(radius, 0.01))];
}
Loading

0 comments on commit 76a6169

Please sign in to comment.