Skip to content

Releases: needle-mirror/com.unity.physics

1.0.0-pre.65

22 Mar 18:15

Choose a tag to compare

[1.0.0-pre.65] - 2023-03-21

Changed

  • Updated Burst version in use to 1.8.3
  • Debug display systems now only update when the PhysicsDebugDisplayData component is present (e.g., through the PhysicsDebugDisplayAuthoring game object component) and are only created within the editor.

Fixed

  • Physics Debug Display for enabled Collider Edges now draws correctly if the collider scale is modified during runtime
  • Debug display systems no longer stall and instead execute their jobs asynchronously
  • Debug draw of collider faces and AABBs now account for uniform scaling of the rigid body
  • Rigidbody components that move in PlayMode will now correctly snap back to their original position when exiting PlayMode while the containing sub scene is open for editing. As part of the fix, the classic PhysX-based physics simulation is now temporarily and globally disabled while in PlayMode with an open sub scene that contains classic Rigidbody authoring components. The Unity Physics-based physics simulation is unaffected during that time.

1.0.0-pre.44

16 Feb 17:14

Choose a tag to compare

[1.0.0-pre.44] - 2023-02-13

Added

  • legacy icons to the physics authoring components PhysicsShape and PhysicsBody.
  • Help icon now always points to latest version of documentation for physics authoring components
  • Unit tests for Motors
  • Unit tests for some Jacobian methods
  • Internal API to help with connecting bodyB to bodyA for joints/motor configuration

Changed

  • Added functions that allow you to set impulse event threshold on all constraint joints, or only one of them.
  • Replaced PhysicsTransformAspect with TransformAspect
  • Increased testing of position motor in Position Motor demo scene, and re-enabled Position Motor package test.
  • Cleanup and simplification of position motor joint code
  • Use of TransformAspect.WorldPosition, TransformAspect.WorldRotation, TransformAspect.WorldScale when using Transform_V2 instead of TransformAspect.Position, TransformAspect.Rotation, TransformAspect.Scale.
  • BaseShapeBakingSystem and BuildCompoundCollidersBakingSystem have been modified to use IJobEntity instead of Entities.ForEach().

Removed

  • Attributes.cs script has been removed since the com.unity.properties package is part of the editor as a module.
  • the gap left due to the old references being removed on the .asmdef files.

Fixed

  • Fixed bug when an extra ConfigurableJoint constraint was created when baking a motored Configurable Joint
  • Fixed bug where target wasn't calculated correctly when baking a motored Configurable Joint
  • Duplicate component error when switching Smoothing type to anything but None in Physics Body
  • Immediately reset component in PhysicsShapeAuthoring's Reset() function to avoid sequential coupling issues
  • During conversion from Game Object physics joints to Unity Physics joints the joint's spring coefficient is correctly considered.

1.0.0-pre.15

23 Nov 18:16

Choose a tag to compare

[1.0.0-pre.15] - 2022-11-16

Added

  • For all 4 motor types, added a new field for the maximum impulse that can be exerted by the motor constraint
  • GameObjects that use axis-aligned motors are now converted during baking
  • [CreateBefore(typeof(BroadphaseSystem))] for PhysicsSimulationPickerSystem within UnityPhysicsSimulationSystems.cs script file.
  • Functions that allow you to set impulse event threshold on all constraint joints, or only one of them.

Changed

  • The UI for each motor type in the Physics Samples has been simplified to allow for more intuitive configuration
  • When creating the constraints for motors, the ordering has been changed so that the motor is always last.
  • The physics baking systems obey the GameObject static flag, in addition to the StaticOptimizeEntity component.
  • Adding '.AsArray()' method to do explicit cast for the test scenes.
  • API for motor creation have an additional argument for the max impulse of a motor. If this argument is not specified, a default value of infinity will be used.
  • naming path for Unity Physics Authoring components and material components.

Removed

  • Removing dependencies com.unity.jobs package.
  • dependency on com.unity.test-framework.performance package.

Fixed

  • For a linear velocity motor using Unity.Physics, fixed a bug where the target wasn't accurate if body was rotated
  • Linear Velocity Motor target calculation fixed for when bodyA is rotated
  • Fixed bug in Position Motor target error calculation for when bodyA is rotated
  • Fixed bug in Linear Velocity Motor regarding the timestep
  • Fixed bug in Position Motor regarding the timestep
  • motion should be not exported for physics entities that have the Simulate component disabled.
  • Fixed a bug in which scale value was read from LocalTransform array even if the array had zero size.
  • Fixed bug when an extra ConfigurableJoint constraint was created when baking a motored Configurable Joint
  • Fixed bug where target wasn't calculated correctly when baking a motored Configurable Joint
  • It is now possible to enable impulse events feature using Constraint creation methods.
  • When baking a configurable joint into a motor, the Break Force and Break Torque now update the Max Impulse for breakable events

1.0.0-exp.12

26 Oct 17:14

Choose a tag to compare

[1.0.0-exp.12] - 2022-10-19

Added

  • [CreateBefore(typeof(BroadphaseSystem))] for PhysicsSimulationPickerSystem within UnityPhysicsSimulationSystems.cs script file.

1.0.0-exp.8

27 Sep 17:13

Choose a tag to compare

[1.0.0-exp.8] - 2022-09-21

Upgrade guide

  • The physics pipeline has been reworked. - PhysicsSystemGroup is introduced. It is a ComponentSystemGroup that covers all physics jobs. It consists of PhysicsInitializeGroup, PhysicsSimulationGroup, and ExportPhysicsWorld. PhysicsSimulationGroup further consists of PhysicsCreateBodyPairsGroup, PhysicsCreateContactsGroup, PhysicsCreateJacobiansGroup, PhysicsSolveAndIntegrateGroup which run in that order. See documentation for details. - StepPhysicsWorld and EndFramePhysicsSystem systems have been removed, BuildPhysicsWorld has been moved to PhysicsInitializeGroup: - If you had Update(Before|After)StepPhysicsWorld, replace it with: [UpdateInGroup(typeof(PhysicsSystemGroup))][Update(After|Before)(typeof(PhysicsSimulationGroup))]. - If you had Update(Before|After)BuildPhysicsWorld, replace it with: [UpdateBefore(typeof(PhysicsSystemGroup))] or [UpdateInGroup(typeof(PhysicsSystemGroup))][UpdateAfter(typeof(PhysicsInitializeGroup))] - If you had Update(Before|After)ExportPhysicsWorld replace it with: [UpdateInGroup(typeof(PhysicsSystemGroup))][UpdateBefore(typeof(ExportPhysicsWorld))] or [UpdateAfter(typeof(PhysicsSystemGroup))] - If you had [Update(Before|After)EndFramePhysicsSystem] replace it with: [UpdateAfter(typeof(PhysicsSystemGroup))] - If you had combination of those (e.g. [UpdateAfter(typeof(BuildPhysicsWorld))][UpdateBefore(typeof(StepPhysicsWorld))) take a look at the diagram in documentation. - All new systems are unmanaged, which means that they are more efficient, and their OnUpdate() is Burst friendly. You shouldn't call World.GetOrCreateSystem<AnyPhysicsSystem>() as of this release and should be using singletons (see below).
  • Retrieval of PhysicsWorld is achieved differently. Previously, it was necessary to get it directly from BuildPhysicsWorld system. Now, PhysicsWorld is retrieved by calling (SystemAPI|SystemBase|EntityQuery).GetSingleton().PhysicsWorld in case read-only access is required, and by calling (SystemAPI|SystemBase|EntityQuery).GetSingletonRW().PhysicsWorld in case of a read-write access. It is still possible to get the world from BuildPhysicsWorld, but is not recommended, as it can cause race conditions. This is only affecting the PhysicsWorld managed by the engine. Users still can create and manage their own PhysicsWorld. Check out documentation for more information.
  • Retrieval of Simulation is achieved differently. Previously, it was neccessary to get it directly from StepPhysicsWorld system. Now, Simulation is retrieved by calling (SystemAPI|SystemBase|EntityQuery).GetSingleton().AsSimulation() in case read-only access is required, and by calling (SystemAPI|SystemBase|EntityQuery).GetSingletonRW().AsSimulation() in case of read-write access. Check out documentation for more information.
  • The dependencies between physics systems now get sorted automatically as long as GetSingleton<>() approach is used for retrieving PhysicsWorld and Simulation. There is no need to call RegisterPhysicsSystems(ReadOnly|ReadWrite), AddInputDependency() or AddInputDependencyToComplete() and these functions were removed.
  • ITriggerEventsJob, ICollisionEventsJob, IBodyPairsJob, IContactsJob and IJacobiansJob no longer take ISimulation as an argument for Schedule() method, but instead take SimulationSingleton. Use GetSingleton<SimulationSingleton>() for ITriggerEventsJob and ICollisionEventsJob, GetSingletonRW<SimulationSingleton>() for IBodyPairsJob, IContactsJob and IJacobiansJob. All of these jobs can be now scheduled in Burst friendly way.
  • Callbacks between simulation stages have been removed. To get the same functionality, you now need to:
    • Create a system
    • Make it [UpdateInGroup(typeof(PhysicsSimulationGroup))] and make it [UpdateBefore] and [UpdateAfter] one of 4 PhysicsSimulationGroup subgroups.
    • In OnUpdate() of the system, recreate the functionality of a callback by scheduling one of the specialised jobs: IBodyPairsJob, IContactsJob, IJacobiansJob.
    • See documentation for details and examples.
  • Uniform scale is now supported. - Scale component is now taken into account when creating physics bodies. The component doesn't get created by Baking (previously known as Conversion) in the Editor. Scale set in Editor gets baked into the collider geometry. If you want to dynamically scale bodies, add this component to physics body entities. - You might get problems if you were creating RigidBody struct instances directly, since the scale will be initialized to zero. Set it to 1.0f to return to previous behaviour. - ColliderCast and ColliderDistance queries now support uniform scale for colliders that you are querying with. ColliderDistanceInput and ColliderCastInput therefore have a new field that enables you to set it. Same as RigidBody, you might get problems since the scale will be initialized to zero. Set it to 1.0f to return to previous behaviour. - Positive and negative values of scale are supported.
  • Multiple worlds support has been reworked. To support this use case previously, it was necessary to create a physics pipeline on your own, by using helpers such as PhysicsWorldData, PhysicsWorldStepper and PhysicsWorldExporter. Now it is possible to instantiate a CustomPhysicsSystemGroup with a proper world index, which will run the physics simulation on non-default world index bodies. Check out the documentation for more information.

Added

  • Reference to com.unity.render-pipelines.universal version 10.7
  • new shaders in the sammpler that are SRP batcher and universal render pipeline compliant compliant
  • New struct - Unity.Physics.Math.ScaledMTransform: Provides the same utility as Unity.Physics.Math.MTransform but supports uniform scale.
  • Operator which converts a float4 into a Unity.Physics.Plane.
  • PhysicsComponentExtensions.ApplyScale(in this PhysicsMass pm, in Scale scale) - an extension method which scales up the PhysicsMass component.
  • The following extension methods have recieved a version which takes a Scale argument. The old versions are not deprecated, and they assume identity scale. - PhysicsComponentExtensions.GetEffectiveMass(in this PhysicsMass bodyMass, in Translation bodyPosition, in Rotation bodyOrientation, in Scale bodyScale, float3 impulse, float3 point) - PhysicsComponentExtensions.GetCenterOfMassWorldSpace(in this PhysicsMass bodyMass, in Scale bodyScale, in Translation bodyPosition, in Rotation bodyOrientation) - PhysicsComponentExtensions.GetImpulseFromForce(in this PhysicsMass bodyMass, in Scale bodyScale, in float3 force, in ForceMode mode, in float timestep, out float3 impulse, out PhysicsMass impulseMass) - PhysicsComponentExtensions.ApplyExplosionForce(ref this PhysicsVelocity bodyVelocity, in PhysicsMass bodyMass, in PhysicsCollider bodyCollider, in Translation bodyPosition, in Rotation bodyOrientation, in Scale bodyScale, float explosionForce, in float3 explosionPosition, in float explosionRadius, in float timestep, in float3 up, in CollisionFilter explosionFilter, in float upwardsModifier = 0, ForceMode mode = ForceMode.Force) - PhysicsComponentExtensions.ApplyImpulse(ref this PhysicsVelocity pv, in PhysicsMass pm, in Translation t, in Rotation r, in Scale bodyScale, in float3 impulse, in float3 point) - PhysicsComponentExtensions.ApplyLinearImpulse(ref this PhysicsVelocity velocityData, in PhysicsMass massData, in Scale bodyScale, in float3 impulse) - PhysicsComponentExtensions.ApplyAngularImpulse(ref this PhysicsVelocity velocityData, in PhysicsMass massData, in Scale bodyScale, in float3 impulse)
  • bool OverlapAabb(OverlapAabbInput input, ref NativeList<int> allHits) has been added to PhysicsWorld.
  • SimulationSingleton IComponentData is added: - Use AsSimulation() to get the simulation that is stored in it. - Use InitializeFromSimulation(ref Simulation) if you need to create it. >Note - Physics engine internally manages one SimulationSingleton, so be careful if using SetSingleton<>() with the newly created SimulationSingleton, as it can override the one stored by the engine. You should be using this method if you are managing a local simulation and need a singleton to use events and simulation modification API.
  • PhysicsWorldSingleton IComponentData is added. It implements ICollidable and has access to the stored PhysicsWorld and it's utility methods.
  • NativeReference<int> HaveStaticBodiesChanged get property is added to BuildPhysicsWorld.
  • The following system groups are introduced: - PhysicsSystemGroup - covers all physics systems - PhysicsInitializeGroup, PhysicsSimulationGroup - subgroups of PhysicsSystemGroup - PhysicsCreateBodyPairsGroup, PhysicsCreateContactsGroup, PhysicsCreateJacobiansGroup and PhysicsSolveAndIntegrateGroup - subgroups of PhysicsSimulationGroup
  • Impulse events to allow users to break joints
  • Supports the following types of motors: rotational, linear velocity, rotational, angular velocity
  • CustomPhysicsSystemGroup and CustomPhysicsSystemGroupBase for providing mulitple worlds support.
  • CustomPhysicsProxyDriver IComponentData, with it's authoring (CustomPhysicsProxyAuthoring) and a system (SyncCustomPhysicsProxySystem), which enable you to drive an entity from one world by an entity from another, using kinematic velocities.

Changed

  • All materials in the samples to be universal render pipeline ...
Read more

0.51.1-preview.21

02 Aug 16:13

Choose a tag to compare

0.51.1-preview.21 Pre-release
Pre-release

[0.51.1] - 2022-06-27

Changed

  • Package Dependencies
    • com.unity.entities to version 0.51.1
    • com.unity.collections to version 1.4.0

[0.51.0] - 2022-05-04

Changed

  • Package Dependencies
    • com.unity.entities to version 0.51.0
    • com.unity.jobs to version 0.51.0
    • com.unity.mathematics to version 1.2.6
    • com.unity.collections to version 1.3.0

Fixed

  • PhysicsShapeAuthoring.SetCylinder() now takes into account provided geometry's side count.

0.51.0-preview.32

15 Jun 18:12

Choose a tag to compare

0.51.0-preview.32 Pre-release
Pre-release

[0.51.0] - 2022-05-04

Changed

  • Package Dependencies
    • com.unity.entities to version 0.51.0
    • com.unity.jobs to version 0.51.0
    • com.unity.mathematics to version 1.2.6
    • com.unity.collections to version 1.3.0

Fixed

  • PhysicsShapeAuthoring.SetCylinder() now takes into account provided geometry's side count.

[0.50.0] - 2021-09-17

Changed

  • Upgraded com.unity.burst to 1.5.5
  • Adjusted code to remove obsolete APIs across all jobs inheriting IJobEntityBatch
  • Resources/ (used by Debug Draw) has been renamed DebugDisplayResources/ and now loads assets differently

Removed

  • All usages of PhysicsExclude from Demo and Runtime code.

Fixed

  • An issue with the rendering pipeline used for the package samples, which caused none of the samples to render post conversion
  • An issue with the materials present in the samples as their colors were no longer correct

0.50.0-preview.43

26 Apr 13:11

Choose a tag to compare

0.50.0-preview.43 Pre-release
Pre-release

[0.50.0] - 2021-09-17

Changed

  • Upgraded com.unity.burst to 1.5.5
  • Adjusted code to remove obsolete APIs across all jobs inheriting IJobEntityBatch
  • Resources/ (used by Debug Draw) has been renamed DebugDisplayResources/ and now loads assets differently

Removed

  • All usages of PhysicsExclude from Demo and Runtime code.

Fixed

  • An issue with the rendering pipeline used for the package samples, which caused none of the samples to render post conversion
  • An issue with the materials present in the samples as their colors were no longer correct

0.50.0-preview.24

16 Mar 11:12

Choose a tag to compare

0.50.0-preview.24 Pre-release
Pre-release

[0.50.0] - 2021-09-17

Changed

  • Upgraded com.unity.burst to 1.5.5
  • Adjusted code to remove obsolete APIs across all jobs inheriting IJobEntityBatch

Removed

  • All usages of PhysicsExclude from Demo and Runtime code.

[0.10.0-preview.1] - 9999-12-31

Upgrade guide

  • Added PhysicsWorldIndex shared component, which is required on every Entity that should be involved in physics simulation (body or joint). Its Value denotes the index of physics world that the Entity belongs to (0 for default PhysicsWorld processed by BuildPhysicsWorld, StepPhysicsWorld and ExportPhysicsWorld systems). Note that Entities for different physics worlds will be stored in separate chunks, due to different values of shared component.
  • PhysicsExclude component is obsolete, but will still work at least until 2021-10-01. Instead of adding PhysicsExclude when you want to exclude an Entity from physics simulation, you can achieve the same thing by removing the required PhysicsWorldIndex shared component.
  • HaveStaticBodiesChanged was added to SimulationStepInput. It's a NativeArray of size 1, used for optimization of static body synchronization.

Changes

  • Dependencies
  • Run-Time API
    • Added BlobAssetReferenceColliderExtension functions for ease of use and to help avoid unsafe code
      • Added reinterpret_cast-like logic via BlobAssetReference<Collider>.As<To> where To is the destination collider struct type. The extension will return a reference to the desired type.
      • Added reinterpret_cast-like logic via BlobAssetReference<Collider>.AsPtr<To> where To is the destination collider struct type. The extension will return a pointer to the desired type.
      • Added an easy conversion helper to PhysicsCollider via BlobAssetReference<Collider>.AsComponent()
      • Added ColliderCastInput and ColliderDistanceInput constructors that do not require unsafe code, along with SetCollider function to change a collider after creation of the input struct.
    • PhysicsWorldData is a new structure encapsulating PhysicsWorld and other data and queries that are necessary for simulating a physics world.
    • PhysicsWorldBuilder and PhysicsWorldExporter are new utility classes providing methods for building a PhysicsWorld and exporting its data to ECS components, with options to tweak queries that fetch Entities for the physics world.
    • PhysicsWorldStepper is a new helper class for scheduling physics simulation jobs. Its SimulationCreator delegate and methods that need to instantiate an ISimulation require physics world index to be passed in.
    • BuildPhysicsWorld was refactored to keep the data in PhysicsWorldData and use PhysicsWorldBuilder. WorldFilter field holds its physics world index (0).
    • StepPhysicsWorld was refactored to use PhysicsWorldStepper.
    • ExportPhysicsWorld was refactored to use PhysicsWorldExporter, which knows how to copy CollisionWorld and export data to Entities fetched by its queries.
    • Optimized Collider.Clone() to no longer create an extra copy of the Collider memory during the clone process.
  • Authoring/Conversion API
    • Physics Body authoring component has a new field WorldIndex in Advanced section, with default value of 0 (meaning that it belongs to the default PhysicsWorld). Objects that don't have Physics Body authoring component on them or on any parent in the hierarchy will also get the default value. CustomTags field was moved to the Advanced section.
    • PhysicsRuntimeExtensions has new template methods RegisterPhysicsRuntimeSystem* which can be used in system's OnStartRunning() method for automatic dependency management for non-default physics runtime data. They are analoguous to the existing non-templated counterparts, just require a separate ComponentData type for each non-default physics world.
  • Run-Time Behavior
    • Added support for multiple PhysicsWorlds, where each body in each world is represented by a separate Entity. Each entity must have all components that are needed for physics simulation in its world.
    • Non-default physics worlds require custom systems that will processs (build, simulate and export) them, from Entities that are marked with appropriate PhysicsWorldIndex shared component. Storage of PhysicsWorld is also controlled by the user. A number of utilities was added to make this easier.
  • Authoring/Conversion Behavior

Fixes

  • Fixed a bug in Graphical Interpolation where LocalToWorld was not updated if rendering and physics were exactly in sync.
  • Fixed the spring constant calculation during joint conversion
  • Fixed the configurable joint linear limit during joint conversion
  • Physics Debug Display: Draw Collider Edges performance improved
  • Physics Debug Display: Draw Collider Edges for sphere colliders improved

[0.9.0-preview.4] - 2021-05-19

Upgrade guide

  • An extra check was added to verify that the data provided to the 'Start/End' properties of 'RayCastInput/ColliderCastInput' does not generate a cast length that is not too long. The maximum length allowed is half of 'float.MaxValue'
  • Integrity checks can be now be enabled and disabled by toggling the new "DOTS/Physics/Enable Integrity Checks" menu item. Integrity checks should be enabled when checking simulation quality and behaviour. Integrity checks should be disabled when measuring performance. When enabled, Integrity checks will be included in a in Development build of a standalone executable, but are always excluded in release builds.
  • An extra check was added to verify that the data provided to the Start & End properties of RayCastInput & ColliderCastInput does not generate a cast length that is too long. The maximum length allowed is half of float.MaxValue

Changes

  • Dependencies
    • Updated Burst to 1.5.3
    • Updated Collections to 0.17.0-preview.18
    • Updated Entities to 0.19.0-preview.30
    • Updated Jobs to 0.10.0-preview.18
    • Updated Test Framework to 1.1.24
  • Added partial keyword to all SystemBase-derived classes

Fixes

  • Fixed the condition for empty physics world, to return from BuildPhysicsWorld.OnUpdate() before calling PhysicsWorld.Reset().
  • Fixed a bug in DebugDisplay.Managed.Instance.Render() where only half of Debug Display lines were rendered for a MeshTopology.Lines type
  • Fixed a bug in CalculateAabb method for cylinder collider that was increasing the AABB height axis by radius
  • Integrity checks can now be toggled via an Editor menu item, and can be run in Development builds.
  • Fixed a bug where PhysicsDebugDisplay lines would disappear if editor was paused in PlayMode

Known Issues

[0.8.0-preview.1] - 2021-03-26

Upgrade guide

Changes

  • Dependencies

    • Updated Collections from 0.16.0-preview.22 to 0.17.0-preview.10
    • Updated Entities from 0.18.0-preview.42 to 0.19.0-preview.17
    • Updated Jobs from 0.9.0-preview.24 to 0.10.0-preview.10
  • Run-Time API

    • Made CollisionEvent and TriggerEvent implement a common ISimulationEvent interface allowing them to be equatable and comparable.
    • Made ColliderKey comparable.
    • Exposed a MotionVelocity.IsKinematic property.
    • Exposed a PhysicsMass.IsKinematic property.
    • Added a PhysicsMassOverride.SetVelocityToZero field. If PhysicsMassOverride.IsKinematic, is a non-zero value, then a body's mass and inertia are made infinite, though it's motion will still be integrated. If PhysicsMassOverride.SetVelocityToZero is also a non-zero value, the kinematic body will ignore the values in the associated PhysicsVelocity component and no longer move.
  • Run-Time Behavior

    • If a body has infinite mass and/or inertia, then linear and/or angular damping will no longer be applied respectively.

Fixes

  • Fixed a bug in ExportPhysicsWorld.CheckColliderFilterIntegrity() method that was giving false integrity errors due to the fact that it had incorrectly handled compound colliders, if they (or their children) had a GroupIndex on the Filter that is not 0.
  • Added an extra change check on the Parent component type to CheckStaticBodyChangesJob in the BuildPhysicsWorld system.

Known Issues

[0.7.0-preview.3] - 2021-02-24

Upgrade guide

  • RegisterPhysicsRuntimeSystemReadOnly() and RegisterPhysicsRuntimeSystemReadWrite() (both registered as extensions of SystemBase) should be used to manage physics data dependencies instead of the old AddInputDependency() and GetOutputDependency() approach. Users should declare their UpdateBefore and UpdateAfter systems as before and additionally only call one of the two new functions in their system's OnStartRunning(), which will be enough to get an automatic update of the Dependency property without the need for manually combining the dependencies as before. Note that things have not changed if you want to read or write physics runtime data directly in your system's OnUpdate() - in that case, you still need to ensure that jobs from previous systems touching physics runtime data are complete, by completing the Dependency. Also note that BuildPhysicsWorld.AddInputDependencyToComplete() still remains needed for jobs that need to finish before any changes are made to the PhysicsWorld, if your system is not scheduled in between other 2 physics systems that will do that for you.

  • The Constraint.DefaultSpringFrequency and Constraint.DefaultSpringDamping values have been changed. The original defaults were setup to match the default fixedDeltaTime and therefore assumed a 50hz simulation timestep. The current default simulation step is now 60hz and so the default spring parameters have been changed to match this assumption. This change may affect more complex Joint setups that are close to being overconstrained, but generally it should not break the original intent of the setup.

Changes

  • Dependenci...
Read more

0.6.0-preview.3

22 Jan 17:16

Choose a tag to compare

0.6.0-preview.3 Pre-release
Pre-release

[0.6.0-preview.3] - 2021-01-18

Upgrade guide

  • PhysicsStep.ThreadCountHint has now been removed, so if you had it set to a value less or equal to 0 (meaning you wanted single threaded simulation with small number of jobs), you now need to set the new field PhysicsStep.MultiThreaded to false. Otherwise, it will be set to true, meaning you'll get a default multi threaded simulation as if PhysicsStep.ThreadCountHint is a positive number.

Changes

  • Dependencies

    • Updated minimum Unity Editor version from 2020.1.0f1 to 2020.1.9f1
    • Updated Burst from 1.3.7 to 1.4.1
    • Updated Collections from 0.14.0-preview.16 to 0.15.0-preview.21
    • Updated Entities from 0.16.0-preview.21 to 0.17.0-preview.41
    • Updated Jobs from 0.7.0-preview.17 to 0.8.0-preview.23
  • Run-Time API

    • Added a Collider.Clone() function.
    • Added Material to IQueryResult interface and its implementations (RaycastHit, ColliderCastHit, DistanceHit). All hits now have material information of the primitive that was hit.
    • Added the following interfaces to ICollidable and all its implementations:
      • These API's represent the equivalent of the familiar GameObjects' query interface, with the addition of Custom version, which takes a collector and enables one to use custom filtering logic when accepting query hits.
      • bool CheckSphere(float3 position, float radius, CollisionFilter filter, QueryInteraction interaction)
      • bool OverlapSphere(float3 position, float radius, ref NativeList<DistanceHit> outHits, CollisionFilter filter, QueryInteraction interaction)
      • bool OverlapSphereCustom<T>(float3 position, float radius, ref T collector, CollisionFilter filter, QueryInteraction interaction) where T : struct, ICollector<DistanceHit>
      • bool CheckCapsule(float3 point1, float3 point2, float radius, CollisionFilter filter, QueryInteraction queryInteraction)
      • bool OverlapCapsule(float3 point1, float3 point2, float radius, ref NativeList<DistanceHit> outHits, CollisionFilter filter, QueryInteraction queryInteraction)
      • bool OverlapCapsuleCustom<T>(float3 point1, float3 point2, float radius, ref T collector, CollisionFilter filter, QueryInteraction queryInteraction) where T : struct, ICollector<DistanceHit>
      • bool CheckBox(float3 center, quaternion orientation, float3 halfExtents, CollisionFilter filter, QueryInteraction queryInteraction)
      • bool OverlapBox(float3 center, quaternion orientation, float3 halfExtents, ref NativeList<DistanceHit> outHits, CollisionFilter filter, QueryInteraction queryInteraction)
      • bool OverlapBoxCustom<T>(float3 center, quaternion orientation, float3 halfExtents, ref T collector, CollisionFilter filter, QueryInteraction queryInteraction where T : struct, ICollector<DistanceHit>
      • bool SphereCast(float3 origin, float radius, float3 direction, float maxDistance, CollisionFilter filter, QueryInteraction queryInteraction)
      • bool SphereCast(float3 origin, float radius, float3 direction, float maxDistance, out ColliderCastHit hitInfo, CollisionFilter filter, QueryInteraction queryInteraction)
      • bool SphereCastAll(float3 origin, float radius, float3 direction, float maxDistance, ref NativeList<ColliderCastHit> outHits, CollisionFilter filter, QueryInteraction queryInteraction)
      • bool SphereCastCustom<T>(float3 origin, float radius, float3 direction, float maxDistance, ref T collector, CollisionFilter filter, QueryInteraction queryInteraction) where T : struct, ICollector<ColliderCastHit>
      • bool BoxCast(float3 center, quaternion orientation, float3 halfExtents, float3 direction, float maxDistance, CollisionFilter filter, QueryInteraction queryInteraction)
      • bool BoxCast(float3 center, quaternion orientation, float3 halfExtents, float3 direction, float maxDistance, out ColliderCastHit hitInfo, CollisionFilter filter, QueryInteraction queryInteraction)
      • bool BoxCastAll(float3 center, quaternion orientation, float3 halfExtents, float3 direction, float maxDistance, ref NativeList<ColliderCastHit> outHits, CollisionFilter filter, QueryInteraction queryInteraction)
      • bool BoxCastCustom<T>(float3 center, quaternion orientation, float3 halfExtents, float3 direction, float maxDistance, ref T collector, CollisionFilter filter, QueryInteraction queryInteraction) where T : struct, ICollector<ColliderCastHit>
      • bool CapsuleCast(float3 point1, float3 point2, float radius, float3 direction, float maxDistance, CollisionFilter filter, QueryInteraction queryInteraction)
      • bool CapsuleCast(float3 point1, float3 point2, float radius, float3 direction, float maxDistance, out ColliderCastHit hitInfo, CollisionFilter filter, QueryInteraction queryInteraction)
      • bool CapsuleCastAll(float3 point1, float3 point2, float radius, float3 direction, float maxDistance, ref NativeList<ColliderCastHit> outHits, CollisionFilter filter, QueryInteraction queryInteraction)
      • bool CapsuleCastCustom<T>(float3 point1, float3 point2, float radius, float3 direction, float maxDistance, ref T collector, CollisionFilter filter, QueryInteraction queryInteraction) where T : struct, ICollector<ColliderCastHit>
    • Exposed the following collider initialization functions:
      • SphereCollider.Initialize(SphereGeometry geometry, CollisionFilter filter, Material material)
      • CapsuleCollider.Initialize(CapsuleGeometry geometry, CollisionFilter filter, Material material)
      • BoxCollider.Initialize(BoxGeometry geometry, CollisionFilter filter, Material material)
      • CylinderCollider.Initialize(CylinderGeometry geometry, CollisionFilter filter, Material material)
      • These functions enable the creation of colliders on stack, as opposed to only creating them using BlobAssetReference<Collider>.Create() methods.
    • Replaced all instances of IJobChunk with IJobEntityBatch or IJobEntityBatchWithIndex for better performance.
    • CollisionWorld and DynamicsWorld now store index maps linking Entity with RigidBody and Joint indices.
      • Use PhysicsWorld.GetRigidBodyIndex(Entity) to get a RigidBody index for the Bodies array. This replaces the variant from PhysicsWorldExtensions.
      • Use PhysicsWorld.GetJointIndex(Entity) to get a Joint index for the Joints array
      • If map is invalid or Entity is not in map then an index of -1 is returned.
      • BuildPhysicsWorld system updates the maps on update. If updating the world manually then call PhysicsWorld.UpdateIndexMaps() to refresh.
    • Removed PhysicsStep.ThreadCountHint since the value is now retrieved from JobsUtility.JobWorkerCount.
    • Added PhysicsStep.SingleThreaded to request the simulation with a very small number of single threaded jobs (previously PhysicsStep.ThreadCountHint <= 0).
    • Added MeshCollider.Filter and CompoundCollider.Filter setters that set the collision filter on all triangles of the mesh and children of the compound. Furthermore, added the CompoundCollider.RefreshCollisionFilter() to be called when a child filter changes, so that the root level of the compound collider can be updated.
    • Collider now has a Filter setter regardless of the type of the collider.
    • Collider now has a RespondsToCollision getter that shows if it will participate in collision, or only move and intercept queries.
  • Authoring/Conversion API

  • Run-Time Behavior

    • ExportPhysicsWorld system should now only get updated when there is at least one entity satisfying BuildPhysicsWorld.DynamicEntityGroup entity query.
  • Authoring/Conversion Behavior

Fixes

  • Fixed the issue of BuildPhysicsWorld system not being run when there are not entities in the scene, leading to StepPhysicsWorld system operating on stale data.
  • Fixed write-back in ContactJacobian.SolveContact() to only affect linear and angular velocity. This prevents JacobianHeader's mass factors from affecting MotionVelocity's mass factors, which used to have multiplicative effect on those mass factors over time.
  • Fixed the issue where ExportPhysicsWorld system would not get run if there wasn't at least one entity that has PhysicsCollider component.
  • Fixed a crash on Android 32 with Bursted calls to create a Hash128.
  • Fixed a bug that was causing AABB of the compound collider to be incorrectly calculated if one of the child colliders were a TerrainCollider.

Known Issues