r3-legacy/src/game-lib-d3-mesh-curve.js

39 lines
890 B
JavaScript
Raw Normal View History

2017-06-23 14:31:41 +02:00
/**
* Mesh Superset - The apiMesh properties get moved into the Mesh object itself, and then the instance is created
* @param graphics GameLib.D3.Graphics
* @param apiMesh GameLib.D3.API.Mesh
* @constructor
*/
GameLib.D3.Mesh.Curve = function (
graphics,
apiMesh
) {
this.graphics = graphics;
this.graphics.isNotThreeThrow();
GameLib.D3.Mesh.call(
this,
this.graphics,
apiMesh
);
};
GameLib.D3.Mesh.Curve.prototype = Object.create(GameLib.D3.Mesh.prototype);
GameLib.D3.Mesh.Curve.prototype.constructor = GameLib.D3.Mesh.Curve;
GameLib.D3.Mesh.Curve.prototype.createInstance = function() {
var geometry = new THREE.Geometry();
/**
* Setup vertices
*/
this.applyVertexDataToInstance(geometry);
var instance = new THREE.Points(geometry);
this.createInstanceDefaults(instance);
return instance;
};