cocos-engine icon indicating copy to clipboard operation
cocos-engine copied to clipboard

支持mesh子网格创建

Open wingcd opened this issue 1 year ago • 10 comments

支持mesh子网格创建

Re: #

Changelog


Continuous Integration

This pull request:

  • [ ] needs automatic test cases check.

    Manual trigger with @cocos-robot run test cases afterward.

  • [ ] does not change any runtime related code or build configuration

    If any reviewer thinks the CI checks are needed, please uncheck this option, then close and reopen the issue.


Compatibility Check

This pull request:

  • [ ] changes public API, and have ensured backward compatibility with deprecated features.
  • [ ] affects platform compatibility, e.g. system version, browser version, platform sdk version, platform toolchain, language version, hardware compatibility etc.
  • [ ] affects file structure of the build package or build configuration which requires user project upgrade.
  • [ ] introduces breaking changes, please list all changes, affected features and the scope of violation.

wingcd avatar Jul 04 '24 04:07 wingcd

Interface Check Report

! WARNING this pull request has changed these public interfaces:

@@ -4134,8 +4134,16 @@
              * @param options @en options of creating @zh 创建选项
              * @return @en The created dynamic mesh, which is same as out @zh 新创建的动态网格,同 out 参数
              */
             static createDynamicMesh(primitiveIndex: number, geometry: primitives.IDynamicGeometry, out?: Mesh, options?: primitives.ICreateDynamicMeshOptions): Mesh;
+            /**
+             * @en create a dynamic mesh, which supports multiple sub meshes.
+             * @zh 创建一个动态网格,支持多个子网格。
+             * @param geometries @en geometry data use for creating @zh 用于创建的几何数据
+             * @param out @en output dynamic mesh @zh 输出的动态网格
+             * @return @en The created dynamic mesh, which is same as out @zh 新创建的动态网格,同 out 参数
+             */
+            static createDynamicMeshes(geometries: primitives.IDynamicGeometry[], out?: Mesh): Mesh;
         }
         export function readBuffer(target: DataView, format?: gfx.Format, offset?: number, length?: number, stride?: number, out?: number[]): number[];
         export function writeBuffer(target: DataView, data: number[], format?: gfx.Format, offset?: number, stride?: number): void;
         export function mapBuffer(target: DataView, callback: (cur: number, idx: number, view: DataView) => number, format?: gfx.Format, offset?: number, length?: number, stride?: number, out?: DataView): DataView;

github-actions[bot] avatar Jul 04 '24 04:07 github-actions[bot]

  • it seems break compatibility
  • could you please fix the eslint error?

minggo avatar Jul 04 '24 08:07 minggo

  • it seems break compatibility
  • could you please fix the eslint error?

好了

wingcd avatar Jul 04 '24 08:07 wingcd

但是这个改动修改了接口,破坏了兼容性了。

minggo avatar Jul 04 '24 08:07 minggo

之前那个就有问题,只支持一个子网格,新版本可以直接用这个,实在不行可以新增一个接口?

wingcd avatar Jul 04 '24 08:07 wingcd

新增接口比较好。

minggo avatar Jul 04 '24 08:07 minggo

理论上 createDynamicMesh 是 createDynamicMeshes 的特例。那能用 createDynamicMeshes 实现 createDynamicMesh 吗?

minggo avatar Jul 04 '24 09:07 minggo

当然可以的

wingcd avatar Jul 04 '24 09:07 wingcd

我的意思是类似这样的代码

static createDynamicMesh(...) {
    ...
    createDynamicMeshes(...);
}

minggo avatar Jul 04 '24 09:07 minggo

好的。可以,其实特例的参数就没用了而已

wingcd avatar Jul 04 '24 09:07 wingcd

@minggo This PR was automatically closed since the target branch was deleted. And the developer could not re-open this Pull Request. We need to check whether to cherry-pick the changes to 3.8.6.

dumganhar avatar Nov 21 '24 14:11 dumganhar

This PR break compatibility, can no be merged.

minggo avatar Nov 22 '24 01:11 minggo