2018-04-09 09:35:04 +02:00
|
|
|
/**
|
|
|
|
* R3.D3.Light.Ambient
|
2019-07-25 22:22:32 +02:00
|
|
|
* @param graphics R3.Runtime.Graphics
|
2018-04-09 09:35:04 +02:00
|
|
|
* @param apiAmbientLight
|
|
|
|
* @constructor
|
|
|
|
*/
|
|
|
|
R3.D3.Light.Ambient = function(
|
|
|
|
graphics,
|
|
|
|
apiAmbientLight
|
|
|
|
) {
|
|
|
|
|
|
|
|
this.graphics = graphics;
|
|
|
|
this.graphics.isNotThreeThrow();
|
|
|
|
|
|
|
|
if (R3.Utils.UndefinedOrNull(apiAmbientLight)) {
|
|
|
|
apiAmbientLight = {
|
|
|
|
lightType : R3.D3.API.Light.LIGHT_TYPE_AMBIENT
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
R3.D3.API.Light.Ambient.call(
|
|
|
|
this,
|
|
|
|
apiAmbientLight
|
|
|
|
);
|
|
|
|
|
|
|
|
R3.D3.Light.call(
|
|
|
|
this,
|
|
|
|
this.graphics,
|
|
|
|
apiAmbientLight
|
|
|
|
);
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
R3.D3.Light.Ambient.prototype = Object.create(R3.D3.Light.prototype);
|
|
|
|
R3.D3.Light.Ambient.prototype.constructor = R3.D3.Light.Ambient;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates a light instance
|
|
|
|
* @returns {*}
|
|
|
|
*/
|
|
|
|
R3.D3.Light.Ambient.prototype.createInstance = function() {
|
|
|
|
|
|
|
|
this.instance = new THREE.AmbientLight();
|
|
|
|
|
|
|
|
R3.D3.Light.prototype.createInstance.call(this);
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Updates the instance with the current state
|
|
|
|
*/
|
|
|
|
R3.D3.Light.Ambient.prototype.updateInstance = function(property) {
|
|
|
|
R3.D3.Light.prototype.updateInstance.call(this, property);
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Converts a R3.D3.Light to a R3.D3.API.Light
|
|
|
|
* @returns {R3.D3.API.Light}
|
|
|
|
*/
|
|
|
|
R3.D3.Light.Ambient.prototype.toApiObject = function() {
|
|
|
|
|
|
|
|
var apiLight = R3.D3.Light.prototype.toApiObject.call(this);
|
|
|
|
|
|
|
|
return apiLight;
|
|
|
|
};
|