Mesh getters and setters

This commit is contained in:
Szymon Nowakowski 2023-08-06 21:54:28 +02:00
parent a7219eae86
commit e70fcbc582
2 changed files with 21 additions and 1 deletions

View File

@ -45,6 +45,27 @@ export class Mesh {
get submeshCount(): number {
return this._submeshes.length;
}
set name(value: string) { this._name = value; }
get name(): string { return this._name; }
set vertexBuffer(value: VertexBuffer) { this._vertexBuffer = value; }
get vertexBuffer(): VertexBuffer { return this._vertexBuffer; }
set indexBuffer(value: IndexBuffer) { this._indexBuffer = value; }
get indexBuffer(): IndexBuffer { return this._indexBuffer; }
setSubmeshes(value: readonly Submesh[]): Mesh {
this._submeshes.length = 0;
this._submeshes.push(...value);
return this;
}
getMaterials(res: Submesh[]): Submesh[] {
res.length = 0;
res.push(...this._submeshes);
return res;
}
}
Object.defineProperty(Mesh.prototype, "type", { value: "Mesh" });

View File

@ -5,6 +5,5 @@
*/
export * from "./IndexBuffer";
export * from "./Material";
export * from "./Texture2D";
export * from "./VertexBuffer";