<commit_before>/**
 A **BoxGeometry** defines box-shaped geometry for attached {{#crossLink "GameObject"}}GameObjects{{/crossLink}}.

 ## Example

 ````javascript

 ````

 @class BoxGeometry
 @module XEO
 @submodule geometry
 @constructor
 @param [scene] {Scene} Parent {{#crossLink "Scene"}}Scene{{/crossLink}} - creates this BoxGeometry in the default
 {{#crossLink "Scene"}}Scene{{/crossLink}} when omitted.
 @param [cfg] {*} Configs
 @param [cfg.id] {String} Optional ID, unique among all components in the parent {{#crossLink "Scene"}}Scene{{/crossLink}},
 generated automatically when omitted.
 @param [cfg.meta] {String:Object} Optional map of user-defined metadata to attach to this BoxGeometry.
 @param [cfg.primitive="triangles"] {String} The primitive type. Accepted values are 'points', 'lines', 'line-loop', 'line-strip', 'triangles', 'triangle-strip' and 'triangle-fan'.
 @param [cfg.xSize=1.0] {Number}
 @param [cfg.ySize=1.0] {Number}
 @param [cfg.zSize=1.0] {Number}
 @extends Geometry
 */
(function () {

    "use strict";

    XEO.BoxGeometry = XEO.Geometry.extend({

        type: "XEO.BoxGeometry",

        _init: function (cfg) {

            this._super(cfg);

            this.xSize = cfg.xSize;
            this.ySize = cfg.ySize;
            this.zSize = cfg.zSize;
        },

        /**
         * Implement protected virtual template method {{#crossLink "Geometry/method:_update"}}{{/crossLink}},
         * to generate geometry data arrays.
         *
         * @protected
         */
        _update: function () {

            var xmin = -this._xSize;
            var ymin = -this._ySize;
            var zmin = -this._zSize;
            var xmax = this._xSize;
            var ymax = this._ySize;
            var zmax = this._zSize;

            this.positions = [
                xmin, ymin, zmax,
                xmax, ymin, zmax,
                xmax, ymax, zmax,
                xmin, ymax, zmax, // Front face

                xmin, ymin, zmin,
                xmin, ymax, zmin,
                xmax, xmax, zmin,
                xmax, ymin, zmin, // Back face

                xmin, ymax, zmin,
                xmin, ymax, zmax,
                xmax, ymax, zmax,
                xmax, ymax, zmin, // Top face

                xmin, ymin, zmin,
                xmax, ymin, zmin,
                xmax, ymin, zmax,
                xmin, ymin, zmax, // Bottom face

                xmax, ymin, zmin,
                xmax, ymax, zmin,
                xmax, ymax, zmax,
                xmax, ymin, zmax, // Right face

                xmin, ymin, zmin,
                xmin, ymin, zmax,
                xmin, ymax, zmax,
                xmin, ymax, zmin // Left face
            ];

            this.normals = [
                0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1,
                1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0,
                0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0,
                -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0,
                0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0,
                0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1
            ];

            this.uv = [
                1, 1, 0, 1, 0, 0, 1, 0,
                0, 1, 0, 0, 1, 0, 1, 1,
                1, 0, 1, 1, 0, 1, 0, 0,
                1, 1, 0, 1, 0, 0, 1, 0,
                0, 0, 1, 0, 1, 1, 0, 1,
                0, 0, 1, 0, 1, 1, 0, 1
            ];

            // Tangents are lazy-computed from normals and UVs
            // for Normal mapping once we know we have texture

            this.tangents = null;

            this.indices = [
                0, 1, 2, 0, 2, 3,    // front
                4, 5, 6, 4, 6, 7,    // back
                8, 9, 10, 8, 10, 11,   // top
                12, 13, 14, 12, 14, 15,   // bottom
                16, 17, 18, 16, 18, 19,   // right
                20, 21, 22, 20, 22, 23    // left
            ];
        },

        _props: {

            /**
             * The BoxGeometry's size on the X-axis.
             *
             * Fires a {{#crossLink "BoxGeometry/xsize:event"}}{{/crossLink}} event on change.
             *
             * @property xSize
             * @default 1
             * @type Number
             */<commit_msg>Fixed XEO.BoxGeometry<commit_after>/**
 A **BoxGeometry** defines box-shaped geometry for attached {{#crossLink "GameObject"}}GameObjects{{/crossLink}}.

 ## Example

 ````javascript

 ````

 @class BoxGeometry
 @module XEO
 @submodule geometry
 @constructor
 @param [scene] {Scene} Parent {{#crossLink "Scene"}}Scene{{/crossLink}} - creates this BoxGeometry in the default
 {{#crossLink "Scene"}}Scene{{/crossLink}} when omitted.
 @param [cfg] {*} Configs
 @param [cfg.id] {String} Optional ID, unique among all components in the parent {{#crossLink "Scene"}}Scene{{/crossLink}},
 generated automatically when omitted.
 @param [cfg.meta] {String:Object} Optional map of user-defined metadata to attach to this BoxGeometry.
 @param [cfg.primitive="triangles"] {String} The primitive type. Accepted values are 'points', 'lines', 'line-loop', 'line-strip', 'triangles', 'triangle-strip' and 'triangle-fan'.
 @param [cfg.xSize=1.0] {Number}
 @param [cfg.ySize=1.0] {Number}
 @param [cfg.zSize=1.0] {Number}
 @extends Geometry
 */
(function () {

    "use strict";

    XEO.BoxGeometry = XEO.Geometry.extend({

        type: "XEO.BoxGeometry",

        _init: function (cfg) {

            this._super(cfg);

            this.xSize = cfg.xSize;
            this.ySize = cfg.ySize;
            this.zSize = cfg.zSize;
        },

        /**
         * Implement protected virtual template method {{#crossLink "Geometry/method:_update"}}{{/crossLink}},
         * to generate geometry data arrays.
         *
         * @protected
         */
        _update: function () {

            var xmin = -this._xSize;
            var ymin = -this._ySize;
            var zmin = -this._zSize;
            var xmax = this._xSize;
            var ymax = this._ySize;
            var zmax = this._zSize;

            // The vertices - eight for our cube, each
            // one spanning three array elements for X,Y and Z
            this.positions = [

                // v0-v1-v2-v3 front
                xmax, ymax, zmax,
                xmin, ymax, zmax,
                xmin, ymin, zmax,
                xmax, ymin, zmax,

                // v0-v3-v4-v1 right
                xmax, ymax, zmax,
                xmax, ymin, zmax,
                xmax, ymin, zmin,
                xmax, ymax, zmin,

                // v0-v1-v6-v1 top
                xmax, ymax, zmax,
                xmax, ymax, zmin,
                xmin, ymax, zmin,
                xmin, ymax, zmax,

                // v1-v6-v7-v2 left
                xmin, ymax, zmax,
                xmin, ymax, zmin,
                xmin, ymin, zmin,
                xmin, ymin, zmax,

                // v7-v4-v3-v2 bottom
                xmin, ymin, zmin,
                xmax, ymin, zmin,
                xmax, ymin, zmax,
                xmin, ymin, zmax,

                // v4-v7-v6-v1 back
                xmax, ymin, zmin,
                xmin, ymin, zmin,
                xmin, ymax, zmin,
                xmax, ymax, zmin
            ];

            // Normal vectors, one for each vertex
            this.normals = [

                // v0-v1-v2-v3 front
                0, 0, 1,
                0, 0, 1,
                0, 0, 1,
                0, 0, 1,

                // v0-v3-v4-v5 right
                1, 0, 0,
                1, 0, 0,
                1, 0, 0,
                1, 0, 0,

                // v0-v5-v6-v1 top
                0, 1, 0,
                0, 1, 0,
                0, 1, 0,
                0, 1, 0,

                // v1-v6-v7-v2 left
                -1, 0, 0,
                -1, 0, 0,
                -1, 0, 0,
                -1, 0, 0,

                // v7-v4-v3-v2 bottom
                0, -1, 0,
                0, -1, 0,
                0, -1, 0,
                0, -1, 0,

                // v4-v7-v6-v5 back
                0, 0, -1,
                0, 0, -1,
                0, 0, -1,
                0, 0, -1
            ];

            // UV coords
            this.uv = [

                // v0-v1-v2-v3 front
                1, 1,
                0, 1,
                0, 0,
                1, 0,

                // v0-v3-v4-v1 right
                0, 1,
                0, 0,
                1, 0,
                1, 1,

                // v0-v1-v6-v1 top
                1, 0,
                1, 1,
                0, 1,
                0, 0,

                // v1-v6-v7-v2 left
                1, 1,
                0, 1,
                0, 0,
                1, 0,

                // v7-v4-v3-v2 bottom
                0, 0,
                1, 0,
                1, 1,
                0, 1,

                // v4-v7-v6-v1 back
                0, 0,
                1, 0,
                1, 1,
                0, 1
            ];

            // Indices - these organise the
            // positions and uv texture coordinates
            // into geometric primitives in accordance
            // with the "primitive" parameter,
            // in this case a set of three indices
            // for each triangle.
            //
            // Note that each triangle is specified
            // in counter-clockwise winding order.
            //
            // You can specify them in clockwise
            // order if you configure the Modes
            // node's frontFace flag as "cw", instead of
            // the default "ccw".
            this.indices = [
                0, 1, 2,
                0, 2, 3,
                // front
                4, 5, 6,
                4, 6, 7,
                // right
                8, 9, 10,
                8, 10, 11,
                // top
                12, 13, 14,
                12, 14, 15,
                // left
                16, 17, 18,
                16, 18, 19,
                // bottom
                20, 21, 22,
                20, 22, 23
            ];

            // Tangents are lazy-computed from normals and UVs
            // for Normal mapping once we know we have texture

            this.tangents = null;

            this.indices = [
                0, 1, 2, 0, 2, 3,    // front
                4, 5, 6, 4, 6, 7,    // back
                8, 9, 10, 8, 10, 11,   // top
                12, 13, 14, 12, 14, 15,   // bottom
                16, 17, 18, 16, 18, 19,   // right
                20, 21, 22, 20, 22, 23    // left
            ];
        },

        _props: {

            /**
             * The BoxGeometry's size on the X-axis.
             *
             * Fires a {{#crossLink "BoxGeometry/xsize:event"}}{{/crossLink}} event on change.
             *
             * @property xSize
             * @default 1
             * @type Number
             */
{'fraction_non_alphanumeric': 0.12409028097650852, 'fraction_numerical': 0.04578535237217872, 'mean_word_length': 1.0318173310874041, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7362540', 'n_tokens_mistral': 3778, 'n_tokens_neox': 3313, 'n_words': 1022}