Releases: needle-mirror/com.unity.physics
Releases · needle-mirror/com.unity.physics
1.2.0-pre.12
[1.2.0-pre.12] - 2024-02-13
Added
- ScheduleUpdateBroadphase and UpdateBroadphaseImmediate to update the Broadphase instead of doing a full rebuild.
- ScheduleUpdateMotionData and UpdateMotionDataImmediate to update the pre-existing MotionData without recreating them.
- BuildPhysicsWorldData.CompleteInputDependency method to complete the InputDependency if necessary.
- Simulaton.ResetSimulationContext to make it possible reset the current simulation context.
Changed
- Updated Burst dependency to version 1.8.12
Fixed
- Fixed errors caused by memory corruption when selecting mesh-based custom Physics Shape Authoring components in the editor.
Updated
- Upgraded Test Framework version to 1.4.3
1.2.0-pre.6
[1.2.0-pre.6] - 2023-12-13
Changed
- Promotion preparation
1.2.0-pre.4
[1.2.0-pre.4] - 2023-11-28
Changed
- Updated Burst dependency to 1.8.10
1.2.0-exp.3
[1.2.0-exp.3] - 2023-11-09
Added
- Added extension functions
PhysicsCollider.ToMesh()
andCollider.ToMesh()
for the creation ofUnityEngine.Mesh
objects from colliders. - use of
PhysicsMaterial
instead ofPhysicMaterial
andPhysicMaterialCombine
toPhysicsMaterialCombine
API when the editor is newer than2023.3
. - The
Layer Overrides
properties specified inCollider
andRigidbody
authoring components are now baked into theCollisionFilter
of the resultant Unity Physics colliders. For each individualCollider
authoring component, the layer overrides on itsRigidbody
and the collider itself are combined and together form theCollidesWith
mask in theCollisionFilter
of the baked collider. The collider collides with layers which are included, and does not collide with layers which are excluded. Furthermore, exclusions have precedence over inclusions. MassProperties.Scale
function allows uniformly scaling mass properties in a physically correct manner, assuming unit mass.
Changed
- Update package
com.unity.mathematics
from1.2.6
to1.3.1
version. - Analytics API update to
SceneSimulationAnalytics.cs
file. - collider files renamed to
BoxCollider.cs
,CapsuleCollider.cs
,Collider.cs
,MeshCollider.cs
,SphereCollider.cs
andTerrainCollider.cs
. - The
EnsureUniqueColliderSystem
now runs first in theBeforePhysicsSystemGroup
instead of after theAfterPhysicsSystemGroup
. A system that instantiates prefabs using unique colliders during runtime should run in theBeforePhysicsSystemGroup
to avoid a bug where colliders would not be unique during prefab instantiation. - The minimum supported editor version is now 2022.3.11f1
Removed
RayCastNode
andColliderCastNode
Fixed
- Prevent crash in debug display when exiting editor application.
1.1.0-pre.3
[1.1.0-pre.3] - 2023-10-17
Added
- The
Physics Debug Display
component can now display colliders of typeTerrainCollider
. - The
Layer Overrides
properties specified inCollider
andRigidbody
authoring components are now baked into theCollisionFilter
of the resultant Unity Physics colliders. For each individualCollider
authoring component, the layer overrides on itsRigidbody
and the collider itself are combined and together form theCollidesWith
mask in theCollisionFilter
of the baked collider. The collider collides with layers which are included, and does not collide with layers which are excluded. Furthermore, exclusions have precedence over inclusions. MassProperties.Scale
function allows uniformly scaling mass properties in a physically correct manner, assuming unit mass.MassProperties.CreateSphere
function for creation of the mass properties of a sphere with the provided radius, assuming unit mass.
Changed
- Significantly improved performance of
Physics Debug Display
through a reduced need for thread synchronization via batching of debug display data. - The
Physics Debug Display
now automatically resizes its debug draw data buffers dynamically to ensure all entities are drawn. - Game objects with built-in or custom collider authoring components that have a purely uniform scale at edit-time, will now have the scale carried over into their
LocalTransform
component'sScale
property during entity baking. Thus far, any scale, including a purely uniform scale, was baked into the Unity Physics collider geometry instead and the corresponding entity'sLocalTransform.Scale
property was set to 1 rather than to the desired uniform scale value. This is no longer the case, and users can now expect to find the uniform edit-time scale they assign to their game objects also in the resultant, baked entities during run-time, making run-time modifications of already uniformly scaled objects much more intuitive and less cumbersome. - Rigid bodies baked from game objects which have any world-space scale or shear at edit-time can now be scaled at runtime using their
LocalTransform
component'sScale
property. Previously, this was not possible. Runtime scaling using theLocalTransform.Scale
property was only possible when the edit-time scale of the baked game object was identity, and no shear was present. Entity
references inCompoundCollider
children are no longer automatically set during baking since these references are not guaranteed to be valid in theWorld
after baking. Only those entity references that appear in components and buffers, such as thePhysicsColliderKeyEntityPair
buffer, are always guaranteed to be valid. Note that thePhysicsColliderKeyEntityPair
buffer is still present on entities which contain a baked compound collider. Via collider keys, this buffer provides a mapping between the child colliders and the original entities that they were in at bake time.
Fixed
- Prevent race condition between the systems that produce the debug draw data and the display system that renders the data. This allows the debug data to be fully produced before the display system attempts to render it.
- Fix draw of collider entities without
LocalToWorld
component when selectingPostIntegration
in the Physics Debug Display. - Avoid leftover debug draw when switching scenes and new scene has no
Physics Debug Display
. - Mass properties debug display now correctly considers the rigid body scale, and correctly handles cases with unphysical inertia tensors.
- Custom mass properties specified using the
Override Default Mass Distribution
option in the customPhysics Body Authoring
component now work correctly even if no collider is present. - A rigid body's uniform scale value (
LocalTransform.Scale
) is now always considered correctly in the simulation. Previously, when the rigid body entity also contained aPostTransformMatrix
component, its uniform scale was not applied to its collider and mass properties, leading to erroneous mass properties and missed collisions (if uniform scale > 1) or ghost collisions (if uniform scale < 1). - Collider debug display now correctly displays colliders with uniform scale other than 1 in accordance with their
LocalTransform
component'sScale
value. - Collider debug display now correctly displays rigid body entities with
Parent
component.
1.1.0-exp.1
[1.1.0-exp.1] - 2023-09-18
Added
- Tests for ensuring proper joint anchor and mass property baking
- new demo scene (5m. Collider Modifications) demonstrating how to create colliders during runtime
- Utility functions were added for the creation of MeshCollider blob assets from UnityEngine.Mesh, UnityEngine.MeshData and UnityEngine.MeshDataArray. These functions are located in the MeshCollider class as `MeshCollider.Create' variants with different function signatures.
- Users can now verify if a collider blob is unique, and make it unique easily if required. The newly introduced
PhysicsCollider.IsUnique
property lets users check if aPhysicsCollider
is unique and turn it into a unique collider if desired via the functionPhysicsCollider.MakeUnique()
. Making a collider unique with this function also takes care of the collider blob lifetime management and will automatically dispose it if it is no longer needed. - Added a custom entity inspector for the collider blob asset stored in the
PhysicsCollider
component. This inspector allows for two-way interaction with the collider. The displayed values update in accordance with the collider's latest runtime state, and the UI can be used in order to interact with the collider manually when it is unique (seePhysicsCollider.IsUnique
). Among others, this lets users try out different material properties at runtime, such as friction and restitution, or modify the collider's size, local position or orientation.
Changed
- Changed the
bool
flags in thePhysics Debug Display
authoring component for drawing colliders, collider edges and axis-aligned bounding boxes of colliders to an enum calledDisplayMode
. With the display mode you can now choose whether to draw these elements at the beginning of the simulation step or at the end of the simulation step after the rigid bodies have been integrated, meaning, they have been moved forward in time. - Convert SystemBase to ISystems.
- Joint baking for built-in 3D physics joints has been improved, leading to the expected simulation results. Now, when the
Spring
andDamping
properties in Configurable and Character Joints are both set to 0 for limits, a hard limit is modeled. This is equivalent to the behavior in built-in 3D physics. Also, theDamping
parameter is now correctly converted from damping coefficient to the Unity Physics damping ratio for joints, yielding the correct damping force. Furthermore, joint baking now considers the scale of game objects. Anchor points are now affected by the scale accordingly. - The formula which converts the user-specified joint relaxation parameters (spring frequency and damping ratio) to the internal constraint regularization parameters (tau and damping) was rewritten as an optimized closed-form expression with constant time complexity. The regularization parameters can now be efficiently computed regardless of the chosen solver iteration count.
PhysicsGraphicalSmoothing
has been added to.WithAll<>()
from.WithAllRW<>()
in theSmoothedDynamicBodiesQuery
variable withinSmoothRigidBodiesGraphicalMotion.cs
system file.- Updating APIs to
GetScriptingDefineSymbols()
andSetScriptingDefineSymbols()
. - Included ragdoll authoring in documentation
- Prefab instances will now contain unique colliders if the "force unique" collider authoring option is used. This allows collider runtime modifications without manual collider blob cloning now also on prefab instances. Note that prefab instances that contain "force unique" colliders will be made unique only after the next physics system group update following the prefab instantiation. Until then, the
PhysicsCollider.IsUnique
property will be false. If users require a unique collider immediately after prefab instantiation for runtime collider modifications, they can safely use the newPhysicsCollider.MakeUnique()
function immediately after instantiation. - Updated Burst dependency to version 1.8.8
- The internal component
DrawComponent
, required by thePhysics Debug Display
, is now hidden in the hierarchy.
Deprecated
- The
Constraint.DefaultSpringDamping
variable was deprecated. UseConstraint.DefaultDampingRatio
instead. The same applies to theConstraint.SpringDamping
property which was deprecated. Instead the newConstraint.DampingRatio
property should be used.
Removed
- Remove unused internal debug draw functionalities which were causing slowdowns during world initialization
Fixed
- BuildCompoundCollidersBakingSystem no longer leaks memory when the world is disposed.
- Convert SystemBase to ISystems
- When using the built-in
Rigidbody
andCollider
authoring components, the inertia tensor of the resultant rigid body in Unity Physics is now set correctly in all situations. Previously, in certain cases, the default inertia tensor was used. - A problem which prevented the solver to respect the user-specified joint spring frequency and damping ratios in certain cases has been fixed, enabling physically-plausible modeling of joints under all operating conditions.
- Link to changelog in documentation now fixed
- Physics Shape components with type Mesh now correctly only use the Custom Mesh for MeshCollider creation if specified rather than also incorrectly including the game object's render mesh and any render mesh found in the game object's children. The previous erroneous behavior could lead to significant performance problems in the narrow phase (contact creation) of the physics simulation group for affected meshes.
- Updated documentation to reflect that the Built-In TerrainCollider is not yet supported by Unity Physics
1.0.16
[1.0.16] - 2023-09-11
Changed
- Updated Burst dependency to version 1.8.8
Fixed
- Bugfix: The
AngularDamping
component ofRigidbodyAspect
is now writing to the correct value instead of toLinearDamping
Security
1.0.14
[1.0.14] - 2023-07-27
Added
- Added support for overriding mass properties when baking
Rigidbody
authoring components. Now, when setting theRigidBody.automaticCenterOfMass
orRigidBody.automaticInertiaTensor
properties to false, the corresponding mass property data values are correctly baked into the Unity Physics rigid body entity and appear as expected in the entity'sPhysicsMass
component.
Changed
- Updated Burst dependency to version 1.8.7
1.0.11
[1.0.11] - 2023-06-19
Changed
- Prevent spawning
ParallelSolverJobs
unnecessarily ahead of time, which was leading to a potentially high overhead in time consumption. Instead, schedule the right number of jobs for the dispatch pair phases created by the scheduler to prevent scheduling and processing overheads. This leads to speed-ups in the time consumed by jobs in theSolveAndIntegrateSystem
specifically in cases with low to medium joint and contact counts. - The
PhysicsColliderKeyEntityPair
buffer is now added only when needed and its internal capacity of the buffer is set to zero, ensuring its content always lives outside of the chunk. This way, we don't unnecessarily increase the rigid body sizes in chunks, allowing for a larger number of rigid bodies in a single chunk, which improves performance.
Fixed
- Fixed regression in accessibility of
PhysicsShapeAuthoring
API. The functionsGetCapsuleProperties()
andSetCapsule()
were made internal by accident during the move of the custom physics authoring components from the package API to a package sample and are now public again.
1.0.10
[1.0.10] - 2023-05-23
Added
- Added missing API documentation and tooltips.
- preprocessors against performance tests package
Changed
- Changed visibility of
BaseJointBaker
class. It is now internal. - Changed visibility of
ColliderGeometry
struct. It is now internal. - Changed visibility of
PrimitiveColliderGeometries
struct. It is now internal.
Fixed
- The relative velocity in the angular velocity motor is now calculated correctly and the relative orientation between the two connected rigid bodies is correctly taken into account. This makes the motor work properly in all configurations.
- Prevent issues with update order for
ModifyJointLimitsSystem
in netcode multiplayer use case in which the system could not be placed after thePhysicsSystemGroup
since both were no longer in the same group.