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

73 lines
1.5 KiB
JavaScript
Raw Normal View History

2017-06-23 14:31:41 +02:00
/**
* GameLib.D3.Mesh.Curve
* @param graphics GameLib.GraphicsRuntime
* @param apiMeshCurve
2017-06-23 14:31:41 +02:00
* @constructor
*/
GameLib.D3.Mesh.Curve = function (
graphics,
apiMeshCurve
2017-06-23 14:31:41 +02:00
) {
this.graphics = graphics;
this.graphics.isNotThreeThrow();
if (GameLib.Utils.UndefinedOrNull(apiMeshCurve)) {
apiMeshCurve = {
2017-12-04 13:23:15 +01:00
meshType: GameLib.D3.API.Mesh.MESH_TYPE_CURVE
};
}
GameLib.D3.API.Mesh.Curve.call(
this,
apiMeshCurve,
apiMeshCurve.pointSize
);
2017-06-23 14:31:41 +02:00
GameLib.D3.Mesh.call(
this,
this.graphics,
this
2017-06-23 14:31:41 +02:00
);
};
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() {
console.warn('todo: not fully implemented');
this.instance = true;
2017-06-23 14:31:41 +02:00
return;
// var geometry = new THREE.Geometry();
//
// /**
// * Setup vertices
// */
// this.applyVertexDataToInstance(geometry);
//
// var instance = new THREE.Points(geometry);
//
// this.createInstanceDefaults(instance);
//
// return instance;
};
2017-06-23 14:31:41 +02:00
/**
* Converts a GameLib.D3.Mesh.Curve to a GameLib.D3.API.Mesh.Curve
* @returns {GameLib.D3.API.Mesh.Curve}
*/
GameLib.D3.Mesh.Curve.prototype.toApiObject = function() {
2017-06-23 14:31:41 +02:00
var apiMesh = GameLib.D3.Mesh.prototype.toApiObject.call(this);
var apiMeshCurve = new GameLib.D3.API.Mesh.Curve(
apiMesh,
this.pointSize
);
2017-06-23 14:31:41 +02:00
return apiMeshCurve;
2017-06-23 14:31:41 +02:00
};