2017-05-16 23:07:52 +00:00
|
|
|
var Mesh = require('./Mesh');
|
|
|
|
var GetAdvancedValue = require('../../utils/object/GetAdvancedValue');
|
|
|
|
var GetValue = require('../../utils/object/GetValue');
|
|
|
|
var BuildGameObject = require('../BuildGameObject');
|
|
|
|
|
2017-07-04 00:59:31 +00:00
|
|
|
var MeshCreator = function (state, config)
|
2017-05-16 23:07:52 +00:00
|
|
|
{
|
|
|
|
var key = GetAdvancedValue(config, 'key', null);
|
|
|
|
var frame = GetAdvancedValue(config, 'frame', null);
|
|
|
|
var vertices = GetValue(config, 'vertices', []);
|
2017-05-18 19:57:05 +00:00
|
|
|
var indices = GetValue(config, 'indices', []);
|
2017-05-22 19:29:27 +00:00
|
|
|
var colors = GetValue(config, 'colors', []);
|
|
|
|
var alphas = GetValue(config, 'alphas', []);
|
2017-05-16 23:07:52 +00:00
|
|
|
var uv = GetValue(config, 'uv', []);
|
|
|
|
|
2017-05-22 19:29:27 +00:00
|
|
|
var mesh = new Mesh(state, 0, 0, vertices, uv, indices, colors, alphas, key, frame);
|
2017-05-16 23:07:52 +00:00
|
|
|
|
|
|
|
BuildGameObject(state, mesh, config);
|
|
|
|
|
|
|
|
return mesh;
|
|
|
|
};
|
|
|
|
|
2017-07-04 00:59:31 +00:00
|
|
|
module.exports = MeshCreator;
|