r3-legacy/bak/r3-d3-api-mesh-cylinder.js

107 lines
2.5 KiB
JavaScript
Raw Permalink Normal View History

2018-01-23 11:01:59 +01:00
/**
2018-04-09 10:05:13 +02:00
* R3.D3.API.Mesh.Cylinder
2018-01-23 11:01:59 +01:00
* @constructor
* @param apiMesh
* @param radiusTop
* @param radiusBottom
* @param height
* @param radiusSegments
* @param heightSegments
* @param openEnded
* @param thetaStart
* @param thetaLength
*/
2018-04-09 10:05:13 +02:00
R3.D3.API.Mesh.Cylinder = function(
2018-01-23 11:01:59 +01:00
apiMesh,
radiusTop,
radiusBottom,
height,
radiusSegments,
heightSegments,
openEnded,
thetaStart,
thetaLength
) {
2018-04-09 10:05:13 +02:00
if (R3.Utils.UndefinedOrNull(apiMesh)) {
2018-01-23 11:01:59 +01:00
apiMesh = {
2018-04-09 10:05:13 +02:00
meshType : R3.D3.API.Mesh.MESH_TYPE_CYLINDER
2018-01-23 11:01:59 +01:00
};
}
2018-04-09 10:05:13 +02:00
if (R3.Utils.UndefinedOrNull(apiMesh.meshType)) {
apiMesh.meshType = R3.D3.API.Mesh.MESH_TYPE_CYLINDER;
}
2018-04-09 10:05:13 +02:00
if (R3.Utils.UndefinedOrNull(radiusTop)) {
2018-01-23 11:01:59 +01:00
radiusTop = 1;
}
this.radiusTop = radiusTop;
2018-04-09 10:05:13 +02:00
if (R3.Utils.UndefinedOrNull(radiusBottom)) {
2018-01-23 11:01:59 +01:00
radiusBottom = 1;
}
this.radiusBottom = radiusBottom;
2018-04-09 10:05:13 +02:00
if (R3.Utils.UndefinedOrNull(height)) {
2018-01-23 11:01:59 +01:00
height = 5;
}
this.height = height;
2018-04-09 10:05:13 +02:00
if (R3.Utils.UndefinedOrNull(radiusSegments)) {
2018-01-23 11:01:59 +01:00
radiusSegments = 10;
}
this.radiusSegments = radiusSegments;
2018-04-09 10:05:13 +02:00
if (R3.Utils.UndefinedOrNull(heightSegments)) {
2018-01-23 11:01:59 +01:00
heightSegments = 10;
}
this.heightSegments = heightSegments;
2018-04-09 10:05:13 +02:00
if (R3.Utils.UndefinedOrNull(openEnded)) {
2018-01-23 11:01:59 +01:00
openEnded = false;
}
this.openEnded = openEnded;
2018-04-09 10:05:13 +02:00
if (R3.Utils.UndefinedOrNull(thetaStart)) {
2018-01-23 11:01:59 +01:00
thetaStart = 0;
}
this.thetaStart = thetaStart;
2018-04-09 10:05:13 +02:00
if (R3.Utils.UndefinedOrNull(thetaLength)) {
2018-01-23 11:01:59 +01:00
thetaLength = Math.PI * 2;
}
this.thetaLength = thetaLength;
2018-04-09 10:05:13 +02:00
R3.D3.API.Mesh.call(
2018-01-23 11:01:59 +01:00
this,
apiMesh.id,
apiMesh.name,
apiMesh.meshType,
2018-02-08 14:21:31 +01:00
apiMesh.excludeFromEnvironment,
2018-01-23 11:01:59 +01:00
apiMesh.vertices,
apiMesh.faces,
apiMesh.materials,
apiMesh.parentMesh,
apiMesh.parentScene,
apiMesh.skeleton,
apiMesh.skinIndices,
apiMesh.skinWeights,
apiMesh.position,
apiMesh.quaternion,
apiMesh.rotation,
apiMesh.scale,
apiMesh.up,
apiMesh.modelMatrix,
apiMesh.renderOrder,
apiMesh.isBufferMesh,
apiMesh.useQuaternion,
apiMesh.visible,
apiMesh.castShadow,
apiMesh.receiveShadow,
2018-01-23 11:01:59 +01:00
apiMesh.parentEntity
);
};
2018-04-09 10:05:13 +02:00
R3.D3.API.Mesh.Cylinder.prototype = Object.create(R3.D3.API.Mesh.prototype);
R3.D3.API.Mesh.Cylinder.prototype.constructor = R3.D3.API.Mesh.Cylinder;