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

73 lines
1.5 KiB
JavaScript
Raw Normal View History

2017-06-23 14:31:41 +02:00
/**
2018-04-09 10:05:13 +02:00
* R3.D3.Mesh.Curve
* @param graphics R3.GraphicsRuntime
* @param apiMeshCurve
2017-06-23 14:31:41 +02:00
* @constructor
*/
2018-04-09 10:05:13 +02:00
R3.D3.Mesh.Curve = function (
2017-06-23 14:31:41 +02:00
graphics,
apiMeshCurve
2017-06-23 14:31:41 +02:00
) {
this.graphics = graphics;
this.graphics.isNotThreeThrow();
2018-04-09 10:05:13 +02:00
if (R3.Utils.UndefinedOrNull(apiMeshCurve)) {
apiMeshCurve = {
2018-04-09 10:05:13 +02:00
meshType: R3.D3.API.Mesh.MESH_TYPE_CURVE
2017-12-04 13:23:15 +01:00
};
}
2018-04-09 10:05:13 +02:00
R3.D3.API.Mesh.Curve.call(
this,
apiMeshCurve,
apiMeshCurve.pointSize
);
2018-04-09 10:05:13 +02:00
R3.D3.Mesh.call(
2017-06-23 14:31:41 +02:00
this,
this.graphics,
this
2017-06-23 14:31:41 +02:00
);
};
2018-04-09 10:05:13 +02:00
R3.D3.Mesh.Curve.prototype = Object.create(R3.D3.Mesh.prototype);
R3.D3.Mesh.Curve.prototype.constructor = R3.D3.Mesh.Curve;
2017-06-23 14:31:41 +02:00
2018-04-09 10:05:13 +02:00
R3.D3.Mesh.Curve.prototype.createInstance = function() {
2017-06-23 14:31:41 +02:00
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
/**
2018-04-09 10:05:13 +02:00
* Converts a R3.D3.Mesh.Curve to a R3.D3.API.Mesh.Curve
* @returns {R3.D3.API.Mesh.Curve}
*/
2018-04-09 10:05:13 +02:00
R3.D3.Mesh.Curve.prototype.toApiObject = function() {
2017-06-23 14:31:41 +02:00
2018-04-09 10:05:13 +02:00
var apiMesh = R3.D3.Mesh.prototype.toApiObject.call(this);
2018-04-09 10:05:13 +02:00
var apiMeshCurve = new R3.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
};