73 lines
1.6 KiB
JavaScript
73 lines
1.6 KiB
JavaScript
|
/**
|
||
|
* GameLib.D3.API.Mesh.Box
|
||
|
* @constructor
|
||
|
* @param apiMesh
|
||
|
* @param width
|
||
|
* @param height
|
||
|
* @param depth
|
||
|
*/
|
||
|
GameLib.D3.API.Mesh.Box = function(
|
||
|
apiMesh,
|
||
|
width,
|
||
|
height,
|
||
|
depth
|
||
|
) {
|
||
|
|
||
|
if (GameLib.Utils.UndefinedOrNull(apiMesh)) {
|
||
|
apiMesh = {
|
||
|
meshType : GameLib.D3.API.Mesh.MESH_TYPE_BOX
|
||
|
};
|
||
|
}
|
||
|
|
||
|
if (GameLib.Utils.UndefinedOrNull(apiMesh.meshType)) {
|
||
|
apiMesh.meshType = GameLib.D3.API.Mesh.MESH_TYPE_BOX;
|
||
|
}
|
||
|
|
||
|
if (GameLib.Utils.UndefinedOrNull(width)) {
|
||
|
width = 1;
|
||
|
}
|
||
|
this.width = width;
|
||
|
|
||
|
if (GameLib.Utils.UndefinedOrNull(height)) {
|
||
|
height = 1;
|
||
|
}
|
||
|
this.height = height;
|
||
|
|
||
|
if (GameLib.Utils.UndefinedOrNull(depth)) {
|
||
|
depth = 1;
|
||
|
}
|
||
|
this.depth = depth;
|
||
|
|
||
|
GameLib.D3.API.Mesh.call(
|
||
|
this,
|
||
|
apiMesh.id,
|
||
|
apiMesh.name,
|
||
|
apiMesh.meshType,
|
||
|
apiMesh.excludeFromEnvironment,
|
||
|
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,
|
||
|
apiMesh.parentEntity
|
||
|
);
|
||
|
};
|
||
|
|
||
|
GameLib.D3.API.Mesh.Box.prototype = Object.create(GameLib.D3.API.Mesh.prototype);
|
||
|
GameLib.D3.API.Mesh.Box.prototype.constructor = GameLib.D3.API.Mesh.Box;
|