Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

支持mesh子网格创建 #17298

Closed
wants to merge 6 commits into from
Closed

支持mesh子网格创建 #17298

wants to merge 6 commits into from

Conversation

wingcd
Copy link

@wingcd wingcd commented Jul 4, 2024

支持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.

支持mesh子网格创建
Copy link

github-actions bot commented Jul 4, 2024

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;

@minggo
Copy link
Contributor

minggo commented Jul 4, 2024

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

@wingcd
Copy link
Author

wingcd commented Jul 4, 2024

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

好了

@minggo
Copy link
Contributor

minggo commented Jul 4, 2024

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

@wingcd
Copy link
Author

wingcd commented Jul 4, 2024

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

@minggo
Copy link
Contributor

minggo commented Jul 4, 2024

新增接口比较好。

@minggo minggo requested a review from GengineJS July 4, 2024 09:01
@minggo
Copy link
Contributor

minggo commented Jul 4, 2024

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

@wingcd
Copy link
Author

wingcd commented Jul 4, 2024

当然可以的

@minggo
Copy link
Contributor

minggo commented Jul 4, 2024

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

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

@wingcd
Copy link
Author

wingcd commented Jul 4, 2024

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

@@ -277,46 +277,54 @@ function getPadding (length: number, align: number): number {
}

function createDynamicMesh (primitiveIndex: number, geometry: IDynamicGeometry, out?: Mesh, options?: ICreateDynamicMeshOptions): Mesh {
options = options || { maxSubMeshes: 1, maxSubMeshVertices: 1024, maxSubMeshIndices: 1024 };
return createDynamicMeshes([geometry], out);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

对 Options 的支持没有了?

@minggo minggo deleted the branch cocos:v3.8.4 October 12, 2024 10:11
@minggo minggo closed this Oct 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants