2个版本
0.1.1 | 2024年4月30日 |
---|---|
0.1.0 | 2024年4月30日 |
#2176 in 游戏开发
37KB
596 行
Bevy MOps (网格操作)
入门指南
// We convert from a "Bevy Mesh" to a `GIMesh` (Globally-positioned Index Mesh)
let mut a = GIMesh::from_mesh(mesh_a);
let b = GIMesh::from_mesh(mesh_b);
// slice `a` triangles by `b`
slice(&mut a, &b);
// seperates `a` into `inside` and `outside` of `b`
let output = seperate(&a, &b);
// Convert the `output` back to a "Bevy Mesh"
let output_mesh = output.inside.to_mesh().unwrap();
// ... Create a handle and apply it to an entity
为什么要转换为 GIMesh
?
- 网格属性转换为向量(例如
Vec3
) - 位置和法线从局部空间转换为世界空间(及返回),允许位置、旋转和缩放影响操作
版本
bevy | bevy_mops |
---|---|
0.13 | 0.1 |
许可证
此存储库中的所有代码均受以下任一许可证的双重许可:
- MIT许可证 (LICENSE-MIT)
- Apache许可证,版本2.0 (LICENSE-APACHE)
由您选择。
依赖项
~33–70MB
~1M SLoC