Archived
Private
Public Access
1
0
This repository has been archived on 2026-02-04. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
ProjectBackup/C#/TSEngine/Core/Graphics/vertex.ts
2022-09-04 12:45:01 +02:00

30 lines
862 B
TypeScript

namespace TSE {
export class Vertex {
public static vertexArray(vertices: Vertex[]): number[] {
let array: number[] = [];
for (let vertex of vertices)
array = array.concat(vertex.toArray());
return array;
}
public position: Vector3;
public texCoords: Vector2;
public constructor(x: number = 0, y: number = 0, z: number = 0, u: number = 0, v: number = 0) {
this.position = new Vector3(x, y, z);
this.texCoords = new Vector2(u, v);
}
public toArray(): number[] {
let array: number[] = [];
array = array.concat(this.position.toArray(), this.texCoords.toArray());
return array;
}
public toFloat32Array(): Float32Array { return new Float32Array(this.toArray()); }
}
}