r3-legacy/src/game-lib-d3-api-spline.js

35 lines
762 B
JavaScript
Raw Normal View History

2016-11-29 12:54:25 +01:00
/**
* API Spline
* @param id String
* @param name String
2016-12-22 17:22:19 +01:00
* @param vertices GameLib.API.Vertex[]
2016-11-29 12:54:25 +01:00
* @constructor
*/
GameLib.D3.API.Spline = function(
id,
name,
vertices
) {
2016-12-22 17:22:19 +01:00
GameLib.Component.call(
this,
GameLib.Component.COMPONENT_SPLINE
);
2016-12-15 14:53:39 +01:00
if (GameLib.Utils.UndefinedOrNull(id)) {
id = GameLib.Utils.RandomId();
2016-11-29 12:54:25 +01:00
}
this.id = id;
2016-12-15 14:53:39 +01:00
if (GameLib.Utils.UndefinedOrNull(name)) {
name = 'Spline (unknown)';
2016-11-29 12:54:25 +01:00
}
this.name = name;
2016-12-15 14:53:39 +01:00
if (GameLib.Utils.UndefinedOrNull(vertices)) {
2016-11-29 12:54:25 +01:00
vertices = [];
}
this.vertices = vertices;
2016-12-22 17:22:19 +01:00
};
GameLib.D3.API.Spline.prototype = Object.create(GameLib.Component.prototype);
GameLib.D3.API.Spline.prototype.constructor = GameLib.D3.API.Spline;