Skip to content

Commit 2a7a129

Browse files
author
Unity Technologies
committed
com.unity.physics@1.4.2
## [1.4.2] - 2025-09-05 ### Added * New maximum depenetration velocity properties in the `Physics Step Authoring` component allow controlling the maximum velocity with which intersecting rigid bodies separate. This can be useful in cases where contacts lead to deep intersections between colliders, consequently causing too aggressive, ejecting motions. The new `Max Dynamic Depenetration Velocity` and `Max Static Depenetration Velocity` properties control the maximum relative velocity that can be produced when separating intersecting dynamic rigid bodies, and the maximum relative velocity that can be produced when separating dynamic rigid bodies intersecting with static rigid bodies, respectively. ### Changed * The maximum number of phases in the parallel constraint solver was increased from 16 to now 64, leading to significant speed-ups in parallel constraint processing by the `ParallelSolverJob` in situations where the body-constraint graph topology would have caused the graph coloring algorithm to run out of colors (phases). In the latter, all affected constraints were processed in serial at the end of each solver iteration by only a single job worker thread, thereby wasting significant computational resources and causing an unnecessary slowdown in every solver iteration. This is no longer the case with this change. The resultant performance improvement can be observed among others in the `Planet Gravity` sample scene in the `PhysicsSamples` project. * Updated Burst dependency to version 1.8.23
1 parent 4a7d0ea commit 2a7a129

File tree

80 files changed

+4561
-321
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+4561
-321
lines changed

.attestation.p7m

10.6 KB
Binary file not shown.

.buginfo

Lines changed: 0 additions & 5 deletions
This file was deleted.

.editorconfig

Lines changed: 0 additions & 74 deletions
This file was deleted.

.signature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"timestamp":1759420299,"signature":"av9aJH2yh9avsNL71KJXu8w5CeNLQ4hCfJyW5TcSErto8B1Q/Z8bm7f7c64Hk+B9c+rCtE9LW6Tx7R20QH+a4b2QBOR2438pGaMPQMovvnHOpzMZNHkYqMS5Fx7Oz7jrHFHQHU8fFDK8TYl4P30wxBQ9DHpGNla0a0QC+YBVPen1UmYaNrqdrcDzKiArElHsBY8fxGAB6PWV89MFG/AxB6TTCeuaXx2F5fQYLTM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d3hmcExLWlROQWdNQkFBRT0KLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0tCg"}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
AutoGenerated:
2+
3+
M|[*] Unity.Entities.EntityQueryDescBuilder [*] Unity.Entities.EntityQueryDescBuilder::Options([*] Unity.Entities.EntityQueryOptions) | bug in api updater, excluding this validation, testing it manually

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,18 @@ uid: unity-physics-changelog
44

55
# Changelog
66

7+
## [1.4.2] - 2025-09-05
8+
9+
### Added
10+
11+
* New maximum depenetration velocity properties in the `Physics Step Authoring` component allow controlling the maximum velocity with which intersecting rigid bodies separate. This can be useful in cases where contacts lead to deep intersections between colliders, consequently causing too aggressive, ejecting motions. The new `Max Dynamic Depenetration Velocity` and `Max Static Depenetration Velocity` properties control the maximum relative velocity that can be produced when separating intersecting dynamic rigid bodies, and the maximum relative velocity that can be produced when separating dynamic rigid bodies intersecting with static rigid bodies, respectively.
12+
13+
### Changed
14+
15+
* The maximum number of phases in the parallel constraint solver was increased from 16 to now 64, leading to significant speed-ups in parallel constraint processing by the `ParallelSolverJob` in situations where the body-constraint graph topology would have caused the graph coloring algorithm to run out of colors (phases). In the latter, all affected constraints were processed in serial at the end of each solver iteration by only a single job worker thread, thereby wasting significant computational resources and causing an unnecessary slowdown in every solver iteration. This is no longer the case with this change. The resultant performance improvement can be observed among others in the `Planet Gravity` sample scene in the `PhysicsSamples` project.
16+
* Updated Burst dependency to version 1.8.23
17+
18+
719
## [1.4.0-pre.4] - 2025-07-11
820

921
### Added

Documentation~/TableOfContents.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
* [Unity Physics package](index.md)
22
* [What's new](whats-new.md)
3-
* [Upgrade guide](upgrade-guide.md)
43
* [Get started](getting-started.md)
54
* [Installation](getting-started-installation.md)
65
* [ECS packages](ecs-packages.md)
@@ -36,4 +35,4 @@
3635
* [Simulation results](simulation-results.md)
3736
* [Glossary](glossary.md)
3837
* [Troubleshooting](troubleshooting.md)
39-
* [Ghost collisions](ghost-collisions.md)
38+
* [Ghost collisions](ghost-collisions.md)

Documentation~/index.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ See the [Unity Physics Samples](https://github.com/Unity-Technologies/EntityComp
99
## Supported Unity Versions
1010

1111
* 2022.3 (LTS)
12-
* 2023.3 (Latest Beta and beyond)
12+
* Unity 6 (LTS)
1313

1414
## Package installation
1515

@@ -20,12 +20,6 @@ To install the package, open the Package Manager window (**Window > Package M
2020
* [Add the package by its name](xref:upm-ui-quick) (com.unity.physics)
2121
* [Add the package from its Git URL](xref:upm-ui-giturl)
2222

23-
## Known issues
24-
25-
* Mesh collider types contacting results in a wrong behaviour by getting glued to each other as if they were joints.
26-
* Mesh collider simplification: if primitive scale is smaller than 0.018f, selecting entities in the scene view throws error.
27-
* Compound collider gets created even if children are disabled in Editor's game object hierarchy.
28-
2923
## Additional resources
3024

3125
* [Getting started](getting-started.md)
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
using System;
2+
using Unity.Mathematics;
3+
using UnityEditor;
4+
using UnityEditor.IMGUI.Controls;
5+
using UnityEngine;
6+
7+
namespace Unity.Physics.Editor
8+
{
9+
class BeveledBoxBoundsHandle : BoxBoundsHandle
10+
{
11+
public float bevelRadius
12+
{
13+
get => math.min(m_BevelRadius, math.cmin(GetSize()) * 0.5f);
14+
set
15+
{
16+
if (!m_IsDragging)
17+
m_BevelRadius = math.max(0f, value);
18+
}
19+
}
20+
float m_BevelRadius = ConvexHullGenerationParameters.Default.BevelRadius;
21+
bool m_IsDragging = false;
22+
23+
static PhysicsBoundsHandleUtility.Corner[] s_Corners = new PhysicsBoundsHandleUtility.Corner[8];
24+
25+
public new void DrawHandle()
26+
{
27+
int prevHotControl = GUIUtility.hotControl;
28+
if (prevHotControl == 0)
29+
m_IsDragging = false;
30+
base.DrawHandle();
31+
int currHotcontrol = GUIUtility.hotControl;
32+
if (currHotcontrol != prevHotControl)
33+
m_IsDragging = currHotcontrol != 0;
34+
}
35+
36+
protected override void DrawWireframe()
37+
{
38+
if (this.bevelRadius <= 0f)
39+
{
40+
base.DrawWireframe();
41+
return;
42+
}
43+
44+
var cameraPosition = float3.zero;
45+
var cameraForward = new float3 { z = 1f };
46+
if (Camera.current != null)
47+
{
48+
cameraPosition = Camera.current.transform.position;
49+
cameraForward = Camera.current.transform.forward;
50+
}
51+
52+
var bounds = new Bounds(this.center, this.size);
53+
bool isCameraInsideBox = Camera.current != null && bounds.Contains(Handles.inverseMatrix.MultiplyPoint(cameraPosition));
54+
var bevelRadius = this.bevelRadius;
55+
var origin = (float3)this.center;
56+
var size = (float3)this.size;
57+
58+
PhysicsBoundsHandleUtility.DrawFace(origin, size * new float3(1f, 1f, 1f), bevelRadius, 0, axes, isCameraInsideBox);
59+
PhysicsBoundsHandleUtility.DrawFace(origin, size * new float3(-1f, 1f, 1f), bevelRadius, 0, axes, isCameraInsideBox);
60+
PhysicsBoundsHandleUtility.DrawFace(origin, size * new float3(1f, 1f, 1f), bevelRadius, 1, axes, isCameraInsideBox);
61+
PhysicsBoundsHandleUtility.DrawFace(origin, size * new float3(1f, -1f, 1f), bevelRadius, 1, axes, isCameraInsideBox);
62+
PhysicsBoundsHandleUtility.DrawFace(origin, size * new float3(1f, 1f, 1f), bevelRadius, 2, axes, isCameraInsideBox);
63+
PhysicsBoundsHandleUtility.DrawFace(origin, size * new float3(1f, 1f, -1f), bevelRadius, 2, axes, isCameraInsideBox);
64+
65+
var corner = 0.5f * size - new float3(1f) * bevelRadius;
66+
var axisx = new float3(1f, 0f, 0f);
67+
var axisy = new float3(0f, 1f, 0f);
68+
var axisz = new float3(0f, 0f, 1f);
69+
70+
// Since the geometry is transformed by Handles.matrix during rendering, we transform the camera position
71+
// by the inverse matrix so that the two-shaded wireframe will have the proper orientation.
72+
var invMatrix = Handles.inverseMatrix;
73+
cameraPosition = invMatrix.MultiplyPoint(cameraPosition);
74+
cameraForward = invMatrix.MultiplyVector(cameraForward);
75+
var cameraOrtho = Camera.current == null || Camera.current.orthographic;
76+
77+
PhysicsBoundsHandleUtility.CalculateCornerHorizon(origin + corner * new float3(-1f, 1f, -1f), quaternion.LookRotation(-axisz, axisy), cameraPosition, cameraForward, cameraOrtho, bevelRadius, out s_Corners[0]);
78+
PhysicsBoundsHandleUtility.CalculateCornerHorizon(origin + corner * new float3(-1f, 1f, 1f), quaternion.LookRotation(-axisx, axisy), cameraPosition, cameraForward, cameraOrtho, bevelRadius, out s_Corners[1]);
79+
PhysicsBoundsHandleUtility.CalculateCornerHorizon(origin + corner * new float3(1f, 1f, 1f), quaternion.LookRotation(axisz, axisy), cameraPosition, cameraForward, cameraOrtho, bevelRadius, out s_Corners[2]);
80+
PhysicsBoundsHandleUtility.CalculateCornerHorizon(origin + corner * new float3(1f, 1f, -1f), quaternion.LookRotation(axisx, axisy), cameraPosition, cameraForward, cameraOrtho, bevelRadius, out s_Corners[3]);
81+
82+
PhysicsBoundsHandleUtility.CalculateCornerHorizon(origin + corner * new float3(-1f, -1f, -1f), quaternion.LookRotation(-axisx, -axisy), cameraPosition, cameraForward, cameraOrtho, bevelRadius, out s_Corners[4]);
83+
PhysicsBoundsHandleUtility.CalculateCornerHorizon(origin + corner * new float3(-1f, -1f, 1f), quaternion.LookRotation(axisz, -axisy), cameraPosition, cameraForward, cameraOrtho, bevelRadius, out s_Corners[5]);
84+
PhysicsBoundsHandleUtility.CalculateCornerHorizon(origin + corner * new float3(1f, -1f, 1f), quaternion.LookRotation(axisx, -axisy), cameraPosition, cameraForward, cameraOrtho, bevelRadius, out s_Corners[6]);
85+
PhysicsBoundsHandleUtility.CalculateCornerHorizon(origin + corner * new float3(1f, -1f, -1f), quaternion.LookRotation(-axisz, -axisy), cameraPosition, cameraForward, cameraOrtho, bevelRadius, out s_Corners[7]);
86+
87+
for (int i = 0; i < s_Corners.Length; i++)
88+
PhysicsBoundsHandleUtility.DrawCorner(s_Corners[i], true);
89+
90+
// Draw the horizon edges between the corners
91+
for (int upA = 3, upB = 0; upB < 4; upA = upB, upB++)
92+
{
93+
int dnA = upA + 4;
94+
int dnB = upB + 4;
95+
96+
if (s_Corners[upA].splitAxis[0].z && s_Corners[upB].splitAxis[1].x) Handles.DrawLine(s_Corners[upA].points[0], s_Corners[upB].points[1]);
97+
if (s_Corners[upA].splitAxis[1].z && s_Corners[upB].splitAxis[0].x) Handles.DrawLine(s_Corners[upA].points[1], s_Corners[upB].points[0]);
98+
99+
if (s_Corners[dnA].splitAxis[0].x && s_Corners[dnB].splitAxis[1].z) Handles.DrawLine(s_Corners[dnA].points[0], s_Corners[dnB].points[1]);
100+
if (s_Corners[dnA].splitAxis[1].x && s_Corners[dnB].splitAxis[0].z) Handles.DrawLine(s_Corners[dnA].points[1], s_Corners[dnB].points[0]);
101+
102+
if (s_Corners[dnA].splitAxis[0].y && s_Corners[upA].splitAxis[1].y) Handles.DrawLine(s_Corners[dnA].points[0], s_Corners[upA].points[1]);
103+
if (s_Corners[dnA].splitAxis[1].y && s_Corners[upA].splitAxis[0].y) Handles.DrawLine(s_Corners[dnA].points[1], s_Corners[upA].points[0]);
104+
}
105+
}
106+
}
107+
}

Samples~/CustomPhysicsAuthoring/Unity.Physics.Custom.Editor/EditorTools/BeveledBoxBoundsHandle.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)