Implemented a custom physics engine #316

Merged
direnbharwani merged 95 commits from SHPhysics into main 2023-01-23 15:55:45 +08:00
direnbharwani commented 2023-01-23 01:59:26 +08:00 (Migrated from github.com)

Majority of the interface remains unchanged on the engine, editor & scripting side. Notable changes are documented below.

[NEW]

  • Per-body gravity modifiable through gravity scale
  • Raycasts return a container of results. A boolean passed into the function controls if the raycast will stop a first result.
  • Auto-mass: Bodies will automatically compute their masses based on the collider material densities.
  • Trigger shapes do not contribute to the mass of the body.
  • Debug draw can be toggled per collider.
  • Added a physics menu, currently only for debug drawing (will be extended for control over the physics world's settings)

[UPDATES]

  • Sleeping has been removed for now since the optimisation to properly implement it is quite a substantial task. This will reduce performance temporarily until the optimisation is in place.
  • Cleaned up fallacies in the collision tag matrix.

[BUGS]

  • This is not a bug per-se, but something to take note of due to how collisions are resolved. The current method may result in excessive energy in some bodies (such as false bounces). This is intended, and improving the stability of contact resolutions will require quite a number of changes to how contacts are detected. I will only do this if absolutely necessary.
  • Edge detection between convex polyhedrons can result in erratic contacts. The math to compute the closest points needs to be reworked to handle certain edge cases. So far it does not affect stability too much.
Majority of the interface remains unchanged on the engine, editor & scripting side. Notable changes are documented below. [NEW] * Per-body gravity modifiable through gravity scale * Raycasts return a container of results. A boolean passed into the function controls if the raycast will stop a first result. * Auto-mass: Bodies will automatically compute their masses based on the collider material densities. * Trigger shapes do not contribute to the mass of the body. * Debug draw can be toggled per collider. * Added a physics menu, currently only for debug drawing (will be extended for control over the physics world's settings) [UPDATES] * Sleeping has been removed for now since the optimisation to properly implement it is quite a substantial task. This will reduce performance temporarily until the optimisation is in place. * Cleaned up fallacies in the collision tag matrix. [BUGS] * This is not a bug per-se, but something to take note of due to how collisions are resolved. The current method may result in excessive energy in some bodies (such as false bounces). This is intended, and improving the stability of contact resolutions will require quite a number of changes to how contacts are detected. I will only do this if absolutely necessary. * Edge detection between convex polyhedrons can result in erratic contacts. The math to compute the closest points needs to be reworked to handle certain edge cases. So far it does not affect stability too much.
XiaoQiDigipen (Migrated from github.com) reviewed 2023-01-23 01:59:26 +08:00
Sign in to join this conversation.
No description provided.