76 Commits

Author SHA1 Message Date
michael bao
232859631d add cvar (ClusterUnion.UseAccelerationStructure, default false for now) to add an acceleration structure to the cluster union component that'll be used for component level sweeps/raycasts/overlaps
- Modified all the low-level overlap/raycast/sweep functions to take in an optional acceleration structure override pointer.
- Converted GeomSweepSingle into a template function similar to GeomSweepMulti and GeomOverlapMulti.
- Added template specializations to take in FPhysicsGeometry for GeomSweepSingle, GeomSweepMulti, and GeomOverlapMulti.
- Added override for FChaosEngineInterface::GetGeometryCollection to take in a FPhysicsGeometry.
- Also changed the cluster union to remove the primitive component from it if the primitive component's physics state is destroyed

#rb benn.gallagher, cedric.caillaud, jaco.vandyk
#preflight 64653a88c34c2e1212aff4c0

[CL 25518722 by michael bao in ue5-main branch]
2023-05-17 19:11:33 -04:00
cedric caillaud
893a5ea0f1 Chaos : add strength to chaos physics material and wire it to the high level engine physics material
#rb steven.barnett, chris caulfield
#preflight 644ae1f3401d328ad9d171b1

[CL 25238017 by cedric caillaud in ue5-main branch]
2023-04-28 15:34:17 -04:00
danny chapman
2726796297 Support kinematics with async physics by adding a UpdateKinematicFromSimulation flag to BodyInstance. Defaults to false, so no change in default behaviour, unless using PhysicsControlComponent
#rb chris.caulfield
#jira UE-167442
#preflight 644aabea09453df5486f14d3

[CL 25218769 by danny chapman in ue5-main branch]
2023-04-27 13:26:51 -04:00
michael forot
564045d020 [Backout] - CL24489307
[FYI] nat.parkinson
Original CL Desc
-----------------------------------------------------------------
[Backout] - CL24480805 to resolve compile error
[FYI] Michael.Forot
Original CL Desc
-----------------------------------------------------------------
Network physics for vehicles

#rb bill.henderson
#preflight 63ff6e32f43e53f68127e521

[CL 24499687 by michael forot in ue5-main branch]
2023-03-03 11:22:01 -05:00
nat parkinson
98d04ec328 [Backout] - CL24480805 to resolve compile error
[FYI] Michael.Forot
Original CL Desc
-----------------------------------------------------------------
Network physics for vehicles

#rb bill.henderson
#preflight 63ff6e32f43e53f68127e521

[CL 24493661 by nat parkinson in ue5-main branch]
2023-03-02 20:26:46 -05:00
michael forot
0fa9892ced Network physics for vehicles
#rb bill.henderson
#preflight 63ff6e32f43e53f68127e521

[CL 24484224 by michael forot in ue5-main branch]
2023-03-02 12:12:37 -05:00
jaco vandyk
77eeff782a Move the QueryOnly Physics objects into its own acceleration structure
Make sure that it does not get included in the physics thread.

#rb Vincent.Robert
#preflight 63f719d19b26c4957efd4f39

[CL 24377687 by jaco vandyk in ue5-main branch]
2023-02-23 05:05:35 -05:00
chris caulfield
831c30609b Chaos - Fix IgnoreCollisionManager so that WakeParticle does not reset ignore collision flags from joints.
The bug was related to the GT and PT both separately manipulating a flag that indicates that a particle has an entry in the ignore table. The flag is used by the broadphase. This flag was not written back to the GT when modified on the PT so any subsequent GT change (to any value in the interop data block containing the flag) would overwrite the PT changes. Explicitly waking a particle from the GT was causing this to happen.

The fix is to remove the GT-controlled flag and have it fully controlled on the PT side based on whether the particle is in the Ignore Manager or not.

This fix can be improved architecturally by breaking the IgnoreCollisionManager into 2 parts: one for the physics thread and one for the interop.

#jira UE-173494
#preflight 63c059b270575f8900c8a1b0

[CL 23671153 by chris caulfield in ue5-main branch]
2023-01-12 18:01:53 -05:00
chris caulfield
0ef53f2111 Chaos - fix kinematic teleport if it happens after animation by clearing the kinematic target in SetGlobalPose
#jira UE-173242
#rb benn.gallagher
#preflight 63b72adcc927e344822464b3

[CL 23593874 by chris caulfield in ue5-main branch]
2023-01-05 17:47:41 -05:00
michael bao
56149cc085 Change the joint constraints to alternatively use the FPhysicsObject and switch over the existing FBodyInstance paths
#rb cedric.caillaud
#preflight 6390e44c1776b8c21c27589a

[CL 23438881 by michael bao in ue5-main branch]
2022-12-07 19:57:03 -05:00
benn gallagher
6cb5283eb1 Chaos: Protected call to IsStatic in the interface layer matching previous behaviour (protects against crashes when setting up body instance parameters in component constructors)
#rb none
#preflight 637b9e764004f73f623e2b3c

[CL 23234021 by benn gallagher in ue5-main branch]
2022-11-22 08:25:33 -05:00
benn gallagher
3750363eb2 Chaos: Fixed global namespace exposure in source files leading to ambiguous symbols in unity builds.
#rb Chris.Caulfield, Kriss.Gossart
#jira UE-168670
#preflight 636270551a32af63a8dcc721
#preflight 636264d11a32af63a8d8caec

[CL 22922321 by benn gallagher in ue5-main branch]
2022-11-02 14:19:06 -04:00
chris caulfield
df4403588a Chaos - add a flag to disable joint mass conditioning
- disable mass conditioning for all joints in TM_PhysGetSetMulti teeter-totter test

#rb benn.gallagher
#jira UE-128000

#ushell-cherrypick of 22694413 by Chris.Caulfield
#preflight 6360639fef6d25c67425b9c6

[CL 22891166 by chris caulfield in ue5-main branch]
2022-11-01 16:40:37 -04:00
benn gallagher
291363b414 Chaos terminology pass
#rb Chris.Caulfield, Kriss.Gossart, Cedric.Caillaud, Jaco.VanDyk, Michael.Forot
#jira UE-159295, UE-158667, UE-158656, UE-158652, UE-158651, UE-158640, UE-158526
#preflight 6320a9cd9677b738f497c14f

[CL 22035600 by benn gallagher in ue5-main branch]
2022-09-15 15:09:35 -04:00
Benn Gallagher
ba51de108e Chaos: Remove ensure in GetWorldVelocityAtPoint that required the object to be kinematic or dynamic. It is valid to request a velocity from a static object without firing an ensure - the velocity will always be zero in that case.
In cases where a user is calculating velocity delta between bodies it's valid to just compare two calls to GetWorldVelocityAtPoint rather than having to handle the if is static case at all callsites. This is also how the interface functioned previously.

#rb trivial
#jira none
#preflight 62f63eb1ad3bd8ad646cace9

[CL 21353495 by Benn Gallagher in ue5-main branch]
2022-08-12 08:17:15 -04:00
Benn Gallagher
1cc0b83d89 Fixed crash attempting to retrieve shapes from a body instance that has no actor instance (e.g. welded bodies).
Fixed incorrect identification of owned instance shapes in GetSquaredDistanceToBody for welded instances
#rb Chris.Caulfield, Vincent.Robert
#jira none
#preflight 62ac974b486b5e268708885b

[CL 21267194 by Benn Gallagher in ue5-main branch]
2022-08-08 07:25:52 -04:00
Benn Gallagher
5f457aece9 Chaos: Changed null actor release message from Warning to Verbose as it is a valid codepath currently when welding shapes into a body instance of a parent that is set to NoCollision.
#rb trivial
#jira none
#preflight 62c2cdd9a3568e306666b976

[CL 20933534 by Benn Gallagher in ue5-main branch]
2022-07-04 07:30:34 -04:00
steven barnett
58f9a385d7 Add Probe and QueryAndProbe to ECollisionEnabled. Single shpaes or entire objects can now be marked as physics probes, meaning that they will generate constraints, contact data, and hit results, without physically responding.
[REVIEW] chris.caulfield, benn.gallagher

#ROBOMERGE-AUTHOR: steven.barnett
#ROBOMERGE-SOURCE: CL 20780284 via CL 20781025 via CL 20781737
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v970-20704180)

[CL 20784443 by steven barnett in ue5-main branch]
2022-06-22 18:59:24 -04:00
satchit subramanian
c70285bb89 Chaos:
SetGlobalPose now no longer discards the same XR if you're kinematic or sleeping.
#rb Benn.Gallagher

#ROBOMERGE-AUTHOR: satchit.subramanian
#ROBOMERGE-SOURCE: CL 20778060 via CL 20778070 via CL 20778076
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v970-20704180)

[CL 20779880 by satchit subramanian in ue5-main branch]
2022-06-22 15:44:37 -04:00
satchit subramanian
6cf6570bec SetGlobalPose_AssumesLocked doesn't do anything if both X and R haven't changed.
#rb Benn.Gallagher
[FYI] Jeff.Bauer

#ROBOMERGE-AUTHOR: satchit.subramanian
#ROBOMERGE-SOURCE: CL 20705968 via CL 20705989 via CL 20706008
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v968-20684695)

[CL 20709289 by satchit subramanian in ue5-main branch]
2022-06-17 16:42:06 -04:00
Benn Gallagher
8757cb3641 Physics interface cleanup.
* Removed deprecated or dead code paths
* Simplified build system setup for physics support
* Deprecated build system flags and unsupported macros

#jira none
#rb Chris.Caulfield, Kriss.Gossart
#preflight 62963ec0fe779f23c8ea0c5e

[CL 20450744 by Benn Gallagher in ue5-main branch]
2022-06-01 06:59:18 -04:00
Chris Caulfield
91c3a26d3f Chaos
- projectionphase  in main solver
- add teleport projection
- recombine projection flags into one flag
- remove unused iteration counts
- correct the iteration count names

#jira none
#rb jaco.vandyk, michael.forot
#preflight 6271490afe09c0cfbc3c5a1e

[CL 20026916 by Chris Caulfield in ue5-main branch]
2022-05-03 11:54:26 -04:00
Chris Caulfield
ec02986fbe Chaos - joint stabilization
- add Inertia Conditioning system to increase inertia for long, thin, or small objects (enabled by default)
- also considiers joints with connectors outside the shape
- move some particle settings into a bitfield to reduce size
- add FVec3f as shorthand for TVec3-FRealSingle

#rb cedric.caillaud, jaco.vandyk,michael.forot
#jira none
#preflight 626c1f925c220f34acf5e912

[CL 19982249 by Chris Caulfield in ue5-main branch]
2022-04-29 13:53:51 -04:00
Benn Gallagher
ffe664d2f7 Chaos: Fix geometry collection/provider asserting that its geometry is of inner types without unwrapping its implicit. Caused crash inside collision analyzer when resolving which shape type was hit.
Chaos: Fix the cast helpers for Chaos geometies only accepting callable objects that return value types

#rb Cedric.Caillaud, Vincent.Robert
#jira none
#preflight 626921835a77b946d9eb24fd

[CL 19937133 by Benn Gallagher in ue5-main branch]
2022-04-27 07:14:48 -04:00
Benn Gallagher
e2725d6446 Chaos: Enable mask filters
Masks are now propagated to shapes correctly whereas previously the call to SetMaskFilter was a no-op and dropped the mask filter.

To match previous behaviour for mask filters (completely ignored for simulation - only ever considered for query) the mask filter check was removed for the sim filter and sim pre-filter.

#rb Max.Whitehead
#jira none
#preflight 62419e707d49f37dfd4d9e80

[CL 19525439 by Benn Gallagher in ue5-main branch]
2022-03-28 08:20:29 -04:00