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

129 lines
3.0 KiB
JavaScript
Raw Normal View History

2017-12-30 11:39:07 +01:00
/**
2018-04-09 10:05:13 +02:00
* R3.D3.API.Mesh.Plane
2017-12-30 11:39:07 +01:00
* @constructor
* @param apiMesh
* @param width
* @param height
* @param widthSegments
* @param heightSegments
* @param heightMapScale
* @param isHeightMap
* @param isDotMap
2018-01-15 22:17:03 +01:00
* @param dotMapScale
* @param dotMapOffset
* @param dotMapWeight
2017-12-30 12:43:58 +01:00
* @param dotObject
2017-12-30 11:39:07 +01:00
*/
2018-04-09 10:05:13 +02:00
R3.D3.API.Mesh.Plane = function(
2017-12-30 11:39:07 +01:00
apiMesh,
width,
height,
widthSegments,
heightSegments,
heightMapScale,
isHeightMap,
isDotMap,
2018-01-15 22:17:03 +01:00
dotMapScale,
dotMapOffset,
dotMapWeight,
2017-12-30 12:43:58 +01:00
dotObject
2017-12-30 11:39:07 +01:00
) {
2018-04-09 10:05:13 +02:00
if (R3.Utils.UndefinedOrNull(apiMesh)) {
2017-12-30 12:43:58 +01:00
apiMesh = {
2018-04-09 10:05:13 +02:00
meshType : R3.D3.API.Mesh.MESH_TYPE_PLANE
2017-12-30 12:43:58 +01:00
};
2017-12-30 11:39:07 +01:00
}
2018-04-09 10:05:13 +02:00
if (R3.Utils.UndefinedOrNull(apiMesh.meshType)) {
apiMesh.meshType = R3.D3.API.Mesh.MESH_TYPE_PLANE;
}
2018-04-09 10:05:13 +02:00
if (R3.Utils.UndefinedOrNull(width)) {
2017-12-30 11:39:07 +01:00
width = 1;
}
this.width = width;
2018-04-09 10:05:13 +02:00
if (R3.Utils.UndefinedOrNull(height)) {
2017-12-30 11:39:07 +01:00
height = 1;
}
this.height = height;
2018-04-09 10:05:13 +02:00
if (R3.Utils.UndefinedOrNull(widthSegments)) {
2017-12-30 12:43:58 +01:00
widthSegments = 5;
2017-12-30 11:39:07 +01:00
}
this.widthSegments = widthSegments;
2018-04-09 10:05:13 +02:00
if (R3.Utils.UndefinedOrNull(heightSegments)) {
2017-12-30 12:43:58 +01:00
heightSegments = 5;
2017-12-30 11:39:07 +01:00
}
this.heightSegments = heightSegments;
2018-04-09 10:05:13 +02:00
if (R3.Utils.UndefinedOrNull(heightMapScale)) {
2017-12-30 11:39:07 +01:00
heightMapScale = 1;
}
this.heightMapScale = heightMapScale;
2018-04-09 10:05:13 +02:00
if (R3.Utils.UndefinedOrNull(isHeightMap)) {
2017-12-30 11:39:07 +01:00
isHeightMap = false;
}
this.isHeightMap = isHeightMap;
2018-04-09 10:05:13 +02:00
if (R3.Utils.UndefinedOrNull(isDotMap)) {
2017-12-30 11:39:07 +01:00
isDotMap = false;
}
this.isDotMap = isDotMap;
2018-04-09 10:05:13 +02:00
if (R3.Utils.UndefinedOrNull(dotMapScale)) {
dotMapScale = new R3.API.Vector3(0.01, 0.01, 0.01);
2018-01-15 22:17:03 +01:00
}
this.dotMapScale = dotMapScale;
2018-04-09 10:05:13 +02:00
if (R3.Utils.UndefinedOrNull(dotMapOffset)) {
dotMapOffset = new R3.API.Vector3(1, -1, 5);
2018-01-15 22:17:03 +01:00
}
this.dotMapOffset = dotMapOffset;
2018-04-09 10:05:13 +02:00
if (R3.Utils.UndefinedOrNull(dotMapWeight)) {
dotMapWeight = new R3.API.Vector3(1, 1, 1);
2018-01-15 22:17:03 +01:00
}
this.dotMapWeight = dotMapWeight;
2018-04-09 10:05:13 +02:00
if (R3.Utils.UndefinedOrNull(dotObject)) {
2017-12-30 12:43:58 +01:00
dotObject = null;
2017-12-30 11:39:07 +01:00
}
2017-12-30 12:43:58 +01:00
this.dotObject = dotObject;
2017-12-30 11:39:07 +01:00
2018-04-09 10:05:13 +02:00
R3.D3.API.Mesh.call(
2017-12-30 11:39:07 +01:00
this,
2017-12-30 12:43:58 +01:00
apiMesh.id,
apiMesh.name,
apiMesh.meshType,
2018-02-08 14:21:31 +01:00
apiMesh.excludeFromEnvironment,
2017-12-30 12:43:58 +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,
2017-12-30 12:43:58 +01:00
apiMesh.parentEntity
2017-12-30 11:39:07 +01:00
);
};
2018-04-09 10:05:13 +02:00
R3.D3.API.Mesh.Plane.prototype = Object.create(R3.D3.API.Mesh.prototype);
R3.D3.API.Mesh.Plane.prototype.constructor = R3.D3.API.Mesh.Plane;