com.unity.physics 0.2.5-preview

com.unity.physics

Notes: processedReleased December 4, 2019

Browse versions

PreviousNext

Unity Compatibility

Minimum Unity: 2019.3 (0f1)

🔄 Changes

  • Run-Time API
  • - Removed `BlockStream` and migrated all usages to `NativeSteam`.
  • - Access to `JointData.Constraints` has changed to an indexer. This means that to change the values of a `Constraint`, a copy should be made first. E.g.,
  • ```c#
  • var c = JointData.Constraints[index];
  • c.Min = 0;
  • JointData.Constraints[index] = c;
  • ```
  • - Added `maxVelocity` parameter to `SimplexSolver.Solve()` to clamp the solving results to the maximum value.
  • - Added `SurfaceConstraintInfo.IsTooSteep` to indicate that a particular surface constraint has a slope bigger than the slope character controller supports.
  • - `MeshCollider.Create()` now takes grouped triangle indices (NativeArray) instead of a flat list of indices (NativeArray) as input.
  • - Removed the following expired members/types:
  • - `BoxCollider.ConvexRadius` (renamed to `BevelRadius`)
  • - `CyllinderCollider.ConvexRadius` (renamed to `BevelRadius`)
  • - Collider factory methods passing nullable types and numeric primitives:
  • - `BoxCollider.Create()`
  • - `CyllinderCollider.Create()`
  • - `CapsuleCollider.Create()`
  • - `ConvexCollider.Create()`
  • - `MeshCollider.Create()`
  • - `PolygonCollider.CreateQuad()`
  • - `PolygonCollider.CreateTriangle()`
  • - `SphereCollider.Create()`
  • - `TerrainCollider.Create()`
  • - `ComponentExtensions` members passing Entity (use components or variants passing component data instead):
  • - `ApplyAngularImpulse()`
  • - `ApplyImpulse()`
  • - `ApplyLinearImpulse()`
  • - `GetAngularVelocity()`
  • - `GetCenterOfMass()`
  • - `GetCollisionFilter()`
  • - `GetEffectiveMass()`
  • - `GetLinearVelocity()`
  • - `GetMass()`
  • - `GetPosition()`
  • - `GetRotation()`
  • - `GetVelocities()`
  • - `SetAngularVelocity()`
  • - `SetLinearVelocity()`
  • - `SetVelocities()`
  • - `CustomDataPair`
  • - `ISimulation.ScheduleStepJobs()`
  • - `JacobianFlags.EnableEnableMaxImpulse`
  • - `MaterialFlags.EnableMaxImpulse`
  • - `ModifiableContactHeader.BodyCustomDatas`
  • - `ModifiableJacobianHeader.HasMaxImpulse`
  • - `ModifiableJacobianHeader.MaxImpulse`
  • - `ModifiableContactJacobian.CoefficientOfRestitution`
  • - `ModifiableContactJacobian.FrictionEffectiveMassOffDiag`
  • - `PhysicsCustomData`
  • - `SimplexSolver.c_SimplexSolverEpsilon`
  • - `SimplexSolver.Solve()` without `minDeltaTime` parameter
  • Authoring/Conversion API
  • - Added `PhysicsShapeAuthoring.ForceUnique`.
  • - Added the following conversion systems:
  • - `BeginColliderConversionSystem`
  • - `BuildCompoundCollidersConversionSystem`
  • - `EndColliderConversionSystem`
  • - `PhysicsShapeAuthoring.GetMeshProperties()` now populates a `NativeList` for indices, instead of a `NativeList`.
  • - The following public members have been made protected:
  • - `DisplayCollisionEventsSystem.FinishDisplayCollisionEventsJob`
  • - `DisplayTriggerEventsSystem.FinishDisplayTriggerEventsJob`
  • - Removed the following expired members/types:
  • - `BaseShapeConversionSystem.GetCustomFlags()`
  • - `DisplayCollidersSystem.DrawComponent`
  • - `DisplayCollidersSystem.DrawComponent.DisplayResult`
  • - `DisplayContactsJob`
  • - `DisplayJointsJob`
  • - `FinishDisplayContactsJob`
  • - `PhysicsShapeAuthoring` members:
  • - `SetConvexHull()` passing only a mesh
  • - `GetMesh()` replaced with `GetMeshProperties`
  • - `ConvexRadius` replaced with `BevelRadius`
  • - `GetBoxProperties()` returning `void`
  • - `SetBox()` passing a box center, size and orientation. Pass `BoxGeometry` instead.
  • - `GetCapsuleProperties()` returning `void`
  • - `SetCapsule()` passing a capsule center, height, radius and orientation. Pass `CapsuleGeometry` instead.
  • - `GetCylinderProperties()` returning `void`
  • - `SetCylinder()` passing a cylinder center, height, radius and orientation. Pass `CylinderGeometry` instead.
  • - `GetSphereProperties()` returning `void`
  • - `SetSphere()` passing a sphere center, radius and orientation. Pass `SphereGeometry` instead.
  • - The following components have been removed:
  • - `PhysicsBody` (renamed to `PhysicsBodyAuthoring`)
  • - `PhysicsShape` (renamed to `PhysicsShapeAuthoring`)
  • - `PhysicsStep` (renamed to `PhysicsStepAuthoring`)
  • - `PhysicsDebugDisplay` (renamed to `PhysicsDebugDisplayAuthoring`)
  • Run-Time Behavior
  • - `CompoundCollider.Create()` is now compatible with Burst.
  • - `CompoundCollider.Create()` now correctly shares memory among repeated instances in the list of children.
  • Authoring/Conversion Behavior
  • - If mesh and convex `PhysicsShapeAuthoring` components have not explicitly opted in to `ForceUnique`, they may share the same `PhysicsCollider` data at run-time, if their inputs are the same.
  • - Classic `MeshCollider` instances with the same inputs will always share the same data at run-time when converted in a sub-scene.
  • - Further improved performance of collider conversion for all types.

🔧 Bug Fixes

  • `JointData.Version` was not being incremented with changes to its properties.
  • Fixed the issue of uninitialized array when scheduling collision event jobs with no dynamic bodies in the scene.
  • Fixed the issue of `CollisionEvent.CalculateDetails()` reporting 0 contact points in some cases.
  • Fixed the issue of joints with enabled collisions being solved after contacts for the same body pair.
  • Fixed exception and leak caused by trying to display a convex hull preview for a physics shape with no render mesh assigned.
  • Fixed bug causing incremental changes to a compound collider to accumulate ghost colliders when using Live Link.
  • Fixed an issue where kinematic (i.e. infinite mass dynamic) bodies did not write to the collision event stream correctly.

⚠️ Known Issues

  • Compound collider mass properties are not correctly updated while editing using Live Link.