ModelHandle/source/engine/model/line.js
2023-10-21 08:46:54 +02:00

32 lines
502 B
JavaScript

export class Line
{
constructor (vertices)
{
this.vertices = vertices;
this.mat = null;
}
HasVertices ()
{
return this.vertices !== null && this.vertices.length >= 2;
}
GetVertices ()
{
return this.vertices;
}
SetMaterial (mat)
{
this.mat = mat;
return this;
}
Clone ()
{
let cloned = new Line ([...this.vertices]);
cloned.SetMaterial (this.mat);
return cloned;
}
}