Using triangle mesh with a kinematic rigid body is allowed, but the options "Compute COM", "Compute Mass" and "Compute Inertia" are not supported by PhysX and an error in logged that default values for COM, Mass and Inertia will be used. Now this situation is captured and an explanatory warning is used instead.
- Improved RigidBody::UpdateMassProperties function to apply the same logic in the treatment of shapes for all three parameters: COM, Mass and Inertia.
- Improved UpdateMassProperties function by using references for the override parameters instead of pointers.
- Improved function that computes the Center of Mass UpdateCenterOfMass (renamed from UpdateComputedCenterOfMass), to include the same shapes that the compute mass and inertia functions in physx updateMassAndInertia, which is to include all shapes if includeAllShapesInMassCalculation is true, else include only the shapes with eSIMULATION_SHAPE flag.
- Removed unused private function RigidBody::ComputeInertia.
- Added unit test to check when the warnings are fired correctly when COM, Mass or Inertia are asked to be computed on a rigid body with triangle mesh shapes.
- Improved MassComputeFixture tests by not only using Box shape, but also sphere and capture, plus improved the PossibleMassComputeFlags parameters to include all possible variations of the MassComputeFlags flags.
Fixes#3322Fixes#3979
Signed-off-by: moraaar <moraaar@amazon.com>
- Avoid saving blast global configuration unnecessarily every time the editor is opened.
- Fixed how to obtain the default physics material library. The relative path needs to be from the project folder, not the asset folder inside the project. It was also missing saving the physx configuration after a the default library is assigned to it.
- Fixed asset id for physics material asset 'assets/physics/surfacetypemateriallibrary.physmaterial'
Signed-off-by: moraaar moraaar@amazon.com
* Fixed physx asset when exported as convex or primitives. Before it was limited to 1 material for the entire object, now it correctly uses multiple materials by looking at the first material per node.
Signed-off-by: moraaar <moraaar@amazon.com>
* Restores the branch to the old status from old branch
Signed-off-by: aaguilea <aaguilea@amazon.com>
* Changes that didnt make it from merge manually fixed
Signed-off-by: aaguilea <aaguilea@amazon.com>
* forgot one
Signed-off-by: aaguilea <aaguilea@amazon.com>
* Added Ebus in order to remove rigidbody's dependencies
Signed-off-by: aaguilea <aaguilea@amazon.com>
* answering some of the comments in the PR
Signed-off-by: aaguilea <aaguilea@amazon.com>
* Small typo changed
Signed-off-by: aaguilea <aaguilea@amazon.com>
* Release build fix for Windows
* Release build fix for Android
* Release build fix for Windows
* Release build fix for Android
* Release build fix for Linux
* Release build fix for Mac
* Release build fix for iOS
Signed-off-by: Steve Pham <spham@amazon.com>
NOTE: The memory driller is still intact for now to avoid needing to
modify allocators, but the frame/cpu portions of driller and the
standalone executable are now gone.
Signed-off-by: Jeremy Ong <jcong@amazon.com>
fixes#2650
The root of the crash was connecting/disconnecting to the AZ::Event SceneSimulationStart when not on the main thread, as that is not thread safe.
The connection/disconnection was originally handled from Enable/EnableQueued and Disable/DisabledQueued which can be called from other threads within EmotionFX. I've moved the connection/disconnection to the Constructor / destructor, as the handler is responsible for executing the queued enable/disable actions and it makes sense to have that connection happen external to the Enable/disable path.
Signed-off-by: amzn-sean 75276488+amzn-sean@users.noreply.github.com
* Fixed bug in hash_table that made rehash() function to run infinitely on specific conditions when inserting an already existing element
Signed-off-by: Garcia Ruiz <aljanru@amazon.co.uk>
* Replaced erasing to happen in the source list instead
Signed-off-by: Garcia Ruiz <aljanru@amazon.co.uk>
* minor comment improvement
Signed-off-by: Garcia Ruiz <aljanru@amazon.co.uk>
* Small commment improvement
Signed-off-by: Garcia Ruiz <aljanru@amazon.co.uk>
* Small comment fix
Signed-off-by: Garcia Ruiz <aljanru@amazon.co.uk>
* Added assert and fixed code with incorrect hashing
Signed-off-by: Garcia Ruiz <aljanru@amazon.co.uk>
* .
Signed-off-by: Garcia Ruiz <aljanru@amazon.co.uk>
* Addressed PR comments, reverted to void* as it size_t hash is different
Signed-off-by: Garcia Ruiz <aljanru@amazon.co.uk>
* Fixed build on linux
Signed-off-by: Garcia Ruiz <aljanru@amazon.co.uk>
* Addressed PR comments
Signed-off-by: Garcia Ruiz <aljanru@amazon.co.uk>
Co-authored-by: Garcia Ruiz <aljanru@amazon.co.uk>
* Enabled PhysX system component in asset builders since it's required for cooking collision meshes
Signed-off-by: pereslav <pereslav@amazon.com>
* Added AssetCatalogService to the list of dependent
Signed-off-by: pereslav <pereslav@amazon.com>
Linear and angular motion of rigid bodies can now be restricted along
specific world-space axes.
Signed-off-by: Ibtehaj Nadeem <81370835+ibtehajn@users.noreply.github.com>