cocos / cocos-engine

Cocos simplifies game creation and distribution with Cocos Creator, a free, open-source, cross-platform game engine. Empowering millions of developers to create high-performance, engaging 2D/3D games and instant web entertainment.
https://www.cocos.com/en/creator
Other
7.14k stars 1.83k forks source link

MeshCollider bake options #15585

Open yiwenxue opened 1 year ago

yiwenxue commented 1 year ago

Use Case

Currently, the mesh collider must use the original data of the assigned mesh. Consequently, if the original mesh is highly complex, it can significantly decrease performance. While it's possible to assign the mesh collider with a simplified mesh, this means users would need to maintain two separate meshes, which increases complexity.

To address this, a bake panel could be introduced for the mesh collider, providing an additional option to configure the mesh collider.

  1. Bake panel

    1. Mesh simplify ratio (0-100%)
    2. Mesh optimization
    3. ...
  2. Bake process The mesh collider component relies on the assigned mesh asset. When the mesh asset is updated, the mesh collider should also be baked to reflect the changes. The baked data is stored in a buffer asset.

    1. Mesh optimization
    2. Mesh simplification
  3. Load process During component initialization, the buffer asset containing the baked mesh data is acquired.

  4. Data storage The data is stored in a buffer asset, supporting two formats:

    1. Converted mesh: Contains only vertex positions.
    2. Indexed mesh: Includes both vertex positions and triangle faces.
  5. Bonus

    1. Compression/decompression capabilities.

Problem Description

None

Proposed Solution

No response

How it works

No response

Alternatives Considered

None

Additional Information

No response

yiwenxue commented 1 year ago

image mesh collider incorrect transform

yiwenxue commented 1 year ago

https://github.com/cocos/3d-tasks/issues/17615

yiwenxue commented 1 year ago

https://github.com/cocos/cocos-engine/issues/16053

yiwenxue commented 1 year ago

企业微信截图_16939794093314 mesh collider incorrect scale