<commit_before>/**
 * @author       <NAME> <<EMAIL>>
 * @copyright    2020 Photon Storm Ltd.
 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
 */

var Class = require('../../utils/Class');
var Vector3 = require('../../math/Vector3');

/**
 * @classdesc
 * The Mesh Light.
 *
 * @class MeshLight
 * @memberof Phaser.GameObjects
 * @constructor
 * @since 3.50.0
 */
var MeshLight = new Class({

    initialize:

    function MeshLight (x, y, z)
    {
        this.position = new Vector3(x, y, z);
        this.ambient = new Vector3(1, 1, 1);
        this.diffuse = new Vector3(1, 1, 1);
        this.specular = new Vector3(1, 1, 1);
    },

    setPosition: function (x, y, z)
    {
        this.position.set(x, y, z);

        return this;
    },

    setAmbient: function (r, g, b)
    {
        this.ambient.set(r, g, b);

        return this;
    },

    setDiffuse: function (r, g, b)
    {
        this.diffuse.set(r, g, b);

        return this;
    },<commit_msg>Swapped to use RGB objects<commit_after>/**
 * @author       <NAME> <<EMAIL>>
 * @copyright    2020 Photon Storm Ltd.
 * @license      {@link https://opensource.org/licenses/MIT|MIT License}
 */

var Class = require('../../utils/Class');
var RGB = require('../../display/RGB');
var Vector3 = require('../../math/Vector3');

/**
 * @classdesc
 * The Mesh Light.
 *
 * @class MeshLight
 * @memberof Phaser.GameObjects
 * @constructor
 * @since 3.50.0
 */
var MeshLight = new Class({

    initialize:

    function MeshLight (x, y, z)
    {
        this.position = new Vector3(x, y, z);
        this.ambient = new RGB(1, 1, 1);
        this.diffuse = new RGB(1, 1, 1);
        this.specular = new RGB(1, 1, 1);

        //  cache structure = position
        this.dirtyCache = [ 0, 0, 0 ];
    },

    isDirty: function ()
    {
        var position = this.position;
        var dirtyCache = this.dirtyCache;

        var x = position.x;
        var y = position.y;
        var z = position.z;

        var xCached = dirtyCache[0];
        var yCached = dirtyCache[1];
        var zCached = dirtyCache[2];

        dirtyCache[0] = x;
        dirtyCache[1] = y;
        dirtyCache[2] = z;

        return (xCached !== x || yCached !== y || zCached !== z);
    },

    setPosition: function (x, y, z)
    {
        this.position.set(x, y, z);

        return this;
    },

    setAmbient: function (r, g, b)
    {
        this.ambient.set(r, g, b);

        return this;
    },

    setDiffuse: function (r, g, b)
    {
        this.diffuse.set(r, g, b);

        return this;
    },
{'fraction_non_alphanumeric': 0.16102683780630106, 'fraction_numerical': 0.020225593154414623, 'mean_word_length': 1.9529276693455797, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2994621', 'n_tokens_mistral': 930, 'n_tokens_neox': 877, 'n_words': 233}