All notable changes to this project will be documented in this file.
- Changed the Joints - Parade demo such that the BreakJoint1 MaxImpulse was changed from (10,10,10) to (2,2,2).
- Added demo scene
Modify Collider Geometry.unitydemonstrating runtime collider deformations. In the demo, the geometry of various types of colliders are modified via the newColliderBakeTransformAuthoringcomponent, which lets you create cyclic animations during which a game object's collider and its visuals are deformed over time. This is achieved through use of theCollider.BakeTransformfunction, which applies an affine transformation to a collider, correspondingly rotating, translating, scaling and shearing its geometry in the process. - Added support for spring and damping for motors in the custom authoring components. In the motor demos, these fields are used now.
- Demo scenes with motors now have examples of how to author using built-in components or custom components
- Modify Runtime - Collision Filter demo: fixed a bug where the render mesh of the cubes was being incorrectly changed to a sphere.
- Fixed a memory leak in the ColliderBakeTransformSystem caused by the subscene being disposed before the OnDestroy could properly dispose a collider blob
- Reorganized the samples, with cleanup of various samples' code and scenes.
- Added demo scene
Modify Collider Geometry.unitydemonstrating runtime collider deformations. In the demo, the geometry of various types of colliders are modified via the newColliderBakeTransformAuthoringcomponent, which lets you create cyclic animations during which a game object's collider and its visuals are deformed over time. This is achieved through use of theCollider.BakeTransformfunction, which applies an affine transformation to a collider, correspondingly rotating, translating, scaling and shearing its geometry in the process. - Added support for spring and damping for motors in the custom authoring components. In the motor demos, these fields are used now.
- Added demo scene
4e. Single Ragdollwith a GameObject ragdoll created using the built-in physics Ragdoll Wizard and simulated using Unity Physics for DOTS on one side and the built-in GameObject physics on the other. - Added demo scene
5m. Collider Modificationsto show how to create mesh colliders during runtime - Added new API for BlobAssetReference MeshCollider.Create(UnityEngine.Mesh, CollisionFilter, Material) in
Physics_MeshCollider.cs - Added new API for BlobAssetReference MeshCollider.Create(UnityEngine.Mesh.MeshData, CollisionFilter, Material) in
Physics_MeshCollider.cs - Added new API for BlobAssetReference MeshCollider.Create(UnityEngine.Mesh.MeshDataArray, CollisionFilter, Material) in
Physics_MeshCollider.cs - Renamed the
4d. Ragdollscene to4d. Ragdollsfor clarity. - The
Mouse Hover Authoringcomponent was improved and now works also when hovering over physics entities whose rendering components are located in a child entity. Consequently, the previously disabledMouse Hover Authoringcomponent has now been enabled in the4d. Ragdollsscene. - Added new physics component: Force Unique Collider Authoring to allow built-in colliders to be made unique during baking
- Updated the
5b. Change Box Collider Sizescene to use the new Physics Force Unique Collider component - The
5. Modifysection now has a new section called5g. Runtime Collider Modifications. - A new demo has been added:
5g1. Change Collider Material - Bouncy Boxes. This demo instantiates prefabs containing unique colliders and modifies collider blob data during runtime - The previously named
5g. Change Collider Filterdemo has been renamed to5g2. Unique Collider Blob Sharing. The focus of this demo is how collider data is shared, rather than how theCollisionFilteris modified. - The
5g2. Unique Collider Blob Sharingdemo uses the newMakeUniquemethod inSpawnExplosionAuthoring.cs. The manual management of new colliders is no longer necessary. - Moved the
5m. Collider Modificationdemo to the5g. Runtime Collider Modificationssection and renamed it to5g3. Runtime Collider Creation - Extended the
Motion Properties - Massdemo with an additional seesaw created using built-in physics authoring components (in grey) alongside the already existing seesaw that uses custom physics authoring components (in yellow). - A new demo has been added:
5g4. Runtime Collision Filter Modification. This demo shows how to modify a CollisionFilter during runtime.
- Improved system start-up efficiency by not initializing systems that aren't required in the following files:
Tests/Animation/Scripts/AnimationPhysicsSystem.csTests/MultipleWorlds/ClientServer/Scripts/ServerPhysicsSystem.csTests/MultipleWorlds/CustomPhysicsGroup/MultiWorldMousePicker.csTests/MultipleWorlds/CustomPhysicsGroup/UserWorldCreator.cs
Tests/SamplesTest/CreatePhysicsPerformanceTests.unity: Fixed an index out of range bug in the OnUpdate method of the system- Fixed bug in demo scene 5c. Change Collider Type where the collider type wasn't being updated'
- Fixed bug in
QueryTester.cs, which is used in demos 3a. All Hits Distance Test / 3b. Cast Test / 3c. Closest Hit Distance Test, where debug draw lines were not drawing the results of the queries. Any system using drawing features of the PhysicsDebugDisplaySystem must update this system within the PhysicsDebugDisplayGroup.
- Added automatic import of Custom Physics Authoring experience:
The custom physics authoring experience, built around thePhysicsBodyAuthoringandPhysicsShapeAuthoringcomponents, is no longer embedded in the Unity Physics package API. Instead it is provided as a Unity Physics package sample called Custom Physics Authoring. This sample is now automatically imported into the PhysicsSamples project underAssets/Samples/Unity Physics/<package version>/Custom Physics Authoring. If you want to update the Unity Physics package in the PhysicsSamples project make sure to import the new version of this sample using the Package Manager under the Samples tab after the update and then delete the previous version of this sample from the project.
- Added demo scenes for new motor joints under
Assets/Demos/4. Joints/4c. Motors. - Added
SimulationValidationAuthoringcomponent for physics behavior validation testing, which can be used to confirm that joints behave as expected and that rigid bodies are at rest if desired. - Added simulation validation to the following PlayMode tests in the
Assetsfolder:Tests/Stacking/BasicStacks.unityTests/JointTest/LimitedHinge/LimitedHingeSub.unityTests/JointTest/Prismatic.unityTests/JointTest/Hinge.unityDemos/4. Joints/4a. Joints Parade/4a. Joints Parade SubScene.unityDemos/4. Joints/4c. Motors/4c3. Linear Velocity Motor.unityDemos/4. Joints/4c. Motors/4c4. Angular Velocity Motor.unity
- Changed base class of systems from SystemBase to ISystem
Demos/5. Modify/5f. Change Surface Velocity.unityfixed a dependency in the DisplayConveyorBeltJob
- Packages:
- Updated com.unity.physics from
0.50.0-preview.24to0.51.0-preview.32 - Updated com.havok.physics from
0.50.0-preview.24to0.51.0-preview.32 - Updated com.unity.collections from
1.2.3-pre.24to1.3.1 - Updated com.unity.entities from
0.50.0-preview.24to0.51.0-preview.32 - Updated com.unity.jobs from
0.50.0-preview.8to0.51.0-preview.32 - Updated com.unity.rendering.hybrid from
0.50.0-preview.24to0.51.0-preview.32 - Updated com.unity.render-pipelines.universal from
10.8.1to12.1.7
- Updated com.unity.physics from
- Editor:
- Updated Editor version from
2020.3.30f1to2021.3.4f1
- Updated Editor version from
- Documentation:
- Updated Documentation folder has been renamed to READMEimages and Samples.md has been renamed to README.md.
- Shader PhysicsStatic material has been disabled due to some rendering errors with
2021.3.4f1a new material substitutes the shader while the errors gets fixed. - Updated NativeHashMap to NativeParallelHashMap.
- Project:
- Updated project name from UnityPhysicsSamples to PhysicsSamples.
- add urp to the project.
- upgrade shaders so they are urp compatible.
- cleanup Shaders/PhysicsStaticInputs.hlsl and Shaders/PhysicsStatic.shader + add materials.
- Packages:
- Updated com.unity.physics to
0.50.0-preview.24 - Updated com.havok.physics to
0.50.0-preview.24 - Updated com.unity.collections to
1.2.3-pre.24 - Updated com.unity.entities to
0.50.0-preview.24 - Updated com.unity.jobs to
0.50.0-preview.8 - Updated com.unity.rendering.hybrid to
0.50.0-preview.24 - Updated com.unity.render-pipelines.universal to
10.8.1
- Updated com.unity.physics to
- fixed materials for all demos
- fixed up ragdoll parts scale based on collider mesh bounds
- fixed material colors
- Added
ImmediatePhysicsWorldStepperutility class for running physics simulation immediately on the current thread. - Changed
ProjectIntoFutureOnCueSystemin Pool demo to useImmediatePhysicsWorldStepper. - Added Assets/Tests/MultipleWorlds/Animation/Animation scene that shows how you can use a separate
PhysicsWorldto simulate a small number of non-critical bodies for animation purposes (character's ponytail and scabbard).DriveAnimationBodySystemsyncs critical bodies between default and side physics world (character's head and torso) and prepares the data for non-critical bodies (position and velocity correction for ponytail and scabbard).AnimationPhysicsSystemperforms single-threadedPhysicsWorldbuilding, simulation and export to ECS components. The demo shows 2 variants of physically animated ponytail: with position and velocity corrections (green) and without them (blue). - Added Assets/Tests/MultipleWorlds/ClientServer/ClientServer scene as a simplified client-server sample, with game-critical ghost bodies (exist on both server and client) and client-only bodies that are simulated only locally to add to game's visual appeal.
Bodies in server physics world are simulated first (would be predicted based on server data in real use-cases) and then mirrored into the default physics world. Default physics world contains ghost and client-only bodies, where ghost bodies are driven by their server counterparts (game objects are linked via Server Entity setting in Drive Ghost Body Authoring script).
DriveGhostBodySystemdrives ghost bodies by position or velocity, the ratio (position vs velocity) is determined by First Order Gain setting in Drive Ghost Body Authoring script on the client ghost body game object.ServerPhysicsSystemis the key system that builds, simulates and exports server physics world. The demo shows different kinematic bars (client-only, dynamic and kinematic ghost) rotating and pushing various speheres around (client-only, dynamic and kinematic ghosts driven by position, velocity and both equally).
- Dependencies
- Updated Data Flow Graph to
0.21.0-preview.1 - Updated IDE Visual Studio to
2.0.7 - Updated Hybrid Renderer
0.13.0-preview.30
- Updated Data Flow Graph to
-
Dependencies
- Updated DOTS Editor from
0.13.0-previewto0.14.0-preview.1 - Updated Hybrid Renderer from
0.12.0-preview.42to0.13.0-preview.17 - Updated Burst from
1.4.4to1.5.0
- Updated DOTS Editor from
-
Refactored the
CollisionEventandTriggerEventdemos to make the Stateful events clearer.- To add stateful events to your own project copy all scripts from the Stateful folder.
- Then, if you want to have collision events:
- Use the 'Collide Raise Collision Events' option of the 'Collision Response' property of a
PhysicsShapeAuthoringcomponent, and - Add a
StatefulCollisionEventBufferAuthoringcomponent to that entity (and select if details should be calculated or not) - At runtime, read from the dynamic buffer of
StatefulCollisionEvents
- Use the 'Collide Raise Collision Events' option of the 'Collision Response' property of a
- Alternatively, if you want to have trigger events:
- Use the 'Raise Trigger Events' option of the 'Collision Response' property of a
PhysicsShapeAuthoringcomponent, and - Add a
StatefulTriggerEventBufferAuthoringcomponent to that entity - At runtime, read from the dynamic buffer of
StatefulTriggerEvents
- Use the 'Raise Trigger Events' option of the 'Collision Response' property of a
-
Dependencies
- Updated Data Flow Graph from
0.18.0-preview.3to0.20.0-preview.4 - Updated DOTS Editor from
0.12.0-preview.4to0.13.0-preview - Updated Hybrid Renderer from
0.10.0-preview.21to0.12.0-preview.42 - Updated Coding from
0.1.0-preview.17to0.1.0-preview.20
- Updated Data Flow Graph from
-
Added a new
MouseHoverAuthoringscript to help highlight the extraCompoundCollider.Child.Entityfield andPhysicsRenderEntitycomponent data. Check out the simple1b. Representationsand more complex2a2. Collider Parade - Advanceddemos scene for example of setup variations. -
Added
Tests/VelocityClipping/VelocityClippingStackingdemo to showcase a simple replacement for the removedSimulationCallbacks.Phase.PostSolveJacobians. This demo does a really simple velocity clipping and the point is not to showcase stacking (which is covered withTests/Stackingdemos) but instead to show how to achieve the effect similar to previous callback without using the callback itself. -
Added
Tests/SystemScheduling/SchedulingSamplewhich shows how jobs that interact with physics runtime data (stored in PhysicsWorld) should be scheduled.
- Fixed a bug where duplicate joint Entities were created when multiple joint components are added to the same game object.
- Dependencies
- Updated Data Flow Graph from
0.18.0-preview.3to0.19.0-preview.5 - Updated DOTS Editor from
0.9.0-preview.1to0.12.0-preview.4 - Updated Hybrid Renderer from
0.10.0-preview.21to0.11.0-preview.40
- Updated Data Flow Graph from
- Added
5g. Change Collider Filtersample showing explosion use case and the importance of collision filters in that case. Setting the force to 0 inSpawnExplosionAuthoringcauses a performance spike because when the filters get set to default, a lot of bodies are pentetrating each other.
- Dependencies
- Updated Hybrid Renderer from
0.7.0-preview.24to0.10.0-preview.21 - Updated Data Flow Graph from
0.16.0-preview.3to0.18.0-preview.1
- Updated Hybrid Renderer from
- All demos now have a target frame rate of 60HZ.
- Moved
LimitDOFjoint into core Unity Physics package
- Fixed issue with the
FreeHingeJoint.Createauthoring script not setting theBodyFrame.PerpendicularAxis
RaycastCardemo has issues that sometimes produce NaN values.
- Added simple
1b. Respresentationssample highlighting graphical and physical representations of the world. - Added simple
1c. Conversionsample, along with worked examples moving from GameObjects (Data & Logic) to DOTS.- New
1c1. GameObjects GravityWellsample - showing Data conversion working but not Logic conversion. - New
1c2. Covertible GravityWellsample - showing Data & Logic conversion. - New
1c3. DOTS GravityWellsample - showing same scene without GameObject conversion.
- New
- Updated
2a2. Collider Parade - Advancedsample with extra setup samples involving multiple graphics mesh and/or multiple physics shapes. - Updated
4. Joints\Ragdolldemo to use new ragdoll joint interface and allow modification of joint limits. - Added
5d. Change Velocitydemo showing a local velocity change. - Added
5f. Change Surface Velocitysample highlighting a conveyor belt use case with no moving parts.
- Updated the following packages:
- Added Data Flow Graph
0.14.0-preview.2 - Added DOTS Editor
0.7.0-preview.1 - Hybrid Renderer from
0.4.0-preview.8to0.5.1-preview.18
- Added Data Flow Graph
- The
PrismaticJointexample no longer includesMinDistanceFromAxisorMaxDistanceFromAxisparameters. - The
RagdollJointexample now takes perpendicular limits in the range of (-90, 90) rather than (0, 180). - Added
5d. Kinematic Motionto illustrate different ways of moving kinematic bodies. - Improved usability of trigger events and collision events:
- Events (StatefulTriggerEvent and StatefulCollisionEvent) have states indicating overlap or colliding state of two bodies:
- Enter - the bodies didn't overlap or collide in the previous frame, and they do in the current frame
- Stay - the bodies did overlap or collide in the previous frame, and they do in the current frame
- Exit - the bodies did overlap or collide in the previous frame, and they do not in the current frame
- Events (StatefulTriggerEvent and StatefulCollisionEvent) are stored in DynamicBuffers of entities that raise them
- Reworked following demos to demonstrate new trigger event approach:
2d1a. Triggers - Change Material2d1b. Triggers - Portals2d1c. Triggers - Force Field
2d2a. Collision Events - Event Statesadded to demonstrate new collision event approach.
- Events (StatefulTriggerEvent and StatefulCollisionEvent) have states indicating overlap or colliding state of two bodies:
- Exposed trigger events and collision events of CharacterController
- CharacterController body is now using a
CollisionResponse.Nonecollision response on its body to avoid reporting duplicated collision/trigger events coming from the physics engine. Demos/2. Setup/2b. Motion Properties/2b1. Motion Properties - Mass,Tests/Pyramidsand a group of demos underTests/Stackingnow showcase new solver stabilization features/strengths and weaknesses/trade-offs.
- Updated the following packages:
- Removed DOTS Editor
- Hybrid Renderer from
0.3.4-preview.24to0.4.0-preview.8 - Input System from
1.0.0-preview.5to1.0.0-preview.6
- Fixed character controller tunnelling issue.
- Made standalone player quit (with exit code 1) if an exception is caught in BasePhysicsDemo or derived classes.
- Fixed a potential character controller tunnelling issue.
- Removed the Lightweight RP package.
- Joint samples now correctly add new joint entity to prefab's linked entity group so they will be instantiated along with the rest of a prefab.
- Renamed
StiffSpringJointtoLimitedDistanceJointto reflect changes in API. - Updated the following packages
- Input System from
0.9.6-previewto1.0.0-preview.5 - Lightweight RP from
7.1.6to7.1.7 - DOTS Editor from
0.2.0-previewto0.3.0-preview - Hybrid Renderer from
0.3.3-preview.11to0.3.4-preview.24
- Input System from
- Character controller improvements
CharacterControllerUtilities.CheckSupport()now uses a collider cast- Character now doesn't collide with triggers, but raises trigger events instead
- Fixed the support check issue with slopes equal to MaxSlope
- Fixed the returned support state when there are no supporting planes
- Added
CharacterControllerAuthoring.MaxMovementSpeedto avoid large velocities coming from penetration recovery. - Improved the behavior of character controller walking on multiple objects or mesh triangles:
- Fixed the problems with losing support state
- Fixed the problems with being unstable due to interaction with steep slopes
- Improved penetration recovery
- Character controller is now using native lists instead of native arrays for constraints and query hits to avoid large preallocations.
- Planet gravity sample now correctly randomizes mass of orbiting bodies.
- Fixed the issue with collider cast in character controller assuming ordered hits, potentially tunneling through objects.
- When opening the Project with Unity
2019.3below0b5it might be required to update the Lightweight RP package (com.unity.render-pipelines.lightweight) to version7.0.1and reimport theAssets/Commonfolder.
- Character controller changes include:
- Character controller demo scenes merged into single scene.
- Character controller can now use any collision filter, as opposed to previously being forced to set it to 'Nothing'.
- Default max slope to climb is now 60 degrees.
- Character controller can now use any collider, instead of previously being forced to use capsule.
- Fixed a race condition problem with scheduling character controller jobs when their data is in multiple chunks.
- Simple collisions between characters are now supported (not going through each other).
- KeepDistance with a default of 2cm has been added to avoid character getting stuck in narrow passages.
- User input is now projected onto supporting surface, incorporating its velocity into input.
- CharacterControllerUtilities.CheckSupport() has been deprecated. Use the new CheckSupport() method that outputs the surface info.
- CharacterControllerUtilities.CollideAndIntegrate() has been deprecated. Use the new CollideAndIntegrate() method that takes numConstraints as input.
- Menu loader scene now supports keyboard and controller input. Controller input now maps correctly across platforms. Controls have been updated to the following:
- Keyboard/Mouse
- UI:
- Arrow keys to navigate
- [Return] to select
- Character Controller
- [WASD] to move
- Mouse look
- [Space] to jump
- [LMB/Ctrl] to shoot
- Vehicle
- [WS] to accelerate/decelerate
- [AD] to steer
- [Left/Right] arrows to look
- [Left/RightBracket] to switch cars
- UI:
- Controller:
- UI
- D-Pad to navigate
- [West] to select
- Character Controller
- Left Stick to move
- Right Stick look
- [South] to jump
- [Right Trigger] to shoot
- Vehicle
- [Left/Right Trigger] to accelerate/decelerate
- Left Stick to steer
- Right Stick arrows to look
- [Left/Right Bumper] to switch cars
- UI
- Keyboard/Mouse
- To open the project with Unity
2019.3.0b1or later, it is currently required to upgrade the following packages:- Hybrid Renderer (com.unity.rendering.hybrid) has to be upgraded to
0.1.1-preview - Lightweight RP (com.unity.render-pipelines.lightweight) has to be updated to version
7.0.1 - A reimport of the materials might be required when this is done while the Unity Editor is opened.
- Hybrid Renderer (com.unity.rendering.hybrid) has to be upgraded to
5a. Change Motion Typedemo illustrating how to swap the motion type of a rigid body.5b. Change Collider Sizedemo shows how to dynamically resize a sphere collider.5c. Change Collider Typedemo shows a body's collider changing between a cube and a sphere.- Removed
4c. Newton's Cradledemo - Removed
4d. Abacusdemo - Added a loader scene to more easily test all examples on a device.
-
1. Hello Worldnow uses convex hulls for letters. -
2b1. Motion Properties - Massshows a number of seesaws in anticipation of future stacking improvements. -
2b6. Motion Properties - Inertia Tensoradds an example of infinite mass dynamic objects - i.e lock rotations. -
2c2. Material Properties - Restitutionshows the changes to the restitution model, with complex bodies bouncing more with high restitution values. -
2c3. Material Properties - Collision Filtersshows the filtering setup between potentially colliding objects -
2d1. Events - Triggersshows a simple trigger use case that changes a bodies gravity fractor when inside the volume.- The more advanced trigger use cases capture state such as Entering, Overlapping and Leaving a trigger volume.
2d1. Triggers - Change Materialshows set of triggers that change a bodies material when they enter the trigger volume.2d2. Triggers - Portalsshows set of triggers that transform a body to a new location and orientation while preserving local velocity.2d3. Triggers - Force Fieldshows a trigger volume acting and a tornado moving through the world.
-
2d2. Events - Contactsshows a simple collision event used to apply an impulse to any body colliding with the tagged 'repulsor' body. -
4a. Joints Paradedemo shows the Prismatic Joint now locks rotation. -
4b. Limit DOFdemo shows the new Limit DOF Joint, locking body rotation and translation to various axes. -
4c. Newton's Cradledemo shows how to cheat collision response to create a desktop toy. -
4d. Abacusshows a desktop toy as an extreme test of the Limit DOF Joint. -
5. Modifydemos have been changed to use the new jobify approach to modifying simulation data. -
Mouse Pick Behavior now ignores Static and Trigger bodies, illustrating a custom hit collector.
-
Joint Editors now lock the connected body offset to the local offsets, as suggested by the UI.
-
Debug Display changes include:
- Colliders are displayed as solid.
- Collider Edges can be display independent of solid Colliders.
- Trigger events draw connecting line between overlapping bodies.
- Collision events draw impulse half-way between colliding bodies.
-
Various tests have been added to confirm API changes and as comparisons for WIP and the upcoming Havok Physics release.
- Character controller now has a max slope constraint to avoid climbing slopes that are too steep.
- Character controller now does another query to check if position returned by the solver can be reached.
- Initial package version and sample project.