73 lines
1.5 KiB
JavaScript
73 lines
1.5 KiB
JavaScript
|
/**
|
||
|
* GameLib.D3.Mesh.Curve
|
||
|
* @param graphics GameLib.GraphicsRuntime
|
||
|
* @param apiMeshCurve
|
||
|
* @constructor
|
||
|
*/
|
||
|
GameLib.D3.Mesh.Curve = function (
|
||
|
graphics,
|
||
|
apiMeshCurve
|
||
|
) {
|
||
|
this.graphics = graphics;
|
||
|
this.graphics.isNotThreeThrow();
|
||
|
|
||
|
if (GameLib.Utils.UndefinedOrNull(apiMeshCurve)) {
|
||
|
apiMeshCurve = {
|
||
|
meshType: GameLib.D3.API.Mesh.MESH_TYPE_CURVE
|
||
|
};
|
||
|
}
|
||
|
|
||
|
GameLib.D3.API.Mesh.Curve.call(
|
||
|
this,
|
||
|
apiMeshCurve,
|
||
|
apiMeshCurve.pointSize
|
||
|
);
|
||
|
|
||
|
GameLib.D3.Mesh.call(
|
||
|
this,
|
||
|
this.graphics,
|
||
|
this
|
||
|
);
|
||
|
};
|
||
|
|
||
|
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;
|
||
|
|
||
|
return;
|
||
|
|
||
|
// var geometry = new THREE.Geometry();
|
||
|
//
|
||
|
// /**
|
||
|
// * Setup vertices
|
||
|
// */
|
||
|
// this.applyVertexDataToInstance(geometry);
|
||
|
//
|
||
|
// var instance = new THREE.Points(geometry);
|
||
|
//
|
||
|
// this.createInstanceDefaults(instance);
|
||
|
//
|
||
|
// return instance;
|
||
|
};
|
||
|
|
||
|
/**
|
||
|
* 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() {
|
||
|
|
||
|
var apiMesh = GameLib.D3.Mesh.prototype.toApiObject.call(this);
|
||
|
|
||
|
var apiMeshCurve = new GameLib.D3.API.Mesh.Curve(
|
||
|
apiMesh,
|
||
|
this.pointSize
|
||
|
);
|
||
|
|
||
|
return apiMeshCurve;
|
||
|
};
|