2016-11-29 12:54:25 +01:00
|
|
|
/**
|
|
|
|
* API Spline
|
2016-12-07 15:20:41 +01:00
|
|
|
* @param id String
|
|
|
|
* @param name String
|
2016-12-23 16:07:10 +01:00
|
|
|
* @param vertices GameLib.API.Vector3[]
|
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)) {
|
2016-12-16 16:03:48 +01:00
|
|
|
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;
|