47 lines
1.1 KiB
Plaintext
47 lines
1.1 KiB
Plaintext
/**
|
|
* This component makes the parentEntity (ex. car) follow the path provided by the spline
|
|
* @param id String
|
|
* @param name String
|
|
* @param domElementId
|
|
* @param camera GameLib.D3.Camera
|
|
* @constructor
|
|
*/
|
|
GameLib.D3.API.Input.Fly = function (
|
|
id,
|
|
name,
|
|
domElementId,
|
|
camera
|
|
) {
|
|
GameLib.Component.call(
|
|
this,
|
|
GameLib.Component.COMPONENT_FLY_INPUT,
|
|
{
|
|
'camera' : GameLib.D3.Camera
|
|
}
|
|
);
|
|
|
|
if (GameLib.Utils.UndefinedOrNull(id)) {
|
|
id = GameLib.Utils.RandomId();
|
|
}
|
|
this.id = id;
|
|
|
|
if (GameLib.Utils.UndefinedOrNull(name)) {
|
|
name = this.constructor.name;
|
|
}
|
|
this.name = name;
|
|
|
|
if (GameLib.Utils.UndefinedOrNull(domElementId)) {
|
|
domElementId = "divCanvas";
|
|
}
|
|
this.domElementId = domElementId;
|
|
|
|
if (GameLib.Utils.UndefinedOrNull(camera)) {
|
|
camera = null;
|
|
}
|
|
this.camera = camera;
|
|
|
|
};
|
|
|
|
GameLib.D3.API.Input.Fly.prototype = Object.create(GameLib.Component.prototype);
|
|
GameLib.D3.API.Input.Fly.prototype.constructor = GameLib.D3.API.Input.Fly;
|