Mesh getters and setters
This commit is contained in:
parent
256e5db1c7
commit
4a72b71a88
@ -45,6 +45,27 @@ export class Mesh {
|
|||||||
get submeshCount(): number {
|
get submeshCount(): number {
|
||||||
return this._submeshes.length;
|
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" });
|
Object.defineProperty(Mesh.prototype, "type", { value: "Mesh" });
|
||||||
|
@ -5,6 +5,5 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
export * from "./IndexBuffer";
|
export * from "./IndexBuffer";
|
||||||
export * from "./Material";
|
|
||||||
export * from "./Texture2D";
|
export * from "./Texture2D";
|
||||||
export * from "./VertexBuffer";
|
export * from "./VertexBuffer";
|
||||||
|
Loading…
Reference in New Issue
Block a user