-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Closed
支持mesh子网格创建 #17298
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
支持mesh子网格创建
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;
|
|
好了 |
但是这个改动修改了接口,破坏了兼容性了。 |
之前那个就有问题,只支持一个子网格,新版本可以直接用这个,实在不行可以新增一个接口? |
新增接口比较好。 |
理论上 createDynamicMesh 是 createDynamicMeshes 的特例。那能用 createDynamicMeshes 实现 createDynamicMesh 吗? |
当然可以的 |
我的意思是类似这样的代码
|
好的。可以,其实特例的参数就没用了而已 |
GengineJS
approved these changes
Jul 5, 2024
minggo
reviewed
Jul 8, 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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
对 Options 的支持没有了?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
支持mesh子网格创建
Re: #
Changelog
Continuous Integration
This pull request:
Compatibility Check
This pull request: